This commit is contained in:
2026-10-08 18:34:09 +08:00
commit 2933904f4c
905 changed files with 112129 additions and 0 deletions
+50
View File
@@ -0,0 +1,50 @@
<template>
<view>
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uititle title="文章详情"></uititle>
</u-sticky>
<view class="m-a bg-white p-30">
<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>
</view>
</template>
<script>
import uititle from "@/components/common/title.vue";
export default {
name: "detail",
components: {uititle},
data() {
return {
info: {
name: '',
content: ''
}
}
},
onLoad(option) {
if (option.id) this.getInfo(option.id);
},
methods: {
async getInfo(id) {
const res = await vk.callFunction({
url: `client/otherArticle/list/pub/getDetail`,
data: {id}
});
this.info = res
const regex = new RegExp('img','gi')
this.info.content = this.info.content.replace(regex,`img style="max-width:100%;"`)
}
}
}
</script>
<style>
img {
width: 100% !important;
}
</style>
+65
View File
@@ -0,0 +1,65 @@
<template>
<view>
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uititle title="文章列表"></uititle>
</u-sticky>
<view class="p-40">
<view v-for="(item, index) in list" :key="index"
@click="navTo(item._id)"
class="p-30 border-bottom flex justify-start flex-col items-start bg-white">
<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>
</view>
</template>
<script>
import uititle from "@/components/common/title.vue";
export default {
name: "list",
components: {uititle},
data() {
return {
list: [],
parentId: null,
pageSize: 500,
total: 0,
}
},
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(`/pages/article/info?id=${id}`)
}
},
onLoad(options) {
if (options) this.parentId = options.id;
this.getList();
}
}
</script>
+193
View File
@@ -0,0 +1,193 @@
<template> <!-- 现货市场-申请合作(企业和个人可共用页面) -->
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uititle title="申请合作"></uititle>
</u-sticky>
<view class="layout layout-title m-top-20">填写合作信息</view>
<view class="layout layout-apply m-top-10 bg-white">
<view class="group flex align-center" v-if="userInfo.accountType === 2">
<view class="lb need m-right-30">企业名称:</view>
<view class="vl flex-1">
<input class="input" type="text" placeholder="请输入内容" v-model="formData.companyName"/>
</view>
</view>
<view class="group flex align-center">
<view class="lb need m-right-30">联系人姓名:</view>
<view class="vl flex-1">
<input class="input" type="text" placeholder="请输入内容" v-model="formData.name"/>
</view>
</view>
<view class="group flex align-center">
<view class="lb need m-right-30">联系人电话:</view>
<view class="vl flex-1">
<input class="input" type="text" placeholder="请输入内容" v-model="formData.mobile"/>
</view>
</view>
<view class="group flex align-center">
<view class="lb need m-right-30">合作留言:</view>
<view class="vl flex-1">
<input class="input" type="text" placeholder="请输入内容" v-model="formData.remark"/>
</view>
</view>
<!-- <view class="flex justify-between align-center m-top-20">-->
<!-- <view class="before">是否对以上信息进行详细核实</view>-->
<!-- <radio-group class="flex justify-between align-center" @change="radioChange">-->
<!-- <label class="m-left-30" v-for="(item, index) in radioEnum" :key="item.value">-->
<!-- <radio :value="item.value" color="#A92924" :checked="index === current"-->
<!-- style="transform:scale(0.7)"/>-->
<!-- <text class="before">{{ item.name }}</text>-->
<!-- </label>-->
<!-- </radio-group>-->
<!-- </view>-->
<view class="group flex align-center">
<view class="lb need m-right-30">附件:</view>
<view class="flex-1">
<u-upload
:fileList="formData.files"
@afterRead="afterRead"
@delete="deletePic"
accept="file"
:maxCount="10"
multiple
>
</u-upload>
</view>
</view>
<u-button class="public-btn" text="提交" @click="addCoop"></u-button>
</view>
</view>
</template>
<script>
import uititle from '@/components/common/title'
import dayjs from "dayjs";
import md5 from "js-md5";
export default {
components: {
uititle,
},
data() {
return {
current: 0,
radioEnum: [
{value: 0, name: '是',},
{value: 0, name: '否',}
],
formData: {
goodsId: null,
goodsUserId: null,
companyName: '',
name: '',
mobile: '',
remark: '',
files: []
},
userInfo: null
};
},
methods: {
afterRead({file}) {
for (let i = 0; i < file.length; i++) {
const item = file[i]
const suffix = item.name.split('.').pop()
uniCloud.uploadFile({
filePath: item.url,
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + md5(item.name + Date.now().toString()) + `.${suffix}`,
success: ({fileID}) => {
uniCloud.getTempFileURL({
fileList: [fileID]
}).then(res => {
this.formData.files.push({url: res.fileList[0].tempFileURL})
})
}
})
}
},
deletePic({index}) {
this.formData.files.splice(index, 1)
},
addCoop() {
if (!this.formData.name) return this.$message.error('请填写联系人姓名')
if (!this.formData.mobile) return this.$message.error('请填写联系方式')
if (this.formData.files) this.formData.files = this.formData.files.map(item => item.url)
vk.callFunction({
url: 'client/spot/goods/kh/addCooperate',
data: this.formData
})
this.$message.success('提交成功')
setTimeout(() => {
uni.navigateBack()
}, 1500)
},
},
onLoad({id, userId}) {
this.formData.goodsId = id
this.formData.goodsUserId = userId
this.userInfo = vk.getStorageSync('uni_id_user_info')
if (this.userInfo.accountType === 1) {
this.formData.name = this.userInfo.person.personName
this.formData.mobile = this.userInfo.person.mobile
} else {
this.formData.companyName = this.userInfo.company.companyName
this.formData.mobile = this.userInfo.company.mobile
if (this.userInfo.manager) this.formData.name = this.userInfo.manager.personName
}
}
}
</script>
<style lang="scss">
.public-btn {
width: 95%;
margin-top: 60rpx;
color: #ffffff;
background: #A92924;
}
.layout-title {
padding: 20rpx 30rpx;
font-size: 28rpx;
font-weight: 600;
line-height: 44rpx;
color: #A92924;
}
.layout-apply {
margin: 20rpx 30rpx;
padding: 50rpx 20rpx;
border-radius: 18rpx;
}
.group {
padding: 20rpx 0;
}
.lb {
position: relative;
width: 180rpx;
font-size: 24rpx;
line-height: 40rpx;
color: #666666;
text-align: right;
}
.vl {
padding: 12rpx 20rpx;
border: 1px solid #f2f2f2;
}
.input {
font-size: 24rpx;
line-height: 40rpx;
color: #101010;
}
.before {
font-size: 24rpx;
line-height: 40rpx;
color: #333333;
}
</style>
+405
View File
@@ -0,0 +1,405 @@
<template> <!-- 现货详情 -->
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uiheader></uiheader>
</u-sticky>
<!-- 内容 -->
<view class="layout layout-detail" v-if="product">
<view class="company flex m-top-20" v-if="product.user">
<view class="logo">
<image class="full" v-if="product.user.businessCard && product.user.businessCard.logo"
:src="product.user.businessCard.logo" mode="aspectFit"></image>
</view>
<view class="info flex-1 p-left-20">
<view class="name flex justify-start align-center">
<view class="name-text">
{{ product.user.accountType === 2 ? product.user.company.companyName : product.user.person.personName }}
</view>
<!-- 认证图标 -->
<!-- <view class="name-icon m-left-20">-->
<!-- <image class="full" src="/static/img/idente.png" mode=""></image>-->
<!-- </view>-->
</view>
<view class="zhu" v-if="product.user.accountType === 2">
主营业务:{{
(product.user.company.mainSpotCategory && product.user.company.mainSpotCategory.length > 0) ? product.user.company.mainSpotCategory.join() : ''
}}
</view>
<view class="flex justify-between items-center">
<view class="zhu">
{{ product._add_time_str }} 发布
</view>
<view class="ml-20">
<u-button size="mini" plain type="primary" @click="$jump(`/pages/yellow/detail?id=${product.user._id}`)">
查看主页
</u-button>
</view>
</view>
</view>
</view>
<view class="card-title m-top-30">现货详情</view>
<view class="detail m-top-20">
<view class="detail-title">{{ product.name }}</view>
<view class="detail-text">库存 :{{ parseInt(product.stock) }}吨</view>
<view class="detail-text">供货地:{{
product.address.province.name + "-" + product.address.city.name + "-" + product.address.area.name
}}
</view>
</view>
<view class="card-body">
<view class="card-title m-top-30">报价有效期</view>
<view class="detail-text">截止: {{
dayjs(product.answerEndTime).format('YYYY-MM-DD HH:mm:ss')
}}
</view>
</view>
<view class="card-title m-top-30">产品规格单价</view>
<view class="m-top-20">
<file-type v-for="(item, index) in product.files" :key="index" :item="item"/>
</view>
<view class="card-title m-top-30">产品现场图片</view>
<view class="m-top-20">
<file-type v-for="(item, index) in product.images" :key="index" :item="item"/>
</view>
<view class="card-title m-top-30">已收到的合作申请</view>
<view class="table-box m-top-30">
<!-- <view class="thead">-->
<!-- <view class="tr">-->
<!-- <view class="th">企业</view>-->
<!-- <view class="th">申请人</view>-->
<!-- <view class="th">联系方式</view>-->
<!-- <view class="th">合作留言</view>-->
<!-- <view class="th">申请时间</view>-->
<!-- </view>-->
<!-- </view>-->
<!-- <view class="tbody">-->
<!-- <view class="flex" v-for="(item, index) in product.cooperateList" :key="index">-->
<!-- <view class="w-25p td-n">{{-->
<!-- item.user.accountType === 2 ? item.user.company.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6") : item.user.person.personName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6")-->
<!-- }}-->
<!-- </view>-->
<!-- <view class="w-25p td-n">{{ item.name }}</view>-->
<!-- <view class="w-25p td-n">-->
<!-- <text class="u-line-2">{{ item.mobile }}</text>-->
<!-- </view>-->
<!-- <view class="w-25p td-n u-line-2">{{ item.remark }}</view>-->
<!-- <view class="w-25p td-n">{{ item._add_time_str }}</view>-->
<!-- </view>-->
<!-- </view>-->
<view class="flex justify-start items-start flex-col mb-25 border rounded p-20 "
style="border-style: dashed" v-for="(item, index) in product.cooperateList" :key="index">
<p class="mb-10" v-if="item.user.accountType === 2">企业: {{
item.user.accountType === 2 ? item.user.company.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6") : item.user.person.personName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6")
}}</p>
<p class="mb-10">申请人: {{ item.name }}</p>
<!-- <p class="mb-10">联系方式: {{ item.mobile }}</p>-->
<p class="mb-10">联系方式: ********</p>
<p class="mb-10">合作留言: {{ item.remark }}</p>
<view class="mb-10 flex justify-start " v-if="product.isMine">
<text>附件:</text>
<file-type v-for="(file, fileIndex) in item.files" class="mx-15" :item="file" :key="fileIndex"/>
</view>
<p class="mb-10">申请时间: {{ item._add_time_str }}</p>
</view>
</view>
</view>
<!-- 底部 -->
<view class="fiexd-bottom flex justify-between align-center bg-white">
<u-icon name="integral" color="#A92924" size="26"></u-icon>
<view class="text red flex-1 m-left-20">{{ product.cooperateList.length }}家已经申请合作</view>
<view class="apply-btn" @click="toCooperate" v-if="userInfo._id !== product.userId">申请合作</view>
</view>
<!-- 弹出窗 -->
</view>
</template>
<script>
import uiheader from '@/components/index/header'
import FileType from "@/components/file-type/file-type.vue";
import dayjs from "dayjs";
export default {
components: {
FileType,
uiheader,
},
data() {
return {
isPopup: false,
product: null,
allChildCate: [],
userInfo: null
};
},
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)
}
});
},
applyLink() {
uni.$u.route('/pages/goods/apply', {
id: 0,
});
},
getInfo(_id) {
vk.callFunction({
url: 'client/spot/goods/pub/getDetail',
title: '请求中...',
data: {
_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)
}
})
}
}
});
},
async toCooperate() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
uni.showModal({
title: '提示',
content: '您尚未认证, 是否前往认证?',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 0)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
uni.showModal({
title: '提示',
content: '请完善名片信息',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 1)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (accountNum === 0) {
uni.showModal({
title: '提示',
content: '请先到个人中心添加收款账户',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 7)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else {
vk.navigateTo({url: `/pages/goods/apply?id=${this.product._id}&userId=${this.product.userId}`});
}
},
},
onLoad({id}) {
this.userInfo = vk.getStorageSync('uni_id_user_info')
this.getCategoryTreeData(id)
}
}
</script>
<style lang="scss">
page {
padding-bottom: 150rpx;
background: #ffffff;
}
.card-title {
position: relative;
padding-left: 20rpx;
font-size: 28rpx;
font-weight: 600;
line-height: 48rpx;
color: #A92924;
&:before {
position: absolute;
left: 0;
top: 50%;
z-index: 9;
margin-top: -14rpx;
content: '';
width: 6rpx;
height: 28rpx;
background: #A92924;
}
.more {
font-size: 24rpx;
font-weight: normal;
color: #999999;
}
}
.layout-detail {
padding: 20rpx 30rpx;
}
.company {
padding-bottom: 40rpx;
border-bottom: 1px solid #f2f2f2;
.logo {
width: 120rpx;
height: 120rpx;
}
.name-text {
//max-width: 380rpx;
font-size: 30rpx;
font-weight: 600;
line-height: 40rpx;
color: #333333;
}
.name-icon {
width: 80rpx;
height: 32rpx;
}
.zhu {
margin-top: 10rpx;
font-size: 24rpx;
line-height: 32rpx;
color: #999999;
}
}
.detail-title {
font-size: 26rpx;
font-weight: 600;
line-height: 40rpx;
color: #101010;
}
.detail-text {
margin-top: 10rpx;
font-size: 24rpx;
line-height: 40rpx;
color: #999999;
}
.fiexd-bottom {
position: fixed;
left: 0;
bottom: 0;
z-index: 99;
width: 100%;
height: 130rpx;
padding: 0 30rpx;
box-sizing: border-box;
border-top: 1px solid #f2f2f2;
.text {
font-size: 26rpx;
line-height: 40rpx;
}
.apply-btn {
width: 220rpx;
height: 70rpx;
font-size: 26rpx;
line-height: 70rpx;
text-align: center;
color: #ffffff;
background: #A92924;
}
}
.table-box {
font-size: 24rpx;
line-height: 28rpx;
text-align: center;
}
.tr {
display: flex;
justify-content: space-between;
align-items: center;
}
.th {
color: #666 !important;
background: #FFF8F2;
}
.th, .td {
display: flex;
justify-content: center;
align-items: center;
width: 50%;
height: 76rpx;
color: #999;
overflow: hidden;
box-sizing: border-box;
border-left: 1px solid #f2f2f2;
border-right: 1px solid #f2f2f2;
border-bottom: 1px solid #f2f2f2;
}
.td-n {
//height: 70rpx;
display: flex;
align-items: center;
justify-content: center;
border-right: 1px solid #f2f2f2;
border-bottom: 1px solid #f2f2f2;
background: #ffffff;
}
.td-3 {
width: 33.33%;
}
.popup-box {
padding: 20rpx 20rpx;
}
.popup-title {
padding: 18rpx 0;
border-bottom: 1px solid #A92924;
.title {
font-size: 24rpx;
line-height: 40rpx;
color: #A92924;
}
.close {
width: 80rpx;
height: 40rpx;
font-size: 22rpx;
line-height: 40rpx;
text-align: center;
color: #ffffff;
background: #A92924;
}
}
</style>
+423
View File
@@ -0,0 +1,423 @@
<template> <!-- 现货市场 -->
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uiheader title="现货市场"></uiheader>
<!-- 搜索栏 -->
<cmsearch :k="keyword" @search="afterSearch"></cmsearch>
<!-- 轮播图-传值:list="数组" -->
<cmswiper page="spot" height="320rpx"></cmswiper>
<!-- 选择器 -->
<view class="bg-white p-20 flex justify-center items-center">
<view class="flex-1 mx-20">
<u-button type="primary" shape="circle" size="mini" @click="toRelease">发布现货</u-button>
</view>
<view class="flex-1 mx-20">
<u-button type="primary" shape="circle" size="mini" plain @click="toMy">我的现货</u-button>
</view>
</view>
<view class="layout-pick flex justify-between align-center bg-white">
<view class="ip down" @click="isPick=true">现货类型:{{ pickValue }}</view>
<view class="ip down" @click="showAddress">供货地:{{ locationValue }}</view>
</view>
</u-sticky>
<!-- 列表数据 -->
<view class="layout-goods">
<view class="goods-box p-top-10">
<uiswiper :ad="9" :category-id="cateId" :category-ids="cateId ? [cateId] : []" :region="region"
padding="10rpx 0"></uiswiper>
<uiswiper :ad="10" :category-id="cateId" :category-ids="cateId ? [cateId] : []" :region="region"
padding="10rpx 0"></uiswiper>
<view class="item bg-white" @click="detailLink(item._id)" v-for="(item, index) in goodsData.rows"
:key="index">
<view class="top" v-if="item.isTop">特别推荐</view>
<view class="top" v-if="!item.isTop && index < 10">最新</view>
<view class="askfor">立即查看</view>
<view class="title text-single">{{ item.name }}</view>
<view class="text m-top-10">
<text class="red">库存:{{ parseInt(item.stock) }}吨</text>
</view>
<view class="text">供货地:{{ item.address.province.name }}-{{
item.address.city.name
}}-{{ item.address.area.name }}
</view>
<view class="flex justify-between align-center">
<view class="company flex justify-center align-center flex-nowrap">
<view class="text flex-1 text-single" v-if="item.user && item.user.company">
<template v-if="item.user">
<text v-if="item.user.accountType === 1">{{
item.user.person.personName.replace(/^(.).*$/, "$1**")
}}
</text>
<text v-if="item.user.accountType === 2">{{
item.user.company.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6")
}}
</text>
</template>
</view>
</view>
</view>
<view class="date">{{ item._add_time_str }} 更新</view>
</view>
</view>
</view>
<!-- 没有数据 -->
<cmempty></cmempty>
<!-- 按钮 -->
<!-- <view class="issue" @click="toRelease">-->
<!-- <u-icon name="plus" color="#fff" size="24"></u-icon>-->
<!-- </view>-->
<!-- <view class="my" @click="toMy">-->
<!-- <u-icon name="account" color="#A92924" size="24"></u-icon>-->
<!-- </view>-->
<!-- 选择器 -->
<u-picker v-if="isPick" :show="isPick" :columns="[categoryTreeData, categoryTreeData[cateIndex[0]].children]"
key-name="name" @confirm="handConfirmPick" @change="handleChangeCate" @cancel="isPick = false">
<template #more>
<text @click="resetCate">重置</text>
</template>
</u-picker>
<AddressSelect ref="AddressSelect" @confirm="regionConfirm"/>
<collapse></collapse>
</view>
</template>
<script>
import uiheader from '@/components/index/header'
import cmsearch from '@/components/common/search'
import cmempty from '@/components/common/empty'
import cmswiper from '@/components/common/swiper'
import AddressSelect from "@/components/AddressSelect.vue";
import Collapse from "@/components/index/collapse.vue";
import uiswiper from "@/components/index/swiper.vue";
export default {
components: {
uiswiper,
Collapse,
AddressSelect,
uiheader,
cmsearch,
cmempty,
cmswiper,
},
data() {
return {
isLogin: false,
sex: '',
isPick: false,
pickValue: '全部',
isLocation: false,
locationValue: '全国',
region: {
province: {
code: null,
name: null,
}
},
pageSize: 500,
goodsData: {
rows: []
},
keyword: '',
categoryTreeData: [],
cateIndex: [0, 0],
cateId: null,
};
},
methods: {
getCategoryTreeData() {
vk.callFunction({
url: 'client/spot/category/pub/getTree',
data: {},
success: (data) => {
this.categoryTreeData = data.rows
}
});
},
showAddress() {
this.$refs.AddressSelect.open(this.region, 1, true);
},
regionConfirm({province}) {
this.region = {province}
this.locationValue = `${province.name}`
this.search(1)
},
detailLink(id) {
vk.navigateTo(`/pages/goods/detail?id=${id}`);
},
handleChangeCate({indexs}) {
this.cateIndex = indexs
},
handConfirmPick({value}) {
this.pickValue = value[1].name
this.cateId = value[1]._id
this.isPick = false
this.search(1)
},
resetCate() {
this.cateIndex = [0, 0]
this.pickValue = '全部'
this.cateId = null
this.isPick = false
this.search(1)
},
async toRelease() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
uni.showModal({
title: '提示',
content: '您尚未认证, 是否前往认证?',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 0)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
uni.showModal({
title: '提示',
content: '请完善名片信息',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 1)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (accountNum === 0) {
uni.showModal({
title: '提示',
content: '请先到个人中心添加收款账户',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 7)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else {
vk.navigateTo({
url: '/pages/goods/publish'
})
}
},
async toMy() {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
uni.showModal({
title: '提示',
content: '您尚未认证, 是否前往认证?',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 0)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
uni.showModal({
title: '提示',
content: '请完善名片信息',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 1)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else this.$jump('/pages/goods/my')
},
afterSearch(keyword) {
this.keyword = keyword
this.search(1)
},
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.cateId ? [this.cateId] : null,
// categoryIds: this.checkCategoryList,
provinceCodes: this.region.province.code ? [this.region.province.code] : null
},
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
}
});
},
getCertUrl() {
vk.callFunction({
url: 'client/fadada.getVerifyUrl',
success: (res) => {
location.href = res.data.url
}
});
},
},
onLoad(option) {
if (option.keyword) this.keyword = option.keyword
this.getCategoryTreeData()
this.search()
}
}
</script>
<style lang="scss">
page {
}
.layout-pick {
// width: 690rpx;
height: 68rpx;
padding: 0 30rpx;
font-size: 24rpx;
line-height: 40rpx;
color: #4F4F4F;
.ip {
position: relative;
max-width: 50%;
height: 40rpx;
padding-right: 30rpx;
overflow: hidden;
box-sizing: border-box;
}
.down::after {
position: absolute;
right: 10rpx;
top: 50%;
z-index: 9;
content: '';
margin-top: -6rpx;
width: 0;
height: 0;
border-left: 10rpx solid transparent;
border-right: 10rpx solid transparent;
border-top: 12rpx solid #999999;
}
}
.layout-goods {
// width: 690rpx;
padding: 10rpx 30rpx;
.item {
position: relative;
margin-top: 10rpx;
padding: 10rpx 20rpx 20rpx;
border-radius: 12rpx;
.title {
width: 80%;
font-size: 30rpx;
font-weight: 600;
line-height: 48rpx;
color: #101010;
}
.link, .askfor {
position: absolute;
right: 20rpx;
top: 16rpx;
z-index: 9;
font-size: 24rpx;
line-height: 36rpx;
color: #A92924;
padding: 4rpx 8rpx;
}
.link {
border: 1px solid #A92924;
}
.text {
font-size: 24rpx;
line-height: 36rpx;
color: #999999;
}
.red {
margin-right: 20rpx;
color: #A92924;
}
.date {
font-size: 24rpx;
line-height: 36rpx;
color: #9a9a9a;
}
.company {
height: 40rpx;
.icon {
width: 40rpx;
height: 40rpx;
}
.text {
//width: 300rpx;
height: 40rpx;
font-size: 26rpx;
line-height: 40rpx;
color: #4f4f4f;
}
}
}
.item:nth-child(1) {
margin-top: 0 !important;
}
}
.red {
color: #A92924 !important;
}
.my {
position: fixed;
right: 30rpx;
bottom: 220rpx;
z-index: 99;
display: flex;
justify-content: center;
align-items: center;
width: 90rpx;
height: 90rpx;
border-radius: 50%;
background: white;
border: 1px solid #A92924;
}
.top {
position: absolute;
right: 0;
bottom: 0;
background-color: rgba(169, 41, 36, 1);
padding: 2px 5px;
border-radius: 5px 0 5px 0;
color: #FFFFFF;
font-size: 25rpx;
}
</style>
+183
View File
@@ -0,0 +1,183 @@
<template>
<view class="wrap">
<u-sticky offset-top="0" customNavHeight="0">
<uititle title="我发布的现货"></uititle>
</u-sticky>
<view class="issue" @click="toRelease">
<u-icon name="plus" color="#fff" size="24"></u-icon>
</view>
<view class="layout-goods">
<view class="goods-box p-top-10" v-if="list.length">
<view class="item bg-white" @click="detailLink(item._id)" v-for="(item, index) in list"
:key="index">
<view class="askfor">查看详情</view>
<view class="title text-single">{{ item.name }}</view>
<view class="text m-top-10">
<text class="red">库存:{{ parseInt(item.stock) }}吨</text>
<text>供货地:{{ item.address.province.name }}-{{ item.address.city.name }}</text>
</view>
<view class="flex justify-between align-center m-top-10">
<view class="company flex justify-center align-center flex-nowrap">
<view class="text flex-1 text-single" v-if="userInfo && userInfo.company">
{{ userInfo.company.companyName }}
</view>
</view>
</view>
<view class="date">{{ item._add_time_str }} 更新</view>
</view>
</view>
<u-empty v-else text="您未发布现货"></u-empty>
</view>
</view>
</template>
<script>
import uititle from '@/components/common/title'
export default {
name: "my",
components: {uititle},
data() {
return {
list: [],
userInfo: null
}
},
methods: {
detailLink(id) {
vk.navigateTo(`/pages/goods/detail?id=${id}`, {
id
});
},
async getList() {
const {rows} = await vk.callFunction({
url: 'client/spot/goods/kh/getSelfOne'
})
this.list = rows
},
async toRelease() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
uni.showModal({
title: '提示',
content: '您尚未认证, 是否前往认证?',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 0)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
uni.showModal({
title: '提示',
content: '请完善名片信息',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 1)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (accountNum === 0) {
uni.showModal({
title: '提示',
content: '请先到个人中心添加收款账户',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 7)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else {
vk.navigateTo({
url: '/pages/goods/publish'
})
}
},
},
onShow() {
this.userInfo = vk.getStorageSync('uni_id_user_info')
this.getList()
}
}
</script>
<style lang="scss" scoped>
.layout-goods {
// width: 690rpx;
padding: 10rpx 30rpx;
.item {
position: relative;
margin-top: 30rpx;
padding: 10rpx 20rpx 20rpx;
border-radius: 12rpx;
.title {
width: 90%;
font-size: 30rpx;
font-weight: 600;
line-height: 48rpx;
color: #101010;
}
.link, .askfor {
position: absolute;
right: 20rpx;
top: 16rpx;
z-index: 9;
font-size: 24rpx;
line-height: 36rpx;
color: #A92924;
padding: 4rpx 8rpx;
}
.link {
border: 1px solid #A92924;
}
.text {
font-size: 24rpx;
line-height: 36rpx;
color: #999999;
}
.red {
margin-right: 20rpx;
color: #A92924;
}
.date {
font-size: 24rpx;
line-height: 36rpx;
color: #9a9a9a;
}
.company {
height: 40rpx;
.icon {
width: 40rpx;
height: 40rpx;
}
.text {
//width: 300rpx;
height: 40rpx;
font-size: 26rpx;
line-height: 40rpx;
color: #4f4f4f;
}
}
}
.item:nth-child(1) {
margin-top: 0 !important;
}
}
</style>
+372
View File
@@ -0,0 +1,372 @@
<template>
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uititle title="发布现货"></uititle>
</u-sticky>
<view class="layout layout-publish m-top-20">
<view class="group flex align-center">
<view class="lb need m-right-20">现货名称:</view>
<view class="vl flex-1">
<u--input
disabled
placeholder="请输入内容"
border="surround"
v-model="formData.name"
></u--input>
</view>
</view>
<view class="tag-title m-top-30">
点击添加现货
<text class="limit">(至少选择1个现货,最多可选择5个现货)</text>
</view>
<view class="tag-box flex justify-start flex-wrap">
<view :class="['item', formData.categoryIds.includes(item._id) ? 'active' : '']"
style="flex: 0 0 30%"
v-for="(item,index) in goodsCate" :key="index"
@click="handTag(item)">{{ item.name }}
</view>
</view>
<view class="group flex align-center">
<view class="lb need m-right-20">库存约:</view>
<view class="vl" style="width: 300rpx;">
<u--input
placeholder="请输入内容"
border="surround"
v-model="formData.stock"
></u--input>
</view>
<view class="fix m-left-20">吨</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need m-right-20">供货地:</view>
<view class="vl flex-1" @click="showAddress">
<u--input
readonly
placeholder="请选择"
border="surround"
v-model="address"
suffixIcon="arrow-down"
style="pointer-events:none"
>
</u--input>
</view>
</view>
<view class="group m-top-30">
<view class="lb m-right-20">产品规格单价:</view>
<view class="m-top-30">
<u-upload
accept="file"
:fileList="formData.files"
@afterRead="afterRead"
@delete="deletePic"
multiple
:maxCount="10"
></u-upload>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb m-right-20">报价有效期:</view>
<view class="vl flex-1" @click.native="isPickDate = true">
<u--input
style="pointer-events:none"
readonly
placeholder="请输入内容"
suffixIcon="calendar"
v-model="formData.answerEndTime"
></u--input>
</view>
</view>
<view class="group m-top-30">
<view class="lb m-right-20">产品现场图片:</view>
<view class="m-top-30">
<u-upload
accept="image"
:fileList="formData.images"
@afterRead="afterReadImages"
@delete="deletePicImages"
multiple
:maxCount="10"
></u-upload>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need m-right-20">是否购买全国广告位:</view>
<view class="vl flex-1">
<u-switch v-model="formData.buyAll" @change="getAmount(true)"></u-switch>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need m-right-20">是否购买省份广告位:</view>
<view class="vl flex-1">
<u-switch v-model="formData.buyTop"
:disabled="address === '' || totalAmount === 0"
@change="getAmount()"></u-switch>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need m-right-20">购买广告位时长(月):</view>
<view class="vl flex-1">
<u-number-box v-model="formData.buyTopNum"></u-number-box>
</view>
</view>
<p class="text-main text-25 my-20" v-if="formData.buyAll">您已选择购买全国广告位,无法继续购买省份广告位</p>
<view class="group flex align-center m-top-30">
<view class="lb need m-right-20">广告位价格:</view>
<view class="vl flex-1">
{{ totalAmount }}元
</view>
</view>
<u-button class="public-btn" text="提交" @click.native="add"></u-button>
</view>
<AddressSelect ref="AddressSelect" @confirm="regionConfirm"/>
<u-datetime-picker :show="isPickDate" v-model="answerEndTime" mode="date"
:minDate="minDate" @cancel="isPickDate = false"
@confirm="handConfirmDate"></u-datetime-picker>
</view>
</template>
<script>
import uititle from '@/components/common/title'
import AddressSelect from "@/components/AddressSelect.vue";
import dayjs from 'dayjs'
export default {
components: {
AddressSelect,
uititle,
},
data() {
return {
tagIndex: -1,
fileList1: [],
formData: {
name: '',
stock: '',
answerEndTime: '',
buyTop: false,
buyAll: false,
buyTopNum: 1,
categoryIds: [],
files: [],
images: [],
address: {}
},
address: '',
amount: '',
answerEndTime: '',
goodsCate: [],
isPickDate: false,
minDate: Number(new Date()),
};
},
methods: {
handConfirmDate({value}) {
this.formData.answerEndTime = dayjs(value).format('YYYY-MM-DD')
this.isPickDate = false
},
changeBuyAll(val) {
if (val && this.formData.buyTop) this.formData.buyTop = false
},
handTag(val) {
const index = this.formData.categoryIds.findIndex(item => item === val._id)
if (index === -1 && this.formData.categoryIds.length === 5) return this.$message.error('最多选择五个分类')
if (index === -1) this.formData.categoryIds.push(val._id)
else this.formData.categoryIds.splice(index, 1)
this.formData.name = this.formData.categoryIds.map(item => this.goodsCate.find(val => val._id === item).name).join('、')
},
afterRead({file}) {
file.forEach(item => {
uniCloud.uploadFile({
filePath: item.url,
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + item.name,
success: ({fileID}) => {
uniCloud.getTempFileURL({
fileList: [fileID]
}).then(res => {
this.formData.files.push({
url: res.fileList[0].tempFileURL,
name: item.name
})
})
}
})
})
},
deletePic({index}) {
this.formData.files.splice(index, 1)
},
afterReadImages({file}) {
file.forEach(item => {
uniCloud.uploadFile({
filePath: item.url,
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + item.name,
success: ({fileID}) => {
uniCloud.getTempFileURL({
fileList: [fileID]
}).then(res => {
this.formData.images.push({
url: res.fileList[0].tempFileURL,
name: item.name
})
})
}
})
})
},
deletePicImages({index}) {
this.formData.images.splice(index, 1)
},
async getGoodsCate() {
const {data} = await vk.callFunction({
url: 'client/spot/category/pub/getList',
data: {
whereJson: {
level: 2
}
}
});
this.goodsCate = data
},
showAddress() {
this.$refs.AddressSelect.open(this.address);
},
regionConfirm({province, city, area}) {
this.formData.address = {province, city, area}
this.address = `${province.name} ${city.name} ${area.name}`
this.getAmount()
},
async add() {
if (this.formData.categoryIds.length === 0) return this.$message.error('请选择分类')
if (!this.formData.stock) return this.$message.error('请填写库存')
if (JSON.stringify(this.formData.address) === '{}') return this.$message.error('请选择供货地')
this.formData.files = this.formData.files.map(i => i.url)
this.formData.images = this.formData.images.map(i => i.url)
const res = await vk.callFunction({
title: '请求中...',
url: 'client/spot/goods/kh/addUpdate',
data: this.formData
})
if (this.formData.buyTop || this.formData.buyAll) {
vk.navigateTo({
url: `/pages/shop/pay?id=${res.data}`
})
} else uni.redirectTo({url: '/pages/goods/goods'});
},
onFormSuccess(res) {
if (this.formData.buyTop) {
vk.navigateTo({
url: `/pages/shop/pay?id=${res.data.data}`
})
} else uni.redirectTo({url: '/pages/goods/goods'});
},
getAmount(isAll = false) {
this.amount = 0
if (!isAll && JSON.stringify(this.form1.data.address) === '{}') return
if (isAll) {
this.formData.buyTop = !this.formData.buyAll
}else {
this.formData.buyAll = !this.formData.buyTop
}
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)
}
}
});
},
},
onLoad() {
this.getGoodsCate()
},
computed: {
totalAmount() {
let amount = 0
if (this.amount) amount = this.amount * this.formData.buyTopNum
return amount
}
}
}
</script>
<style lang="scss">
page {
background: #ffffff;
}
.public-btn {
width: 95%;
margin-top: 60rpx;
color: #ffffff;
background: #A92924;
}
.layout-publish {
padding: 20rpx 30rpx;
}
.tag-title {
font-size: 26rpx;
line-height: 40rpx;
color: #000000;
.limit {
font-size: 24rpx;
color: #999999;
}
}
.tag-box {
padding: 20rpx 0;
.item {
padding: 6rpx 10rpx;
font-size: 24rpx;
line-height: 32rpx;
color: #555555;
}
.active {
color: #A92924;
}
}
.lb, .fix {
position: relative;
font-size: 26rpx;
line-height: 40rpx;
color: #666666;
}
.lbx {
font-size: 24rpx;
color: #999999;
}
.download {
padding: 8rpx 20rpx;
font-size: 24rpx;
line-height: 36rpx;
color: #A92924;
border: 1px solid #A92924;
}
.need::before {
position: absolute;
left: -16rpx;
top: 50%;
z-index: 9;
margin-top: -12rpx;
content: '*';
color: #A92924;
font-size: 32rpx;
line-height: 1;
}
</style>
+136
View File
@@ -0,0 +1,136 @@
<template>
<view class="wrap">
<!-- 顶部-吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<uiheader :index='index'></uiheader>
</u-sticky>
<!-- 半圆区 -->
<uisemicircle @search="search"></uisemicircle>
<!-- 导航栏 -->
<common-swiper height="14" class="mt-15"/>
<div class="flex justify-around items-center">
<div @click="$jump('/pages/self/self')" style="width: 30%; margin: 1%">
<image src="/static/img/home1.jpg" alt="" style="width: 100%;" mode="widthFix"/>
</div>
<div @click="$jump('/pages/goods/goods')" style="width: 30%; margin: 1%">
<image src="/static/img/home2.jpg" alt="" style="width: 100%;" mode="widthFix"/>
</div>
<div @click="$jump('/pages/price/price')" style="width: 30%; margin: 1%">
<image src="/static/img/home3.jpg" alt="" style="width: 100%;" mode="widthFix"/>
</div>
</div>
<view>
<uinavr :index='index'></uinavr>
</view>
<!-- 轮播图 -->
<uiswiper :ad="3"></uiswiper>
<uiswiper :ad="4"></uiswiper>
<!-- 最新询价 -->
<uiprice></uiprice>
<!-- 现货市场 -->
<uigoods></uigoods>
<!-- 合作商家 -->
<uiwork></uiwork>
<!-- 服务商 -->
<uifacilitator></uifacilitator>
<!-- 交易模式 -->
<uimodel></uimodel>
<!-- 金融服务 -->
<uifinance></uifinance>
<!-- 最新开通 -->
<uiopen></uiopen>
<!-- 入门 -->
<uiabc></uiabc>
<!-- 资讯中心 -->
<uinews></uinews>
<uiswiper :ad="5"></uiswiper>
<uiswiper :ad="6"></uiswiper>
<uiswiper :ad="7"></uiswiper>
<uiswiper :ad="8"></uiswiper>
<collapse></collapse>
<!-- 广告图 -->
<!-- <uiadvert></uiadvert>-->
</view>
</template>
<script>
import uiheader from '@/components/index/header'
import uisemicircle from '@/components/index/semicircle'
import uinavr from '@/components/index/nav'
import uiswiper from '@/components/index/swiper'
import uiprice from '@/components/index/price'
import uigoods from '@/components/index/goods'
import uiwork from '@/components/index/work'
import uifacilitator from '@/components/index/facilitator'
import uimodel from '@/components/index/model'
import uifinance from '@/components/index/finance'
import uiopen from '@/components/index/open'
import uiabc from '@/components/index/abc'
import uinews from '@/components/index/news'
import uiadvert from '@/components/index/advert'
import Collapse from "@/components/index/collapse.vue";
export default {
components: {
Collapse,
uiheader,
uisemicircle,
uinavr,
uiswiper,
uinews,
uiabc,
uiadvert,
uiopen,
uifinance,
uifacilitator,
uiwork,
uigoods,
uiprice,
uimodel,
},
data() {
return {
index: 0,
isLogin: false,
}
},
methods: {
search({keyword, type}) {
let url = ''
switch (type) {
case 0 : {
url = '/pages/shop/shop'
}
break;
case 1 : {
url = '/pages/goods/goods'
}
break;
case 2 : {
url = '/pages/price/price'
}
break;
case 3 : {
url = '/pages/work/work'
}
break;
case 4 : {
url = '/pages/junk/junk'
}
break;
}
this.$jump(`${url}?keyword=${keyword}`)
}
},
onLoad() {
},
}
</script>
<style lang="scss">
page {
// padding-top: 80rpx;
}
</style>
+260
View File
@@ -0,0 +1,260 @@
<template>
<el-card class="box-card">
<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="userInfo && parseInt(userInfo.userLevel) > 0"><i
class="el-icon-setting"></i> 消息推送设置
</el-button>
</div>
<!-- 消息列表 -->
<div class="notice-list">
<div class="item" v-for="(item,index) in noticeList" :key="index">
<div class="notice-main">
<div class="title-box" @click="toDetail(item, index)">
<div class="flex justify-start items-start">
<el-badge is-dot class="badge" v-if="!item.hasRead"></el-badge>
<div class="title">{{ item.title }}</div>
</div>
</div>
<div class="meta-row">
<div class="time">{{ item._add_time_str }}</div>
<div class="right">
<div class="btn" @click="setRead(index)" v-if="!item.hasRead">
<i class="el-icon-sunset"></i>已读
</div>
<div class="btn" @click="del(index)">
<i class="el-icon-delete"></i>删除
</div>
</div>
</div>
</div>
<div class="desc pointer" @click="toDetail(item, index)">
{{ item.content }}
</div>
</div>
<div class="text-center mt-20">
<el-pagination @current-change="getList" background layout="prev, pager, next"
:total="total"></el-pagination>
</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="toContract" type="primary">去签合同</el-button>
<el-button @click="dialogVisible = false">关闭</el-button>
</div>
</el-dialog>
</el-card>
</template>
<script>
let that;
export default {
data() {
return {
unreadNum: 0,
noticeList: [],
pageSize: 10,
total: 0,
dialogVisible: false,
sheet: null,
userInfo: null,
}
},
onShow() {
this.getUserInfo()
this.getList()
this.getUnreadNum()
},
methods: {
async getUserInfo() {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
this.userInfo = userInfo
},
async getList(pageIndex = 1) {
const {rows, total} = await vk.callFunction({
url: 'client/message/kh/getList',
data: {
pageIndex,
pageSize: this.pageSize,
}
})
this.total = total
this.noticeList = rows
},
async getUnreadNum() {
const {data} = await vk.callFunction({
url: 'client/message/kh/getUnreadCount',
});
this.unreadNum = data
},
async setRead(index) {
this.noticeList[index].hasRead = true
await vk.callFunction({
url: 'client/message/kh/setRead',
data: {
id: this.noticeList[index]._id
}
})
},
del(index) {
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()
})
},
onSetting() {
uni.setStorageSync('user_tab', 3)
vk.navigateTo('/pages/user/user')
},
toDetail(item, index) {
if (!item.hasRead) this.setRead(index)
let url = null
if (item.type === 'old') url = `/pages/junk/detail?id=${item.pk}`
else if (item.type === 'enquiry') url = `/pages/price/detail?id=${item.pk}`
else if (item.type === 'process') url = `/pages/work/detail?id=${item.pk}`
else if (item.type === 'contract') url = `/pages/public/contract?tab=1`
else if (item.type === 'self-support') url = `/pages/self/makeQuote?id=${item.pk}`
else if (item.type === 'self-product') url = `/pages/user/seller`
else if (item.type === 'spot') url = `/pages/goods/detail?id=${item.pk}`
else if (item.type === 'self-support-quote') {
this.getQuoteDetail(item.pk)
}
if (url) vk.navigateTo({url})
},
async allRead() {
await vk.callFunction({
url: 'client/message/kh/setAllRead'
})
await this.getList(1)
await this.getUnreadNum()
},
async getQuoteDetail(_id) {
await vk.callFunction({
url: 'client/selfSupport/kh/getQuoteDetail',
data: {
_id
},
success: ({rows}) => {
this.sheet = rows
this.dialogVisible = true
}
});
},
toContract() {
this.dialogVisible = false
vk.navigateTo({url: '/pages/public/contract?tab=1'})
}
}
}
</script>
<style lang="less">
.el-icon-setting {
padding: 0 5px;
}
.notice-list {
.item {
font-size: 25rpx;
display: flex;
flex-direction: column;
padding: 10rpx 0;
border-bottom: 1px solid #ddd;
.notice-main {
width: 100%;
}
.title-box {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: flex-start;
.title {
font-size: 14px;
}
.badge {
display: flex;
flex-direction: column;
margin-top: 12rpx;
//margin-right: 10px;
}
}
.meta-row {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 8rpx;
.time {
color: #999999;
}
}
.desc {
color: #999999;
line-height: 2em;
}
.right {
display: flex;
justify-content: flex-end;
.btn {
color: #bf2b28;
cursor: pointer;
i {
padding: 0 5px;
margin-left: 10px;
}
}
.active {
}
}
}
}
</style>
+65
View File
@@ -0,0 +1,65 @@
<template>
<u-popup :show="show" @close="close" @open="handlePopupOpen" mode="center" round="15">
<view style="height: 80vh; overflow-y: auto;width: 80vw" class="p-20">
<u-parse :content="agreement"/>
</view>
<u-button shape="circle" @click="close">关闭</u-button>
</u-popup>
</template>
<script>
export default {
name: "agreement",
data() {
return {
agreement: '',
show: false,
readTimer: null,
readCompleted: false,
}
},
methods: {
open() {
this.getAgreement()
},
handlePopupOpen() {
this.startReadTimer()
},
startReadTimer() {
this.clearReadTimer()
if (this.readCompleted) return
this.readTimer = setTimeout(() => {
this.readTimer = null
this.readCompleted = true
this.$emit('read-complete')
}, 5000)
},
clearReadTimer() {
if (this.readTimer) {
clearTimeout(this.readTimer)
this.readTimer = null
}
},
close() {
this.clearReadTimer()
this.show = false
},
async getAgreement() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '65885d5b862066f18a4e4a36'
},
})
this.agreement = res.content
this.show = true
},
},
beforeDestroy() {
this.clearReadTimer()
},
mounted() {
},
}
</script>
+262
View File
@@ -0,0 +1,262 @@
<template>
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uititle title="提交报价"></uititle>
</u-sticky>
<quote-remain-num v-if="reloaded" :amount="sheet.quoteAmount" type="old" :id="formData.sheetId"/>
<view class="layout layout-title m-top-20">填写报价信息</view>
<view class="layout layout-publish m-top-20 bg-white">
<view class="card-title m-top-30">报价信息</view>
<view class="group flex align-center m-top-30">
<view class="lb need m-right-20">总价(人民币:元):</view>
<view class="vl flex-1">
<u--input
placeholder="请输入内容"
border="surround"
v-model="formData.totalPrice"
suffixIcon="元"
suffixIconStyle="font-size: 24rpx;color: #909399"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb m-right-20">报价单详情:</view>
<view class="vl flex-1">
<u--input
placeholder="请输入报价单详情"
border="surround"
v-model="formData.remark"
suffixIconStyle="font-size: 24rpx;color: #909399"
></u--input>
</view>
</view>
<view class="card-title m-top-30">附件信息</view>
<view class="group m-top-20">
<view class="lb need m-right-20">附件内容:</view>
<view class="flex justify-between align-center m-top-20">
<view class="lbx flex-1">仅支持纵向PDF文档,报价附件将生成标准合同附件,请认真审阅。</view>
<!-- <view class="download">报价单样板下载</view>-->
</view>
<view class="m-top-30">
<u-upload
accept="file"
:fileList="formData.files"
@afterRead="afterRead"
@delete="deletePic"
name="1"
multiple
:maxCount="10"
></u-upload>
</view>
</view>
<u-button class="public-btn m-top-30" text="提交报价" @click="addCoop"></u-button>
</view>
</view>
</template>
<script>
import uititle from '@/components/common/title'
import dayjs from "dayjs";
import QuoteRemainNum from "@/components/quote-remain-num/quote-remain-num.vue";
import md5 from "js-md5";
export default {
components: {
QuoteRemainNum,
uititle,
},
data() {
return {
current: 0,
radioEnum: [
{value: 0, name: '是',},
{value: 0, name: '否',}
],
formData: {
sheetId: null,
totalPrice: null,
files: [],
remark: '',
},
reloaded: false,
sheet: null,
};
},
methods: {
getDetail() {
this.reloaded = false
vk.callFunction({
url: 'client/old/pub/getDetail',
title: '请求中...',
data: {
id: this.formData.sheetId
},
success: (res) => {
this.sheet = res
this.reloaded = true
}
}).catch(err => {
if (err.code === -1) {
setTimeout(() => {
vk.navigateBack()
}, 1500)
}
})
},
addCoop() {
if (!this.formData.totalPrice) return this.$message.error('请填写金额')
if (this.formData.files.length === 0) return this.$message.error('请上传报价附件')
if (this.formData.files.length > 0) this.formData.files = this.formData.files.map(item => item.url)
vk.callFunction({
url: 'client/old/kh/addQuote',
data: this.formData
})
this.$message.success('提交成功')
uni.navigateBack()
},
afterRead({file}) {
for (let i = 0; i < file.length; i++) {
const item = file[i]
if (item.type !== 'application/pdf') {
uni.showToast({
title: '请上传PDF文件',
icon: 'none'
})
return
}
uniCloud.uploadFile({
filePath: item.url,
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + md5(item.name + Date.now().toString()) + '.pdf',
success: ({fileID}) => {
uniCloud.getTempFileURL({
fileList: [fileID]
}).then(res => {
this.formData.files.push({
url: res.fileList[0].tempFileURL,
name: item.name
})
})
}
})
}
},
deletePic({index}) {
this.formData.files.splice(index, 1)
},
},
onLoad({id}) {
this.formData.sheetId = id
this.getDetail()
},
onShow() {
this.reloaded = false
setTimeout(() => {
this.reloaded = true
}, 500)
}
}
</script>
<style lang="scss">
.layout-title {
padding: 20rpx 30rpx;
font-size: 28rpx;
font-weight: 600;
line-height: 44rpx;
color: #A92924;
}
.card-title {
position: relative;
padding-left: 20rpx;
font-size: 26rpx;
font-weight: 600;
line-height: 48rpx;
color: #A92924;
&:before {
position: absolute;
left: 0;
top: 50%;
z-index: 9;
margin-top: -14rpx;
content: '';
width: 4rpx;
height: 28rpx;
background: #A92924;
}
}
.public-btn {
width: 80%;
margin-top: 60rpx;
color: #ffffff;
background: #A92924;
}
.layout-publish {
margin: 20rpx 30rpx;
padding: 50rpx 30rpx;
border-radius: 18rpx;
}
.tag-title {
font-size: 26rpx;
line-height: 40rpx;
color: #000000;
.limit {
font-size: 24rpx;
color: #999999;
}
}
.tag-box {
padding: 20rpx 0;
.item {
padding: 6rpx 10rpx;
font-size: 24rpx;
line-height: 32rpx;
color: #555555;
}
.active {
color: #A92924;
}
}
.lb, .fix {
position: relative;
font-size: 26rpx;
line-height: 40rpx;
color: #666666;
}
.lbx {
font-size: 24rpx;
color: #999999;
}
.download {
padding: 8rpx 20rpx;
font-size: 24rpx;
line-height: 36rpx;
color: #A92924;
border: 1px solid #A92924;
}
.need::before {
position: absolute;
left: -16rpx;
top: 50%;
z-index: 9;
margin-top: -12rpx;
content: '*';
color: #A92924;
font-size: 32rpx;
line-height: 1;
}
</style>
+659
View File
@@ -0,0 +1,659 @@
<template> <!-- 现货详情 -->
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uiheader></uiheader>
</u-sticky>
<!-- 内容 -->
<view class="layout layout-detail" v-if="sheet">
<view class="company flex m-top-20">
<view class="info flex-1 p-left-20">
<view class="font-bold">
{{ sheet.supplier.companyName ? sheet.supplier.companyName : sheet.supplier.personalName }}
</view>
<view class="zhu">
{{ sheet._add_time_str }} 发布
</view>
</view>
</view>
<view class="card-title m-top-30">物资信息</view>
<view class="detail m-top-20">
<view class="detail-title">
<text>{{ sheet.title }}</text>
<text class="text-main" v-if="sheet.isUrgent">[加急]</text>
</view>
<view class="m-top-20">
<file-type v-for="(item, index) in sheet.files" :key="index" :item="item"/>
</view>
<view class="detail-text">物资分类:{{ sheet.category[1] }}</view>
<view class="detail-text" v-if="sheet.addressRegion && sheet.addressRegion.city">
物资所在地:{{ sheet.addressRegion.province.name }}{{
sheet.addressRegion.city.name
}}{{ sheet.addressRegion.area.name }}{{ sheet.addressDetail }}
</view>
<view class="detail-text" v-if="[1, 2].includes(sheet.type) && sheet.deliverAddressRegion.city">
{{
sheet.type === 2 ? (sheet.rentType === 0 ? '物资交货地' : '物资装货地') : '物资交货地'
}}:{{ sheet.deliverAddressRegion.province.name }}{{
sheet.deliverAddressRegion.city.name
}}{{ sheet.deliverAddressRegion.area.name }}{{ sheet.deliverAddressDetail }}
</view>
<view class="detail-text">详情:{{ sheet.desc ? sheet.desc : '无' }}</view>
<template v-if="sheet.type === 0">
<view class="detail-text">起拍计价单位:{{
sheet.startNum ? sheet.startNum : ''
}}{{ sheet.unit ? sheet.unit : '' }}
</view>
<view class="detail-text">起拍人民币单价:{{
sheet.startAmount ? `${sheet.startAmount}元` : ''
}}
</view>
<view class="detail-text">拍卖信息失效时间:{{ sheet.expiredTime ? sheet.expiredTime : '' }}</view>
</template>
</view>
<view v-if="[0, 1, 2].includes(sheet.type)">
<view class="card-title m-top-30">合同条款</view>
<view class="detail m-top-20">
<view class="detail-text">是否含税:{{ sheet.invoice ? '含税' : '不含税' }}</view>
<template v-if="sheet.invoice">
<view class="detail-text" v-if="sheet.invoiceOther">税票要求:{{ sheet.invoiceOther }}</view>
<template v-else>
<view class="detail-text">
开票时间:{{ sheet.writeInvoiceTime ? sheet.writeInvoiceTime : '无' }}
</view>
<view class="detail-text">
纳税人身份:{{ sheet.taxType ? sheet.taxType : '无' }}
</view>
<view class="detail-text">
发票种类:{{ sheet.invoiceType ? sheet.invoiceType : '无' }}
</view>
<view class="detail-text">
税率:{{ sheet.taxRate ? sheet.taxRate : '无' }}
</view>
</template>
</template>
<view class="detail-text">报价明细:{{ sheet.invoiceDetail ? sheet.invoiceDetail : '无' }}</view>
</view>
</view>
<template v-if="sheet.type !== 3">
<view class="card-title m-top-30">交易说明</view>
<view class="detail m-top-20">
<view class="mt-15 detail-text">报价区域:{{
sheet.offerAddressNoLimit ? '不限区域' :
(sheet.offerAddressRegion && sheet.offerAddressRegion.province) ? `${sheet.offerAddressRegion.province.name} ${sheet.offerAddressRegion.city ? sheet.offerAddressRegion.city.name : ''} ${sheet.offerAddressRegion.area ? sheet.offerAddressRegion.area.name : '无'}` : '无'
}}
</view>
<view class="mt-15 detail-text" v-if="sheet.payMethod">付款方式:{{ sheet.payMethod }}{{
sheet.payMethod === '预付' ? `${sheet.prePayRate}%,货到付全款` : ''
}}
</view>
<view class="mt-15 detail-text" v-if="sheet.payMethod === '其他付款方式描述'">{{
sheet.otherPayMethodDesc
}}
</view>
<!-- <view class="mt-15">报价形式:{{ sheet.offerType === 0 ? '整单报价' : '可分项报价' }}</view>-->
</view>
</template>
<template v-if="sheet.type === 1">
<view class="item-wrap">
<view class="card-title m-top-30">采购商信息</view>
<template v-if="sheet.isMine || sheet.hasQuote || userInfo.userLevel > 0">
<template v-if="sheet.user && sheet.user.accountType === 2">
<view class="mt-15" v-if="sheet.buyer.companyName">公司信息:{{
sheet.buyer.companyName ? sheet.buyer.companyName : ''
}}
</view>
<view class="mt-15" v-if="sheet.buyer.contract">公司联系方式:{{
sheet.buyer.contract ? sheet.buyer.contract : ''
}}
</view>
</template>
<template v-else>
<view class="mt-15" v-if="sheet.buyer.personalName">个人信息:{{
sheet.buyer.personalName ? sheet.buyer.personalName : ''
}}
</view>
<view class="mt-15" v-if="sheet.buyer.personalContract">个人联系方式:{{
sheet.buyer.personalContract ? sheet.buyer.personalContract : ''
}}
</view>
</template>
<view class="mt-15" v-if="sheet.buyer.managerName">授权人姓名:{{
sheet.buyer.managerName ? sheet.buyer.managerName : ''
}}
</view>
<view class="mt-15" v-if="sheet.buyer.managerContract">授权联系方式:{{
sheet.buyer.managerContract ? sheet.buyer.managerContract : ''
}}
</view>
</template>
<template v-else>
<template v-if="sheet.user && sheet.user.accountType === 2">
<view class="mt-15" v-if="sheet.buyer.companyName">公司信息:{{
sheet.buyer.companyName ? sheet.buyer.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6") : ''
}}
</view>
<view class="mt-15" v-if="sheet.buyer.contract">公司联系方式:{{
sheet.buyer.contract ? sheet.buyer.contract.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : ''
}}
</view>
</template>
<template v-else>
<view class="mt-15" v-if="sheet.buyer.personalName">个人信息:{{
sheet.buyer.personalName ? sheet.buyer.personalName.replace(/^(.).*(.)$/, "$1***$2") : ''
}}
</view>
<view class="mt-15" v-if="sheet.buyer.personalContract">个人联系方式:{{
sheet.buyer.personalContract ? sheet.buyer.personalContract.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : ''
}}
</view>
</template>
<view class="mt-15" v-if="sheet.buyer.managerName">授权人姓名:{{
sheet.buyer.managerName ? sheet.buyer.managerName.replace(/^(.).*(.)$/, "$1***$2") : ''
}}
</view>
<view class="mt-15" v-if="sheet.buyer.managerContract">授权联系方式:{{
sheet.buyer.managerContract ? sheet.buyer.managerContract.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : ''
}}
</view>
</template>
</view>
</template>
<template v-else>
<view class="item-wrap">
<view class="card-title m-top-30">{{ sheet.type === 3 ? '回收单位信息' : '供货商信息' }}</view>
<template v-if="sheet.isMine || sheet.hasQuote || userInfo.userLevel > 0">
<template v-if="sheet.user && sheet.user.accountType === 2">
<view class="mt-15" v-if="sheet.supplier.companyName">公司信息:{{
sheet.supplier.companyName ? sheet.supplier.companyName : ''
}}
</view>
<view class="mt-15" v-if="sheet.supplier.contract">公司联系方式:{{
sheet.supplier.contract ? sheet.supplier.contract : ''
}}
</view>
</template>
<template v-else>
<view class="mt-15" v-if="sheet.supplier.personalName">个人信息:{{
sheet.supplier.personalName ? sheet.supplier.personalName : ''
}}
</view>
<view class="mt-15" v-if="sheet.supplier.personalContract">
个人联系方式:{{
sheet.supplier.personalContract ? sheet.supplier.personalContract : ''
}}
</view>
</template>
<view class="mt-15" v-if="sheet.supplier.managerName">授权人姓名:{{
sheet.supplier.managerName ? sheet.supplier.managerName : ''
}}
</view>
<view class="mt-15" v-if="sheet.supplier.managerContract">授权联系方式:{{
sheet.supplier.managerContract ? sheet.supplier.managerContract : ''
}}
</view>
</template>
<template v-else>
<template v-if="sheet.user && sheet.user.accountType === 2">
<view class="mt-15" v-if="sheet.supplier.companyName">公司信息:{{
sheet.supplier.companyName ? sheet.supplier.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6") : ''
}}
</view>
<view class="mt-15" v-if="sheet.supplier.contract">公司联系方式:{{
sheet.supplier.contract ? sheet.supplier.contract.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : ''
}}
</view>
</template>
<template v-else>
<view class="mt-15" v-if="sheet.supplier.personalName">个人信息:{{
sheet.supplier.personalName ? sheet.supplier.personalName.replace(/^(.).*(.)$/, "$1***$2") : ''
}}
</view>
<view class="mt-15" v-if="sheet.supplier.personalContract">
个人联系方式:{{
sheet.supplier.personalContract ? sheet.supplier.personalContract.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : ''
}}
</view>
</template>
<view class="mt-15" v-if="sheet.supplier.managerName">授权人姓名:{{
sheet.supplier.managerName ? sheet.supplier.managerName.replace(/^(.).*(.)$/, "$1***$2") : ''
}}
</view>
<view class="mt-15" v-if="sheet.supplier.managerContract">授权联系方式:{{
sheet.supplier.managerContract ? sheet.supplier.managerContract.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : ''
}}
</view>
</template>
</view>
</template>
<view v-if="sheet.signMethod === 0" style="line-height: 32rpx">
<view class="card-title m-top-30">合同条款</view>
<view class="detail m-top-20 text-25">
<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">采购方补充条款: {{ sheet.supplementary }}</view>
</view>
</view>
<!-- <view class="card-title m-top-30">已收到的合作申请</view>-->
<!-- <view class="table-box m-top-30">-->
<!-- <view class="thead">-->
<!-- <view class="tr">-->
<!-- <view class="th">企业</view>-->
<!-- <view class="th">申请人</view>-->
<!-- <view class="th">联系方式</view>-->
<!-- <view class="th">合作留言</view>-->
<!-- <view class="th">申请时间</view>-->
<!-- </view>-->
<!-- </view>-->
<!-- <view class="tbody" v-if="sheet">-->
<!-- <view class="tr" v-for="(item, index) in sheet.quoteList" :key="index">-->
<!-- <view class="td">-->
<!-- <text v-if="item.user">{{-->
<!-- item.user.accountType === 2 ? item.user.company.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6") : item.user.person.personName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6")-->
<!-- }}-->
<!-- </text>-->
<!-- </view>-->
<!-- <view class="td">{{ item.name }}</view>-->
<!-- <view class="td">{{ item.mobile }}</view>-->
<!-- <view class="td">{{ item.remark }}</view>-->
<!-- <view class="td">{{ item._add_time_str }}</view>-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
</view>
<!-- 底部 -->
<view class="fiexd-bottom flex justify-between align-center bg-white" v-if="sheet && sheet.type < 3">
<u-icon name="integral" color="#A92924" size="26"></u-icon>
<view class="text red flex-1 m-left-20">{{ sheet.quoteList.length }}家已报价</view>
<view class="apply-btn" @click="toCooperate" v-if="userInfo._id !== sheet.uid && sheet.status === 0 ">
{{ sheet.type === 3 ? '我要询价' : '我要报价' }}
</view>
<view class="apply-btn" @click="isPopup = true" v-else-if="userInfo._id === sheet.uid">收到的报价申请
</view>
</view>
<!-- 弹出窗 -->
<u-popup :show="isPopup" mode="center" @close="isPopup = false" @open="open" :custom-style="{width: '100%'}">
<view class="popup-box" v-if="isPopup">
<view class="popup-title flex justify-between align-center">
<view class="title">收到的合作申请列表</view>
<view class="close" @click="isPopup = false">关闭</view>
</view>
<view class="py-20 border-bottom text-25" v-for="(item, index) in sheet.quoteList" :key="index">
<view class="flex justify-start items-center mb-20">
<text class="mr-10">报价方:</text>
<text>{{ item.subjectName }}</text>
</view>
<view class="flex justify-start items-center mb-20">
<text class="mr-10">报价时间:</text>
<text>{{ item._add_time_str }}</text>
</view>
<view class="flex justify-start items-center mb-20">
<text class="mr-10">联系方式:</text>
<text>{{ item.user.mobile }}</text>
</view>
<view class="flex justify-start items-center mb-20">
<text class="mr-10">报价:</text>
<text>{{ item.totalPrice }}元</text>
</view>
<view class="flex justify-start items-center mb-20">
<text class="mr-10">详情:</text>
<text>{{ item.remark }}</text>
</view>
<view class="flex justify-start items-center mb-20">
<text class="mr-10">附件:</text>
<template v-if="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>
</view>
<u-button v-if="sheet.status === 0 && sheet.type !== 3"
size="mini" type="error" text="选择" style="width: 60rpx;"
@click="confirmQuote(item._id)"
></u-button>
</view>
</view>
</u-popup>
</view>
</template>
<script>
import uiheader from '@/components/index/header'
import dayjs from 'dayjs';
import {INVOICE_TYPE, WRITE_INVOICE_TIME} from "../../util";
import FileType from "@/components/file-type/file-type.vue";
export default {
components: {
FileType,
uiheader,
},
data() {
return {
isPopup: false,
sheet: null,
allChildCate: [],
userInfo: null
};
},
methods: {
INVOICE_TYPE() {
return INVOICE_TYPE
},
WRITE_INVOICE_TIME() {
return WRITE_INVOICE_TIME
},
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)
}
});
},
applyLink() {
uni.$u.route('/pages/goods/apply', {
id: 0,
});
},
getDetail() {
vk.callFunction({
url: 'client/old/pub/getDetail',
title: '请求中...',
data: {
id: this.id
},
success: (res) => {
this.sheet = res
this.sheet.address = ''
this.sheet.deliverAddress = ''
this.sheet.offerAddress = ''
if (this.sheet.addressRegion && this.sheet.addressRegion.length > 0)
this.sheet.address = this.sheet?.addressRegion[0]?.name + this.sheet?.addressRegion[1]?.name + this.sheet?.addressRegion[2]?.name + this.sheet.addressDetail
if (this.sheet.deliverAddress && this.sheet.deliverAddress.length > 0)
this.sheet.deliverAddress = this.sheet?.deliverAddressRegion[0]?.name + this.sheet?.deliverAddressRegion[1]?.name + this.sheet?.deliverAddressRegion[2]?.name + this.sheet.addressDetail
if (this.sheet.offerAddress && this.sheet.offerAddress.length > 0)
this.sheet.offerAddress = !this.sheet.offerAddressNoLimit ? (this.sheet?.offerAddressRegion[0]?.name + this.sheet?.offerAddressRegion[1]?.name + this.sheet?.offerAddressRegion[2]?.name) : '无限制'
this.sheet.expiredTime = dayjs(this.sheet.expiredTime).format('YYYY-MM-DD')
}
});
},
async toCooperate() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
uni.showModal({
title: '提示',
content: '您尚未认证, 是否前往认证?',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 0)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
uni.showModal({
title: '提示',
content: '请完善名片信息',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 1)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (accountNum === 0) {
uni.showModal({
title: '提示',
content: '请先到个人中心添加收款账户',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 7)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else {
vk.navigateTo({url: `/pages/junk/apply?id=${this.sheet._id}&userId=${this.sheet.userId}`});
}
},
async confirmQuote(quoteId) {
await vk.callFunction({
url: 'client/old/kh/confirmQuote',
title: '请求中...',
data: {
quoteId,
}
});
this.showDialog = false
this.$message({
message: "选择成功",
type: 'success'
})
if (this.sheet.signMethod === 0) vk.navigateTo('/pages/public/contract?tab=1')
else {
if (this.sheet.signMethod === 1) vk.navigateTo('/pages/user/seller?menuIndex=2')
else vk.navigateTo('/pages/public/contract')
}
},
openDownload(url) {
window.location.href = url
// window.open(url)
}
},
onLoad({id}) {
this.id = id
this.userInfo = vk.getStorageSync('uni_id_user_info')
this.getDetail()
}
}
</script>
<style lang="scss">
page {
padding-bottom: 150rpx;
background: #ffffff;
}
.card-title {
position: relative;
padding-left: 20rpx;
font-size: 28rpx;
font-weight: 600;
line-height: 48rpx;
color: #A92924;
&:before {
position: absolute;
left: 0;
top: 50%;
z-index: 9;
margin-top: -14rpx;
content: '';
width: 6rpx;
height: 28rpx;
background: #A92924;
}
.more {
font-size: 24rpx;
font-weight: normal;
color: #999999;
}
}
.layout-detail {
padding: 20rpx 30rpx;
}
.company {
padding-bottom: 40rpx;
border-bottom: 1px solid #f2f2f2;
.logo {
width: 120rpx;
height: 120rpx;
}
.name-text {
max-width: 380rpx;
font-size: 30rpx;
font-weight: 600;
line-height: 40rpx;
color: #333333;
}
.name-icon {
width: 80rpx;
height: 32rpx;
}
.zhu {
margin-top: 10rpx;
font-size: 24rpx;
line-height: 32rpx;
color: #999999;
}
}
.detail-title {
font-size: 26rpx;
font-weight: 600;
line-height: 40rpx;
color: #101010;
}
.detail-text {
margin-top: 10rpx;
font-size: 24rpx;
line-height: 40rpx;
color: #999999;
}
.fiexd-bottom {
position: fixed;
left: 0;
bottom: 0;
z-index: 99;
width: 100%;
height: 130rpx;
padding: 0 30rpx;
box-sizing: border-box;
border-top: 1px solid #f2f2f2;
.text {
font-size: 26rpx;
line-height: 40rpx;
}
.apply-btn {
width: 220rpx;
height: 70rpx;
font-size: 26rpx;
line-height: 70rpx;
text-align: center;
color: #ffffff;
background: #A92924;
}
}
.table-box {
font-size: 24rpx;
line-height: 28rpx;
text-align: center;
}
.tr {
display: flex;
justify-content: space-between;
align-items: center;
}
.th {
color: #666 !important;
background: #FFF8F2;
}
.th, .td {
display: flex;
justify-content: center;
align-items: center;
width: 50%;
height: 76rpx;
color: #999;
overflow: hidden;
box-sizing: border-box;
border-left: 1px solid #f2f2f2;
border-right: 1px solid #f2f2f2;
border-bottom: 1px solid #f2f2f2;
}
.td {
border-right: 1px solid #f2f2f2;
border-bottom: 1px solid #f2f2f2;
background: #ffffff;
}
.td-3 {
width: 33.33%;
}
.popup-box {
padding: 20rpx 20rpx;
}
.popup-title {
padding: 18rpx 0;
border-bottom: 1px solid #A92924;
.title {
font-size: 24rpx;
line-height: 40rpx;
color: #A92924;
}
.close {
width: 80rpx;
height: 40rpx;
font-size: 22rpx;
line-height: 40rpx;
text-align: center;
color: #ffffff;
background: #A92924;
}
}
.item-wrap {
margin-top: 10rpx;
font-size: 24rpx;
line-height: 40rpx;
color: #999999;
}
</style>
+523
View File
@@ -0,0 +1,523 @@
<template> <!-- 旧货交易 -->
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uiheader title="旧货交易"></uiheader>
<!-- 搜索栏 -->
<cmsearch :k="keyword" @search="afterSearch"></cmsearch>
</u-sticky>
<!-- 轮播图-传值:list="数组" -->
<cmswiper page="old" height="320rpx"></cmswiper>
<!-- 四个入口 -->
<view class="bg-white p-20 flex justify-center items-center">
<view class="flex-1 mx-20">
<u-button type="primary" shape="circle" size="mini" @click="toRelease">发布旧货</u-button>
</view>
<view class="flex-1 mx-20">
<u-button type="primary" shape="circle" size="mini" plain @click="toMyEnquiry">我发布的</u-button>
</view>
<view class="flex-1 mx-20">
<u-button type="primary" shape="circle" size="mini" plain @click="toMyQuote">我的报价</u-button>
</view>
</view>
<cmfourth></cmfourth>
<!-- 加急公告 -->
<view class="layout layout-notice bg-white flex justify-start align-center">
<view class="notice-left">
<view>加急</view>
<view>公告</view>
</view>
<view class="notice-right m-left-30">
<swiper class="swiper-box" vertical="true" :autoplay="true" :interval="3000" :duration="1000"
next-margin="48rpx">
<swiper-item class="swiper-item" v-for="(item, index) in urgentList" :key="index"
@click="$jump(`/pages/junk/detail?id=${item._id}`)">
<view class="swiper-item">
<view class="city" v-if="item.addressRegion && item.addressRegion.city">[{{
item.addressRegion.city.name
}}]
</view>
<template v-else>
<view class="city" v-if="item.deliverAddressRegion && item.deliverAddressRegion.city">[{{
item.deliverAddressRegion.city.name
}}]
</view>
</template>
<view class="text text-single">{{ item.title }}</view>
<view class="date">{{ dayjs(item._add_time_str).format('MM-DD') }}</view>
</view>
</swiper-item>
</swiper>
</view>
</view>
<!-- 最新拍卖消息 -->
<view class="layout layout-list">
<view class="list-h2">
<view class="big">最新拍卖消息</view>
<view class="more" @click="listLink(0)">更多></view>
</view>
<view class="list-box m-top-10">
<view class="li text-single" v-for="(item, index) in dataList[0]" :key="index"
v-if="item.addressRegion && item.addressRegion.city "
@click="$jump(`/pages/junk/detail?id=${item._id}`)">
<text>【{{ item.addressRegion.city.name }}】</text>
<text class="text-main" v-if="item.isUrgent">[加急]</text>
{{ item.title }}
</view>
</view>
</view>
<!-- 最新采购消息 -->
<view class="layout layout-list">
<view class="list-h2">
<view class="big">最新采购消息</view>
<view class="more" @click="listLink(1)">更多></view>
</view>
<view class="list-box m-top-10">
<view class="li text-single" v-for="(item, index) in dataList[1]" :key="index"
v-if="item.deliverAddressRegion && item.deliverAddressRegion.city "
@click="$jump(`/pages/junk/detail?id=${item._id}`)">
<text>【{{ item.deliverAddressRegion.city.name }}】</text>
<text class="text-main" v-if="item.isUrgent">[加急]</text>
{{ item.title }}
</view>
</view>
</view>
<!-- 列表-最新租赁消息 -->
<view class="layout layout-list">
<view class="list-h2">
<view class="big red">最新租赁消息</view>
<view class="more" @click="listLink(2)">更多></view>
</view>
<view class="list-box m-top-10">
<view class="li text-single" v-for="(item, index) in dataList[2]" :key="index"
@click="$jump(`/pages/junk/detail?id=${item._id}`)">
<text v-if="item.addressRegion && item.addressRegion.city">【{{ item.addressRegion.city.name }}】</text>
<template v-else>
<text v-if="item.deliverAddressRegion && item.deliverAddressRegion.city">【{{ item.deliverAddressRegion.city.name }}】</text>
</template>
<text class="text-main" v-if="item.isUrgent">[加急]</text>
{{ item.title }}
</view>
</view>
</view>
<!-- 列表-最新物资回收消息 -->
<view class="layout layout-list">
<view class="list-h2">
<view class="big red">最新物资回收消息</view>
<view class="more" @click="listLink(3)">更多></view>
</view>
<view class="list-box m-top-10">
<view class="li text-single" v-for="(item, index) in dataList[3]" :key="index"
v-if="item.addressRegion && item.addressRegion.city "
@click="$jump(`/pages/junk/detail?id=${item._id}`)">
<text>【{{ item.addressRegion.city.name }}】</text>
<text class="text-main" v-if="item.isUrgent">[加急]</text>
{{ item.title }}
</view>
</view>
</view>
<!-- 品牌推荐 -->
<view class="layout layout-brand bg-white">
<view class="brand-img flex justify-center p-top-20">
<image class="img" src="/static/img/brand.png" mode=""></image>
</view>
<view class="brand-box flex justify-between flex-wrap">
<view class="item" v-for="(item, index) in companyList" :key="index"
@click="$jump(`/pages/yellow/detail?id=${item.uid}`)">
<view class="flex flex-col justify-start items-start ml-10" style="width: 290rpx">
<view class="text text-24 flex-1 u-line-1">{{ item.company.companyName }}</view>
<view class="main m-top-10 u-line-1">
主营:{{
(item.mainSpotCategory && item.mainSpotCategory.length > 0) ? item.mainSpotCategory.join() : (item.company.mainSpotCategorySelf || '')
}}
</view>
</view>
</view>
</view>
</view>
<!-- <view v-if="showMore" class="more-btns">-->
<!-- <view class="item" @click="toMyQuote">-->
<!-- <u-icon name="order" color="#A92924" size="24"></u-icon>-->
<!-- </view>-->
<!-- <view class="item" @click="toMyEnquiry">-->
<!-- <u-icon name="account" color="#A92924" size="24"></u-icon>-->
<!-- </view>-->
<!-- <view class="item" @click="toRelease">-->
<!-- <u-icon name="plus" color="#A92924" size="24"></u-icon>-->
<!-- </view>-->
<!-- </view>-->
<!-- <view class="issue" @click="showMore = !showMore">-->
<!-- <u-icon :name="showMore ? 'close' : 'plus'" color="#fff" size="24"></u-icon>-->
<!-- </view>-->
<collapse></collapse>
</view>
</template>
<script>
import uiheader from '@/components/index/header'
import cmsearch from '@/components/common/search'
import cmempty from '@/components/common/empty'
import cmfourth from '@/components/common/fourth'
import cmswiper from '@/components/common/swiper'
import dayjs from 'dayjs'
import Collapse from "@/components/index/collapse.vue";
import {FactoryBuilding} from "@icon-park/vue";
export default {
components: {
FactoryBuilding,
Collapse,
uiheader,
cmsearch,
cmempty,
cmfourth,
cmswiper,
},
data() {
return {
companyList: [],
dataList: [],
urgentList: [],
allChildCate: [],
keyword: '',
showMore: false
};
},
methods: {
dayjs,
toMyEnquiry() {
vk.navigateTo({
url: '/pages/junk/my'
})
},
toMyQuote() {
vk.navigateTo({
url: '/pages/junk/myQuote'
})
},
listLink(type) {
vk.navigateTo(`/pages/junk/list?type=${type}`);
},
async toRelease() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
uni.showModal({
title: '提示',
content: '您尚未认证, 是否前往认证?',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 0)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
uni.showModal({
title: '提示',
content: '请完善名片信息',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 1)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (accountNum === 0) {
uni.showModal({
title: '提示',
content: '请先到个人中心添加收款账户',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 7)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else {
vk.navigateTo({
url: '/pages/junk/publish'
})
}
},
async getInfo(id) {
this.info = await vk.callFunction({
url: 'client/goods/list/pub/getDetail',
data: {
id
}
})
},
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()
}
});
},
async getCompanyList() {
const {rows} = await vk.callFunction({
url: 'client/user/pub/getCompany',
data: {isCoop: 1}
})
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
})
},
afterSearch(keyword) {
this.keyword = keyword
this.getDataList()
},
async getDataList() {
for (let i = 0; i < 4; i++) {
const {rows} = await vk.callFunction({
url: 'client/old/pub/getList',
data: {
type: i,
keyword: this.keyword
}
})
this.dataList[i] = rows.map(item => {
item.addDate = dayjs(item._add_time).format('MM-DD')
return item
})
this.$forceUpdate()
}
},
async getUrgentList() {
const {rows} = await vk.callFunction({
url: 'client/old/pub/getList',
data: {
isUrgent: true
}
})
this.urgentList = rows.map(item => {
item.addDate = dayjs(item._add_time).format('MM-DD')
return item
})
console.log(this.urgentList)
}
},
onLoad(option) {
if (option.keyword) this.keyword = option.keyword
this.getCategoryTreeData()
this.getDataList()
this.getUrgentList()
}
}
</script>
<style lang="scss">
page {
background: #F8F8F8;
}
.layout-notice {
margin: 20rpx 30rpx;
padding: 20rpx 20rpx;
.notice-left {
width: 80rpx;
height: 100%;
font-size: 28rpx;
font-weight: 600;
line-height: 32rpx;
color: #A92924;
border-right: 1px solid #f2f2f2;
}
.notice-right {
width: 550rpx;
height: auto;
}
.swiper-box {
width: 100%;
height: 96rpx;
}
.swiper-item {
display: flex;
justify-content: flex-start;
align-items: center;
width: 100%;
height: 48rpx !important;
overflow: hidden;
font-size: 24rpx;
line-height: 48rpx;
color: #999999;
.text {
margin: 0 10rpx;
max-width: 300rpx;
color: #333333;
}
}
}
.layout-banner {
padding: 0rpx 30rpx;
.banner {
margin-top: 20rpx;
width: 100%;
height: 126rpx;
}
}
.layout-brand {
margin: 30rpx 30rpx 10rpx;
.brand-img {
.img {
width: 174rpx;
height: 58rpx;
}
}
}
.brand-box {
padding: 10rpx;
.item {
position: relative;
width: 50%;
height: 136rpx;
//padding: 10rpx;
box-sizing: border-box;
border-bottom: 1px solid #f2f2f2;
display: flex;
align-items: center;
justify-content: center;
.main {
height: 36rpx;
font-size: 24rpx;
line-height: 36rpx;
color: #666666;
}
.company {
width: 64rpx;
//height: 64rpx;
.icon {
width: 64rpx;
height: 64rpx;
}
.text {
font-size: 25rpx;
font-weight: 600;
line-height: 48rpx;
color: #101010;
}
}
}
.item:nth-child(2n+1) {
border-right: 1px solid #f2f2f2;
}
.item:nth-last-child(-n+2) {
border-bottom: none;
}
}
.layout-list {
margin: 20rpx 30rpx 10rpx;
border-radius: 12rpx;
.list-h2 {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10rpx 0rpx;
.big {
font-size: 28rpx;
line-height: 48rpx;
color: #000000;
}
.more {
font-size: 26rpx;
line-height: 40rpx;
color: #A92924;
}
.red {
color: #A92924 !important;
}
}
.list-box {
padding: 20rpx 20rpx;
background: #FFFDFD;
border-radius: 20rpx;
.li {
position: relative;
width: 100%;
height: 48rpx;
font-size: 24rpx;
line-height: 48rpx;
color: #6c6c6c;
text-indent: 1em;
&:before {
position: absolute;
left: 0;
top: 50%;
z-index: 9;
content: '';
margin-top: -2px;
width: 4px;
height: 4px;
background: #A92924;
border-radius: 50%;
}
}
}
}
.more-btns {
position: fixed;
right: 30rpx;
bottom: 220rpx;
z-index: 99;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 90rpx;
border-radius: 999rpx;
background: white;
border: 1px solid #A92924;
.item {
margin: 20rpx 0;
}
}
</style>
+506
View File
@@ -0,0 +1,506 @@
<template> <!-- 旧货详情 -->
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uiheader></uiheader>
<!-- 搜索栏 -->
<cmsearch></cmsearch>
</u-sticky>
<!-- 四个入口 -->
<view class="bg-white">
<cmfourth :type="type"/>
</view>
<!-- 选择器 -->
<view class="layout-pick flex justify-between align-center bg-white">
<view class="flex justify-start">
<view class="ip down" @click="isPick = true">分类:{{ pickValue }}</view>
<view class="ip down ml-35" @click="showRentType = true" v-if="type === 2">{{ rentTypeStr }}</view>
</view>
<view class="ip down" @click="showAddress">省份:{{ locationValue }}</view>
</view>
<view class="layout layout-detail">
<template v-if="type === 0">
<uiswiper :ad="15" padding="10rpx 0"></uiswiper>
<uiswiper :ad="16" padding="10rpx 0"></uiswiper>
</template>
<template v-if="type === 1">
<uiswiper :ad="17" padding="10rpx 0"></uiswiper>
<uiswiper :ad="18" padding="10rpx 0"></uiswiper>
</template>
<template v-if="type === 2">
<uiswiper :ad="19" padding="10rpx 0"></uiswiper>
<uiswiper :ad="20" padding="10rpx 0"></uiswiper>
</template>
<template v-if="type === 3">
<uiswiper :ad="21" padding="10rpx 0"></uiswiper>
<uiswiper :ad="22" padding="10rpx 0"></uiswiper>
</template>
<view class="item flex flex-col " v-for="(item, index) in goodsData.rows" :key="index">
<!-- <view class="img">-->
<!-- <image class="full" src="/static/img/abc-1.png" mode=""></image>-->
<!-- </view>-->
<view class="info flex-1 p-left-30" @click="$jump(`/pages/junk/detail?id=${item._id}`)">
<view class="title text-single">
<text>{{ item.title }}</text>
<text class="text-main" v-if="item.isUrgent">[加急]</text>
</view>
<view class="flex justify-start items-start flex-col">
<view class="p half">
<text class="lb">企业</text>
<text v-if="![0, 2, 3].includes(item.type) ">
{{ item.buyer.companyName ? item.buyer.companyName : '无' }}
</text>
<text v-else>{{ item.supplier.companyName ? item.supplier.companyName : '无' }}</text>
</view>
<view class="p half">
<text class="lb">所属分类</text>
{{ item.category[1] }}
</view>
<view class="p">
<text class="lb">所在区域</text>
{{ item.addressStr }}
</view>
<view class="flex justify-between items-center">
<view class="p half">
<text class="lb">发布时间</text>
{{ item._add_time_str }}
</view>
<view class="p half">
<text class="lb">有效期至</text>
{{ item.expiredTime }}
</view>
</view>
</view>
</view>
<view class="buttons">
<button class="btn" plain @click="doShowContract(index)">查看电话
</button>
<button class="btn green" plain @click="doShowWechat(index)">添加微信
</button>
<button class="btn" plain @click="$jump(`/pages/junk/detail?id=${item._id}`)"
v-if="item.type !== 2">
{{ item.uid === userInfo._id ? '查看报价' : '我要报价' }}
</button>
<button class="btn" plain @click="$jump(`/pages/junk/detail?id=${item._id}`)"
v-else-if="item.type === 2 && item.rentType === 0">
{{ item.uid === userInfo._id ? '查看报价' : '我要报价' }}
</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" v-if="item.buyer && item.buyer.managerContract">{{ item.buyer.managerContract }}</text>
<text class="ml-20" v-else-if="item.supplier && item.supplier.managerContract">
{{ item.supplier.managerContract }}
</text>
</view>
</view>
</view>
</view>
<u-empty mode="list" text="暂无更多内容~" v-if="goodsData.rows.length === 0"></u-empty>
<!-- 悬浮按钮 -->
<view class="issue" @click="toRelease">
<u-icon name="plus" color="#fff" size="24"></u-icon>
</view>
<AddressSelect ref="AddressSelect" @confirm="regionConfirm"/>
<u-picker v-if="isPick" :show="isPick" :columns="[categoryTreeData, categoryTreeData[cateIndex[0]].children]"
key-name="name" @confirm="handConfirmPick" @change="handleChangeCate" @cancel="isPick = false">
<template #more>
<text @click="resetCate">重置</text>
<text @click="otherCate" class="ml-20">其他</text>
</template>
</u-picker>
<u-picker v-if="showRentType" :show="showRentType"
:columns="[[{name: '承租信息', value: 0}, {name: '出租信息', value: 1}], ]"
key-name="name" @confirm="handConfirmRentType" @cancel="showRentType = false">
</u-picker>
<collapse></collapse>
</view>
</template>
<script>
import uiheader from '@/components/index/header'
import cmsearch from '@/components/common/search'
import cmempty from '@/components/common/empty'
import cmfourth from '@/components/common/fourth'
import dayjs from 'dayjs'
import Collapse from "@/components/index/collapse.vue";
import AddressSelect from "@/components/AddressSelect.vue";
import uiswiper from "@/components/index/swiper.vue";
export default {
components: {
uiswiper,
AddressSelect, Collapse,
uiheader,
cmsearch,
cmempty,
cmfourth,
},
data() {
return {
type: 1,
pageSize: 500,
keyword: '',
checkProvinceList: [],
checkCategoryList: [],
goodsData: {
total: 0,
rows: []
},
oldType: [
'拍卖信息',
'采购信息',
'承租信息',
'物资回收信息',
],
categoryTreeData: [],
allChildCate: [],
locationValue: '全国',
pickValue: '全部',
isPick: false,
cateId: null,
cateIndex: [0, 0],
region: {
province: {
code: null,
name: null,
}
},
userInfo: null,
rentType: 0,
rentTypeStr: '承租信息',
showRentType: false
};
},
methods: {
handleChangeCate({indexs}) {
this.cateIndex = indexs
},
handConfirmPick({value}) {
this.pickValue = value[1].name
this.cateId = value[1]._id
this.isPick = false
this.search(1)
},
handConfirmRentType({value}) {
this.rentType = value[0].value
this.rentTypeStr = value[0].name
this.showRentType = false
this.search(1)
},
resetCate() {
this.cateIndex = [0, 0]
this.pickValue = '全部'
this.cateId = null
this.isPick = false
this.search(1)
},
otherCate() {
this.cateIndex = [0]
this.pickValue = '其他'
this.cateId = 0
this.isPick = false
this.search(1)
},
showAddress() {
this.$refs.AddressSelect.open(this.region, 1, true);
},
regionConfirm({province}) {
this.region = {province}
this.locationValue = `${province.name}`
this.search(1)
},
async toRelease() {
const {
userInfo, accountNum
} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
uni.showModal({
title: '提示',
content: '您尚未认证, 是否前往认证?',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 0)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
uni.showModal({
title: '提示',
content: '请完善名片信息',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 1)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (accountNum === 0) {
uni.showModal({
title: '提示',
content: '请先到个人中心添加收款账户',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 7)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else {
if (userInfo.businessCard.status !== 1) {
uni.showModal({
title: '提示',
content: '您的名片信息未审核,请耐心等待',
})
return
}
vk.navigateTo({
url: '/pages/junk/publish'
})
}
},
async toMy() {
const {
userInfo
} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
uni.showModal({
title: '提示',
content: '您尚未认证, 是否前往认证?',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 0)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
uni.showModal({
title: '提示',
content: '请完善名片信息',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 1)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else {
vk.navigateTo({
url: '/pages/junk/my'
})
}
},
search(pageIndex) {
// const categoryIds = []
// this.allChildCate.map(item => {
// if (this.checkCategoryList.indexOf(item._id) > -1) categoryIds.push(item.name)
// })
vk.callFunction({
url: 'client/old/pub/getList',
title: '加载中...',
data: {
pageIndex,
pageSize: this.pageSize,
keyword: this.keyword,
type: this.type,
categoryIds: this.cateId !== null ? [this.cateId] : null,
provinceCodes: this.region.province.code ? [this.region.province.code] : null,
rentType: this.rentType
},
success: (data) => {
data.rows.map(item => {
if (item.type === 1) item.addressStr = (item.deliverAddressRegion && item.deliverAddressRegion.city) ? (item.deliverAddressRegion.province.name + "-" + item.deliverAddressRegion.city.name) : ''
else {
if (item.type === 2) {
if (item.addressRegion && item.addressRegion.city) {
item.addressStr = (item.addressRegion && item.addressRegion.city) ? (item.addressRegion.province.name + "-" + item.addressRegion.city.name) : ''
} else {
if (item.deliverAddressRegion && item.deliverAddressRegion.city) {
item.addressStr = (item.deliverAddressRegion && item.deliverAddressRegion.city) ? (item.deliverAddressRegion.province.name + "-" + item.deliverAddressRegion.city.name) : ''
}
}
}else {
item.addressStr = (item.addressRegion && item.addressRegion.city) ? (item.addressRegion.province.name + "-" + item.addressRegion.city.name) : (item.deliverAddressRegion.province.name + "-" + item.deliverAddressRegion.city.name)
}
}
item.expiredTime = item.expiredTime ? dayjs(item.expiredTime).format('YYYY-MM-DD') : ''
item.showWechat = false
item.showContract = false
return item
})
this.goodsData = data
}
});
},
doShowWechat(index) {
if (parseInt(this.goodsData.rows[index].user.accountType) === 2 && !this.goodsData.rows[index].user.businessCard.companyWechat)
return vk.toast('用户暂未上传')
else if (parseInt(this.goodsData.rows[index].user.accountType) === 1 && !this.goodsData.rows[index].user.businessCard.personalWechat)
return vk.toast('用户暂未上传')
this.goodsData.rows[index].showContract = false
this.goodsData.rows[index].showWechat = !this.goodsData.rows[index].showWechat
},
doShowContract(index) {
this.goodsData.rows[index].showWechat = false
this.goodsData.rows[index].showContract = !this.goodsData.rows[index].showContract
}
},
onLoad(option) {
this.userInfo = vk.getStorageSync('uni_id_user_info')
if (option.type) {
this.type = parseInt(option.type)
this.search(1)
vk.callFunction({
url: 'client/old/pub/getTree',
title: '请求中...',
data: {type: parseInt(this.type)},
success: (data) => {
this.categoryTreeData = data.rows
this.allChildCate = []
this.categoryTreeData.forEach(item => {
item.children.forEach(child => {
this.allChildCate.push(child)
})
})
}
});
} else uni.navigateBack()
},
}
</script>
<style lang="scss">
.layout-pick {
width: 690rpx;
height: 68rpx;
padding: 0 30rpx;
font-size: 24rpx;
line-height: 40rpx;
color: #4F4F4F;
.ip {
position: relative;
//max-width: 33.333%;
height: 40rpx;
padding-right: 30rpx;
overflow: hidden;
box-sizing: border-box;
}
.down::after {
position: absolute;
right: 10rpx;
top: 50%;
z-index: 9;
content: '';
margin-top: -6rpx;
width: 0;
height: 0;
border-left: 10rpx solid transparent;
border-right: 10rpx solid transparent;
border-top: 12rpx solid #999999;
}
}
.layout-detail {
padding: 30rpx 30rpx;
.item {
margin-top: 30rpx;
padding: 30rpx 30rpx;
background: #ffffff;
&:nth-child(1) {
margin-top: 0;
}
.img {
width: 160rpx;
height: 130rpx;
}
.title {
font-size: 28rpx;
font-weight: 600;
line-height: 40rpx;
color: #4b4b4b;
}
.p {
padding: 5rpx 0;
height: 40rpx;
overflow: hidden;
font-size: 24rpx;
line-height: 40rpx;
color: #4b4b4b;
}
.lb {
padding-right: 6rpx;
color: #999999;
}
}
}
.buttons {
margin-top: 20rpx;
padding: 0 20rpx;
display: flex;
justify-content: flex-end;
align-items: center;
position: relative;
.btn {
height: 60rpx;
font-size: 25rpx;
width: 220rpx;
margin: 0 10rpx;
}
.green {
background-color: #7ec050 !important;
color: #ffffff;
}
.wechat {
position: absolute;
left: 240rpx;
top: -200rpx;
width: 150rpx;
height: 150rpx;
background-color: white;
border-radius: 10rpx;
padding: 5rpx;
box-shadow: 0 1px 10px 0 #eee
}
.mobile {
position: absolute;
left: -12rpx;
top: -60rpx;
background-color: white;
border-radius: 10rpx;
padding: 5rpx;
box-shadow: 0 1px 10rpx 0 #aaa;
display: flex;
align-items: center;
justify-content: center;
}
}
</style>
+208
View File
@@ -0,0 +1,208 @@
<template>
<view class="wrap">
<u-sticky offset-top="0" customNavHeight="0">
<uititle title="我发布的旧货"></uititle>
</u-sticky>
<view class="issue" @click="toRelease">
<u-icon name="plus" color="#fff" size="24"></u-icon>
</view>
<view class="layout-goods">
<view class="goods-box p-top-10" v-if="list.length">
<view class="item bg-white" v-for="(item, index) in list"
:key="index">
<view @click="detailLink(item._id)" class="askfor">查看详情</view>
<view @click="detailLink(item._id)" class="title text-single">{{ item.title }}</view>
<view class="text m-top-10">{{ typeList[item.type].label }}</view>
<view @click="detailLink(item._id)" class="text m-top-10">
<text class="red" v-if="item.addressRegion && item.addressRegion.province">
所在地:{{ item.addressRegion.province.name }} {{ item.addressRegion.city.name }} {{
item.addressRegion.area.name
}}
</text>
<text class="red">{{ item.quoteNum }}家已报价</text>
</view>
<text @click="detailLink(item._id)" class="text-25 text-gray" v-if="item.remark">备注:{{ item.remark }}</text>
<view @click="detailLink(item._id)" class="date">{{ item._add_time_str }} 发布</view>
<view>
<u-button type="primary" plain size="mini" @click="del(item._id)">删除</u-button>
</view>
</view>
</view>
<u-empty v-else text="您未发布旧货"></u-empty>
</view>
</view>
</template>
<script>
import uititle from '@/components/common/title'
export default {
name: "my",
components: {uititle},
data() {
return {
list: [],
userInfo: null,
typeList: [
{value: 0, label: '拍卖'},
{value: 1, label: '采购'},
{value: 2, label: '租赁'},
{value: 3, label: '物资回收'},
]
}
},
methods: {
detailLink(id) {
vk.navigateTo(`/pages/junk/detail?id=${id}`);
},
async getList() {
const {rows} = await vk.callFunction({
url: 'client/old/kh/getList'
})
this.list = rows
},
async toRelease() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
uni.showModal({
title: '提示',
content: '您尚未认证, 是否前往认证?',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 0)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
uni.showModal({
title: '提示',
content: '请完善名片信息',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 1)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (accountNum === 0) {
uni.showModal({
title: '提示',
content: '请先到个人中心添加收款账户',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 7)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else {
vk.navigateTo({
url: '/pages/junk/publish'
})
}
},
del(_id) {
uni.showModal({
title: '提示',
content: '如果你要删除此条信息,之前其他客户填写的留言将无法查看',
success: res => {
if (res.confirm) {
vk.callFunction({
url: 'client/old/kh/delete',
title: '请求中...',
data: {
_id
},
}).then(res => {
this.getList()
})
}
}
})
}
},
onShow() {
this.userInfo = vk.getStorageSync('uni_id_user_info')
this.getList()
}
}
</script>
<style lang="scss" scoped>
.layout-goods {
// width: 690rpx;
padding: 10rpx 30rpx;
.item {
position: relative;
margin-top: 30rpx;
padding: 10rpx 20rpx 20rpx;
border-radius: 12rpx;
.title {
width: 90%;
font-size: 30rpx;
font-weight: 600;
line-height: 48rpx;
color: #101010;
}
.link, .askfor {
position: absolute;
right: 20rpx;
top: 16rpx;
z-index: 9;
font-size: 24rpx;
line-height: 36rpx;
color: #A92924;
padding: 4rpx 8rpx;
}
.link {
border: 1px solid #A92924;
}
.text {
font-size: 24rpx;
line-height: 36rpx;
color: #999999;
}
.red {
margin-right: 20rpx;
color: #A92924;
}
.date {
font-size: 24rpx;
line-height: 36rpx;
color: #9a9a9a;
}
.company {
height: 40rpx;
.icon {
width: 40rpx;
height: 40rpx;
}
.text {
//width: 300rpx;
height: 40rpx;
font-size: 26rpx;
line-height: 40rpx;
color: #4f4f4f;
}
}
}
.item:nth-child(1) {
margin-top: 0 !important;
}
}
</style>
+182
View File
@@ -0,0 +1,182 @@
<template>
<view class="wrap">
<u-sticky offset-top="0" customNavHeight="0">
<uititle title="我的报价"></uititle>
</u-sticky>
<view class="issue" @click="toRelease">
<u-icon name="plus" color="#fff" size="24"></u-icon>
</view>
<view class="layout-goods">
<view class="goods-box p-top-10" v-if="list.length">
<view class="item bg-white" @click="detailLink(item.sheetId)" v-for="(item, index) in list"
:key="index">
<view class="askfor">查看详情</view>
<view class="title text-single">{{ item.sheet.title }}</view>
<view class="text m-top-10">
<text class="red">{{ typeList[item.sheet.type].label }}</text>
<text class="red">金额:{{ parseInt(item.totalPrice) }}元</text>
</view>
<view class="my-10 text-25 red font-bold">{{ item.status === 0 ? '待选商' : '已被选商' }}</view>
<view class="my-10 text-25 text-gray" v-if="item.remark">备注:{{ item.remark }}</view>
<view class="date">{{ item._add_time_str }} 发布</view>
</view>
</view>
<u-empty v-else text="您未报价"></u-empty>
</view>
</view>
</template>
<script>
import uititle from '@/components/common/title'
export default {
name: "my",
components: {uititle},
data() {
return {
list: [],
userInfo: null,
typeList: [
{value: 0, label: '拍卖'},
{value: 1, label: '采购'},
{value: 2, label: '租赁'},
{value: 3, label: '物资回收'},
]
}
},
methods: {
detailLink(sheetId) {
vk.navigateTo(`/pages/junk/detail?id=${sheetId}`);
},
async getList() {
const {rows} = await vk.callFunction({
url: 'client/old/kh/getMyQuoteList'
})
this.list = rows
},
async toRelease() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
uni.showModal({
title: '提示',
content: '您尚未认证, 是否前往认证?',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 0)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
uni.showModal({
title: '提示',
content: '请完善名片信息',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 1)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (accountNum === 0) {
uni.showModal({
title: '提示',
content: '请先到个人中心添加收款账户',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 7)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else {
vk.navigateTo({
url: '/pages/old/publish'
})
}
},
},
onShow() {
this.userInfo = vk.getStorageSync('uni_id_user_info')
this.getList()
}
}
</script>
<style lang="scss" scoped>
.layout-goods {
// width: 690rpx;
padding: 10rpx 30rpx;
.item {
position: relative;
margin-top: 10rpx;
padding: 10rpx 20rpx 20rpx;
border-radius: 12rpx;
.title {
width: 90%;
font-size: 30rpx;
font-weight: 600;
line-height: 48rpx;
color: #101010;
}
.link, .askfor {
position: absolute;
right: 20rpx;
top: 16rpx;
z-index: 9;
font-size: 24rpx;
line-height: 36rpx;
color: #A92924;
padding: 4rpx 8rpx;
}
.link {
border: 1px solid #A92924;
}
.text {
font-size: 24rpx;
line-height: 36rpx;
color: #999999;
}
.red {
margin-right: 20rpx;
color: #A92924;
}
.date {
font-size: 24rpx;
line-height: 36rpx;
color: #9a9a9a;
}
.company {
height: 40rpx;
.icon {
width: 40rpx;
height: 40rpx;
}
.text {
//width: 300rpx;
height: 40rpx;
font-size: 26rpx;
line-height: 40rpx;
color: #4f4f4f;
}
}
}
.item:nth-child(1) {
margin-top: 0 !important;
}
}
</style>
+147
View File
@@ -0,0 +1,147 @@
<template>
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<uititle title="发布旧货信息"></uititle>
</u-sticky>
<u-tabs :list="tabList" @click="click"></u-tabs>
<view class="layout layout-publish m-top-10 bg-white p-30" v-if="user && pass">
<type_0 :urgentAmount="urgentAmount" :remainOldNum="remainOldNum" v-if="activeIndex === 0"
:buyOldNumAmount="buyOldNumAmount" :user="user" :unit-list="unitList"
:commonContractUrl="commonContractUrl" :contactList="contactList"/>
<type_1 :urgentAmount="urgentAmount" :remainOldNum="remainOldNum" v-if="activeIndex === 1"
:buyOldNumAmount="buyOldNumAmount" :user="user"
:commonContractUrl="commonContractUrl" :contactList="contactList"/>
<type_2 :urgentAmount="urgentAmount" :remainOldNum="remainOldNum" v-if="activeIndex === 2"
:buyOldNumAmount="buyOldNumAmount" :user="user"
:commonContractUrl="commonContractUrl" :contactList="contactList"/>
<type_3 :urgentAmount="urgentAmount" :remainOldNum="remainOldNum" :user="user" v-if="activeIndex === 3"
:buyOldNumAmount="buyOldNumAmount" :contactList="contactList"/>
</view>
</view>
</template>
<script>
import uititle from "@/components/common/title.vue";
import Type_0 from "./release/type_0.vue";
import Type_1 from "./release/type_1.vue";
import Type_2 from "./release/type_2.vue";
import Type_3 from "./release/type_3.vue";
import {getUserLevelLabel} from "@/util";
export default {
name: "publish",
components: {uititle, Type_3, Type_2, Type_1, Type_0},
data() {
return {
tabList: [{
name: '拍卖信息发布',
}, {
name: '采购信息发布',
}, {
name: '租赁信息发布'
}, {
name: '物资回收信息发布'
}],
activeIndex: 0,
urgentAmount: 1,
remainOldNum: 0,
buyOldNumAmount: 5,
agreement: '',
commonContractUrl: '',
contactList: [],
unitList: [],
user: null,
pass: false,
}
},
methods: {
click({index}) {
this.activeIndex = index
},
async getContactList() {
const {rows} = await vk.callFunction({
url: 'client/businessContact/kh/getList',
})
this.contactList = rows
if (!this.contactList.length) {
return uni.showModal({
title: '提示',
content: '您还未添加联系人,请先添加联系人',
showCancel: false,
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 8)
uni.switchTab({url: '/pages/user/user'})
}
}
})
}
this.pass = true
},
async getUrgentAmount() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '6587dd2fe0ec19027452c5b5'
},
})
this.urgentAmount = res.content
},
async getBuyOldAmount() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '6587dd54189f86d49b3d5ff5'
},
})
this.buyOldNumAmount = res.content
},
async getUserInfo() {
const {userInfo} = await vk.userCenter.getCurrentUserInfo()
this.remainOldNum = userInfo.remainOldNum ? parseInt(userInfo.remainOldNum) : 0
this.user = userInfo
console.log(this.user)
},
async getUnitList() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: 'a45325976635f10600341a7f2f472cd1'
},
})
this.unitList = res.content.split(',')
},
},
async 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/shop/pay?id=${data}`
})
}).catch(() => {
vk.navigateBack()
})
}
}
});
await this.getUserInfo()
await this.getContactList()
await this.getUrgentAmount()
await this.getBuyOldAmount()
// await this.getAgreement()
await this.getUnitList()
},
}
</script>
+950
View File
@@ -0,0 +1,950 @@
<template>
<view class="flex flex-col justify-start items-start">
<text class="text-50">发布我的拍卖信息</text>
<text class="text-gray">拍卖信息越完整,成功交易越容易</text>
<view class="layout w-100p m-top-10">
<view class="goods-item half flex align-center flex-wrap w-100p">
<text class="need text-red">*</text>
<view class="lb">物资分类:</view>
<view class="vl flex-1 p-right-20" @click="openPicker">
<u--input
style="pointer-events:none"
placeholder="请选择"
v-model="cateName"
fontSize="24rpx"
suffixIcon="arrow-down-fill"
suffixIconStyle="font-size: 10px;color: #d5d5d5"
:disabled="true"
disabledColor="#fff"
></u--input>
</view>
</view>
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
<el-checkbox label="其他分类" v-model="form.otherCate" class="mx-20"></el-checkbox>
<u--input
placeholder="请选择"
v-model="form.otherCateName"
fontSize="24rpx"
:disabled="!form.otherCate"
@change="setOther"
></u--input>
</view>
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
<text class="need text-red">*</text>
<view class="lb">信息标题:</view>
<view class="vl flex-1 p-right-20">
<u--input
placeholder="一句话简介物资,如拍卖直缝钢管200吨等"
v-model="form.title"
fontSize="24rpx"
></u--input>
</view>
</view>
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
<view class="lb">采购物资详情:</view>
<view class="vl flex-1 p-right-20">
<u--textarea
placeholder="请详细描述物资信息,描述内容:材料名称、材质......(限300字以内)"
v-model="form.desc"
fontSize="24rpx"
></u--textarea>
</view>
</view>
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
<view class="lb">拍卖实物:</view>
<view class="vl flex-1 p-right-20">
<u-upload
multiple
:fileList="files"
@afterRead="afterRead"
@delete="deletePic"
width="120rpx"
height="120rpx"
></u-upload>
</view>
</view>
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
<text class="need text-red">*</text>
<view class="lb">物资所在地:</view>
<view class="vl flex-1 p-right-20" @click="showAddress">
<u--input
style="pointer-events:none"
placeholder="请选择"
v-model="region"
fontSize="24rpx"
suffixIcon="arrow-down-fill"
suffixIconStyle="font-size: 10px;color: #d5d5d5"
:disabled="true"
disabledColor="#fff"
></u--input>
</view>
</view>
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
<view class="lb">物资详细地址:</view>
<view class="vl flex-1 p-right-20">
<u--input placeholder="请输入物资详细地址" v-model="form.addressDetail"></u--input>
</view>
</view>
<!-- <view class="goods-item half flex align-center flex-wrap mt-20 w-100p">-->
<!-- <view class="lb">起拍数:</view>-->
<!-- <view class="vl flex-1 p-right-20">-->
<!-- <u&#45;&#45;input placeholder="请选择" v-model="form.startNum"></u&#45;&#45;input>-->
<!-- </view>-->
<!-- </view>-->
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
<view class="lb">起拍计价单位:</view>
<view class="vl flex-1 p-right-20" @click="showUnit = true">
<u--input placeholder="请输入起拍计价单位" v-model="form.unit" style="pointer-events:none"
fontSize="24rpx"
suffixIcon="arrow-down-fill"
suffixIconStyle="font-size: 10px;color: #d5d5d5"
:disabled="true"
disabledColor="#fff"></u--input>
</view>
</view>
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
<view class="lb">起拍人民币单价:</view>
<view class="vl flex-1 p-right-20">
<u--input placeholder="请输入内容" v-model="form.startAmount"></u--input>
</view>
</view>
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
<text class="need text-red">*</text>
<view class="lb">拍卖信息失效时间:</view>
<view class="vl flex-1 p-right-20" @click="showExpire = true">
<u--input placeholder="请选择" v-model="form.expiredTime" style="pointer-events:none"
fontSize="24rpx"
suffixIcon="arrow-down-fill"
suffixIconStyle="font-size: 10px;color: #d5d5d5"
:disabled="true"
disabledColor="#fff"></u--input>
</view>
</view>
<view class="expire-tip">温馨提示:为保证信息有效性发布最长时限为1年(12个月)到期后需重新发布。</view>
<view class="card-title m-top-30">发票要求</view>
<view class="flex justify-start align-center m-top-30">
<u-radio-group v-model="form.invoice" placement="row">
<u-radio activeColor="red" :name='true' label="含税" :customStyle="{marginRight: '30px'}"></u-radio>
<u-radio activeColor="red" :name='false' label="不含税"></u-radio>
</u-radio-group>
</view>
<template v-if="form.invoice">
<view class="group flex m-top-30">
<view class="lb m-right-20">开票时间:</view>
<view class="vl flex-1">
<u-radio-group v-model="form.writeInvoiceTime" placement="column">
<u-radio activeColor="red" :name='0' label="付款当月(限20号之后付款次月开票)"
:customStyle="{marginBottom: '10px'}"></u-radio>
<u-radio activeColor="red" :name='1' label="付款后次月"
:customStyle="{marginBottom: '10px'}"></u-radio>
<u-radio activeColor="red" :name='2' label="付款前"></u-radio>
</u-radio-group>
</view>
</view>
<view class="group flex m-top-30">
<view class="lb m-right-20">纳税人身份:</view>
<view class="vl flex-1">
<u-radio-group v-model="form.taxType" placement="column">
<u-radio activeColor="red" name='一般纳税人' label="一般纳税人"
:customStyle="{marginBottom: '10px'}"></u-radio>
<u-radio activeColor="red" name='小规模公司' label="小规模公司"
:customStyle="{marginBottom: '10px'}"></u-radio>
<u-radio activeColor="red" name='个体工商户' label="个体工商户"></u-radio>
</u-radio-group>
</view>
</view>
<view class="group flex m-top-30">
<view class="lb m-right-20">发票种类:</view>
<view class="vl flex-1">
<u-radio-group v-model="form.invoiceType" placement="column">
<u-radio activeColor="red" name='专用发票' label="专用发票"
:customStyle="{marginBottom: '10px'}"></u-radio>
<u-radio activeColor="red" name='普通发票' label="普通发票"
:customStyle="{marginBottom: '10px'}"></u-radio>
</u-radio-group>
</view>
</view>
<view class="group flex m-top-30">
<view class="lb m-right-20">税率:</view>
<view class="vl flex-1">
<u-radio-group v-model="form.taxRate" placement="column">
<u-radio activeColor="red" v-for="(item, index) in ['13%', '9%', '6%', '4%', '3%', '1%']"
:key="index" :name='item' :label="item"
:customStyle="{marginBottom: '10px'}"/>
</u-radio-group>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb m-right-20">手动填写税票要求:</view>
<view class="vl flex-1">
<u--input
placeholder="如:一般纳税人 专用发票 税率13%"
border="surround"
v-model="form.invoiceOther"
></u--input>
</view>
</view>
</template>
<view class="card-title m-top-30">交易说明</view>
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
<view class="lb">报价区域:</view>
<view class="vl flex-1 p-right-20" @click="showOfferAddress">
<u--input
style="pointer-events:none"
placeholder="请选择"
v-model="offerRegion"
fontSize="24rpx"
suffixIcon="arrow-down-fill"
suffixIconStyle="font-size: 10px;color: #d5d5d5"
:disabled="true"
disabledColor="#fff"
></u--input>
</view>
<el-checkbox v-model="form.offerAddressNoLimit" @change="changeOfferAddressNoLimit">不限区域
</el-checkbox>
</view>
<view class="group flex m-top-30">
<view class="lb m-right-20">付款方式:</view>
<view class="vl flex-1">
<u-radio-group v-model="form.payMethod" placement="column">
<!-- <u-radio activeColor="red" name='预付' label="预付N%,货到付全款"-->
<!-- :customStyle="{marginBottom: '10px'}"></u-radio>-->
<u-radio activeColor="red" name='预付'
:customStyle="{marginBottom: '10px'}">
<view class="text-25 flex justify-start items-center">
<text>预付</text>
<u-input v-model="form.prePayRate" :disabled="form.payMethod !== '预付'"
:custom-style="{width: '100rpx'}"></u-input>
<text>%,货到付全款</text>
</view>
</u-radio>
<u-radio activeColor="red" name='提货付全款' label="提货付全款"
:customStyle="{marginBottom: '10px'}"></u-radio>
<u-radio activeColor="red" name='其他付款方式描述'
:customStyle="{marginBottom: '10px'}">
<view class="flex justify-start items-start flex-col w-100p">
<text style="color: rgb(96, 98, 102);
font-size: 15px;
line-height: 15px;">其他付款方式描述
</text>
<u--textarea v-model="form.otherPayMethodDesc" :disabled="form.payMethod !== '其他付款方式描述'"
placeholder="请输入内容" :custom-style="{width: '400rpx'}"/>
</view>
</u-radio>
</u-radio-group>
</view>
</view>
<!-- <view class="group flex align-center m-top-30" v-if="form.payMethod === '预付'">-->
<!-- <view class="lb m-right-20">预付(%):</view>-->
<!-- <view class="vl flex-1">-->
<!-- <u&#45;&#45;input-->
<!-- placeholder="请输入内容"-->
<!-- v-model="form.prePayRate"-->
<!-- ></u&#45;&#45;input>-->
<!-- </view>-->
<!-- </view>-->
<view class="card-title m-top-30">合同条款</view>
<view class="flex justify-start align-center m-top-30">
<u-radio-group v-model="form.signMethod" placement="column">
<u-radio activeColor="red" :name='0' label="线上签约-标准合同"
:customStyle="{marginBottom: '30rpx'}"></u-radio>
<u-radio activeColor="red" :name='2' label="线上签约-双方协商合同"
:customStyle="{marginBottom: '30rpx'}"></u-radio>
<u-radio activeColor="red" :name='1' label="线下签约"
:customStyle="{marginBottom: '30rpx'}"></u-radio>
</u-radio-group>
</view>
<template v-if="form.signMethod === 2">
<view class="card-title m-top-30">合同附件</view>
<u-upload
accept="file"
:fileList="contractAttachment"
@afterRead="afterReadAttachment($event, 'contractAttachment')"
@delete="deletePicAttachment($event, 'contractAttachment')"
name="contractAttachment"
multiple
:maxCount="10"
></u-upload>
</template>
<view v-if="form.signMethod === 0" class="text-25" style="line-height: 32rpx">
<view v-if="form.signMethod === 0" class="mb-15">补充条款</view>
<view class="flex justify-start items-start flex-col">
<view class="m-10">违约责任:</view>
<view class="pl-20 flex-1 py-20">
1.
乙方所交产品品种、型号、规格、质量不符合规定的,如果甲方同意利用,应当按质论价;如果甲方不能利用的,应根据产品的具体情况,由乙方负责包换或包修,并承担修理、调换或退货而支付的实际费用;
2.乙方不予供货违约责任为甲方的实际损失+违约金,如乙方材料符合订货标准,甲方不能退货和不收货,甲方无条件应按实际本合同订货数量支付100%货款,并支付乙方因此产生的实际费用。带有甲乙双方单位相关收货人和发货人签字的本合同的发货清单事项和内容均视为本合同的补充合同,与本合同有相同的法律效力,双方应共同遵照执行。
</view>
</view>
<view class="flex justify-start items-start flex-col">
<view class="m-10">解决纠纷的方法:</view>
<view class="pl-20 flex-1 py-20">
1、凡因本合同引起的或与本合同有关的任何争议,均可友好协商或仲裁解决,协商或仲裁不成的,双方协商同意在合同签订地人民法院管辖地起诉,违约一方或对合同争议承担主要责任的一方,应承担对方因仲裁和起诉而产生的全部律师代理费、鉴定(检验)费、诉讼保全费、诉讼保险费、公告费、差旅费、执行费、误工费和获取证据产生费用等其他相关费用。
2、双方本合同相关权利放弃均应有双方书面作出并加盖公章或授权委托人签字后生效。
</view>
</view>
<view class="flex justify-start items-start flex-col">
<view class="m-10">不可抗力:</view>
<view class="pl-20 flex-1 py-20">
甲乙双方的任何一方由于不可抗力或突发公共事件的原因不能履行合同时,应及时向对方通报不能履行或不能完全履行的理由,以减轻可能给对方造成的损失,在取得有关机构证明以后,允许延期履行、部分履行或者不履行合同,并根据情况可部分或全部免予承担违约责任。
</view>
</view>
<view class="flex justify-start items-start flex-col">
<view class="m-10">其他:</view>
<view class="pl-20 flex-1 py-20">
本合同的全部内容由双方平等共同协商一致,共同起草制定,非一方事先拟定,不属于格式条款。本合同自双方签字盖章后生效(包括电子签字、盖章),按本合同内容地址、联系方式寄送的一切文书、函件送达与否,均为视为送达有法律效力,通知途径和本合同内联系方式或地址送达文件双方均予以验证。
</view>
</view>
<view class="flex justify-start items-start flex-col">
<view class="lb m-right-20">销售方补充条款:</view>
<view class="vl w-100p">
<u--textarea
placeholder="请输入内容"
v-model="form.supplementary"
></u--textarea>
</view>
</view>
</view>
<view class="card-title m-top-30">供货商信息</view>
<view class="group flex align-center m-top-30">
<view class="lb m-right-20">{{ user.accountType === 2 ? '公司信息' : '个人信息' }}:</view>
<view class="vl flex-1">
<u--input
placeholder="请输入内容"
v-model="form.supplier.companyName"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb m-right-20">{{ user.accountType === 2 ? '公司联系方式' : '个人联系方式' }}:</view>
<view class="vl flex-1">
<u--input
placeholder="请输入内容"
v-model="form.supplier.contract"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb m-right-20">联系人:</view>
<view class="vl flex-1" @click="showContactPicker = true">
<u--input
style="pointer-events:none"
readonly
placeholder="点击选择联系人"
v-model="form.supplier.managerName"
suffixIcon="arrow-right"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb m-right-20">联系方式:</view>
<view class="vl flex-1">
<u--input
disabled
placeholder="请输入内容"
v-model="form.supplier.managerContract"
></u--input>
</view>
</view>
</view>
<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 text-25">
<el-checkbox :value="agree" active-color="#A92924" @change="handleAgreementCheck">我已阅读并同意</el-checkbox>
<span class="text-main pointer font-bold" @click="showAgreement">《金久信旧货交易协议》</span>
</view>
<view class="flex justify-center items-center mt-30 m-a w-100p">
<view class="flex-1 mx-15">
<u-button type="primary" @click="save" plain="">暂存</u-button>
</view>
<view class="flex-1 mx-15">
<u-button type="primary" :disabled="checked === '否' || !agree" @click="publish">立即发布</u-button>
</view>
</view>
<u-picker v-if="showPicker" :show="showPicker" :columns="[cateData, cateData[cateDataIndex].children]"
keyName="name" @change="changeCate"
@cancel="showPicker = false" @close="showPicker = false" closeOnClickOverlay
@confirm="confirmCate"></u-picker>
<AddressSelect ref="AddressSelect" @confirm="regionConfirm"/>
<AddressSelect ref="OfferAddressSelect" @confirm="offerRegionConfirm"/>
<u-picker :show="showUnit" :columns="[unitList]"
@cancel="showUnit = false" @close="showUnit = false" closeOnClickOverlay
@confirm="confirmUnit"></u-picker>
<u-datetime-picker :show="showExpire" v-model="expireTime" mode="date" @cancel="showExpire = false"
:minDate="minDate" :maxDate="maxDate"
@confirm="handConfirmDate"></u-datetime-picker>
<u-picker :show="showContactPicker" :columns="[contactList]" keyName="name"
@cancel="showContactPicker = false" @close="showContactPicker = false" closeOnClickOverlay
@confirm="confirmContact"></u-picker>
<agreement ref="agreementRef" @read-complete="onAgreementReadComplete"/>
</view>
</template>
<script>
import AddressSelect from "@/components/AddressSelect.vue";
import dayjs from "dayjs";
import md5 from "js-md5";
import Agreement from "@/pages/junk/agreement.vue";
export default {
name: "type_0",
components: {Agreement, AddressSelect},
props: {
urgentAmount: {
type: Number,
default: 10
},
remainOldNum: {
type: Number,
default: 0
},
commonContractUrl: {
type: String,
default: ''
},
contactList: {
type: Array,
default: ''
},
unitList: {
type: Array,
default: ''
},
user: {
type: Object,
default: null
},
},
data() {
return {
pickerOptions: {
disabledDate(time) {
return time.getTime() < Date.now();
},
},
agree: false,
agreementReadCompleted: false,
allChildCate: [],
cateData: [],
cateDataIndex: 0,
form: {
type: 0,
category: 0,
files: [],
otherCate: false,
otherCateName: '',
title: '',
desc: '',
addressRegion: {},
addressDetail: '',
startNum: '',
unit: '吨',
startAmount: '',
expiredTime: '',
offerAddressRegion: {},
offerAddressNoLimit: false,
payMethod: '预付',
prePayRate: '',
otherPayMethodDesc: '',
signMethod: 0,
buyer: {
companyName: '',
contract: '',
personalName: '',
personalContract: '',
managerName: '',
managerContract: '',
},
supplier: {
companyName: '',
contract: '',
personalName: '',
personalContract: '',
managerName: '',
managerContract: '',
},
contractAttachment: [],
isUrgent: false,
supplementary: '',
invoice: false,
writeInvoiceTime: 0,
taxType: '一般纳税人',
invoiceType: '专用发票',
taxRate: '13%',
invoiceOther: '',
},
provinceIndex: null,
cityIndex: null,
areaIndex: null,
offerProvinceIndex: null,
offerCityIndex: null,
offerAreaIndex: null,
checked: '否',
showPicker: false,
cateName: '',
region: '',
offerRegion: '',
showUnit: false,
showExpire: false,
expireTime: '',
showContactPicker: false,
minDate: Number(new Date()),
maxDate: dayjs().add(1, 'year').valueOf(),
contractAttachment: [],
files: [],
}
},
methods: {
showAddress() {
this.$refs.AddressSelect.open(this.form.addressRegion);
},
regionConfirm({province, city, area}) {
this.form.addressRegion = {province, city, area}
this.region = `${province.name} ${city.name} ${area.name}`
},
showOfferAddress() {
this.$refs.OfferAddressSelect.open(this.form.offerAddressRegion);
},
offerRegionConfirm({province, city, area}) {
this.form.offerAddressRegion = {province, city, area}
this.offerRegion = `${province.name} ${city.name} ${area.name}`
},
async publish() {
if (this.remainOldNum === 0) {
uni.showModal({
title: '提示',
content: '您的旧货发布次数已用完,是否立即购买?',
success: async res => {
if (res.confirm) {
const {data} = await vk.callFunction({
url: 'client/old/kh/buyNum',
})
vk.navigateTo({
url: `/pages/shop/pay?id=${data}`
})
}
}
})
return
}
if (!this.form.addressRegion) 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'
})
if (dayjs(this.form.expiredTime).valueOf() > this.maxDate) return this.$message({
message: "为保证信息有效性发布最长时限为1年(12个月)",
type: 'warning'
})
if (this.form.payMethod === '预付' && String(this.form.prePayRate).trim() === '') return this.$message({
message: "请填写预付比例",
type: 'warning'
})
const res = await vk.callFunction({
url: 'client/old/kh/add',
data: this.form
})
localStorage.removeItem("old_0")
this.$message({
message: "您的信息已经提交,等待管理员审核,请您耐心等待!",
type: 'success'
})
setTimeout(() => {
if (this.form.isUrgent) {
vk.navigateTo({
url: `/pages/shop/pay?id=${res.data}`
})
} else {
vk.redirectTo({url: '/pages/junk/junk'});
}
}, 1500)
},
handleAgreementCheck(value) {
if (!value) {
this.agree = false
return
}
if (!this.agreementReadCompleted) {
this.agree = false
uni.showToast({
title: '请先查看《金久信旧货交易协议》5秒以上',
icon: 'none'
})
return
}
this.agree = true
},
onAgreementReadComplete() {
this.agreementReadCompleted = true
},
showAgreement() {
// this.$confirm(this.agreement, '金久信旧货交易协议', {
// cancelButtonText: '关闭',
// showConfirmButton: false,
// dangerouslyUseHTMLString: true,
// })
this.$refs.agreementRef.open()
},
openDownload() {
window.location.href = this.commonContractUrl
// window.open(this.commonContractUrl)
},
navTo() {
vk.navigateTo({url: '/pages/user/user?menu=business-contact'})
},
confirmCate({value}) {
this.form.category = value.map(i => i.name)
this.cateName = `${value[0].name} / ${value[1].name}`
this.showPicker = false
},
changeCate({columnIndex, index}) {
if (columnIndex === 0) {
this.cateDataIndex = index
}
},
confirmUnit({value}) {
this.form.unit = value[0]
this.showUnit = false
},
afterRead({file}) {
file.forEach(item => {
const suffix = item.name.split('.').pop()
uniCloud.uploadFile({
filePath: item.url,
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + md5(item.name + Date.now().toString()) + `.${suffix}`,
success: ({fileID}) => {
uniCloud.getTempFileURL({
fileList: [fileID]
}).then(res => {
this.form.files.push(res.fileList[0].tempFileURL)
this.files.push({url: res.fileList[0].tempFileURL})
})
}
})
})
},
deletePic({index}) {
this.form.files.splice(index, 1)
},
handConfirmDate({value}) {
this.form.expiredTime = dayjs(value).format('YYYY-MM-DD')
this.showExpire = false
},
confirmContact({value}) {
this.form.supplier.managerName = value[0].name
this.form.supplier.managerContract = value[0].phone
this.showContactPicker = false
},
changeOfferAddressNoLimit(val) {
if (val) {
this.form.offerAddressRegion = {}
this.offerRegion = ''
this.offerProvinceIndex = this.offerCityIndex = this.offerAreaIndex = null
}
},
afterReadAttachment({file}, field) {
for (let i = 0; i < file.length; i++) {
const item = file[i]
const suffix = item.name.split('.').pop()
if (field === 'files' || field === 'contractAttachment') {
if (item.type !== 'application/pdf') {
uni.showToast({
title: '请上传PDF文件',
icon: 'none'
})
return
}
}
uniCloud.uploadFile({
filePath: item.url,
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + md5(item.name + Date.now().toString()) + `.${suffix}`,
success: ({fileID}) => {
uniCloud.getTempFileURL({
fileList: [fileID]
}).then(res => {
this[field].push({url: res.fileList[0].tempFileURL})
this.form[field].push(res.fileList[0].tempFileURL)
})
}
})
}
},
deletePicAttachment({index}, field) {
this[field].splice(index, 1)
this.form[field].splice(index, 1)
},
save() {
localStorage.setItem("old_0", JSON.stringify({
form: this.form,
cateName: this.cateName,
files: this.files,
region: this.region,
}))
this.$message({
message: "已保存",
type: 'success'
})
},
setOther(){
this.cateName = ''
},
openPicker(){
if(this.form.otherCate) return
this.showPicker = true
}
},
mounted() {
vk.callFunction({
url: 'client/old/pub/getTree',
title: '请求中...',
data: {type: 0},
success: (data) => {
this.cateData = data.rows.map(item => {
item.children.forEach(child => {
delete child.children
})
return item
})
}
});
if (this.user.accountType === 2) {
this.form.supplier.companyName = this.user.company.companyName
this.form.supplier.contract = this.user.company.mobile
} else {
this.form.supplier.companyName = this.user.person.personName
this.form.supplier.contract = this.user.person.mobile
}
if (!!localStorage.getItem("old_0")) {
this.$confirm('您有一份暂存数据,是否恢复?', '提示', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
const savedData = JSON.parse(localStorage.getItem("old_0"))
this.form = savedData.form
this.cateName = savedData.cateName
this.files = savedData.files
this.offerRegion = savedData.offerRegion
this.region = savedData.region
})
}
}
}
</script>
<style lang="scss">
page {
background: #ffffff;
}
.layout-header {
margin: 0rpx 30rpx;
padding: 30rpx 0;
border-bottom: 1px solid rgba(169, 41, 36, 0.34);
.big {
font-size: 32rpx;
line-height: 48rpx;
color: #000000;
text-align: center;
}
.small {
font-size: 24rpx;
line-height: 40rpx;
color: #9a9a9a;
text-align: center;
}
.ptb {
margin-right: 20rpx;
padding: 6rpx 14rpx;
font-size: 24rpx;
line-height: 40rpx;
color: #333333;
border: 1px solid #f2f2f2;
&:last-child {
margin-right: 0;
}
}
.active {
color: #ffffff;
border-color: #A92924;
background: #A92924;
}
}
.public-btn {
width: 95%;
margin-top: 60rpx;
color: #ffffff;
background: #A92924;
}
.layout-publish {
padding: 20rpx 30rpx;
}
.tag-title {
font-size: 26rpx;
line-height: 40rpx;
color: #000000;
.limit {
font-size: 24rpx;
color: #999999;
}
}
.tag-box {
padding: 20rpx 0;
.item {
padding: 6rpx 10rpx;
font-size: 24rpx;
line-height: 32rpx;
color: #555555;
}
.active {
color: #A92924;
}
}
.lb, .fix {
position: relative;
font-size: 26rpx;
line-height: 40rpx;
color: #666666;
}
.lbx {
font-size: 24rpx;
color: #999999;
}
.download {
padding: 8rpx 20rpx;
font-size: 24rpx;
line-height: 36rpx;
color: #A92924;
border: 1px solid #A92924;
}
.need::before {
position: absolute;
left: -16rpx;
top: 50%;
z-index: 9;
margin-top: -12rpx;
content: '*';
color: #A92924;
font-size: 32rpx;
line-height: 1;
}
.card-title {
position: relative;
padding-left: 20rpx;
font-size: 28rpx;
font-weight: 600;
line-height: 48rpx;
color: #A92924;
&:before {
position: absolute;
left: 0;
top: 50%;
z-index: 9;
margin-top: -14rpx;
content: '';
width: 6rpx;
height: 28rpx;
background: #A92924;
}
}
.template-tab {
.ttb {
margin-right: 30rpx;
padding: 6rpx 20rpx;
font-size: 28rpx;
line-height: 40rpx;
color: #333333;
border: 1px solid #f2f2f2;
}
.active {
color: #A92924;
border-color: #A92924;
}
}
.template-content {
padding: 30rpx 0;
}
.goods-item {
padding: 18rpx 0;
}
.expire-tip {
padding: 0 20rpx 18rpx;
font-size: 24rpx;
line-height: 36rpx;
color: #A92924;
}
.add-btn {
margin-left: 0;
width: 180rpx;
height: 60rpx;
color: #A92924;
border-color: #A92924;
}
</style>
+995
View File
@@ -0,0 +1,995 @@
<template>
<view class="flex flex-col justify-start items-start">
<text class="text-50">发布我的采购信息</text>
<text class="text-gray">采购信息越完整,成功交易越容易</text>
<view class="layout w-100p m-top-10">
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
<view class="lb">信息失效时间:</view>
<view class="vl flex-1 p-right-20" @click="showExpire = true">
<u--input placeholder="请选择" v-model="form.expiredTime" style="pointer-events:none"
fontSize="24rpx"
suffixIcon="arrow-down-fill"
suffixIconStyle="font-size: 10px;color: #d5d5d5"
:disabled="true"
disabledColor="#fff"></u--input>
</view>
</view>
<view class="expire-tip">温馨提示:为保证信息有效性发布最长时限为1年(12个月)到期后需重新发布。</view>
<view class="goods-item half flex align-center flex-wrap w-100p">
<text class="need text-red">*</text>
<view class="lb">物资分类:</view>
<view class="vl flex-1 p-right-20" @click="openPicker">
<u--input
style="pointer-events:none"
placeholder="请选择"
v-model="cateName"
fontSize="24rpx"
suffixIcon="arrow-down-fill"
suffixIconStyle="font-size: 10px;color: #d5d5d5"
:disabled="true"
disabledColor="#fff"
></u--input>
</view>
</view>
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
<el-checkbox label="其他分类" v-model="form.otherCate" class="mx-20"></el-checkbox>
<u--input
placeholder="请选择"
v-model="form.otherCateName"
fontSize="24rpx"
:disabled="!form.otherCate"
@change="setOther"
></u--input>
</view>
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
<text class="need text-red">*</text>
<view class="lb">信息标题:</view>
<view class="vl flex-1 p-right-20">
<u--input
placeholder="一句话简介物资,如拍卖直缝钢管200吨等"
v-model="form.title"
fontSize="24rpx"
></u--input>
</view>
</view>
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
<text class="need text-red">*</text>
<view class="lb">采购物资详情:</view>
<view class="vl flex-1 p-right-20">
<u--textarea
placeholder="请详细描述物资信息,描述内容:材料名称、材质......(限300字以内)"
v-model="form.desc"
fontSize="24rpx"
></u--textarea>
</view>
</view>
<!-- <view class="goods-item half flex align-center flex-wrap mt-20 w-100p">-->
<!-- <view class="lb">物资装货所在地:</view>-->
<!-- <view class="vl flex-1 p-right-20" @click="showAddress">-->
<!-- <u&#45;&#45;input-->
<!-- style="pointer-events:none"-->
<!-- placeholder="请选择"-->
<!-- v-model="region"-->
<!-- fontSize="24rpx"-->
<!-- suffixIcon="arrow-down-fill"-->
<!-- suffixIconStyle="font-size: 10px;color: #d5d5d5"-->
<!-- :disabled="true"-->
<!-- disabledColor="#fff"-->
<!-- ></u&#45;&#45;input>-->
<!-- </view>-->
<!-- </view>-->
<!-- <view class="goods-item half flex align-center flex-wrap mt-20 w-100p">-->
<!-- <view class="lb">物资装货详细地址:</view>-->
<!-- <view class="vl flex-1 p-right-20">-->
<!-- <u&#45;&#45;input placeholder="请选择" v-model="form.addressDetail"></u&#45;&#45;input>-->
<!-- </view>-->
<!-- </view>-->
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
<text class="need text-red">*</text>
<view class="lb">物资交货所在地:</view>
<view class="vl flex-1 p-right-20" @click="deliverShowAddress">
<u--input
style="pointer-events:none"
placeholder="请选择"
v-model="deliverRegion"
fontSize="24rpx"
suffixIcon="arrow-down-fill"
suffixIconStyle="font-size: 10px;color: #d5d5d5"
:disabled="true"
disabledColor="#fff"
></u--input>
</view>
</view>
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
<text class="need text-red">*</text>
<view class="lb">物资交货详细地址:</view>
<view class="vl flex-1 p-right-20">
<u--input placeholder="请选择" v-model="form.deliverAddressDetail"></u--input>
</view>
</view>
<view class="card-title m-top-30">税票要求</view>
<view class="flex justify-start align-center m-top-30">
<u-radio-group
v-model="form.invoice"
placement="row"
>
<u-radio activeColor="red" :name='true' label="含税" :customStyle="{marginRight: '30px'}"></u-radio>
<u-radio activeColor="red" :name='false' label="不含税"></u-radio>
</u-radio-group>
</view>
<template v-if="form.invoice">
<view class="group flex m-top-30">
<view class="lb m-right-20">开票时间:</view>
<view class="vl flex-1">
<u-radio-group v-model="form.writeInvoiceTime" placement="column">
<u-radio activeColor="red" :name='0' label="付款当月(限20号之后付款次月开票)"
:customStyle="{marginBottom: '10px'}"></u-radio>
<u-radio activeColor="red" :name='1' label="付款后次月"
:customStyle="{marginBottom: '10px'}"></u-radio>
<u-radio activeColor="red" :name='2' label="付款前"></u-radio>
</u-radio-group>
</view>
</view>
<view class="group flex m-top-30">
<view class="lb m-right-20">纳税人身份:</view>
<view class="vl flex-1">
<u-radio-group v-model="form.taxType" placement="column">
<u-radio activeColor="red" name='一般纳税人' label="一般纳税人"
:customStyle="{marginBottom: '10px'}"></u-radio>
<u-radio activeColor="red" name='小规模公司' label="小规模公司"
:customStyle="{marginBottom: '10px'}"></u-radio>
<u-radio activeColor="red" name='个体工商户' label="个体工商户"></u-radio>
</u-radio-group>
</view>
</view>
<view class="group flex m-top-30">
<view class="lb m-right-20">发票种类:</view>
<view class="vl flex-1">
<u-radio-group v-model="form.invoiceType" placement="column">
<u-radio activeColor="red" name='专用发票' label="专用发票"
:customStyle="{marginBottom: '10px'}"></u-radio>
<u-radio activeColor="red" name='普通发票' label="普通发票"
:customStyle="{marginBottom: '10px'}"></u-radio>
</u-radio-group>
</view>
</view>
<view class="group flex m-top-30">
<view class="lb m-right-20">税率:</view>
<view class="vl flex-1">
<u-radio-group v-model="form.taxRate" placement="column">
<u-radio activeColor="red" v-for="(item, index) in ['13%', '9%', '6%', '4%', '3%', '1%']"
:key="index" :name='item' :label="item"
:customStyle="{marginBottom: '10px'}"/>
</u-radio-group>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb m-right-20">手动填写税票要求:</view>
<view class="vl flex-1">
<u--input
placeholder="如:一般纳税人 专用发票 税率13%"
border="surround"
v-model="form.invoiceOther"
></u--input>
</view>
</view>
</template>
<view class="card-title m-top-30">交易说明</view>
<!-- <view class="group flex align-center m-top-30">-->
<!-- <view class="lb m-right-20">报价明细:</view>-->
<!-- <view class="vl flex-1">-->
<!-- <u&#45;&#45;input-->
<!-- placeholder="请输入内容"-->
<!-- border="surround"-->
<!-- v-model="form.invoiceDetail"-->
<!-- ></u&#45;&#45;input>-->
<!-- </view>-->
<!-- </view>-->
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
<view class="lb">报价区域:</view>
<view class="vl flex-1 p-right-20" @click="offerShowAddress">
<u--input
style="pointer-events:none"
placeholder="请选择"
v-model="offerRegion"
fontSize="24rpx"
suffixIcon="arrow-down-fill"
suffixIconStyle="font-size: 10px;color: #d5d5d5"
:disabled="true"
disabledColor="#fff"
></u--input>
</view>
<el-checkbox v-model="form.offerAddressNoLimit" @change="changeOfferAddressNoLimit">不限区域
</el-checkbox>
</view>
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
<view class="lb">报价截止时间:</view>
<view class="vl flex-1 p-right-20" @click="showOfferExpire = true">
<u--input placeholder="请选择" v-model="form.offerExpiredTime" style="pointer-events:none"
fontSize="24rpx"
suffixIcon="arrow-down-fill"
suffixIconStyle="font-size: 10px;color: #d5d5d5"
:disabled="true"
disabledColor="#fff"></u--input>
</view>
</view>
<view class="group flex m-top-30">
<view class="lb m-right-20">付款方式:</view>
<view class="vl flex-1">
<u-radio-group v-model="form.payMethod" placement="column">
<!-- <u-radio activeColor="red" name='预付' label="预付N%,货到付全款"-->
<!-- :customStyle="{marginBottom: '10px'}"></u-radio>-->
<u-radio activeColor="red" name='预付'
:customStyle="{marginBottom: '10px'}">
<view class="text-25 flex justify-start items-center">
<text>预付</text>
<u-input v-model="form.prePayRate" :disabled="form.payMethod !== '预付'"
:custom-style="{width: '100rpx'}"></u-input>
<text>%,货到付全款</text>
</view>
</u-radio>
<u-radio activeColor="red" name='提货付全款' label="提货付全款"
:customStyle="{marginBottom: '10px'}"></u-radio>
<u-radio activeColor="red" name='其他付款方式描述'
:customStyle="{marginBottom: '10px'}">
<view class="flex justify-start items-start flex-col w-100p">
<text style="color: rgb(96, 98, 102);
font-size: 15px;
line-height: 15px;">其他付款方式描述
</text>
<u--textarea v-model="form.otherPayMethodDesc" :disabled="form.payMethod !== '其他付款方式描述'"
placeholder="请输入内容" :custom-style="{width: '400rpx'}"/>
</view>
</u-radio>
</u-radio-group>
</view>
</view>
<view class="flex justify-start align-center m-top-30">
<view class="lb m-right-20">报价形式:</view>
<view class="vl flex-1">
<u-radio-group
v-model="form.offerType"
placement="row"
>
<u-radio activeColor="red" name='整单报价' label="整单报价"
:customStyle="{marginRight: '30px'}"></u-radio>
<u-radio activeColor="red" name='可分项报价' label="可分项报价"></u-radio>
</u-radio-group>
</view>
</view>
<view class="card-title m-top-30">合同条款</view>
<view class="flex justify-start align-center m-top-30">
<u-radio-group v-model="form.signMethod" placement="column">
<u-radio activeColor="red" :name='0' label="线上签约-标准合同"
:customStyle="{marginBottom: '30rpx'}"></u-radio>
<u-radio activeColor="red" :name='2' label="线上签约-双方协商合同"
:customStyle="{marginBottom: '30rpx'}"></u-radio>
<u-radio activeColor="red" :name='1' label="线下签约"
:customStyle="{marginBottom: '30rpx'}"></u-radio>
</u-radio-group>
</view>
<template v-if="form.signMethod === 2">
<view class="card-title m-top-30">合同附件</view>
<u-upload
accept="file"
:fileList="contractAttachment"
@afterRead="afterReadAttachment($event, 'contractAttachment')"
@delete="deletePicAttachment($event, 'contractAttachment')"
name="contractAttachment"
multiple
:maxCount="10"
></u-upload>
</template>
<view v-if="form.signMethod === 0" class="text-25" style="line-height: 32rpx">
<view v-if="form.signMethod === 0" class="mb-15">补充条款</view>
<view class="flex justify-start items-start flex-col">
<view class="m-10">违约责任:</view>
<view class="pl-20 flex-1 py-20">
1.
乙方所交产品品种、型号、规格、质量不符合规定的,如果甲方同意利用,应当按质论价;如果甲方不能利用的,应根据产品的具体情况,由乙方负责包换或包修,并承担修理、调换或退货而支付的实际费用;
2.乙方不予供货违约责任为甲方的实际损失+违约金,如乙方材料符合订货标准,甲方不能退货和不收货,甲方无条件应按实际本合同订货数量支付100%货款,并支付乙方因此产生的实际费用。带有甲乙双方单位相关收货人和发货人签字的本合同的发货清单事项和内容均视为本合同的补充合同,与本合同有相同的法律效力,双方应共同遵照执行。
</view>
</view>
<view class="flex justify-start items-start flex-col">
<view class="m-10">解决纠纷的方法:</view>
<view class="pl-20 flex-1 py-20">
1、凡因本合同引起的或与本合同有关的任何争议,均可友好协商或仲裁解决,协商或仲裁不成的,双方协商同意在合同签订地人民法院管辖地起诉,违约一方或对合同争议承担主要责任的一方,应承担对方因仲裁和起诉而产生的全部律师代理费、鉴定(检验)费、诉讼保全费、诉讼保险费、公告费、差旅费、执行费、误工费和获取证据产生费用等其他相关费用。
2、双方本合同相关权利放弃均应有双方书面作出并加盖公章或授权委托人签字后生效。
</view>
</view>
<view class="flex justify-start items-start flex-col">
<view class="m-10">不可抗力:</view>
<view class="pl-20 flex-1 py-20">
甲乙双方的任何一方由于不可抗力或突发公共事件的原因不能履行合同时,应及时向对方通报不能履行或不能完全履行的理由,以减轻可能给对方造成的损失,在取得有关机构证明以后,允许延期履行、部分履行或者不履行合同,并根据情况可部分或全部免予承担违约责任。
</view>
</view>
<view class="flex justify-start items-start flex-col">
<view class="m-10">其他:</view>
<view class="pl-20 flex-1 py-20">
本合同的全部内容由双方平等共同协商一致,共同起草制定,非一方事先拟定,不属于格式条款。本合同自双方签字盖章后生效(包括电子签字、盖章),按本合同内容地址、联系方式寄送的一切文书、函件送达与否,均为视为送达有法律效力,通知途径和本合同内联系方式或地址送达文件双方均予以验证。
</view>
</view>
<view class="flex justify-start items-start flex-col">
<view class="lb m-right-20">采购方补充条款:</view>
<view class="vl w-100p">
<u--textarea
placeholder="请输入内容"
v-model="form.supplementary"
></u--textarea>
</view>
</view>
</view>
<view class="card-title m-top-30">采购商信息</view>
<view class="group flex align-center m-top-30">
<view class="lb m-right-20">采购商:</view>
<view class="vl flex-1">
<u--input
placeholder="请输入内容"
v-model="form.buyer.companyName"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb m-right-20">联系方式:</view>
<view class="vl flex-1">
<u--input
placeholder="请输入内容"
v-model="form.buyer.contract"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb m-right-20">联系人:</view>
<view class="vl flex-1" @click="showContactPicker = true">
<u--input
style="pointer-events:none"
readonly
placeholder="点击选择联系人"
v-model="form.buyer.managerName"
suffixIcon="arrow-right"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb m-right-20">联系方式:</view>
<view class="vl flex-1">
<u--input
disabled
placeholder="请输入内容"
v-model="form.buyer.managerContract"
></u--input>
</view>
</view>
</view>
<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 :value="agree" active-color="#A92924" @change="handleAgreementCheck">我已阅读并同意</el-checkbox>
<span class="text-main pointer font-bold" @click="showAgreement">《金久信旧货交易协议》</span>
</view>
<view class="flex justify-center items-center mt-30 m-a w-100p">
<view class="flex-1 mx-15">
<u-button type="primary" @click="save" plain="">暂存</u-button>
</view>
<view class="flex-1 mx-15">
<u-button type="primary" :disabled="checked === '否' || !agree" @click="publish">立即发布</u-button>
</view>
</view>
<u-picker v-if="showPicker" :show="showPicker" :columns="[cateData, cateData[cateDataIndex].children]"
keyName="name" @change="changeCate"
@cancel="showPicker = false" @close="showPicker = false" closeOnClickOverlay
@confirm="confirmCate"></u-picker>
<AddressSelect ref="AddressSelect" @confirm="regionConfirm"/>
<AddressSelect ref="DeliverAddressSelect" @confirm="deliverRegionConfirm"/>
<AddressSelect ref="OfferAddressSelect" @confirm="offerRegionConfirm"/>
<u-picker :show="showUnit" :columns="[unitList]"
@cancel="showUnit = false" @close="showUnit = false" closeOnClickOverlay
@confirm="confirmUnit"></u-picker>
<u-datetime-picker :show="showExpire" v-model="expireTime" mode="date" @cancel="showExpire = false"
:minDate="minDate" :maxDate="maxDate"
@confirm="handConfirmDate"></u-datetime-picker>
<u-datetime-picker :show="showOfferExpire" v-model="offerExpiredTime" mode="date"
@cancel="showOfferExpire = false" :minDate="minDate"
@confirm="handOfferConfirmDate"></u-datetime-picker>
<u-picker :show="showContactPicker" :columns="[contactList]" keyName="name"
@cancel="showContactPicker = false" @close="showContactPicker = false" closeOnClickOverlay
@confirm="confirmContact"></u-picker>
<agreement ref="agreementRef" @read-complete="onAgreementReadComplete"/>
</view>
</template>
<script>
import AddressSelect from "@/components/AddressSelect.vue";
import dayjs from "dayjs";
import {INVOICE_TYPE, WRITE_INVOICE_TIME} from "@/util";
import md5 from "js-md5";
import Agreement from "@/pages/junk/agreement.vue";
export default {
name: "type_0",
components: {Agreement, AddressSelect},
props: {
urgentAmount: {
type: Number,
default: 10
},
remainOldNum: {
type: Number,
default: 0
},
agreement: {
type: String,
default: ''
},
commonContractUrl: {
type: String,
default: ''
},
contactList: {
type: Array,
default: ''
},
user: {
type: Object,
default: null
},
},
data() {
return {
pickerOptions: {
disabledDate(time) {
return time.getTime() < Date.now();
},
},
agree: false,
agreementReadCompleted: false,
unitList: ['吨', '万吨'],
allChildCate: [],
cateData: [],
cateDataIndex: 0,
form: {
otherCate: false,
otherCateName: '',
type: 1,
category: 0,
files: [],
title: '',
desc: '',
addressRegion: {},
addressDetail: '',
deliverAddressRegion: {},
deliverAddressDetail: '',
invoiceDetail: '',
expiredTime: '',
offerExpiredTime: '',
offerAddressRegion: {},
offerAddressNoLimit: false,
payMethod: '预付',
offerType: '整单报价',
prePayRate: '',
otherPayMethodDesc: '',
signMethod: 0,
buyer: {
companyName: '',
contract: '',
personalName: '',
personalContract: '',
managerName: '',
managerContract: '',
},
supplier: {
companyName: '',
contract: '',
personalName: '',
personalContract: '',
managerName: '',
managerContract: '',
},
contractAttachment: [],
isUrgent: false,
supplementary: '',
invoice: false,
writeInvoiceTime: 0,
taxType: '一般纳税人',
invoiceType: '专用发票',
taxRate: '13%',
invoiceOther: '',
},
provinceIndex: null,
cityIndex: null,
areaIndex: null,
offerProvinceIndex: null,
offerCityIndex: null,
offerAreaIndex: null,
checked: '否',
showPicker: false,
cateName: '',
region: '',
deliverRegion: '',
offerRegion: '',
showUnit: false,
showExpire: false,
showOfferExpire: false,
expireTime: '',
offerExpiredTime: '',
showContactPicker: false,
minDate: Number(new Date()),
maxDate: dayjs().add(1, 'year').valueOf()
}
},
methods: {
INVOICE_TYPE() {
return INVOICE_TYPE
},
WRITE_INVOICE_TIME() {
return WRITE_INVOICE_TIME
},
showAddress() {
this.$refs.AddressSelect.open(this.form.addressRegion);
},
regionConfirm({province, city, area}) {
this.form.addressRegion = {province, city, area}
this.region = `${province.name} ${city.name} ${area.name}`
},
deliverShowAddress() {
this.$refs.DeliverAddressSelect.open(this.form.deliverAddressRegion);
},
deliverRegionConfirm({province, city, area}) {
this.form.deliverAddressRegion = {province, city, area}
this.deliverRegion = `${province.name} ${city.name} ${area.name}`
},
offerShowAddress() {
this.$refs.OfferAddressSelect.open(this.form.offerAddressRegion);
},
offerRegionConfirm({province, city, area}) {
this.form.offerAddressRegion = {province, city, area}
this.offerRegion = `${province.name} ${city.name} ${area.name}`
},
async publish() {
if (this.remainOldNum === 0) {
uni.showModal({
title: '提示',
content: '您的旧货发布次数已用完,是否立即购买?',
success: async res => {
if (res.confirm) {
const {data} = await vk.callFunction({
url: 'client/old/kh/buyNum',
})
vk.navigateTo({
url: `/pages/shop/pay?id=${data}`
})
}
}
})
return
}
if (!this.form.deliverAddressRegion) return this.$message({
message: "请选择完整的物资所在地",
type: 'warning'
})
if (!this.form.deliverAddressDetail) 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'
})
if (dayjs(this.form.expiredTime).valueOf() > this.maxDate) return this.$message({
message: "为保证信息有效性发布最长时限为1年(12个月)",
type: 'warning'
})
if (this.form.payMethod === '预付' && String(this.form.prePayRate).trim() === '') return this.$message({
message: "请填写预付比例",
type: 'warning'
})
this.form.files = this.form.files.map(i => i.url)
const res = await vk.callFunction({
url: 'client/old/kh/add',
data: this.form
})
localStorage.removeItem("old_1")
this.$message({
message: "您的信息已经提交,等待管理员审核,请您耐心等待!",
type: 'success'
})
setTimeout(() => {
if (this.form.isUrgent) {
vk.navigateTo({
url: `/pages/shop/pay?id=${res.data}`
})
} else {
vk.redirectTo({url: '/pages/junk/junk'});
}
}, 1500)
},
handleAgreementCheck(value) {
if (!value) {
this.agree = false
return
}
if (!this.agreementReadCompleted) {
this.agree = false
uni.showToast({
title: '请先查看《金久信旧货交易协议》5秒以上',
icon: 'none'
})
return
}
this.agree = true
},
onAgreementReadComplete() {
this.agreementReadCompleted = true
},
showAgreement() {
// this.$confirm(this.agreement, '金久信旧货交易协议', {
// cancelButtonText: '关闭',
// showConfirmButton: false,
// dangerouslyUseHTMLString: true,
// })
this.$refs.agreementRef.open()
},
openDownload() {
// window.open(this.commonContractUrl)
window.location.href = this.commonContractUrl
},
navTo() {
vk.navigateTo({url: '/pages/user/user?menu=business-contact'})
},
confirmCate({value}) {
this.form.category = value.map(i => i.name)
this.cateName = `${value[0].name}${value[1].name}`
this.showPicker = false
},
confirmUnit({value}) {
this.form.unit = value
this.showUnit = false
},
afterRead({file}) {
file.forEach(item => {
const suffix = item.name.split('.').pop()
uniCloud.uploadFile({
filePath: item.url,
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + md5(item.name + Date.now().toString()) + `.${suffix}`,
success: ({fileID}) => {
uniCloud.getTempFileURL({
fileList: [fileID]
}).then(res => {
this.form.files.push({url: res.fileList[0].tempFileURL})
})
}
})
})
},
deletePic({index}) {
this.form.files.splice(index, 1)
},
handConfirmDate({value}) {
this.form.expiredTime = dayjs(value).format('YYYY-MM-DD')
this.showExpire = false
},
handOfferConfirmDate({value}) {
this.form.offerExpiredTime = dayjs(value).format('YYYY-MM-DD')
this.showOfferExpire = false
},
confirmContact({value}) {
this.form.buyer.managerName = value[0].name
this.form.buyer.managerContract = value[0].phone
this.showContactPicker = false
},
changeOfferAddressNoLimit(val) {
if (val) {
this.form.offerAddressRegion = {}
this.offerRegion = ''
this.offerProvinceIndex = this.offerCityIndex = this.offerAreaIndex = null
}
},
changeCate({columnIndex, index}) {
if (columnIndex === 0) {
this.cateDataIndex = index
}
},
save() {
localStorage.setItem("old_1", JSON.stringify({
form: this.form,
cateName: this.cateName,
files: this.files,
region: this.region,
deliverRegion: this.deliverRegion,
offerRegion: this.offerRegion,
}))
this.$message({
message: "已保存",
type: 'success'
})
},
afterReadAttachment({file}, field) {
for (let i = 0; i < file.length; i++) {
const item = file[i]
const suffix = item.name.split('.').pop()
if (field === 'files' || field === 'contractAttachment') {
if (item.type !== 'application/pdf') {
uni.showToast({
title: '请上传PDF文件',
icon: 'none'
})
return
}
}
uniCloud.uploadFile({
filePath: item.url,
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + md5(item.name + Date.now().toString()) + `.${suffix}`,
success: ({fileID}) => {
uniCloud.getTempFileURL({
fileList: [fileID]
}).then(res => {
this[field].push({url: res.fileList[0].tempFileURL})
this.form[field].push(res.fileList[0].tempFileURL)
})
}
})
}
},
deletePicAttachment({index}, field) {
this[field].splice(index, 1)
this.form[field].splice(index, 1)
},
setOther() {
this.cateName = ''
},
openPicker() {
if (this.form.otherCate) return
this.showPicker = true
}
},
mounted() {
vk.callFunction({
url: 'client/old/pub/getTree',
title: '请求中...',
data: {type: 1},
success: (data) => {
this.cateData = data.rows.map(item => {
item.children.forEach(child => {
delete child.children
})
return item
})
}
});
if (this.user.accountType === 2) {
this.form.buyer.companyName = this.user.company.companyName
this.form.buyer.contract = this.user.company.mobile
} else {
this.form.buyer.companyName = this.user.person.personName
this.form.buyer.contract = this.user.person.mobile
}
if (!!localStorage.getItem("old_1")) {
this.$confirm('您有一份暂存数据,是否恢复?', '提示', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
const savedData = JSON.parse(localStorage.getItem("old_1"))
this.form = savedData.form
this.cateName = savedData.cateName
this.files = savedData.files
this.deliverRegion = savedData.deliverRegion
this.offerRegion = savedData.offerRegion
this.region = savedData.region
})
}
}
}
</script>
<style lang="scss">
page {
background: #ffffff;
}
.layout-header {
margin: 0rpx 30rpx;
padding: 30rpx 0;
border-bottom: 1px solid rgba(169, 41, 36, 0.34);
.big {
font-size: 32rpx;
line-height: 48rpx;
color: #000000;
text-align: center;
}
.small {
font-size: 24rpx;
line-height: 40rpx;
color: #9a9a9a;
text-align: center;
}
.ptb {
margin-right: 20rpx;
padding: 6rpx 14rpx;
font-size: 24rpx;
line-height: 40rpx;
color: #333333;
border: 1px solid #f2f2f2;
&:last-child {
margin-right: 0;
}
}
.active {
color: #ffffff;
border-color: #A92924;
background: #A92924;
}
}
.public-btn {
width: 95%;
margin-top: 60rpx;
color: #ffffff;
background: #A92924;
}
.layout-publish {
padding: 20rpx 30rpx;
}
.tag-title {
font-size: 26rpx;
line-height: 40rpx;
color: #000000;
.limit {
font-size: 24rpx;
color: #999999;
}
}
.tag-box {
padding: 20rpx 0;
.item {
padding: 6rpx 10rpx;
font-size: 24rpx;
line-height: 32rpx;
color: #555555;
}
.active {
color: #A92924;
}
}
.lb, .fix {
position: relative;
font-size: 26rpx;
line-height: 40rpx;
color: #666666;
}
.lbx {
font-size: 24rpx;
color: #999999;
}
.download {
padding: 8rpx 20rpx;
font-size: 24rpx;
line-height: 36rpx;
color: #A92924;
border: 1px solid #A92924;
}
.need::before {
position: absolute;
left: -16rpx;
top: 50%;
z-index: 9;
margin-top: -12rpx;
content: '*';
color: #A92924;
font-size: 32rpx;
line-height: 1;
}
.card-title {
position: relative;
padding-left: 20rpx;
font-size: 28rpx;
font-weight: 600;
line-height: 48rpx;
color: #A92924;
&:before {
position: absolute;
left: 0;
top: 50%;
z-index: 9;
margin-top: -14rpx;
content: '';
width: 6rpx;
height: 28rpx;
background: #A92924;
}
}
.template-tab {
.ttb {
margin-right: 30rpx;
padding: 6rpx 20rpx;
font-size: 28rpx;
line-height: 40rpx;
color: #333333;
border: 1px solid #f2f2f2;
}
.active {
color: #A92924;
border-color: #A92924;
}
}
.template-content {
padding: 30rpx 0;
}
.goods-item {
padding: 18rpx 0;
}
.expire-tip {
padding: 0 20rpx 18rpx;
font-size: 24rpx;
line-height: 36rpx;
color: #A92924;
}
.add-btn {
margin-left: 0;
width: 180rpx;
height: 60rpx;
color: #A92924;
border-color: #A92924;
}
</style>
File diff suppressed because it is too large Load Diff
+683
View File
@@ -0,0 +1,683 @@
<template>
<view class="flex flex-col justify-start items-start">
<text class="text-50">发布我的回收信息</text>
<text class="text-gray">回收信息越完整,成功交易越容易</text>
<view class="layout w-100p m-top-10">
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
<text class="need text-red">*</text>
<view class="lb">信息失效时间:</view>
<view class="vl flex-1 p-right-20" @click="showExpire = true">
<u--input placeholder="请选择" v-model="form.expiredTime" style="pointer-events:none"
fontSize="24rpx"
suffixIcon="arrow-down-fill"
suffixIconStyle="font-size: 10px;color: #d5d5d5"
:disabled="true"
disabledColor="#fff"></u--input>
</view>
</view>
<view class="expire-tip">温馨提示:为保证信息有效性发布最长时限为1年(12个月)到期后需重新发布。</view>
<view class="goods-item half flex align-center flex-wrap w-100p">
<text class="need text-red">*</text>
<view class="lb">物资分类:</view>
<view class="vl flex-1 p-right-20" @click="openPicker">
<u--input
style="pointer-events:none"
placeholder="请选择"
v-model="cateName"
fontSize="24rpx"
suffixIcon="arrow-down-fill"
suffixIconStyle="font-size: 10px;color: #d5d5d5"
:disabled="true"
disabledColor="#fff"
></u--input>
</view>
</view>
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
<el-checkbox label="其他分类" v-model="form.otherCate" class="mx-20"></el-checkbox>
<u--input
placeholder="请选择"
v-model="form.otherCateName"
fontSize="24rpx"
:disabled="!form.otherCate" @change="setOther"
></u--input>
</view>
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
<text class="need text-red">*</text>
<view class="lb">信息标题:</view>
<view class="vl flex-1 p-right-20">
<u--input
placeholder="一句话简介物资,如拍卖直缝钢管200吨等"
v-model="form.title"
fontSize="24rpx"
></u--input>
</view>
</view>
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
<view class="lb">回收方简述:</view>
<view class="vl flex-1 p-right-20">
<u--textarea
placeholder="请详细描述物资信息,描述内容:材料名称、材质......(限300字以内)"
v-model="form.desc"
fontSize="24rpx"
></u--textarea>
</view>
</view>
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
<view class="lb">回收物实景照片:</view>
<view class="vl flex-1 p-right-20">
<u-upload
multiple
:fileList="form.files"
@afterRead="afterRead"
@delete="deletePic"
width="120rpx"
height="120rpx"
></u-upload>
</view>
</view>
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
<text class="need text-red">*</text>
<view class="lb">回收单位所在地:</view>
<view class="vl flex-1 p-right-20" @click="showAddress">
<u--input
style="pointer-events:none"
placeholder="请选择"
v-model="region"
fontSize="24rpx"
suffixIcon="arrow-down-fill"
suffixIconStyle="font-size: 10px;color: #d5d5d5"
:disabled="true"
disabledColor="#fff"
></u--input>
</view>
</view>
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
<text class="need text-red">*</text>
<view class="lb">回收单位地址:</view>
<view class="vl flex-1 p-right-20">
<u--input placeholder="请选择" v-model="form.addressDetail"></u--input>
</view>
</view>
<view class="card-title m-top-30">回收单位信息</view>
<view class="group flex align-center m-top-30">
<view class="lb m-right-20">{{ user.accountType === 2 ? '公司信息' : '个人信息' }} :</view>
<view class="vl flex-1">
<u--input
placeholder="请输入内容"
v-model="form.supplier.companyName"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb m-right-20">{{ user.accountType === 2 ? '公司联系方式' : '个人联系方式' }} :</view>
<view class="vl flex-1">
<u--input
placeholder="请输入内容"
v-model="form.supplier.contract"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb m-right-20">联系人:</view>
<view class="vl flex-1" @click="showContactPicker = true">
<u--input
style="pointer-events:none"
readonly
placeholder="点击选择联系人"
v-model="form.supplier.managerName"
suffixIcon="arrow-right"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb m-right-20">联系方式:</view>
<view class="vl flex-1">
<u--input
disabled
placeholder="请输入内容"
v-model="form.supplier.managerContract"
></u--input>
</view>
</view>
</view>
<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 :value="agree" active-color="#A92924" @change="handleAgreementCheck">我已阅读并同意</el-checkbox>
<span class="text-main pointer font-bold" @click="showAgreement">《金久信旧货交易协议》</span>
</view>
<view class="flex justify-center items-center mt-30 m-a w-100p">
<view class="flex-1 mx-15">
<u-button type="primary" @click="save" plain="">暂存</u-button>
</view>
<view class="flex-1 mx-15">
<u-button type="primary" :disabled="checked === '否' || !agree" @click="publish">立即发布</u-button>
</view>
</view>
<u-picker v-if="showPicker" :show="showPicker" :columns="[cateData, cateData[cateDataIndex].children]"
keyName="name" @change="changeCate"
@cancel="showPicker = false" @close="showPicker = false" closeOnClickOverlay
@confirm="confirmCate"></u-picker>
<AddressSelect ref="AddressSelect" @confirm="regionConfirm"/>
<u-picker :show="showUnit" :columns="[unitList]"
@cancel="showUnit = false" @close="showUnit = false" closeOnClickOverlay
@confirm="confirmUnit"></u-picker>
<u-datetime-picker :show="showExpire" v-model="expireTime" mode="date" @cancel="showExpire = false"
:minDate="minDate" :maxDate="maxDate"
@confirm="handConfirmDate"></u-datetime-picker>
<u-picker :show="showContactPicker" :columns="[contactList]" keyName="name"
@cancel="showContactPicker = false" @close="showContactPicker = false" closeOnClickOverlay
@confirm="confirmContact"></u-picker>
<agreement ref="agreementRef" @read-complete="onAgreementReadComplete"/>
</view>
</template>
<script>
import AddressSelect from "@/components/AddressSelect.vue";
import dayjs from "dayjs";
import md5 from "js-md5";
import Agreement from "@/pages/junk/agreement.vue";
export default {
name: "type_0",
components: {Agreement, AddressSelect},
props: {
urgentAmount: {
type: Number,
default: 10
},
remainOldNum: {
type: Number,
default: 0
},
agreement: {
type: String,
default: ''
},
commonContractUrl: {
type: String,
default: ''
},
contactList: {
type: Array,
default: ''
},
user: {
type: Object,
default: null
},
},
data() {
return {
pickerOptions: {
disabledDate(time) {
return time.getTime() < Date.now();
},
},
agree: false,
agreementReadCompleted: false,
unitList: ['吨', '万吨'],
allChildCate: [],
cateData: [],
cateDataIndex: 0,
form: {
type: 3,
category: 0,
files: [],
otherCate: false,
otherCateName: '',
title: '',
desc: '',
addressRegion: {},
addressDetail: '',
startNum: '',
unit: '吨',
startAmount: '',
expiredTime: '',
offerAddressRegion: {},
offerAddressNoLimit: false,
payMethod: '预付',
prePayRate: '',
otherPayMethodDesc: '',
signMethod: 0,
buyer: {
companyName: '',
contract: '',
personalName: '',
personalContract: '',
managerName: '',
managerContract: '',
},
supplier: {
companyName: '',
contract: '',
personalName: '',
personalContract: '',
managerName: '',
managerContract: '',
},
contractAttachment: [],
isUrgent: false,
supplementary: ''
},
provinceIndex: null,
cityIndex: null,
areaIndex: null,
offerProvinceIndex: null,
offerCityIndex: null,
offerAreaIndex: null,
checked: '否',
showPicker: false,
cateName: '',
region: '',
showUnit: false,
showExpire: false,
expireTime: '',
showContactPicker: false,
minDate: Number(new Date()),
maxDate: dayjs().add(1, 'year').valueOf()
}
},
methods: {
showAddress() {
this.$refs.AddressSelect.open(this.form.addressRegion);
},
regionConfirm({province, city, area}) {
this.form.addressRegion = {province, city, area}
this.region = `${province.name} ${city.name} ${area.name}`
},
async publish() {
if (this.remainOldNum === 0) {
uni.showModal({
title: '提示',
content: '您的旧货发布次数已用完,是否立即购买?',
success: async res => {
if (res.confirm) {
const {data} = await vk.callFunction({
url: 'client/old/kh/buyNum',
})
vk.navigateTo({
url: `/pages/shop/pay?id=${data}`
})
}
}
})
return
}
if (!this.form.addressRegion) 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'
})
if (dayjs(this.form.expiredTime).valueOf() > this.maxDate) return this.$message({
message: "为保证信息有效性发布最长时限为1年(12个月)",
type: 'warning'
})
this.form.files = this.form.files.map(i => i.url)
const res = await vk.callFunction({
url: 'client/old/kh/add',
data: this.form
})
localStorage.removeItem("old_3")
this.$message({
message: "您的信息已经提交,等待管理员审核,请您耐心等待!",
type: 'success'
})
setTimeout(() => {
if (this.form.isUrgent) {
vk.navigateTo({
url: `/pages/shop/pay?id=${res.data}`
})
} else {
vk.redirectTo({url: '/pages/junk/junk'});
}
}, 1500)
},
handleAgreementCheck(value) {
if (!value) {
this.agree = false
return
}
if (!this.agreementReadCompleted) {
this.agree = false
uni.showToast({
title: '请先查看《金久信旧货交易协议》5秒以上',
icon: 'none'
})
return
}
this.agree = true
},
onAgreementReadComplete() {
this.agreementReadCompleted = true
},
showAgreement() {
// this.$confirm(this.agreement, '金久信旧货交易协议', {
// cancelButtonText: '关闭',
// showConfirmButton: false,
// dangerouslyUseHTMLString: true,
// })
this.$refs.agreementRef.open()
},
openDownload() {
// window.open(this.commonContractUrl)
window.location.href = this.commonContractUrl
},
navTo() {
vk.navigateTo({url: '/pages/user/user?menu=business-contact'})
},
confirmCate({value}) {
this.form.category = value.map(i => i.name)
this.cateName = `${value[0].name}${value[1].name}`
this.showPicker = false
},
confirmUnit({value}) {
this.form.unit = value
this.showUnit = false
},
afterRead({file}) {
file.forEach(item => {
const suffix = item.name.split('.').pop()
uniCloud.uploadFile({
filePath: item.url,
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + md5(item.name + Date.now().toString()) + `.${suffix}`,
success: ({fileID}) => {
uniCloud.getTempFileURL({
fileList: [fileID]
}).then(res => {
this.form.files.push({url: res.fileList[0].tempFileURL})
})
}
})
})
},
deletePic({index}) {
this.form.files.splice(index, 1)
},
handConfirmDate({value}) {
this.form.expiredTime = dayjs(value).format('YYYY-MM-DD')
this.showExpire = false
},
confirmContact({value}) {
this.form.supplier.managerName = value[0].name
this.form.supplier.managerContract = value[0].phone
this.showContactPicker = false
},
changeCate({columnIndex, index}) {
if (columnIndex === 0) {
this.cateDataIndex = index
}
},
save() {
localStorage.setItem("old_3", JSON.stringify({
form: this.form,
cateName: this.cateName,
region: this.region,
}))
this.$message({
message: "已保存",
type: 'success'
})
},
setOther(){
this.cateName = ''
},
openPicker(){
if(this.form.otherCate) return
this.showPicker = true
}
},
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 (this.user.accountType === 2) {
this.form.supplier.companyName = this.user.company.companyName
this.form.supplier.contract = this.user.company.mobile
} else {
this.form.supplier.companyName = this.user.person.personName
this.form.supplier.contract = this.user.person.mobile
}
this.form.supplier.contract = this.user.businessCard.companyMobile
if (!!localStorage.getItem("old_3")) {
this.$confirm('您有一份暂存数据,是否恢复?', '提示', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
const savedData = JSON.parse(localStorage.getItem("old_3"))
this.form = savedData.form
this.cateName = savedData.cateName
this.region = savedData.region
})
}
}
}
</script>
<style lang="scss">
page {
background: #ffffff;
}
.layout-header {
margin: 0rpx 30rpx;
padding: 30rpx 0;
border-bottom: 1px solid rgba(169, 41, 36, 0.34);
.big {
font-size: 32rpx;
line-height: 48rpx;
color: #000000;
text-align: center;
}
.small {
font-size: 24rpx;
line-height: 40rpx;
color: #9a9a9a;
text-align: center;
}
.ptb {
margin-right: 20rpx;
padding: 6rpx 14rpx;
font-size: 24rpx;
line-height: 40rpx;
color: #333333;
border: 1px solid #f2f2f2;
&:last-child {
margin-right: 0;
}
}
.active {
color: #ffffff;
border-color: #A92924;
background: #A92924;
}
}
.public-btn {
width: 95%;
margin-top: 60rpx;
color: #ffffff;
background: #A92924;
}
.layout-publish {
padding: 20rpx 30rpx;
}
.tag-title {
font-size: 26rpx;
line-height: 40rpx;
color: #000000;
.limit {
font-size: 24rpx;
color: #999999;
}
}
.tag-box {
padding: 20rpx 0;
.item {
padding: 6rpx 10rpx;
font-size: 24rpx;
line-height: 32rpx;
color: #555555;
}
.active {
color: #A92924;
}
}
.lb, .fix {
position: relative;
font-size: 26rpx;
line-height: 40rpx;
color: #666666;
}
.lbx {
font-size: 24rpx;
color: #999999;
}
.download {
padding: 8rpx 20rpx;
font-size: 24rpx;
line-height: 36rpx;
color: #A92924;
border: 1px solid #A92924;
}
.need::before {
position: absolute;
left: -16rpx;
top: 50%;
z-index: 9;
margin-top: -12rpx;
content: '*';
color: #A92924;
font-size: 32rpx;
line-height: 1;
}
.card-title {
position: relative;
padding-left: 20rpx;
font-size: 28rpx;
font-weight: 600;
line-height: 48rpx;
color: #A92924;
&:before {
position: absolute;
left: 0;
top: 50%;
z-index: 9;
margin-top: -14rpx;
content: '';
width: 6rpx;
height: 28rpx;
background: #A92924;
}
}
.template-tab {
.ttb {
margin-right: 30rpx;
padding: 6rpx 20rpx;
font-size: 28rpx;
line-height: 40rpx;
color: #333333;
border: 1px solid #f2f2f2;
}
.active {
color: #A92924;
border-color: #A92924;
}
}
.template-content {
padding: 30rpx 0;
}
.goods-item {
padding: 18rpx 0;
}
.expire-tip {
padding: 0 20rpx 18rpx;
font-size: 24rpx;
line-height: 36rpx;
color: #A92924;
}
.add-btn {
margin-left: 0;
width: 180rpx;
height: 60rpx;
color: #A92924;
border-color: #A92924;
}
</style>
+321
View File
@@ -0,0 +1,321 @@
<template> <!-- 忘记密码 -->
<view class="wrap">
<view class="login-img">
<image class="full" src="/static/img/login.png" mode=""></image>
</view>
<view class="layout-login bg-white">
<view class="login-title">找回密码</view>
<view class="login-form">
<view class="m-top-30">
<u--input
v-model="form1.mobile"
placeholder="请输入手机号"
prefixIcon="account"
prefixIconStyle="font-size: 26px;color: #909399"
></u--input>
</view>
<view class="m-top-30">
<u--input
v-model="form1.code"
placeholder="请输入短信验证码"
prefixIcon="email"
prefixIconStyle="font-size: 26px;color: #909399"
>
<template slot="suffix">
<u-code
ref="uCode"
@change="codeChange"
seconds="20"
changeText="X秒重新获取"
></u-code>
<u-button
@tap="sendSmsCode"
:text="smsTips"
type="success"
size="mini"
color="#db1c2c"
></u-button>
</template>
</u--input>
</view>
<view class="m-top-30">
<u--input
v-model="form1.password"
placeholder="设置登录密码"
prefixIcon="lock"
prefixIconStyle="font-size: 26px;color: #909399"
></u--input>
</view>
<view class="m-top-30">
<u--input
v-model="form1.repassword"
placeholder="确认登录密码"
prefixIcon="lock"
prefixIconStyle="font-size: 26px;color: #909399"
></u--input>
</view>
<view class="m-top-30">
<u-button color="#db1c2c" text="立即找回" @click="handleSubmit"></u-button>
</view>
</view>
</view>
</view>
</template>
<script>
let timer = null
let timeS = 60
export default {
data() {
return {
roleIndex: 1,
tabIndex: 1,
tips: '',
checked: false,
smsTips: '获取验证码',
form1: {
mobile: '',
password: '',
repassword: '',
code: '',
username: ''
},
}
},
methods: {
handRole(index) {
this.roleIndex = index
},
handTab(index) {
this.tabIndex = index
},
codeChange(text) {
this.tips = text;
},
getCode() {
if (this.$refs.uCode.canGetCode) {
// 模拟向后端请求验证码
uni.showLoading({
title: '正在获取验证码'
})
setTimeout(() => {
uni.hideLoading();
// 这里此提示会被this.start()方法中的提示覆盖
uni.$u.toast('验证码已发送');
// 通知验证码组件内部开始倒计时
this.$refs.uCode.start();
}, 2000);
} else {
uni.$u.toast('倒计时结束后再发送');
}
},
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
},
},
onLoad() {
},
onUnload() {
if (timer != null) {
clearInterval(timer)
timer = null
}
}
}
</script>
<style lang="scss">
page {
background: #e8f5fe;
}
.login-img {
width: 100%;
height: 330rpx;
}
.layout-login {
margin: 20rpx 30rpx;
padding: 30rpx 30rpx 50rpx;
.login-title {
font-size: 44rpx;
font-weight: 500;
line-height: 60rpx;
text-align: center;
color: #101010;
}
.login-type {
font-size: 24rpx;
line-height: 36rpx;
color: #8e8e8e;
}
.login-role .role {
position: relative;
margin: 0 50rpx;
padding-left: 60rpx;
font-size: 30rpx;
line-height: 40rpx;
color: #666666;
&:before {
position: absolute;
left: 0;
top: 50%;
z-index: 9;
content: '';
transform: translateY(-50%);
width: 36rpx;
height: 36rpx;
padding: 10rpx;
border: 1px solid #f2f2f2;
border-radius: 50%;
box-sizing: border-box;
background-clip: content-box;
background-color: #ffffff;
}
}
.login-role .active {
color: #A92924;
&:before {
border-color: #A92924;
background-color: #A92924;
}
}
.fg {
font-size: 28rpx;
line-height: 40rpx;
color: #666666;
}
.xie {
font-size: 26rpx;
line-height: 40rpx;
color: blue;
}
}
</style>
+251
View File
@@ -0,0 +1,251 @@
<template> <!-- 登录 -->
<view class="wrap pos-r h-100 flex flex-col justify-start items-center" style="background-color: #AB0011">
<u-image src="/static/img/login.jpg" width="750rpx" height="470rpx" mode=""></u-image>
<view class="layout-login card" style="z-index: 10">
<view class="login-title">会员登录</view>
<view class="login-type flex justify-between m-top-30">
<view :class="['type', {red : tabIndex == 1}]" @click="handTab(1)">账号密码登录</view>
<!-- <view :class="['type', {red : tabIndex == 2}]" @click="handTab(2)">短信验证登录</view>-->
</view>
<view class="login-form">
<view class="m-top-30">
<u--input
v-model="form.username"
placeholder="请输入手机号"
prefixIcon="account"
prefixIconStyle="font-size: 26px;color: #909399"
></u--input>
</view>
<view class="m-top-30" v-if="tabIndex == 1">
<u--input
v-model="form.password"
placeholder="请输入密码"
prefixIcon="lock"
type="password"
prefixIconStyle="font-size: 26px;color: #909399"
></u--input>
</view>
<view class="m-top-30" v-if="tabIndex == 2">
<u--input
v-model="form.smsCode"
placeholder="请输入验证码"
prefixIcon="email"
prefixIconStyle="font-size: 26px;color: #909399"
>
<template slot="suffix">
<u-code
ref="uCode"
@change="codeChange"
seconds="20"
changeText="X秒重新获取"
></u-code>
<u-button
@tap="getCode"
:text="tips"
type="success"
size="mini"
color="#db1c2c"
></u-button>
</template>
</u--input>
</view>
<!-- <view class="m-top-30">-->
<!-- <drag-verify ref="dragVerify" :width="280" :isPassing.sync="isPassing"-->
<!-- text="请按住滑块拖动" successText="验证通过"-->
<!-- handlerIcon="el-icon-d-arrow-right" successIcon="el-icon-circle-check">-->
<!-- <i v-show="!isPassing" slot="textBefore" class="el-icon-lock"></i>-->
<!-- </drag-verify>-->
<!-- </view>-->
<view class="m-top-30">
<u-button color="#db1c2c" text="立即登录" @click="handleSubmit"></u-button>
</view>
<view class="flex justify-between m-top-20">
<view class="fg" @click="registerLink">免费注册新账号</view>
<view class="fg" @click="forgetLink">找回密码</view>
</view>
<view class="m-top-30 p-top-20">
<u-divider text="第三方登录"></u-divider>
</view>
<view class="flex justify-center align-center">
<u-icon name="weixin-circle-fill" color="#05BC04" size="38" @click="wechatLogin"></u-icon>
<!-- <view style="width: 50rpx;"></view>-->
<!-- <u-icon name="qq-circle-fill" color="#2286EA" size="38"></u-icon>-->
</view>
</view>
</view>
</view>
</template>
<script>
import dragVerify from 'vue-drag-verify2'
export default {
components: {dragVerify},
data() {
return {
tabIndex: 1,
tips: '',
isPassing: false,
form: {
mobile: '',
password: '',
smsCode: '',
username: ''
},
}
},
methods: {
registerLink() {
uni.$u.route('/pages/login/register')
},
forgetLink() {
uni.$u.route('/pages/login/forget')
},
handTab(index) {
this.tabIndex = index
},
codeChange(text) {
this.tips = text;
},
getCode() {
if (this.$refs.uCode.canGetCode) {
// 模拟向后端请求验证码
uni.showLoading({
title: '正在获取验证码'
})
setTimeout(() => {
uni.hideLoading();
// 这里此提示会被this.start()方法中的提示覆盖
uni.$u.toast('验证码已发送');
// 通知验证码组件内部开始倒计时
this.$refs.uCode.start();
}, 2000);
} else {
uni.$u.toast('倒计时结束后再发送');
}
},
handleSubmit() {
// if (!this.isPassing) return this.$message.error('请先完成滑块验证')
let data = {}
const {
username,
password,
mobile,
smsCode
} = this.form
if (this.tabIndex === 1) {
data = {
username,
password,
}
vk.userCenter.login({
loading: false,
data,
success: (data) => {
this.loginSuccess()
}
})
} else {
vk.userCenter.loginBySms({
loading: false,
data: {
mobile: mobile,
code: smsCode,
},
success: (data) => {
this.loginSuccess()
}
}).catch(() => {
// this.$refs.dragVerify.reset()
})
}
},
loginSuccess() {
uni.reLaunch({
url: '/'
})
},
wechatLogin(){
const redirect_uri = 'https://m.jinjiuxinzg.cn/pages/login/wechat'
const state = `jjx_2`
let url = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx950c88b951cadd52'
url += '&redirect_uri=' + encodeURIComponent(redirect_uri)
url += `&response_type=code&scope=snsapi_userinfo&state=${state}#wechat_redirect`
window.location.href = url
}
},
onLoad() {
},
}
</script>
<style lang="scss">
.login-img {
width: 100%;
height: 330rpx;
}
.layout-login {
margin: 40rpx 30rpx;
padding: 30rpx 30rpx 50rpx;
width: 80%;
.login-title {
font-size: 44rpx;
font-weight: 500;
line-height: 60rpx;
text-align: center;
color: #101010;
}
.login-type {
font-size: 24rpx;
line-height: 36rpx;
color: #8e8e8e;
}
.login-role .role {
position: relative;
margin: 0 50rpx;
padding-left: 60rpx;
font-size: 30rpx;
line-height: 40rpx;
color: #666666;
&:before {
position: absolute;
left: 0;
top: 50%;
z-index: 9;
content: '';
transform: translateY(-50%);
width: 36rpx;
height: 36rpx;
padding: 10rpx;
border: 1px solid #f2f2f2;
border-radius: 50%;
box-sizing: border-box;
background-clip: content-box;
background-color: #ffffff;
}
}
.login-role .active {
color: #A92924;
&:before {
border-color: #A92924;
background-color: #A92924;
}
}
.fg {
font-size: 28rpx;
line-height: 40rpx;
color: #666666;
}
}
</style>
+438
View File
@@ -0,0 +1,438 @@
<template> <!-- 注册 -->
<view class="wrap pos-r h-100 flex flex-col justify-start items-center" style="background-color: #AB0011">
<u-image :src="registerBgImage || '/static/img/login.jpg'" width="750rpx" height="470rpx" mode=""></u-image>
<view class="layout-login card" style="z-index: 10">
<view class="login-title">免费注册会员</view>
<view class="login-role flex justify-center m-top-20">
<view :class="['role', {active : form1.accountType === 2}]" @click="form1.accountType = 2">企业用户
</view>
<view :class="['role', {active : form1.accountType === 1}]" @click="form1.accountType = 1">个人用户
</view>
</view>
<view class="login-form">
<view class="m-top-30">
<view class="m-top-30" v-if="form1.accountType === 2">
<u--input
v-model="form1.company.companyName"
placeholder="请输入公司名称"
prefixIcon="integral"
prefixIconStyle="font-size: 26px;color: #909399"
></u--input>
</view>
<view class="m-top-30" v-if="form1.accountType === 1">
<u--input
v-model="form1.person.personName"
placeholder="请输入姓名"
prefixIcon="integral"
prefixIconStyle="font-size: 26px;color: #909399"
></u--input>
</view>
</view>
<view class="m-top-30">
<u--input
placeholder="请输入邀请码,选填"
prefixIcon="coupon"
prefixIconStyle="font-size: 26px;color: #909399"
></u--input>
</view>
<view class="m-top-30">
<u--input
v-model="form1.password"
type="password"
placeholder="设置登录密码"
prefixIcon="lock"
prefixIconStyle="font-size: 26px;color: #909399"
></u--input>
</view>
<view class="tips mb-15 text-gray">6~20位的数字、字母组合</view>
<view class="m-top-30">
<u--input
v-model="form1.repassword"
type="password"
placeholder="确认登录密码"
prefixIcon="lock"
prefixIconStyle="font-size: 26px;color: #909399"
></u--input>
</view>
<view class="tips mb-15 text-gray">6~20位的数字、字母组合</view>
<view class="m-top-30">
<u--input
v-model="form1.mobile"
placeholder="请输入手机号"
prefixIcon="account"
prefixIconStyle="font-size: 26px;color: #909399"
></u--input>
</view>
<view class="m-top-30">
<u--input
v-model="form1.smsCode"
placeholder="请输入短信验证码"
prefixIcon="email"
prefixIconStyle="font-size: 26px;color: #909399"
>
<template slot="suffix">
<u-code
ref="uCode"
@change="codeChange"
seconds="20"
:changeText="smsTips"
></u-code>
<u-button
@tap="sendSmsCode"
type="success"
size="mini"
color="#db1c2c"
>{{ smsTips }}
</u-button>
</template>
</u--input>
</view>
<view class="check-box flex justify-start m-top-30">
<u-checkbox-group v-model="checked" placement="row" @change="changeCheck" :disabled="!hasRead">
<u-checkbox activeColor="red" label="阅读并同意" name="agree"></u-checkbox>
</u-checkbox-group>
<text class="xie" @click="getInfo">《用户服务协议和隐私政策》</text>
</view>
<view class="m-top-30">
<u-button color="#db1c2c" text="立即免费登录" @click="handleSubmit"></u-button>
</view>
<view class="flex justify-center m-top-20">
<view class="fg">已有账号,</view>
<view class="fg red" @click="loginLink">去登录</view>
</view>
</view>
</view>
<u-popup mode="center" :show="showRule" closeable close-on-click-overlay @close="showRule = false" round="15"
:customStyle="{width: '90%'}">
<view class="p-30 rule">
<view v-html="info"></view>
<u-button :disabled="readCountDown > 0" type="primary" @click="showRule = false;hasRead = true">
确定{{ readCountDown > 0 ? `${readCountDown}秒` : '' }}
</u-button>
</view>
</u-popup>
</view>
</template>
<script>
export default {
data() {
return {
roleIndex: 1,
tabIndex: 1,
tips: '',
checked: [],
timer: null,
timeS: 60,
smsTips: '获取验证码',
form1: {
accountType: 2, // business 企业 、、personal个人
mobile: '',
smsCode: '',
password: '',
repassword: '',
inviteCode: '',
person: {
personName: ''
},
company: {
companyName: ''
}
},
hasRead: false,
showRule: false,
info: null,
registerBgImage: '',
readCountDown: 10,
readInterval: null
}
},
onLoad() {
this.loadSiteConfig()
},
methods: {
async loadSiteConfig() {
try {
const {data = {}} = await vk.callFunction({
url: 'client/site_config/pub/detail',
loading: false
})
this.registerBgImage = data.registerH5BgImage || ''
} catch (e) {
this.registerBgImage = ''
}
},
changeCheck(e) {
console.log(e)
},
loginLink() {
uni.$u.route('/pages/login/login')
},
handTab(index) {
this.tabIndex = index
},
codeChange(text) {
this.tips = text;
},
sendSmsCode() {
if (this.timer != null) return
if (!this.form1.mobile) return this.$message.error('请输入手机号');
vk.userCenter.sendSmsCode({
loading: false,
data: {
mobile: this.form1.mobile,
type: 'register',
},
success: (data) => {
this.$message({
message: "验证码已发送",
type: 'success'
})
this.timeS = 60
this.timer = setInterval(() => {
console.log(this.smsTips)
this.timeS--
if (this.timeS <= 0) {
this.smsTips = "重新发送"
this.stopTimer()
} else {
this.smsTips = this.timeS + "秒"
}
}, 1000)
}
});
},
handleSubmit() {
if (!this.checked.includes('agree')) {
this.$message({
message: '请先阅读并同意《金久信注册协议》',
type: 'warning'
})
} else {
if (this.testForm()) {
const {
mobile, // 手机号
smsCode, // 短信验证码4-8位
password, // 密码 6-20位
repassword, // 重复输入密码
inviteCode, // 邀请码
accountType,
company,
person
} = this.form1
vk.userCenter.loginBySms({
data: {
type: 'register',
mobile: mobile,
code: smsCode,
password,
inviteCode,
accountType,
company,
person
},
success: (data) => {
uni.reLaunch({
url: '/'
})
}
});
}
}
},
testForm() {
const {
mobile, // 手机号
smsCode, // 短信验证码4-8位
password, // 密码 6-20位
repassword, // 重复输入密码
inviteCode, // 邀请码
accountType,
company,
person
} = 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 (parseInt(accountType) === 1 && !person.personName) {
this.$message({
message: '请输入姓名',
type: 'error'
})
return false
}
if (parseInt(accountType) === 2 && !company.companyName) {
this.$message({
message: '请输入公司名称',
type: 'error'
})
return false
}
return true
},
stopTimer() {
if (this.timer != null) {
clearInterval(this.timer)
this.timer = null
}
},
async getInfo() {
const {content} = await vk.callFunction({
url: `client/otherArticle/list/pub/getDetail`,
data: {id: '65792dc8652341901b34a0bc'}
});
this.info = content
this.showRule = true
this.readCountDown = 10
this.readInterval = setInterval(() => {
this.readCountDown--
if (this.readCountDown <= 0) {
clearInterval(this.readInterval)
}
}, 1000)
},
clickAgree(check) {
if (check && !this.hasRead) {
this.agree = false
return this.$message.error('请先阅读并同意《金久信注册协议》')
}
}
},
}
</script>
<style lang="scss">
page {
background: #e8f5fe;
}
.login-img {
width: 100%;
height: 330rpx;
}
.layout-login {
margin: 20rpx 30rpx;
padding: 30rpx;
.login-title {
font-size: 44rpx;
font-weight: 500;
line-height: 60rpx;
text-align: center;
color: #101010;
}
.login-type {
font-size: 24rpx;
line-height: 36rpx;
color: #8e8e8e;
}
.login-role .role {
position: relative;
margin: 0 50rpx;
padding-left: 60rpx;
font-size: 30rpx;
line-height: 40rpx;
color: #666666;
&:before {
position: absolute;
left: 0;
top: 50%;
z-index: 9;
content: '';
transform: translateY(-50%);
width: 36rpx;
height: 36rpx;
padding: 10rpx;
border: 1px solid #f2f2f2;
border-radius: 50%;
box-sizing: border-box;
background-clip: content-box;
background-color: #ffffff;
}
}
.login-role .active {
color: #A92924;
&:before {
border-color: #A92924;
background-color: #A92924;
}
}
.fg {
font-size: 28rpx;
line-height: 40rpx;
color: #666666;
}
.xie {
font-size: 26rpx;
line-height: 40rpx;
color: blue;
}
}
.rule {
height: 90vh;
margin: 20rpx;
overflow-y: scroll;
}
</style>
+427
View File
@@ -0,0 +1,427 @@
<template> <!-- 注册 -->
<view class="wrap pos-r h-100 flex flex-col justify-start items-center" style="background-color: #AB0011">
<u-image src="/static/img/login.jpg" width="750rpx" height="470rpx" mode=""></u-image>
<view class="layout-login card" style="z-index: 10">
<view class="login-title">手机号绑定</view>
<template v-if="showBind">
<view class="login-role flex justify-center m-top-20">
<view :class="['role', {active : form1.accountType === 2}]" @click="form1.accountType = 2">企业用户
</view>
<view :class="['role', {active : form1.accountType === 1}]" @click="form1.accountType = 1">个人用户
</view>
</view>
<view class="login-form">
<view class="m-top-30">
<u--input
v-model="form1.mobile"
placeholder="请输入手机号"
prefixIcon="account"
prefixIconStyle="font-size: 26px;color: #909399"
></u--input>
</view>
<view class="m-top-30">
<u--input
v-model="form1.password"
type="password"
placeholder="设置登录密码"
prefixIcon="lock"
prefixIconStyle="font-size: 26px;color: #909399"
></u--input>
</view>
<view class="m-top-30">
<u--input
v-model="form1.repassword"
type="password"
placeholder="确认登录密码"
prefixIcon="lock"
prefixIconStyle="font-size: 26px;color: #909399"
></u--input>
</view>
<view class="m-top-30" v-if="form1.accountType === 2">
<u--input
v-model="form1.company.companyName"
placeholder="请输入公司名称"
prefixIcon="integral"
prefixIconStyle="font-size: 26px;color: #909399"
></u--input>
</view>
<view class="m-top-30" v-if="form1.accountType === 1">
<u--input
v-model="form1.person.personName"
placeholder="请输入姓名"
prefixIcon="integral"
prefixIconStyle="font-size: 26px;color: #909399"
></u--input>
</view>
<view class="m-top-30">
<u--input
placeholder="请输入邀请码,选填"
prefixIcon="coupon"
prefixIconStyle="font-size: 26px;color: #909399"
></u--input>
</view>
<view class="m-top-30">
<u--input
v-model="form1.smsCode"
placeholder="请输入短信验证码"
prefixIcon="email"
prefixIconStyle="font-size: 26px;color: #909399"
>
<template slot="suffix">
<u-code
ref="uCode"
@change="codeChange"
seconds="20"
:changeText="smsTips"
></u-code>
<u-button
@tap="sendSmsCode"
type="success"
size="mini"
color="#db1c2c"
>{{ smsTips }}
</u-button>
</template>
</u--input>
</view>
<view class="check-box flex justify-start m-top-30">
<u-checkbox-group v-model="checked" placement="row" @change="changeCheck">
<u-checkbox activeColor="red" label="阅读并同意" name="agree"></u-checkbox>
</u-checkbox-group>
<text class="xie" @click="getInfo">《金久信注册协议》</text>
</view>
<view class="m-top-30">
<u-button color="#db1c2c" text="立即免费登录" @click="handleSubmit"></u-button>
</view>
<view class="flex justify-center m-top-20">
<view class="fg">已有账号,</view>
<view class="fg red" @click="loginLink">去登录</view>
</view>
</view>
</template>
</view>
<u-popup mode="center" :show="showRule" closeable close-on-click-overlay @close="showRule = false" round="15"
:customStyle="{width: '90%'}">
<view class="p-30 rule">
<view v-html="info"></view>
</view>
</u-popup>
</view>
</template>
<script>
export default {
data() {
return {
roleIndex: 1,
tabIndex: 1,
tips: '',
checked: [],
timer: null,
timeS: 60,
smsTips: '获取验证码',
form1: {
accountType: 2, // business 企业 、、personal个人
mobile: '',
smsCode: '',
password: '',
repassword: '',
inviteCode: '',
person: {
personName: ''
},
company: {
companyName: ''
}
},
hasRead: false,
showRule: false,
info: null,
code: null,
uid: null,
showBind: false,
}
},
methods: {
changeCheck(e) {
console.log(e)
},
loginLink() {
uni.$u.route('/pages/login/login')
},
handTab(index) {
this.tabIndex = index
},
codeChange(text) {
this.tips = text;
},
sendSmsCode() {
if (this.timer != null) return
if (!this.form1.mobile) return this.$message.error('请输入手机号');
vk.userCenter.sendSmsCode({
loading: false,
data: {
mobile: this.form1.mobile,
type: 'bind',
},
success: (data) => {
this.$message({
message: "验证码已发送",
type: 'success'
})
this.timeS = 60
this.timer = setInterval(() => {
console.log(this.smsTips)
this.timeS--
if (this.timeS <= 0) {
this.smsTips = "重新发送"
this.stopTimer()
} else {
this.smsTips = this.timeS + "秒"
}
}, 1000)
}
});
},
async handleSubmit() {
if (!this.checked.includes('agree')) {
this.$message({
message: '请先阅读并同意《金久信注册协议》',
type: 'warning'
})
} else {
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/login/login'})
}
})
}
})
}
}
},
testForm() {
const {
mobile, // 手机号
smsCode, // 短信验证码4-8位
password, // 密码 6-20位
repassword, // 重复输入密码
inviteCode, // 邀请码
accountType,
company,
person
} = 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 (parseInt(accountType) === 1 && !person.personName) {
this.$message({
message: '请输入姓名',
type: 'error'
})
return false
}
if (parseInt(accountType) === 2 && !company.companyName) {
this.$message({
message: '请输入公司名称',
type: 'error'
})
return false
}
return true
},
stopTimer() {
if (this.timer != null) {
clearInterval(this.timer)
this.timer = null
}
},
async getInfo() {
const {content} = await vk.callFunction({
url: `client/otherArticle/list/pub/getDetail`,
data: {id: '65792dc8652341901b34a0bc'}
});
this.info = content
this.showRule = true
this.readCountDown = 10
this.readInterval = setInterval(() => {
this.readCountDown--
if (this.readCountDown <= 0) {
clearInterval(this.readInterval)
}
}, 1000)
},
clickAgree(check) {
if (check && !this.hasRead) {
this.agree = false
return this.$message.error('请先阅读并同意《金久信注册协议》')
}
},
loginSuccess() {
uni.reLaunch({url: '/'})
},
},
async onLoad(options) {
if (options.state && options.state.includes('jjx')) {
this.form1.accountType = parseInt(options.state.split('_')[1])
this.code = options.code
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,
wap: true
},
})
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()
}
}
</script>
<style lang="scss">
.login-img {
width: 100%;
height: 330rpx;
}
.layout-login {
margin: 40rpx 30rpx;
padding: 30rpx 30rpx 50rpx;
width: 80%;
.login-title {
font-size: 44rpx;
font-weight: 500;
line-height: 60rpx;
text-align: center;
color: #101010;
}
.login-type {
font-size: 24rpx;
line-height: 36rpx;
color: #8e8e8e;
}
.login-role .role {
position: relative;
margin: 0 50rpx;
padding-left: 60rpx;
font-size: 30rpx;
line-height: 40rpx;
color: #666666;
&:before {
position: absolute;
left: 0;
top: 50%;
z-index: 9;
content: '';
transform: translateY(-50%);
width: 36rpx;
height: 36rpx;
padding: 10rpx;
border: 1px solid #f2f2f2;
border-radius: 50%;
box-sizing: border-box;
background-clip: content-box;
background-color: #ffffff;
}
}
.login-role .active {
color: #A92924;
&:before {
border-color: #A92924;
background-color: #A92924;
}
}
.fg {
font-size: 28rpx;
line-height: 40rpx;
color: #666666;
}
}
</style>
+295
View File
@@ -0,0 +1,295 @@
<template>
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uititle title="报价单"></uititle>
</u-sticky>
<quote-remain-num v-if="reloaded && sheet" :amount="sheet.quoteAmount" type="enquiry" :id="enquiryId"/>
<view class="layout layout-title m-top-20">填写报价信息</view>
<view class="layout layout-publish m-top-20 bg-white">
<view class="card-title m-top-30">报价信息</view>
<view class="group flex align-center m-top-30">
<view class="lb need m-right-20 w-25p">货款总价:</view>
<view class="vl flex-1">
<u--input
@blur="formatter"
placeholder="请输入货款总价"
border="surround"
v-model="formData.totalPrice"
suffixIcon="元"
suffixIconStyle="font-size: 24rpx;color: #909399"
></u--input>
</view>
</view>
<view class="group flex items-start m-top-30">
<view class="lb m-right-20 w-25p mt-20">报价单详情:</view>
<view class="vl flex-1">
<u-textarea
placeholder="请输入报价单详情"
border="surround"
v-model="formData.remark"
suffixIconStyle="font-size: 24rpx;color: #909399"
></u-textarea>
</view>
</view>
<view class="group flex items-start m-top-30" v-if="sheet.payMethod !== 1">
<view class="lb m-right-20 w-25p mt-20">供应商合同补充条款:</view>
<view class="vl flex-1">
<u-textarea
placeholder="如:完全符合采购标准或描述差异部分或其他说明。"
border="surround"
v-model="formData.supplierExt"
suffixIconStyle="font-size: 24rpx;color: #909399"
></u-textarea>
</view>
</view>
<view class="card-title m-top-30 need">附件信息</view>
<view class="group m-top-20">
<!-- <view class="lb m-right-20">附件内容:</view>-->
<!-- <view class="flex justify-between align-center m-top-20">-->
<!-- <view class="lbx flex-1">上传自有报价单图片或文档,支持jpg/png/word/excel。</view>-->
<!-- <view class="download">报价单样板下载</view>-->
<!-- </view>-->
<view class="m-top-30">
<u-upload
:fileList="formData.files"
@afterRead="afterRead"
@delete="deletePic"
accept="file"
:maxCount="10"
multiple
:previewImage="false"
>
<view class="w-100p">
<view>
<u-button size="mini" type="primary">点击上传</u-button>
</view>
<view class="mt-10 flex justify-between items-center w-100p" @click="delFiles(index)"
v-for="(item, index) in fileNameList" :key="index">
<text>{{ item }}</text>
<u-icon name="trash"/>
</view>
</view>
</u-upload>
</view>
</view>
</view>
<u-button class="public-btn m-top-30" text="提交报价" @click="submit"></u-button>
</view>
</template>
<script>
import uititle from '@/components/common/title'
import dayjs from "dayjs";
import QuoteRemainNum from "@/components/quote-remain-num/quote-remain-num.vue";
import md5 from "js-md5";
export default {
components: {
QuoteRemainNum,
uititle,
},
data() {
return {
enquiryId: null,
sheet: null,
formData: {
totalPrice: '',
files: [],
remark: '',
supplierExt: '',
},
reloaded: false,
fileNameList: []
};
},
methods: {
handTag(val) {
val.checked = !val.checked
},
afterRead({file}) {
for (let i = 0; i < file.length; i++) {
const item = file[i]
if (item.type !== 'application/pdf') {
uni.showToast({
title: '请上传PDF文件',
icon: 'none'
})
return
}
uniCloud.uploadFile({
filePath: item.url,
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + md5(item.name + Date.now().toString()) + '.pdf',
success: ({fileID}) => {
uniCloud.getTempFileURL({
fileList: [fileID]
}).then(res => {
this.formData.files.push(res.fileList[0].tempFileURL)
this.fileNameList.push(item.name)
})
}
})
}
},
deletePic({index}) {
this.formData.files.splice(index, 1)
},
async submit() {
if (!this.formData.totalPrice) return this.$message.error('请填写金额')
if (!this.formData.files.length) return this.$message.error('请上传附件')
// if (this.formData.files.length > 0) this.formData.files = this.formData.files.map(item => item.url)
vk.callFunction({
url: 'client/enquiry/quote/kh/addQuote',
title: '请求中...',
data: {
sheetId: this.enquiryId,
...this.formData
},
success: (data) => {
this.$message({
message: "报价成功",
type: 'success'
})
uni.navigateBack()
}
});
},
/**
* 获取询价单详情
*/
getEnquiryDetail() {
vk.callFunction({
url: 'client/enquiry/sheet/pub/getDetail',
title: '请求中...',
data: {
_id: this.enquiryId
},
success: (res) => {
this.sheet = res.data
}
});
},
delFiles(index){
this.formData.files.splice(index, 1)
this.fileNameList.splice(index, 1)
},
formatter(val){
this.formData.totalPrice = parseFloat(val).toFixed(2)
},
},
onLoad({enquiryId}) {
this.enquiryId = enquiryId
this.getEnquiryDetail()
},
onShow() {
this.reloaded = false
setTimeout(() => {
this.reloaded = true
}, 500)
}
}
</script>
<style lang="scss">
.layout-title {
padding: 20rpx 30rpx;
font-size: 28rpx;
font-weight: 600;
line-height: 44rpx;
color: #A92924;
}
.card-title {
position: relative;
padding-left: 20rpx;
font-size: 26rpx;
font-weight: 600;
line-height: 48rpx;
color: #A92924;
&:before {
position: absolute;
left: 0;
top: 50%;
z-index: 9;
margin-top: -14rpx;
content: '';
width: 4rpx;
height: 28rpx;
background: #A92924;
}
}
.public-btn {
width: 80%;
margin-top: 60rpx;
color: #ffffff;
background: #A92924;
}
.layout-publish {
margin: 20rpx 30rpx;
padding: 50rpx 30rpx;
border-radius: 18rpx;
}
.tag-title {
font-size: 26rpx;
line-height: 40rpx;
color: #000000;
.limit {
font-size: 24rpx;
color: #999999;
}
}
.tag-box {
padding: 20rpx 0;
.item {
padding: 6rpx 10rpx;
font-size: 24rpx;
line-height: 32rpx;
color: #555555;
}
.active {
color: #A92924;
}
}
.lb, .fix {
position: relative;
font-size: 26rpx;
line-height: 40rpx;
color: #666666;
}
.lbx {
font-size: 24rpx;
color: #999999;
}
.download {
padding: 8rpx 20rpx;
font-size: 24rpx;
line-height: 36rpx;
color: #A92924;
border: 1px solid #A92924;
}
.need::before {
position: absolute;
left: -16rpx;
top: 50%;
z-index: 9;
margin-top: -12rpx;
content: '*';
color: #A92924;
font-size: 32rpx;
line-height: 1;
}
</style>
+195
View File
@@ -0,0 +1,195 @@
<template>
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uititle title="报价单"></uititle>
</u-sticky>
<view class="layout layout-goods">
<view class="goods-title">商品1:螺纹钢</view>
<view class="goods-box m-top-20 clear">
<!-- 百分比,hundred-100%,half-50%,third-33.33%,fourth-25%,fifth-20% -->
<view class="goods-item half flex flex-wrap fl">
<view class="lb">直径D mm:</view>
<view class="vl flex-1">12mm</view>
</view>
<view class="goods-item half flex flex-wrap fl">
<view class="lb">执行标准:</view>
<view class="vl flex-1">GB/T1499.2</view>
</view>
<view class="goods-item half flex flex-wrap fl">
<view class="lb">单件长度:</view>
<view class="vl flex-1">6000定尺 mm</view>
</view>
<view class="goods-item half flex flex-wrap fl">
<view class="lb">材质:</view>
<view class="vl flex-1">HRB355</view>
</view>
<view class="goods-item half flex flex-wrap fl">
<view class="lb">计价形式:</view>
<view class="vl flex-1">过磅</view>
</view>
<view class="goods-item half flex flex-wrap fl">
<view class="lb">采购数量:</view>
<view class="vl flex-1">100吨</view>
</view>
<view class="goods-item half flex flex-wrap fl">
<view class="lb">交货时限: </view>
<view class="vl flex-1">2024-05-11</view>
</view>
<view class="goods-item hundred flex flex-wrap fl">
<view class="lb">交货服务:</view>
<view class="vl flex-1">供货方送至交货地点</view>
</view>
<view class="goods-item hundred flex flex-wrap fl">
<view class="lb">交货地点:</view>
<view class="vl flex-1">广西壮族自治区-贵港市-覃塘区-大圩</view>
</view>
</view>
<view class="flex justify-between align-center m-top-20">
<view class="group flex align-center" style="width: 48%;">
<view class="lb m-right-20">报价单价:</view>
<view class="vl flex-1">
<u--input
placeholder="请输入内容"
border="surround"
v-model="value"
suffixIcon="元"
suffixIconStyle="font-size: 26rpx;color: #909399"
@change="change"
></u--input>
</view>
</view>
<view class="group flex align-center" style="width: 48%;">
<view class="lb m-right-20">小计金额:</view>
<view class="vl flex-1">
<u--input
placeholder="请输入内容"
border="surround"
v-model="value"
suffixIcon="元"
suffixIconStyle="font-size: 26rpx;color: #909399"
@change="change"
></u--input>
</view>
</view>
</view>
</view>
<view class="layout layout-publish bg-white">
<view class="group flex align-center">
<view class="lb need strong m-right-20">货款总价:</view>
<view class="vl flex-1">
<u--input
placeholder="请输入内容"
border="surround"
v-model="value"
suffixIcon="元"
suffixIconStyle="font-size: 26rpx;color: #909399"
@change="change"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need strong m-right-20">人民币大写:</view>
<view class="vl flex-1">
<u--input
placeholder="请输入内容"
border="surround"
v-model="value"
suffixIcon="元"
suffixIconStyle="font-size: 26rpx;color: #909399"
@change="change"
></u--input>
</view>
</view>
<u--text text="温馨提示:贷款总价由各个商品报价加起来" size="24rpx" color="#777" margin="30rpx 0"></u--text>
</view>
<u-button class="public-btn m-top-30" text="提交报价"></u-button>
</view>
</template>
<script>
import uititle from '@/components/common/title'
export default {
components: {
uititle,
},
data() {
return {
// 输入框自定义样式
inputStyle: {
borderRadius: 0,
},
value: '', // 模拟值
};
},
methods: {
handTag(val) {
val.checked = !val.checked
},
},
onLoad() {
}
}
</script>
<style lang="scss">
page {
background: #ffffff;
}
.goods-title {
font-size: 28rpx;
font-weight: 600;
line-height: 40rpx;
color: #101010;
}
.layout-goods {
margin: 20rpx 30rpx;
padding: 30rpx 0;
font-size: 28rpx;
line-height: 32rpx;
color: #626262;
border-bottom: 1px solid #f2f2f2;
.goods-item {
padding: 18rpx 0;
}
}
.public-btn {
width: 80%;
margin-top: 60rpx;
color: #ffffff;
background: #A92924;
}
.layout-publish {
margin: 20rpx 30rpx;
padding: 50rpx 30rpx;
border-radius: 18rpx;
}
.group .lb {
position: relative;
font-size: 28rpx;
line-height: 40rpx;
color: #A92924;
}
.group .strong {
width: 160rpx;
font-weight: 600;
color: #101010;
}
.lbx {
font-size: 24rpx;
color: #999999;
}
.need::before {
position: absolute;
left: -16rpx;
top: 50%;
z-index: 9;
margin-top: -12rpx;
content: '*';
color: #A92924;
font-size: 32rpx;
line-height: 1;
}
</style>
+526
View File
@@ -0,0 +1,526 @@
<template>
<view class="border-bottom pt-20">
<el-form ref="form" :model="form1" label-width="80px" :rules="form1.props.rules">
<view class="flex flex-wrap justify-start items-start">
<view class="w-25p">
<el-form-item label="商品名称">
<el-select v-model="form1.data.goodsId" placeholder="请选择商品" @change="selectGoods">
<el-option
v-for="(item, index) in goodsList"
:key="index"
:label="item.name"
:value="item._id">
</el-option>
</el-select>
</el-form-item>
</view>
<view class="w-25p" v-for="(item, index) in goodsAttributes" :key="index">
<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"
type="number">
<template slot="append">米</template>
<!-- <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="6">
<el-form-item label="交货服务">
<el-select v-model="form1.data.deliverService" 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-row>
<el-row :gutter="10">
<el-col :span="6">
<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="6">
<el-form-item label="计价形式">
<el-select v-model="form1.data.pricingForm" 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-row>
</el-form>
</view>
</template>
<script>
import provinces from "@/util/address/provinces.json";
import citys from "@/util/address/citys.json";
import areas from "@/util/address/areas.json";
export default {
props: {
value: {
type: Object,
default: () => {
return {}
}
},
baseAttributes: {
type: Array,
default: () => {
return []
}
},
productIndex: {
type: Number,
default: 0
}
},
data() {
return {
pickerOptions: {
disabledDate(time) {
return time.getTime() < Date.now();
},
},
provinceData: provinces,
cityData: citys,
areaData: areas,
provinceIndex: null,
cityIndex: null,
areaIndex: null,
title: '商品',
attributesLoaded: false,
goodsList: [],
attributes: [],
goodsAttributes: [],
address: ['', '', ''],
form: {
addressDetail: ''
},
// 表单相关开始-----------------------------------------------------------
form1: {
// 表单请求数据,此处可以设置默认值
data: {
goodsId: null,
model: [],
otherData: null,
materialQuality: null,
singleLength: null,
singleLengthUnit: null,
deliverService: null,
standard: null,
pricingForm: null,
deliveryTime: null,
len: null,
extraAttributes: {},
attributes: {},
addressRegion: [],
addressDetail: null
},
// 表单属性
props: {
// 表单请求地址
action: "client/enquiry/kh/add",
// 表单字段显示规则
columns: [
{key: "", title: "商品1", type: "bar-title", component: 'custom-form-section'},
{
key: "name",
title: "模板",
type: "remote-select",
action: "client/enquiry/template/pub/getList",
showAll: true,
actionData: {
pageSize: 1000
},
props: {
list: "rows",
value: "name",
label: "name"
},
watch: (res) => {
const {
option
} = res
console.log(option);
if (option.extraAttributes) {
let groupIndex = -1
option.extraAttributes.forEach((item, index) => {
if (index % 4 == 0) {
this.form1.props.columns[2].columns.push({
key: "",
title: "",
type: "group",
justify: "start",
showLabel: false,
columns: []
})
groupIndex++
}
this.form1.props.columns[2].columns[0].columns.push({
key: index,
title: item.label,
type: "select",
allowCreate: true,
filterable: true,
data: item.values.map(citem => {
return {
value: JSON.stringify({keyName: item.lable, keyValue: citem}),
label: citem
}
})
})
})
} else {
this.form1.props.columns[2].columns = []
}
}
},
{
key: "extraAttributes",
title: "额外属性",
type: "object",
justify: "start",
showLabel: false,
columns: [],
},
{
key: "",
title: "",
type: "group",
justify: "start",
showLabel: false,
columns: [
{
key: "brand",
title: "品牌厂家",
type: "select",
showAll: true,
allowCreate: true,
filterable: true,
data: () => {
const row = this.attributes.find(item => item.label == '品牌厂家')
if (row) {
return row.options
}
return [];
}
},
{
key: "materialQuality",
title: "材质",
type: "select",
showAll: true,
allowCreate: true,
filterable: true,
data: () => {
const row = this.attributes.find(item => item.label == '材质')
if (row) {
return row.options
}
return [];
}
},
{
key: "singleLength",
title: "单件长度",
type: "select",
showAll: true,
allowCreate: true,
filterable: true,
data: () => {
const row = this.attributes.find(item => item.label == '单件长度')
if (row) {
return row.options
}
return [];
}
},
{
key: "productStandard",
title: "产品标准",
type: "select",
showAll: true,
allowCreate: true,
filterable: true,
data: () => {
const row = this.attributes.find(item => item.label == '产品标准')
if (row) {
return row.options
}
return [];
}
},
],
},
{
key: "",
title: "",
type: "group",
justify: "start",
showLabel: false,
columns: [
{
key: "pricingForm",
title: "计价形式",
type: "select",
showAll: true,
allowCreate: true,
filterable: true,
data: () => {
const row = this.attributes.find(item => item.label == '计价形式')
if (row) {
return row.options
}
return [];
}
},
{
key: "processStandard",
title: "加工标准",
type: "select",
showAll: true,
allowCreate: true,
filterable: true,
data: () => {
const row = this.attributes.find(item => item.label == '加工标准')
if (row) {
return row.options
}
return [];
}
},
{
key: "deliveryService",
title: "交货服务",
type: "select",
showAll: true,
allowCreate: true,
filterable: true,
data: () => {
const row = this.attributes.find(item => item.label == '交货服务')
if (row) {
return row.options
}
return [];
}
},
{key: "deliveryTime", title: "交货时限", type: "date",},
],
},
{
key: "", title: "", type: 'group', showLabel: false, justify: "start", columns:
[
{key: "procureNumber", title: "采购数量", type: "number",},
{
key: "procureUnit",
title: "单位",
type: "select",
showAll: true,
allowCreate: true,
filterable: true,
data: () => {
const row = this.attributes.find(item => item.label == '单位')
if (row) {
return row.options
}
return [];
}
},
{key: "addressRegion", title: "交货地点", type: "address",},
{key: "addressDetail", title: "详细地址", type: "textarea",},
]
},
],
// 表单验证规则
rules: {
goodsId: [
{required: true, message: '商品不能为空', trigger: ["change", "blur"]}
],
addressRegion: [
{required: true, message: '交货地点不能为空', trigger: ["change", "blur"]}
],
procureNumber: [
{required: true, message: '采购数量不能为空', trigger: ["change", "blur"]},
{min: 1, type: 'number', message: '采购数量不能小于1', trigger: ["change", "blur"]}
],
procureUnit: [
{required: true, message: '采购数量不能为空', trigger: ["change", "blur"]},
],
},
// add 代表添加 update 代表修改
formType: "add",
// 表单是否在请求中
loading: false,
// 是否显示表单1 的弹窗
show: false,
beforeAction: (formData) => {
return false
}
}
},
// 表单相关结束-----------------------------------------------------------
}
},
created() {
this.form1.props.columns[0].title = '商品' + (this.productIndex + 1)
vk.callFunction({
url: 'client/enquiry/attributes/pub/getList',
title: '请求中...',
data: {},
success: (data) => {
this.attributes = data.rows
this.attributesLoaded = true
}
});
this.getGoodsList()
},
methods: {
getGoodsList() {
vk.callFunction({
url: 'client/enquiry/template/pub/getList',
pageSize: 500,
title: '请求中',
success: ({rows}) => {
this.goodsList = rows
}
})
},
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
})
})
}
})
},
selectProvince(index) {
this.form1.data.addressRegion[0] = this.provinceData[index].code
},
selectCity(index) {
this.form1.data.addressRegion[1] = this.cityData[this.provinceIndex][index].code
},
selectArea(index) {
this.form1.data.addressRegion[2] = this.areaData[this.provinceIndex][this.cityIndex][index].code
},
},
watch: {
"form1.data": {
immediate: true,
handler(val) {
this.$emit('input', val)
console.log("this.$emit('input', val.data)");
}
},
value: {
immediate: true,
handler(val) {
this.form1.data = val
console.log("this.form1.data = val", val);
}
}
}
}
</script>
<style scoped lang="scss">
.product-title {
margin: 10px;
text-align: center;
font-size: 14px;
}
</style>
<style>
/deep/ .input-with-select .el-input-group__append {
background-color: #fff !important;
width: 130px !important;
}
</style>
+817
View File
@@ -0,0 +1,817 @@
<template> <!-- 询价单详情 -->
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uititle title="询价详情"></uititle>
</u-sticky>
<!-- 内容 -->
<view class="layout layout-detail">
<view class="company flex m-top-20">
<!-- <view class="logo">-->
<!-- <image v-if="sheet.user && sheet.user.businessCard" class="full" :src="sheet.user.businessCard.logo"-->
<!-- mode=""></image>-->
<!-- <image v-else class="full" src="/static/no-logo.jpg" mode=""></image>-->
<!-- </view>-->
<view class="info flex-1 p-left-20 w-100p">
<view class="name-text w-100p">{{
sheet.user.accountType === 1 ? sheet.user.person.personName.replace(/^(.).*$/, "$1**") : sheet.user.company.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6")
}}
</view>
<!-- <view class="name flex justify-start align-center">-->
<!-- 认证图标 -->
<!-- <view class="name-icon m-left-20">-->
<!-- <image class="full" src="/static/img/idente.png" mode=""></image>-->
<!-- </view>-->
<!-- </view>-->
<!-- <view class="zhu">-->
<!-- 主营业务:-->
<!-- 主营业务:{{-->
<!-- (sheet.user.company.mainSpotCategory && sheet.user.company.mainSpotCategory.length > 0) ? sheet.user.company.mainSpotCategory.join() : ''-->
<!-- }}-->
<!-- </view>-->
<view class="zhu">
{{ sheet._add_time_str }} 发布
</view>
</view>
</view>
<!-- 批量上传-判断使用 -->
<template>
<view class="detail m-top-20">
<view class="detail-title">{{ sheet.title }}</view>
</view>
</template>
<view class="flex justify-start items-end text-25 mt-20"
v-if="sheet.answerEndTime && dayjs(sheet.answerEndTime).diff(dayjs(), 'second') > 0">
<text>距离报价结束还有:</text>
<view class="border-main countdown text-main">{{
dayjs(sheet.answerEndTime).diff(dayjs(), 'day')
}}
</view>
<text>天</text>
<view class="border-main countdown text-main">
{{ (dayjs(sheet.answerEndTime).diff(dayjs(), 'hour')) % 24 }}
</view>
<text>时</text>
</view>
<!-- 手动上传-判断使用 -->
<template>
<view class="card-title m-top-30">主要商品</view>
<view class="goods-box m-top-20 clear" v-if="sheet.fillType === 1">
{{
batchProductNames
}}
</view>
<view class="goods-box m-top-20 flex justify-start items-start flex-col" v-else>
<view v-for="(item, index) in sheet.productList" :key="index">
<text class="font-bold clear">{{ item.goodsName }}:</text>
<view class="goods-item half flex flex-wrap fl" v-for="(model, modelIndex) in item.model">
<view class="lb">{{ model.label }}:</view>
<view class="vl flex-1">{{ model.value }}</view>
</view>
<!-- <view class="goods-item half flex flex-wrap fl">-->
<!-- <view class="lb">单件长度:</view>-->
<!-- <view class="vl flex-1">{{-->
<!-- item.singleLength ? item.singleLength : ''-->
<!-- }}{{ item.singleLengthUnit ? item.singleLengthUnit : '' }}-->
<!-- </view>-->
<!-- </view>-->
<view class="goods-item half flex flex-wrap fl">
<view class="lb">交货服务:</view>
<view class="vl flex-1">{{
item.deliverService ? item.deliverService : ''
}}
</view>
</view>
<view class="goods-item half flex flex-wrap fl">
<view class="lb">采购数量:</view>
<view class="vl flex-1">{{
item.procureNumber ? item.procureNumber : ''
}}{{ item.procureUnit ? item.procureUnit : '' }}
</view>
</view>
<view class="goods-item half flex flex-wrap fl">
<view class="lb">计价形式:</view>
<view class="vl flex-1">{{
item.pricingForm ? item.pricingForm : ''
}}
</view>
</view>
<view class="goods-item half flex flex-wrap fl">
<view class="lb">交货时限:</view>
<view class="vl flex-1">{{ sheet.deliveryTime ? sheet.deliveryTime : '' }}</view>
</view>
<view class="goods-item half flex flex-wrap fl">
<view class="lb">交货地点:</view>
<view class="vl flex-1">{{ sheet.fullAddress }}</view>
</view>
</view>
</view>
</template>
<view class="card-title m-top-30">上传的附件</view>
<view class="m-top-20" v-if="sheet.files">
<file-type :item="item" v-for="(item, index) in sheet.files" :key="index"/>
</view>
<view class="m-top-20" v-if="sheet.multiFiles">
<file-type :item="item" v-for="(item, index) in sheet.multiFiles" :key="index"/>
</view>
<view class="card-title m-top-30" v-if="sheet.remark">采购商其他要求</view>
<view class="detail-text">
{{ sheet.remark }}
</view>
<view class="card-title m-top-30">合同条款</view>
<view class="detail-text">是否含税:{{ sheet.invoice ? '含税' : '不含税' }}</view>
<template v-if="sheet.invoice">
<view class="detail-text">开票时间:{{ WRITE_INVOICE_TIME[sheet.writeInvoiceTime] }}</view>
<!-- <view class="detail-text">发票种类:{{ INVOICE_TYPE[sheet.invoiceType] }}</view>-->
<!-- <view class="detail-text" v-if="sheet.invoiceOther">其他要求:{{ sheet.invoiceOther }}</view>-->
<view class="detail-text" v-if="sheet.invoiceOther">税票要求:{{ sheet.invoiceOther }}</view>
<template v-else>
<view class="detail-text">纳税人身份:{{ sheet.taxType ? sheet.taxType : '无' }}</view>
<view class="detail-text">发票种类:{{ sheet.invoiceType ? sheet.invoiceType : '无' }}</view>
<view class="detail-text">税率:{{ sheet.taxRate ? sheet.taxRate : '无' }}</view>
</template>
</template>
<view class="card-title m-top-30">运输要求</view>
<view class="detail-text" v-if="sheet.transportDocuments && sheet.transportDocuments.length > 0">
随货资料:{{ sheet.transportDocuments.join() }}
</view>
<view class="detail-text" v-if="sheet.otherTransportDocuments">其他资料:{{
sheet.otherTransportDocuments
}}
</view>
<view class="detail-text">运输限制:{{ sheet.transportLimit ? '有' : '无' }}</view>
<view class="detail-text" v-if="sheet.transportLimit && sheet.otherTransportRequest">
运输限制说明:{{ sheet.otherTransportRequest }}
</view>
<view class="card-title m-top-30">交易模式</view>
<view class="detail-text">交易模式:{{ sheet.tradeMethod === 0 ? '自主交易' : '金久信公证' }}</view>
<view class="card-title m-top-30">交易说明</view>
<view class="detail-text">付款方式:{{ PROCESS_PAY_METHOD[sheet.payMethod] }}{{
sheet.payMethod === 0 ? `${sheet.advancePayRate}%货到付全款` : ''
}}{{
sheet.payMethod === 3 ? `${sheet.reputationPayDay}天` :
(sheet.payMethod === 4 ? `:${sheet.otherPayMethod}` : '')
}}
</view>
<view class="detail-text">报价形式:{{ sheet.offerType === 0 ? '整单报价' : '可分项报价' }}</view>
<view class="detail-text" v-if="sheet.answerStartTime && sheet.answerEndTime">报价期限:{{
dayjs(sheet.answerStartTime).format('YYYY-MM-DD')
}}~{{ dayjs(sheet.answerEndTime).format('YYYY-MM-DD') }}
</view>
<view class="card-title m-top-30">采购商信息</view>
<view class="detail-text">项目名称:{{ sheet.projectName ? sheet.projectName : '' }}</view>
<view class="detail-text">项目地址:{{ sheet.fullAddress }}</view>
<template v-if="(sheet.isMine || sheet.hasQuote || userInfo.userLevel > 0) && dayjs(sheet.answerEndTime).isBefore(dayjs())">
<view class="detail-text" v-if="sheet.companyName">采购商信息:{{
sheet.companyName ? sheet.companyName : ''
}}
</view>
<view class="detail-text" v-if="sheet.companyMobile">采购商联系方式:{{
sheet.companyMobile ? sheet.companyMobile : ''
}}
</view>
<view class="detail-text">授权业务咨询人:{{
sheet.businessName ? sheet.businessName : ''
}}
</view>
<view class="detail-text">业务咨询联系方式:{{
sheet.businessMobile ? sheet.businessMobile : ''
}}
</view>
</template>
<template v-else>
<view class="detail-text" v-if="sheet.companyName">采购商信息:{{
sheet.companyName ? sheet.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6") : ''
}}
</view>
<view class="detail-text" v-if="sheet.companyMobile">采购商联系方式:{{
sheet.companyMobile ? sheet.companyMobile.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : ''
}}
</view>
<view class="detail-text">授权业务咨询人:{{
sheet.businessName ? sheet.businessName.replace(/^(.).*(.)$/, "$1***$2") : ''
}}
</view>
<view class="detail-text">业务咨询联系方式:{{
sheet.businessMobile ? sheet.businessMobile.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : ''
}}
</view>
</template>
<view class="card-title m-top-30">平台交易保证金要求</view>
<view class="detail-text">{{ sheet.earnestMoney ? sheet.earnestMoney : '无' }}</view>
<view class="card-title m-top-30">签约模式</view>
<view class="detail-text">
<view>{{
sheet.signMethod === 0 ? '线上签约-标准合同' : (sheet.signMethod !== 1 ? '线上签约-双方协商合同' : '线下签约')
}}
</view>
</view>
<view class="item-wrap" v-if="sheet.signMethod === 0">
<view class="card-title m-top-30">合同条款</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">采购方补充条款: {{ 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="card-title m-top-30">已收到的加工申请</view>-->
<!-- <view class="table-box m-top-30">-->
<!-- <view class="thead">-->
<!-- <view class="tr">-->
<!-- <view class="th">申请人</view>-->
<!-- <view class="th">申请时间</view>-->
<!-- </view>-->
<!-- </view>-->
<!-- <view class="tbody">-->
<!-- <view class="tr" v-for="(item, index) in sheet.quoteList" :key="index">-->
<!-- <view class="td">{{ item.subjectName }}</view>-->
<!-- <view class="td">{{ item._add_time_str }}</view>-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
</view>
<!-- 底部 -->
<view class="fiexd-bottom flex justify-between align-center bg-white">
<u-icon name="integral" color="#A92924" size="26"></u-icon>
<view class="text red flex-1 m-left-20">{{ sheet.quoteNum }}家已经报价</view>
<view class="apply-btn" v-if="userInfo._id !== sheet.userId && sheet.status === 0" @click="toQuote">{{
sheet.disabled ? '已超时无法报价' : '我要报价'
}}
</view>
<view class="apply-btn" v-else-if="userInfo._id === sheet.userId" @click="showEnquiryModal">收到的报价
</view>
</view>
<!-- 弹出窗-报价次数 -->
<u-popup :show="isPrice" mode="center" @close="isPrice = false">
<view class="popup-box" style="padding: 50rpx 30rpx;width: 600rpx;">
<view class="residue text-center">
今日剩余报价
<text class="red">3</text>
次
</view>
<u-button class="custom-style" text="继续报价" @click="isPopup = true,isPrice = false"></u-button>
<view class="increase text-center">
*升级会员可以增加每日报价次数,
<text class="red">去升级</text>
</view>
</view>
</u-popup>
<!-- 模态框-报价类型-->
<!-- 弹出窗-报价列表 -->
<u-popup :show="isPopup" mode="center" @close="isPopup = false">
<view class="popup-box">
<view class="popup-title flex justify-between align-center">
<view class="title">收到的报价列表</view>
<view class="close" @click="isPopup = false">关闭</view>
</view>
<view class="table-box m-top-30">
<view class="thead">
<view class="tr">
<view class="th w-25p">供应商</view>
<view class="th w-25p">联系方式</view>
<view class="th w-25p">报价</view>
<view class="th w-25p">操作</view>
</view>
</view>
<view class="tbody">
<view class="tr" v-for="(item, index) in sheet.quoteList" :key="index">
<view class="td w-25p">{{ item.subjectName }}</view>
<view class="td w-25p">
<text>{{ item.subjectMobile }}</text>
</view>
<view class="td w-25p">{{ item.totalPrice }}元</view>
<view class="td w-25p">
<u-button
size="mini"
type="error"
plain="true"
text="选择"
style="width: 40rpx;"
@click="confirm(item)"
></u-button>
</view>
</view>
</view>
</view>
</view>
</u-popup>
<u-modal
:show="isEnquiryTip"
title="重点提示"
confirmText="同意悉知"
cancelText="取消"
confirmColor="#A92924"
showCancelButton
@confirm="confirmEnquiryModal"
@cancel="isEnquiryTip = false"
>
<view class="enquiry-tip-content">
<view v-for="(item, index) in enquiryTipList" :key="index" class="enquiry-tip-item">
{{ item }}
</view>
</view>
</u-modal>
<enquiry-modal ref="enquiryModal"/>
</view>
</template>
<script>
import uiheader from '@/components/index/header'
import uititle from '@/components/common/title'
import {INVOICE_TYPE, PROCESS_PAY_METHOD, WRITE_INVOICE_TIME} from "@/util";
import dayjs from "dayjs";
import FileType from "@/components/file-type/file-type.vue";
import EnquiryModal from "@/pages/user/components/enquiryModal.vue";
export default {
components: {
EnquiryModal,
FileType,
uiheader,
uititle,
},
data() {
return {
fileList3: [
{url: 'https://cdn.uviewui.com/uview/swiper/1.jpg',},
{url: 'https://cdn.uviewui.com/uview/swiper/1.jpg',},
{url: 'https://cdn.uviewui.com/uview/swiper/1.jpg',},
],
isPopup: false,
isPrice: false,
isModal: false,
isEnquiryTip: false,
enquiryTipList: [
'1、请您谨慎点击"选择",选择供应商后,系统将自动关闭您此条询价信息,无法返回,只能再次发布询价信息;',
'2、点击"选择"前,您可通过供应商联系方式,仔细商讨:商品明细、数量、单价、执行标准、交货方式、交货期、验收方式、合同条款等细节关键题确认,各种交易细节无误后要求供应商进行最终报价;',
'3、您承诺对此次交易的内容用途已经完全了解并知悉经过严格仔细审核后实施,此次交易为合法经营,如违反相关法律规定,您将承担全部责任,与平台无关。您确认以上描述无误后请点击"选择"。'
],
parseText: '<p>露从今夜白,月是故乡明</p>',
WRITE_INVOICE_TIME,
INVOICE_TYPE,
PROCESS_PAY_METHOD,
hasQuote: false,
productList: [],
sheet: {
user: {},
productList: [],
transportDocuments: [],
otherCate: null
},
userInfo: null
};
},
computed: {
batchProductNames() {
if (this.sheet.otherCate) return this.sheet.otherCate
return this.sheet.productList.map(item => item.goodsName + `${item.materialQuality ? `(${item.materialQuality})` : ''}`).join(',')
}
},
methods: {
dayjs,
applyLink() {
uni.$u.route('/pages/price/apply', {
id: 0,
});
},
showEnquiryModal() {
this.isEnquiryTip = true
},
confirmEnquiryModal() {
this.isEnquiryTip = false
this.$refs.enquiryModal.open(this.sheet)
},
handConfirmModal() {
this.isPopup = false
this.isModal = false
uni.$u.route('/pages/price/apply1', {
id: 0,
});
},
handCancelModal() {
this.isPopup = false
this.isModal = false
uni.$u.route('/pages/price/apply2', {
id: 0,
});
},
async toQuote() {
if (this.sheet.disabled) return
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
uni.showModal({
title: '提示',
content: '您尚未认证, 是否前往认证?',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 0)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
uni.showModal({
title: '提示',
content: '请完善名片信息',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 1)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (accountNum === 0) {
uni.showModal({
title: '提示',
content: '请先到个人中心添加收款账户',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 7)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else {
if (userInfo.businessCard.status !== 1) {
uni.showModal({
title: '提示',
content: '您的名片信息未审核,请耐心等待',
})
return
}
if (this.sheet.tradeMethod === 1) {
const rate = this.sheet.notaryServiceRate || 0.1
uni.showModal({
title: '重要提示',
content: `提示着您成功签约交易,平台将收取总交易金额 x${rate}%服务费,如您存在利用系统漏洞恶意逃避支付服务费的情况,平台有将您的失信行为进行公布,情况严重的平台予以劝退。\n并有权依法追回平台服务费。您承诺此次交易为合法经营,如违反相关法律法规您将承担全部任与平台无关。您已经完全理解解并知悉,您不同意请点击'取消',取消报价,您同意以上夠定请点击'同意并知悉'。`,
confirmText: '同意并知悉',
cancelText: '取消',
success: ({confirm}) => {
if (confirm) {
vk.navigateTo({url: '/pages/price/apply1?enquiryId=' + this.enquiryId});
}
}
})
return
}
vk.navigateTo({url: '/pages/price/apply1?enquiryId=' + this.enquiryId});
}
},
/**
* 获取询价单详情
*/
getEnquiryDetail() {
vk.callFunction({
url: 'client/enquiry/sheet/pub/getDetail',
title: '请求中...',
data: {
_id: this.enquiryId
},
success: (res) => {
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
}
});
},
confirm(item) {
this.isPopup = false
if (this.sheet.tradeMethod === 1 && (!this.sheet.user || this.sheet.user.isNotaryBusiness !== 1)) {
uni.showModal({
title: '温馨提示',
content: '请您先至个人中心-卖家中心-金久信公正银联资料,完成银联资料收集,并联系金久信客服开通功能。才能进行金久信公正交易',
showCancel: false,
confirmText: '确定'
})
return
}
if (this.sheet.tradeMethod === 1) {
const rate = this.sheet.notaryServiceRate || 0.1
uni.showModal({
title: '温馨提示',
content: `提示若您成功签约交易,平台将收取总交易金额 x${rate}%服务费,如您存在利用系统漏洞恶意逃避支付服务费的情况。\n平台有将您的失信行为进行公布,情况严重的平台予以劝退。\n并有权依法追回平台服务费。您承诺此次交易为合法经营,如违反相关法律法规您将承担全部任与平台无关。您己经完全理解并知悉,您不同意请点击“取消”,取消报价,您同意以上约定请点击“同意并知悉”。`,
confirmText: '同意并知悉',
cancelText: '取消',
success: ({confirm}) => {
if (confirm) this.doConfirm(item)
}
})
return
}
this.doConfirm(item)
},
doConfirm(item) {
vk.callFunction({
url: 'client/enquiry/quote/kh/confirmQuote',
title: '请求中...',
data: {
quoteId: item._id,
},
success: (data) => {
this.showDialog = false
if (this.sheet.signMethod === 0) vk.navigateTo('/pages/public/contract')
else {
if (this.sheet.signMethod === 1) vk.navigateTo('/pages/user/buyer')
else vk.navigateTo('/pages/public/contract')
}
this.$message({
type: 'success',
message: '报价确认成功'
})
}
});
},
},
onLoad({id}) {
this.enquiryId = id
this.userInfo = vk.getStorageSync('uni_id_user_info')
this.getEnquiryDetail()
}
}
</script>
<style lang="scss">
page {
padding-bottom: 150rpx;
background: #ffffff;
}
.card-title {
position: relative;
padding-left: 20rpx;
font-size: 28rpx;
font-weight: 600;
line-height: 48rpx;
color: #A92924;
&:before {
position: absolute;
left: 0;
top: 50%;
z-index: 9;
margin-top: -14rpx;
content: '';
width: 6rpx;
height: 28rpx;
background: #A92924;
}
.more {
font-size: 24rpx;
font-weight: normal;
color: #999999;
}
}
.layout-detail {
padding: 20rpx 30rpx;
}
.company {
padding-bottom: 40rpx;
border-bottom: 1px solid #f2f2f2;
.logo {
width: 120rpx;
height: 120rpx;
}
.name-text {
//max-width: 380rpx;
font-size: 30rpx;
font-weight: 600;
line-height: 40rpx;
color: #333333;
}
.name-icon {
width: 80rpx;
height: 32rpx;
}
.zhu {
margin-top: 10rpx;
font-size: 24rpx;
line-height: 32rpx;
color: #999999;
}
}
.detail-title {
font-size: 26rpx;
font-weight: 600;
line-height: 40rpx;
color: #101010;
}
.detail-text {
padding: 15rpx 0;
font-size: 26rpx;
line-height: 40rpx;
color: #333333;
}
.fiexd-bottom {
position: fixed;
left: 0;
bottom: 0;
z-index: 99;
width: 100%;
height: 130rpx;
padding: 0 30rpx;
box-sizing: border-box;
border-top: 1px solid #f2f2f2;
.text {
font-size: 26rpx;
line-height: 40rpx;
}
.apply-btn {
width: 220rpx;
height: 70rpx;
font-size: 26rpx;
line-height: 70rpx;
text-align: center;
color: #ffffff;
background: #A92924;
}
}
.table-box {
font-size: 24rpx;
line-height: 28rpx;
text-align: center;
}
.tr {
display: flex;
justify-content: space-between;
align-items: center;
}
.th {
color: #666 !important;
background: #FFF8F2;
}
.th, .td {
display: flex;
justify-content: center;
align-items: center;
width: 50%;
height: 76rpx;
color: #999;
overflow: hidden;
box-sizing: border-box;
border-left: 1px solid #f2f2f2;
border-right: 1px solid #f2f2f2;
border-bottom: 1px solid #f2f2f2;
}
.td {
border-right: 1px solid #f2f2f2;
border-bottom: 1px solid #f2f2f2;
background: #ffffff;
}
.td-3 {
width: 33.33%;
}
.popup-box {
padding: 20rpx 20rpx;
width: 700rpx;
.residue {
font-size: 28rpx;
line-height: 40rpx;
color: #333333;
}
.increase {
font-size: 24rpx;
line-height: 40rpx;
color: #727272;
}
.custom-style {
margin: 40rpx auto;
width: 200rpx;
color: #ffffff;
background: #A92924;
}
}
.popup-title {
padding: 18rpx 0;
border-bottom: 1px solid #A92924;
.title {
font-size: 24rpx;
line-height: 40rpx;
color: #A92924;
}
.close {
width: 80rpx;
height: 40rpx;
font-size: 22rpx;
line-height: 40rpx;
text-align: center;
color: #ffffff;
background: #A92924;
}
}
.goods-item {
padding: 18rpx 0;
font-size: 24rpx;
line-height: 32rpx;
color: #626262;
}
.item-wrap {
margin: 24px 0;
font-size: 25rpx;
.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: #A92924;
font-size: 18px;
line-height: 18px;
border-left: 4px solid #A92924;
}
}
}
.countdown {
padding: 2px 5px;
margin: 0 5px;
}
.enquiry-tip-content {
text-align: left;
}
.enquiry-tip-item {
padding-bottom: 12rpx;
font-size: 26rpx;
line-height: 40rpx;
color: #333333;
}
</style>
+205
View File
@@ -0,0 +1,205 @@
<template>
<view class="wrap">
<u-sticky offset-top="0" customNavHeight="0">
<uititle title="我发布的询价"></uititle>
</u-sticky>
<view class="issue" @click="toRelease">
<u-icon name="plus" color="#fff" size="24"></u-icon>
</view>
<view class="layout-goods">
<view class="goods-box p-top-10" v-if="list.length">
<view class="item bg-white" v-for="(item, index) in list"
:key="index">
<view @click="detailLink(item._id)" class="askfor">查看详情</view>
<view @click="detailLink(item._id)" class="text-25 text-gray text-single">单号{{ item.enquiryNo }}</view>
<view @click="detailLink(item._id)" class="title text-single">{{ item.title }}</view>
<view @click="detailLink(item._id)" class="text m-top-10">
<text class="red">采购量:{{
item.productList.map(i => (i.procureNumber ? i.procureNumber : '') + (i.procureUnit ? i.procureUnit : '')).join("/")
}}
</text>
<text class="red">{{ item.quoteNum }}家已报价</text>
</view>
<text @click="detailLink(item._id)" class="text-25 text-gray">{{
`${item.addressRegion.province.name}${item.addressRegion.city.name}${item.addressRegion.area.name} ${item.addressDetail}`
}}
</text>
<text @click="detailLink(item._id)" class="text-25 text-gray" v-if="item.remark">备注:{{ item.remark }}</text>
<view @click="detailLink(item._id)" class="date">{{ item._add_time_str }} 发布</view>
<view>
<u-button type="primary" plain size="mini" @click="del(item._id)">删除</u-button>
</view>
</view>
</view>
<u-empty v-else text="您未发布询价单"></u-empty>
</view>
</view>
</template>
<script>
import uititle from '@/components/common/title'
export default {
name: "my",
components: {uititle},
data() {
return {
list: [],
userInfo: null
}
},
methods: {
detailLink(id) {
vk.navigateTo(`/pages/price/detail?id=${id}`);
},
async getList() {
const {rows} = await vk.callFunction({
url: 'client/enquiry/sheet/kh/getList'
})
this.list = rows
},
async toRelease() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
uni.showModal({
title: '提示',
content: '您尚未认证, 是否前往认证?',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 0)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
uni.showModal({
title: '提示',
content: '请完善名片信息',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 1)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (accountNum === 0) {
uni.showModal({
title: '提示',
content: '请先到个人中心添加收款账户',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 7)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else {
vk.navigateTo({
url: '/pages/price/publish'
})
}
},
del(_id) {
uni.showModal({
title: '提示',
content: '如果你要删除此条信息,之前其他客户填写的留言将无法查看',
success: res => {
if (res.confirm) {
vk.callFunction({
url: 'client/enquiry/sheet/kh/delete',
title: '请求中...',
data: {
_id
},
}).then(res => {
this.getList()
})
}
}
})
}
},
onShow() {
this.userInfo = vk.getStorageSync('uni_id_user_info')
this.getList()
}
}
</script>
<style lang="scss" scoped>
.layout-goods {
// width: 690rpx;
padding: 10rpx 30rpx;
.item {
position: relative;
margin-top: 30rpx;
padding: 10rpx 20rpx 20rpx;
border-radius: 12rpx;
.title {
width: 90%;
font-size: 30rpx;
font-weight: 600;
line-height: 48rpx;
color: #101010;
}
.link, .askfor {
position: absolute;
right: 20rpx;
top: 16rpx;
z-index: 9;
font-size: 24rpx;
line-height: 36rpx;
color: #A92924;
padding: 4rpx 8rpx;
}
.link {
border: 1px solid #A92924;
}
.text {
font-size: 24rpx;
line-height: 36rpx;
color: #999999;
}
.red {
margin-right: 20rpx;
color: #A92924;
}
.date {
font-size: 24rpx;
line-height: 36rpx;
color: #9a9a9a;
}
.company {
height: 40rpx;
.icon {
width: 40rpx;
height: 40rpx;
}
.text {
//width: 300rpx;
height: 40rpx;
font-size: 26rpx;
line-height: 40rpx;
color: #4f4f4f;
}
}
}
.item:nth-child(1) {
margin-top: 0 !important;
}
}
</style>
+175
View File
@@ -0,0 +1,175 @@
<template>
<view class="wrap">
<u-sticky offset-top="0" customNavHeight="0">
<uititle title="我的报价"></uititle>
</u-sticky>
<view class="issue" @click="toRelease">
<u-icon name="plus" color="#fff" size="24"></u-icon>
</view>
<view class="layout-goods">
<view class="goods-box p-top-10" v-if="list.length">
<view class="item bg-white" @click="detailLink(item.sheetId)" v-for="(item, index) in list"
:key="index">
<view class="askfor">查看详情</view>
<view class="title text-single">{{ item.sheet.title }}</view>
<view class="text m-top-10">
<text class="red">金额:{{ parseInt(item.totalPrice) }}元</text>
</view>
<view class="red text-25 font-bold">{{ item.status === 0 ? '待选商' : '已被选商' }}</view>
<view class="text-25 text-gray" v-if="item.remark">备注:{{ item.remark }}</view>
<view class="date">{{ item._add_time_str }} 发布</view>
</view>
</view>
<u-empty v-else text="您未报价"></u-empty>
</view>
</view>
</template>
<script>
import uititle from '@/components/common/title'
export default {
name: "my",
components: {uititle},
data() {
return {
list: [],
userInfo: null
}
},
methods: {
detailLink(sheetId) {
vk.navigateTo(`/pages/price/detail?id=${sheetId}`);
},
async getList() {
const {rows} = await vk.callFunction({
url: 'client/enquiry/quote/kh/getList'
})
this.list = rows
},
async toRelease() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
uni.showModal({
title: '提示',
content: '您尚未认证, 是否前往认证?',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 0)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
uni.showModal({
title: '提示',
content: '请完善名片信息',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 1)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (accountNum === 0) {
uni.showModal({
title: '提示',
content: '请先到个人中心添加收款账户',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 7)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else {
vk.navigateTo({
url: '/pages/price/publish'
})
}
},
},
onShow() {
this.userInfo = vk.getStorageSync('uni_id_user_info')
this.getList()
}
}
</script>
<style lang="scss" scoped>
.layout-goods {
// width: 690rpx;
padding: 10rpx 30rpx;
.item {
position: relative;
margin-top: 10rpx;
padding: 10rpx 20rpx 20rpx;
border-radius: 12rpx;
.title {
width: 90%;
font-size: 30rpx;
font-weight: 600;
line-height: 48rpx;
color: #101010;
}
.link, .askfor {
position: absolute;
right: 20rpx;
top: 16rpx;
z-index: 9;
font-size: 24rpx;
line-height: 36rpx;
color: #A92924;
padding: 4rpx 8rpx;
}
.link {
border: 1px solid #A92924;
}
.text {
font-size: 24rpx;
line-height: 36rpx;
color: #999999;
}
.red {
margin-right: 20rpx;
color: #A92924;
}
.date {
font-size: 24rpx;
line-height: 36rpx;
color: #9a9a9a;
}
.company {
height: 40rpx;
.icon {
width: 40rpx;
height: 40rpx;
}
.text {
//width: 300rpx;
height: 40rpx;
font-size: 26rpx;
line-height: 40rpx;
color: #4f4f4f;
}
}
}
.item:nth-child(1) {
margin-top: 0 !important;
}
}
</style>
+476
View File
@@ -0,0 +1,476 @@
<template> <!-- 找加工 -->
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uiheader title="找供应"></uiheader>
<!-- 搜索栏 -->
<cmsearch :k="keyword" @search="afterSearch"></cmsearch>
<!-- 轮播图-传值:list="数组" -->
<cmswiper page="enquiry" height="320rpx"></cmswiper>
<!-- 选择器 -->
<view class="bg-white p-20 flex justify-center items-center">
<view class="flex-1 mx-20">
<u-button type="primary" shape="circle" size="mini" @click="toRelease">发布询价单</u-button>
</view>
<view class="flex-1 mx-20">
<u-button type="primary" shape="circle" size="mini" plain @click="toMyEnquiry">我发布的询价单</u-button>
</view>
<view class="flex-1 mx-20">
<u-button type="primary" shape="circle" size="mini" plain @click="toMyQuote">我的报价</u-button>
</view>
</view>
<view class="layout-pick flex flex-col justify-start items-start bg-white">
<view class="flex justify-start items-center">
<view class="ip down" @click="isPick = true">产品分类筛选:{{ pickValue }}</view>
</view>
<view class="flex justify-between items-center w-100p mt-15">
<view class="ip down" style="" @click="isPickStatus = true">询价状态:{{ status }}</view>
<view class="ip down" style="" @click="showAddress">城市:{{ locationValue }}</view>
</view>
</view>
</u-sticky>
<!-- 数据列表 -->
<view class="layout layout-work">
<uiswiper :ad="11" :category-name="cateId ? (pickValue === '其他' ? '' : pickValue) : ''"
:category-names="cateId && pickValue !== '其他' ? [pickValue] : []" :region="region"
padding="10rpx 0"></uiswiper>
<uiswiper :ad="112" :category-name="cateId ? (pickValue === '其他' ? '' : pickValue) : ''"
:category-names="cateId && pickValue !== '其他' ? [pickValue] : []" :region="region"
padding="10rpx 0"></uiswiper>
<view class="table-box">
<view class="thead" style="height: 50rpx">
<view class="tr">
<view style="height: 50rpx" class="w-25p flex justify-center items-center">品名、材质</view>
<view style="height: 50rpx" class="w-20p flex justify-center items-center">采购量</view>
<!-- <view class="th">收货地</view>-->
<view style="height: 50rpx" class="w-25p flex justify-center items-center">采购企业</view>
<view style="height: 50rpx" class="w-15p flex justify-center items-center">报价情况</view>
<view style="height: 50rpx" class="w-15p flex justify-center items-center">操作</view>
</view>
</view>
<view class="tbody">
<view class="tr" v-for="(item, index) in list.rows" :key="index">
<view class="w-25p td-n" @click="detailLink(item._id)">
<text class="u-line-2">
{{
item.productList.map(p => `${p.goodsName}${p.materialQuality ?
`(${p.materialQuality})` : ''}`).join("/")
}}
</text>
</view>
<view class="w-20p td-n">
<text>{{
item.productList.map(p => (p.procureNumber ? p.procureNumber : '') + (p.procureUnit ? p.procureUnit : '')).join("/")
}}
</text>
</view>
<!-- <view class="td">{{ item.fullAddress }}</view>-->
<view class="w-25p td-n">
<text v-if="item.user">
{{
item.user.accountType === 1 ? item.user.person.personName.replace(/^(.).*(.)$/, "$1*$2") : item.user.company.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6")
}}
</text>
</view>
<view class="w-15p td-n">{{ item.quoteNum }}家</view>
<view class="w-15p td-n">
<u-button
class="minibtn"
size="mini"
type="error"
plain
text="详情"
@click="detailLink(item._id)"
></u-button>
</view>
</view>
</view>
</view>
</view>
<!-- 暂无数据 -->
<u-empty mode="list" text="暂无更多内容~" v-if="list.rows.length === 0"></u-empty>
<!-- <cmempty></cmempty> -->
<!-- <view v-if="showMore" class="more-btns">-->
<!-- <view class="item" @click="toMyQuote">-->
<!-- <u-icon name="order" color="#A92924" size="24"></u-icon>-->
<!-- </view>-->
<!-- <view class="item" @click="toMyEnquiry">-->
<!-- <u-icon name="account" color="#A92924" size="24"></u-icon>-->
<!-- </view>-->
<!-- <view class="item" @click="toRelease">-->
<!-- <u-icon name="plus" color="#A92924" size="24"></u-icon>-->
<!-- </view>-->
<!-- </view>-->
<!-- <view class="issue" @click="showMore = !showMore">-->
<!-- <u-icon :name="showMore ? 'close' : 'plus'" color="#fff" size="24"></u-icon>-->
<!-- </view>-->
<AddressSelect ref="AddressSelect" @confirm="regionConfirm"/>
<u-picker v-if="isPick" :show="isPick" :columns="[allProductList]"
key-name="name" @confirm="handConfirmPick" @cancel="isPick = false">
<template #more>
<text @click="otherCateFilter" class="mr-15">其他分类</text>
<text @click="resetCate">重置</text>
</template>
</u-picker>
<u-picker v-if="isPickStatus" :show="isPickStatus"
:columns="[[{name: '正在询价', value: 'notPick'}, {name: '合作成交', value: 'picked'}, ]]"
key-name="name" @confirm="handConfirmStatusPick" @cancel="isPickStatus = false">
</u-picker>
<collapse></collapse>
</view>
</template>
<script>
import uiheader from '@/components/index/header'
import cmsearch from '@/components/common/search'
import cmempty from '@/components/common/empty'
import cmswiper from '@/components/common/swiper'
import {FactoryBuilding} from "@icon-park/vue";
import AddressSelect from "@/components/AddressSelect.vue";
import Collapse from "@/components/index/collapse.vue";
import uiswiper from "@/components/index/swiper.vue";
export default {
components: {
uiswiper,
Collapse,
AddressSelect,
FactoryBuilding,
uiheader,
cmsearch,
cmempty,
cmswiper,
},
data() {
return {
allChildCate: [],
categoryTreeData: [],
checkCategoryList: [],
allProductList: [],
list: {
rows: [],
total: 0
},
pageSize: 500,
keyword: '',
area: null,
showMore: false,
locationValue: '全国',
region: {
province: {
code: null,
name: null,
},
city: {
code: null,
name: null,
},
area: {
code: null,
name: null,
}
},
pickValue: '全部',
isPick: false,
cateId: null,
cateIndex: [0, 0],
status: '正在询价',
statusVal: 'notPick',
isPickStatus: false,
};
},
methods: {
handleChangeCate({indexs}) {
this.cateIndex = indexs
},
handConfirmPick({value}) {
this.pickValue = value[0].name
this.cateId = value[0]._id
this.isPick = false
this.search(1)
},
handConfirmStatusPick({value}) {
this.status = value[0].name
this.statusVal = value[0].value
this.isPickStatus = false
this.search(1)
},
resetCate() {
this.cateIndex = [0, 0]
this.pickValue = '全部'
this.cateId = null
this.isPick = false
this.search(1)
},
showAddress() {
this.$refs.AddressSelect.open(this.region, 3, true);
},
regionConfirm({province, city, area}) {
this.region = {province, city, area}
this.locationValue = !province.code ? '全国' : `${province.name}${city.name}${area.name}`
this.search(1)
},
detailLink(id) {
vk.navigateTo(`/pages/price/detail?id=${id}`);
},
toMyEnquiry() {
vk.navigateTo({
url: '/pages/price/my'
})
},
toMyQuote() {
vk.navigateTo({
url: '/pages/price/myQuote'
})
},
async toRelease() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
uni.showModal({
title: '提示',
content: '您尚未认证, 是否前往认证?',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 0)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
uni.showModal({
title: '提示',
content: '请完善名片信息',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 1)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (accountNum === 0) {
uni.showModal({
title: '提示',
content: '请先到个人中心添加收款账户',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 7)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else {
if (userInfo.businessCard.status !== 1) {
uni.showModal({
title: '提示',
content: '您的名片信息未审核,请耐心等待',
})
return
}
vk.navigateTo({
url: '/pages/price/publish'
})
}
},
selectArea(e) {
this.area = e[2]
this.search(1)
},
afterSearch(keyword) {
this.keyword = keyword
this.search()
},
otherCateFilter() {
this.pickValue = '其他'
this.cateId = -1
this.isPick = false
this.search(1)
},
search(pageIndex = 1) {
// const cateList = []
// this.allChildCate.forEach(item => {
// if (this.checkCategoryList.includes(item._id)) cateList.push(item.name)
// })
vk.callFunction({
url: 'client/enquiry/sheet/pub/getList',
title: '请求中...',
data: {
pageIndex,
pageSize: this.pageSize,
keyword: this.keyword,
// companyList: this.checkCompanyList,
// categoryIds: this.checkCategoryList
cateList: this.cateId ? [this.pickValue === '其他' ? 0 : this.pickValue] : null,
// material: this.checkTextureList,
area: this.region.area ? this.region.area.code : null,
status: this.statusVal
},
success: (data) => {
this.list = data
this.list.rows.forEach((val, index) => {
this.list.rows[index].fullAddress = (val.addressRegion && val.addressRegion.province) ? `${val.addressRegion.province.name}${val.addressRegion.city.name}${val.addressRegion.area.name}` : ''
if (val.addressDetail) this.list.rows[index].fullAddress += val.addressDetail
})
}
});
},
async getCate() {
const {rows} = await vk.callFunction({
url: 'client/spot/category/pub/getTree',
title: '请求中...',
});
this.allProductList = []
rows.map(item => {
item.children.forEach(child => {
this.allProductList.push({
...child,
parentName: item.name
})
})
item.idList = []
return item
})
}
},
onLoad(option) {
if (option.keyword) this.keyword = option.keyword
// vk.callFunction({
// url: 'client/enquiry/template/pub/getList',
// title: '请求中...',
// data: {},
// success: (data) => {
// this.categoryTreeData = data.rows
// this.allChildCate = []
// this.categoryTreeData.forEach(item => {
// item.children.forEach(child => {
// this.allChildCate.push(child)
// })
// })
// }
// });
this.getCate()
this.search()
}
}
</script>
<style lang="scss">
.minibtn {
width: 60rpx;
font-size: 20rpx;
color: #A92924 !important;
border-color: #A92924;
}
.layout-pick {
// width: 690rpx;
//height: 68rpx;
padding: 0 30rpx;
font-size: 24rpx;
line-height: 40rpx;
color: #4F4F4F;
.ip {
position: relative;
//max-width: 33.333%;
height: 40rpx;
padding-right: 30rpx;
overflow: hidden;
box-sizing: border-box;
}
.down::after {
position: absolute;
right: 0rpx;
top: 50%;
z-index: 9;
content: '';
margin-top: -6rpx;
width: 0;
height: 0;
border-left: 10rpx solid transparent;
border-right: 10rpx solid transparent;
border-top: 12rpx solid #999999;
}
}
.layout-work {
margin: 20rpx 10rpx;
}
.tr {
display: flex;
justify-content: space-between;
align-items: center;
}
.table-box {
font-size: 24rpx;
line-height: 28rpx;
text-align: center;
}
.th, .td {
display: flex;
justify-content: center;
align-items: center;
width: 20%;
height: 76rpx;
color: #000;
overflow: hidden;
box-sizing: border-box;
&:nth-child(2) {
width: 15%;
}
&:nth-child(4) {
width: 15%;
}
&:nth-child(5) {
width: 30%;
}
}
.td-n {
border-right: 1px solid #f2f2f2;
border-bottom: 1px solid #f2f2f2;
background: #ffffff;
height: 60rpx;
display: flex;
align-items: center;
justify-content: center;
&:first-child {
color: #A92924;
}
&:last-child {
border-right: none;
}
}
.more-btns {
position: fixed;
right: 30rpx;
bottom: 220rpx;
z-index: 99;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 90rpx;
border-radius: 999rpx;
background: white;
border: 1px solid #A92924;
.item {
margin: 20rpx 0;
}
}
</style>
File diff suppressed because it is too large Load Diff
+470
View File
@@ -0,0 +1,470 @@
<template>
<view class="">
<u-sticky offset-top="0" customNavHeight="0">
<uititle title="出证申请"></uititle>
</u-sticky>
<view class="w-100p">
<view class="certificate-container bg-white p-20">
<!-- 申请表格 -->
<u-parse :content="content"></u-parse>
<!-- 出证样板选择 -->
<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 pos-r">
<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="收件人姓名:">-->
<!-- <el-input v-model="form.electronicDelivery.receiver"></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="手机号码:">-->
<!-- <el-input v-model="form.electronicDelivery.phone"></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="收件邮箱:">-->
<!-- <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="收件人姓名:">
<el-input v-model="form.paperDelivery.receiver"></el-input>
</el-form-item>
<el-form-item label="手机号码:">
<el-input v-model="form.paperDelivery.phone"></el-input>
</el-form-item>
<el-form-item label="收件地址:">
<el-input v-model="form.paperDelivery.address"></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="advance">公对公支付</el-radio>
<el-radio v-model="form.paymentMethod" label="online">在线支付</el-radio>
<template v-if="form.paymentMethod === 'advance'">
<u-upload
:fileList="payVoucher"
@afterRead="afterRead($event, 'payVoucher')"
@delete="deletePic($event, 'payVoucher')"
:maxCount="1"
width="120rpx"
height="120rpx"
></u-upload>
<p>上传付款凭证</p>
</template>
</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>
<el-button type="primary" @click="uploadSuccess" v-else>提交支付</el-button>
</view>
<!-- 客服电话 -->
<view class="text-center">
<view class="service-phone">客服电话:400 686 5559</view>
</view>
</view>
</view>
</view>
</template>
<script>
import uititle from "@/components/common/title.vue";
import dayjs from "dayjs";
export default {
components: {uititle},
data() {
return {
form: {
sampleSelected: 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: '',
paidConfirm: false,
hasReport: false,
},
contractId: null,
transactionId: null,
amount: null,
urgentAmount: null,
content: null,
bankAccount: null,
payVoucher: []
}
},
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
},
afterRead({file}, field) {
uniCloud.uploadFile({
filePath: file.url,
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + file.name,
success: ({fileID}) => {
uniCloud.getTempFileURL({
fileList: [fileID]
}).then(res => {
this.payVoucher = [{url: res.fileList[0].tempFileURL}]
this.form.payVoucher = res.fileList[0].tempFileURL;
})
}
})
},
deletePic({index}, field) {
this[field] = []
this.form.payVoucher = null
},
uploadSuccess() {
if (!this.form.payVoucher) return vk.toast('请上传付款凭证');
this.submitForm()
},
submitForm() {
// 表单验证
if (!this.validateForm()) {
return;
}
if (this.form.certificateType === 'normal') {
this.form.amount = this.amount;
} else {
this.form.amount = this.urgentAmount;
}
uni.showModal({
title: '温馨提示',
content: `司法调证服务需向数据中心付费(${this.form.amount}元/次),是否继续?`,
success: async res => {
if (res.confirm) {
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/shop/pay?id=${data}`
})
} else {
this.$message({
message: '请等待后台审核',
type: 'success'
});
setTimeout(() => {
vk.navigateTo({
url: `/pages/public/sign?tab=signBuyLog`
})
}, 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;
},
async getBankAccount() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: 'b5ad93e068f343230344c7b63cb1aac5'
},
})
this.bankAccount = res.content
},
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;
}
},
}
}
</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>
+680
View File
@@ -0,0 +1,680 @@
<template> <!-- 合同管理 -->
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uititle title="合同管理"></uititle>
<!-- 选项卡 -->
<view class="layout layout-tab flex justify-between align-center">
<view :class="['tab', {active: tabIndex == 0}]" @click="handTab(0)">待创建</view>
<view :class="['tab', {active: tabIndex == 1}]" @click="handTab(1)">待签署</view>
<view :class="['tab', {active: tabIndex == 2}]" @click="handTab(2)">已完成</view>
<!-- <view :class="['tab', {active: tabIndex == 3}]" @click="handTab(3)">已作废</view>-->
</view>
<u-subsection :list="signTypeList" :current="subsection" keyName="label" active-color="#A92924"
@change="changeSubsection"/>
</u-sticky>
<view>
<u-subsection :list="signTypeFilterList" :current="signTypeFilter" keyName="label" active-color="#A92924"
@change="changeSignTypeFilter" v-if="tabIndex == 2"/>
<u-search bg-color="#FFFFFF" v-model="keyword" placeholder="输入签约方关键字搜索" @blur="query(1)" @custom="query(1)"></u-search>
</view>
<view class="layout layout-contract">
<view class="item" v-for="(item, index) in tableData.rows" :key="index">
<view class="title text-single m-right-20">
<text v-if="item.contract.status > 0">{{ item.contract.docTitle }}</text>
<text v-else-if="item.contract.status === 0 && item.sheet">{{ item.sheet.title }}</text>
</view>
<view class="flex justify-start align-center mt-15">
<template v-if="item.sheet">
<view class="mr-10">
<u-tag plain text="自主交易" size="mini" v-if="item.sheet.tradeMethod === 0" type="primary"
>
</u-tag>
<u-tag plain text="金久信公证" size="mini"
v-if="item.sheet.tradeMethod === 1 && item.contract.type !== 'sign'"
type="success">
</u-tag>
</view>
<view class="mr-10">
<u-tag plain text="标准合同" size="mini" effect="plain" v-if="item.sheet.signMethod === 0"
type="success">
</u-tag>
<u-tag plain text="双方协商合同" size="mini" effect="plain"
v-if="item.sheet.signMethod === 2"
type="primary">
</u-tag>
<u-tag plain text="线下合同" size="mini" effect="plain" v-if="item.sheet.signMethod === 1"
type="warning">
</u-tag>
</view>
</template>
<u-tag plain text="金久信公证" size="mini"
v-if="item.contract.tradeMethod === 1 && item.contract.type === 'sign'" class="mr-10"
type="success">
</u-tag>
<u-tag type="primary" v-if="item.contract.type === 'enquiry'" text="询价单" size="mini"
class="mr-10"/>
<u-tag type="success" v-else-if="item.contract.type === 'process'" text="加工单" size="mini"
class="mr-10"/>
<u-tag type="success" v-else-if="item.contract.type === 'sign'" text="金久信签约宝" size="mini"
class="mr-10"/>
<u-tag type="primary" v-else-if="item.contract.type === 'old'" text="旧货交易" size="mini"
class="mr-10"/>
<u-tag type="errpr" v-else-if="item.contract.type === 'self-support'" text="自营询价" size="mini"
class="mr-10"/>
<view v-if="item.contract.status === 1" class="flex justify-start items-center flex-wrap">
<view class="justify-start items-center flex-wrap"
v-for="(party, pIndex) in item.contract.partyList" :key="pIndex">
<u-tag size="mini" class="mr-10 ml-10"
v-if="party.userId !== userInfo._id && !party.sign && party.role !== 'third'" plain
type="error" text="待交易方签署"/>
<u-tag size="mini" class="mr-10 ml-10"
v-if="party.userId !== userInfo._id && !party.sign && party.role === 'third'" plain
type="error" text="待第三方签署"/>
<u-tag size="mini" class="mr-10 ml-10" v-if="party.userId === userInfo._id && !party.sign"
plain
type="primary" text="待我签署"/>
</view>
</view>
<view v-if="item.order" class="text-main text-25">
(订单状态:{{
item.order.orderStatus === 4 ? '已完成' : ([5, 6].includes(item.order.orderStatus) ? '订单终止' : '执行中')
}})
</view>
<!-- <view class="flex-1"></view>-->
<!-- <view class="date">2023-04-27到期,过期将无法签署</view>-->
</view>
<view class="sm m-top-20 flex flex-col justify-start items-start">
<text class="m-right-20">合同编码:{{ item.contract.transactionId }}</text>
<text class="m-right-20" v-if="item.sheet && item.contract.type !== 'old'">交易编码:{{
item.contract.type === 'enquiry' ? item.sheet.enquiryNo : item.sheet.orderNo
}}
</text>
<text class="m-right-20">创建时间:{{ item.contract._add_time_str }}</text>
<template v-if="parseInt(item.contract.status) > 0">
<text v-for="(party, partyIndex) in item.contract.partyList " :key="partyIndex">
<template v-if="party.role !== 'third'">
<template v-if="party.userId === item.contract.userId">
发起方签订完成时间:{{
party.signedAt ? dayjs(party.signedAt).format('YYYY-MM-DD HH:mm:ss') : ''
}}
</template>
<template v-if="party.userId !== item.contract.userId">
接收方签订完成时间:{{
party.signedAt ? dayjs(party.signedAt).format('YYYY-MM-DD HH:mm:ss') : ''
}}
</template>
</template>
<template v-if="party.role === 'third'">
第三方签订完成时间:{{
party.signedAt ? dayjs(party.signedAt).format('YYYY-MM-DD HH:mm:ss') : ''
}}
</template>
</text>
</template>
<view v-if="item.contract.signEndDate">
<text>签订截止时间:{{
dayjs(item.contract.signEndDate).format('YYYY-MM-DD HH:mm:ss')
}}</text>
<text class="text-red ml-20" v-if="item.contract.signCount === 0">{{ dayjs(item.contract.signEndDate).isBefore(dayjs()) ? '已超时限' : '' }}</text>
</view>
<view v-if="item.contract.type === 'sign' && item.contract.payUser && item.contract.payUser.user">
费用承担方:{{
item.contract.payUser.user.accountType === 2 ?
item.contract.payUser.user.company.companyName : item.contract.payUser.user.person.personName
}}
</view>
</view>
<view class="flex justify-start align-center m-top-20">
<view class="op flex justify-start align-center m-right-30" @click="showParty(item)">
<u-icon name="chat" color="#A92924" size="18"></u-icon>
<text class="op-text m-left-10">查看交易方</text>
</view>
</view>
<view class="mt-20 flex justify-start align-center">
<view class="op flex justify-start align-center"
v-if="item.contract.status === 0 && item.contract.userId === userInfo._id"
@click="createContract(item.contract)">
<u-icon name="plus-circle" color="#A92924" size="18"></u-icon>
<text class="op-text m-left-10">创建合同</text>
</view>
<view class="mr-10">
<u-button @click.native="changeContract(item.contract)" custom-style="padding: 0"
v-if="((item.sheet && item.sheet.signMethod === 2) || item.contract.type === 'sign' || item.contract.type === 'self-support')
&& item.contract.status === 1
&& item.contract.userId === userInfo._id && item.contract.signCount === 0"
size="mini" type="primary">修改合同内容
</u-button>
</view>
<view class="ml-10">
<u-button custom-style="padding: 0" v-if="item.contract.userId === userInfo._id"
@click="delContract(item.contract)" size="mini" type="text">
删除合同
</u-button>
</view>
<template v-if="parseInt(item.contract.status) === 1 && dayjs(item.contract.signEndDate).isAfter(dayjs())">
<view class="ml-10">
<u-button @click="extSign(item.sign, item.contract)" size="mini" type="primary"
:disabled="item.sign">
{{ item.sign ? '已签署' : '签署文件' }}
</u-button>
</view>
</template>
<template v-if="parseInt(item.contract.status) === 2">
<view class="ml-10">
<u-button custom-style="padding: 0"
@click="viewContract(item.contract)"
size="mini" plain>
{{ parseInt(item.contract.signType) === 1 ? '查看单据' : '查看合同' }}
</u-button>
</view>
<view class="ml-10">
<u-button custom-style="padding: 0" @click="downloadContract(item.contract.transactionId)" type="success"
size="mini" plain>
{{ parseInt(item.contract.signType) === 1 ? '下载单据' : '下载合同' }}
</u-button>
</view>
<view class="ml-10">
<u-button @click="payDownloadContract(item.contract)" type="primary" custom-style="padding: 0"
size="mini" plain>
{{
parseInt(item.contract.signType) === 1 ? '下载单据(付费司法调证)' : '下载合同(付费司法调证)'
}}
</u-button>
</view>
</template>
<view class="ml-10">
<u-button custom-style="padding: 0"
v-if="item.order && parseInt(item.contract.status) === 2 && ((item.sheet && item.sheet.tradeMethod === 1) || item.contract.tradeMethod === 1)"
@click="$jump(`/pages/shop/order?menuIndex=${item.role === 'buyer' ? 1 : 0}&keyword=${item.order.orderNo}`)"
size="mini"
:type="(item.order && item.order.orderStatus > 4) ? 'info' :'success'">
{{
(item.order && item.order.orderStatus === 4) ? '订单已结束' : ([5, 6].includes(item.order.orderStatus) ? '订单已终止' : (item.role === 'buyer' ? '去付款' : '去请款'))
}}
</u-button>
</view>
<view class="ml-10">
<u-button custom-style="padding: 0"
v-if="item.contract.otherFile && item.contract.otherFile.length > 0"
@click="openDownload(item.contract.otherFile)" plain
size="mini"
type="info">查看附件
</u-button>
</view>
</view>
</view>
</view>
<!-- 没有数据 u-empty是框架组件 cmempty是自己封装组件 -->
<u-empty mode="list" text="暂无更多内容~"></u-empty>
<!-- <cmempty></cmempty> -->
<u-popup :show="show" mode="center" @close="show = false" closeable close-on-click-overlay
:custom-style="{width: '90%'}">
<view class="p-30">
<view class="mb-10">名称:{{ title }}</view>
<view class="mb-10">联系人:{{ name }}</view>
<view class="mb-10">联系方式:{{ companyMobile }}</view>
</view>
</u-popup>
<contact-modal ref="contactModal"/>
<u-modal :show="showPartyModal" title="交易方" @confirm="showPartyModal = false">
<u-parse :content="partyContent"></u-parse>
</u-modal>
</view>
</template>
<script>
import uititle from '@/components/common/title'
import cmsearch from '@/components/common/search'
import cmempty from '@/components/common/empty'
import dayjs from "dayjs";
import ContactModal from "@/components/ContactModal.vue";
import {Loading} from "element-ui";
const SIGN_CONFIRM_CONTENT = `1、您确认,若全体各签约方未完成全部签约流程,本签约文件不发生法律效力,系统无法对该签约文件予以保存及提供司法调证服务;
2、您确认,当前签约的实名主体名称、手机号码与注册认证阶段提交的信息未发生变更;若发生变更,必须及时进行重新认证后方可继续签约,避免产生严重法律风险与经济损失;
3、您确认,本次签约为本系统实名认证主体操作,如若不是实名认证主体操作,授权委托人需本系统进行授权认证后签约;
4、您确认,您与其他签约方均系在平等、自愿的基础上完成本次签约;
5、你确认,此次签约内容符合《中华人民共和国电子签名法》《民法典》生效保护范畴;
6、如因法律法规、监管部门政策更新等原因,系统提示您重新进行实名认证、证书续期等重要提示时,请您必须在签约前完成,否则造成任何损失,平台不承担任何责任;以上签约条件您均已经知悉并确认,否则您有权拒绝本次签约。`
export default {
components: {
ContactModal,
uititle,
cmsearch,
cmempty,
},
data() {
return {
tabIndex: 0,
tableData: {},
userInfo: null,
show: false,
title: '',
name: '',
companyMobile: '',
signTypeList: [
{
tradeMethod: null,
type: null,
label: '全部'
},
{
tradeMethod: 0,
type: null,
label: '自主交易'
},
{
tradeMethod: 1,
type: null,
label: '金久信公正'
},
{
tradeMethod: null,
type: 'sign',
label: '金久信签约宝'
},
],
subsection: 0,
signTypeFilterList: [
{
value: '2',
label: '合同签约'
},
{
value: '1',
label: '单据签约'
},
],
signTypeFilter: 0,
keyword: '',
numToChForThird: ['三', '四', '五', '六', '七', '八', '九', '十'],
showPartyModal: false,
partyContent: ''
}
},
methods: {
dayjs,
handTab(index) {
this.tabIndex = index
this.query(1)
},
detailLink(val) {
vk.navigateTo('/pages/public/create')
},
menuSelect(e) {
this.menuIndex = String(e)
this.formData.status = Number(e)
this.isSign = false
this.query(1)
},
selectSign() {
this.isSign = true
this.menuIndex = ''
},
changeSubsection(index) {
this.subsection = index
this.query(1)
},
changeSignTypeFilter(index) {
this.signTypeFilter = index
this.query(1)
},
async query(pageIndex) {
this.tableData = await vk.callFunction({
url: 'client/contract/kh/getList',
title: '请求中...',
data: {
pageIndex,
pageSize: 500,
status: this.tabIndex,
tradeMethod: this.signTypeList[this.subsection].tradeMethod,
type: this.signTypeList[this.subsection].type,
keyword: this.keyword,
signType: this.signTypeFilter === 1 ? '1' : '2',
},
});
this.$forceUpdate()
},
/**
* 创建合同
* @param contract
*/
createContract(contract) {
// this.form1.contractId = contract._id
this.$jump(`/pages/public/create?contractId=${contract._id}`)
},
async changeContract(contract) {
this.$jump(`/pages/public/create?contractId=${contract._id}`)
},
onFormSuccess() {
this.form1.props.show = false
// this.form1.data.contractId = null
// this.formData.status = 1
// this.menuIndex = '1'
// this.isSign = false
// this.$refs.form2.resetForm()
// this.$refs.form1.resetForm()
// this.query(1)
vk.redirectTo({url: '/pages/contract/index?tab=1'})
},
/**
* 签署合同
* @param sign
* @param contract
*/
extSign(sign, contract) {
if (sign) return
uni.showModal({
title: '提示',
content: SIGN_CONFIRM_CONTENT,
showCancel: false,
confirmText: '知悉同意',
success: (confirmRes) => {
if (confirmRes.confirm) {
vk.callFunction({
url: 'client/contract/kh/extSign',
title: '请求中...',
data: {
contractId: contract._id,
isWap: true
},
success: (res) => {
window.location.href = res.data
// window.open(res.data)
}
});
}
}
});
},
showStopSign(contract) {
vk.callFunction({
url: 'client/contract/kh/extSign',
title: '请求中...',
data: {
contractId: contract._id
},
success: (res) => {
// window.open(res.data)
window.location.href = res.data
}
});
},
viewContract(contract) {
vk.callFunction({
url: 'client/contract/kh/viewContract',
title: '请求中...',
data: {
contractId: contract._id
},
success: (res) => {
window.location.href = res.data
// window.open(res.data)
this.query(1)
}
});
},
navTo(url) {
vk.navigateTo({
url: url
})
},
showParty(userContract) {
// let content = ''
// userContract.contract.partyList.forEach(party => {
// // if (party.userId !== userContract.userId) partyUser = party.user
// const partyUser = party.user
// if (partyUser) {
// const name = partyUser.nickname
// let role = party.role === 'buyer' ? '购买方' : '销售方'
// if (party.role === 'third') role = '第三方'
// content += `<view class="flex flex-col justify-start items-start py-10 border-bottom">
// <view>身份:${role}</view>
// <view>联系人:${name}</view>
// <view>联系方式:${partyUser.mobile}</view></view>`
// }
// })
let content = ''
const buyer = userContract.contract.partyList.find(item => item.role !== 'third' && userContract.contract.userId === item.userId)
const seller = userContract.contract.partyList.find(item => item.role !== 'third' && userContract.contract.userId !== item.userId)
const thirdList = userContract.contract.partyList.filter(item => item.role === 'third')
content += `<div class="flex flex-col justify-start items-start py-10 border-bottom">
<div>身份:发起方</div>
<div>联系人:${buyer.user.nickname}</div>
<div>联系方式:${buyer.user.mobile}</div></div>`
content += `<div class="flex flex-col justify-start items-start py-10 border-bottom">
<div>身份:接收方</div>
<div>联系人:${seller.user.nickname}</div>
<div>联系方式:${seller.user.mobile}</div></div>`
thirdList.forEach((item, index) => {
console.log(item)
content += `<div class="flex flex-col justify-start items-start py-10 border-bottom">
<div>身份:第${this.numToChForThird[index]}方</div>
<div>联系人:${item.user.nickname}</div>
<div>联系方式:${item.user.mobile}</div></div>`
})
// this.$confirm(content, '', {
// cancelButtonText: '关闭',
// showConfirmButton: false,
// dangerouslyUseHTMLString: true
// })
this.partyContent = content
this.showPartyModal = true
},
changeTradeMethod(tradeMethod) {
this.formData.tradeMethod = tradeMethod
this.formData.type = null
this.query(1)
},
changeType(type) {
this.formData.tradeMethod = null
this.formData.type = type
this.query(1)
},
openDownload(otherFile) {
for (let file in otherFile) {
// window.open(otherFile)
window.location.href = otherFile
}
},
async getCommonContractUrl() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '657d36befe975f63af1f24e7'
},
})
this.contractTemplate = res.content
},
downloadContractTemplate() {
// window.open(this.contractTemplate)
window.location.href = this.contractTemplate
},
async delContract(contract) {
uni.showModal({
title: '温馨提示',
content: '请您确认文件无用或已经完成履约后再删除文件,删除后平台将无法为您提供相关数据,您将无法查询已经删除文件。请您谨慎操作。',
success: async res => {
if (res.confirm) {
await vk.callFunction({
url: 'client/contract/kh/del',
data: {
id: contract._id
},
success: (res) => {
this.query(1)
}
})
}
}
})
},
async payDownloadContract(contract) {
const amountRes = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: 'ded3e568662e5817000026633aad1e69'
},
})
if (!contract.canDownloadUidList || !contract.canDownloadUidList.includes(this.userInfo.uid)) {
if (contract.certificate && !contract.certificate.paidConfirm) {
if (contract.certificate.paymentMethod === 'online') {
return vk.navigateTo({
url: `/pages/shop/pay?id=${contract.certificate.orderId}`
})
}else return vk.toast('请先等待后台确认支付')
}
vk.navigateTo({
url: `/pages/public/certificate?contractId=${contract._id}&transactionId=${contract.transactionId}&amount=${amountRes.content}`
})
} else {
uni.showModal({
title: '温馨提示',
content: '您提交申请后,平台将在两个工作日内向您提供合法生效文件,客服电话:400-686-5559',
success: async res => {
if (res.confirm) {
if (contract.certificate) {
if (contract.certificate.deliveryMethods.paper) {
vk.toast('您的司法调证文件已发货,请注意查收')
} else {
if (contract.certificate.downloadUrl) window.open(contract.certificate.downloadUrl)
else vk.toast('文件生成中,请耐心等待')
}
} else vk.toast('操作失败,请联系客服')
}
}
})
}
},
async downloadContract(contract_id) {
let loadingInstance1 = Loading.service({fullscreen: true, text: '加载中...'});
const res = await vk.callFunction({
url: 'client/contract/pub/getDownload',
data: {
contract_id
}
});
loadingInstance1.close()
if (res) {
// window.open(`https://textapi.fadada.com/api2/downLoadContract.api?app_id=502704&timestamp=${res.data.timestamp}&v=2.0&msg_digest=${res.data.msg_digest}&contract_id=${contract_id}`)
window.location.href = `https://textapi.fadada.com/api2/downLoadContract.api?app_id=502704&timestamp=${res.data.timestamp}&v=2.0&msg_digest=${res.data.msg_digest}&contract_id=${contract_id}`
}
},
},
onLoad(option) {
if (option.tab) this.tabIndex = parseInt(option.tab)
this.userInfo = vk.getStorageSync('uni_id_user_info')
this.query(1)
},
}
</script>
<style lang="scss">
page {
background: #ffffff;
}
/deep/ .u-tag--mini {
padding: 0 1px !important;
}
.layout-tab {
height: 100rpx;
padding: 0 30rpx;
background: #f1f1f1;
.tab {
margin: 0 20rpx;
padding: 10rpx 0rpx;
font-size: 28rpx;
line-height: 40rpx;
color: #666666;
}
.active {
position: relative;
color: #A92924;
&::after {
position: absolute;
left: 0;
bottom: 0;
z-index: 9;
content: '';
width: 100%;
height: 1px;
background: #A92924;
}
}
}
.layout-contract {
padding: 10rpx 30rpx;
.item {
padding: 30rpx 0rpx;
border-bottom: 1px solid #f2f2f2;
&:last-child {
border-bottom: none;
}
.sm {
font-size: 24rpx;
line-height: 40rpx;
color: #999999;
}
.title {
//max-width: 300rpx;
font-size: 28rpx;
line-height: 40rpx;
color: #101010;
}
}
.tag {
display: inline-block;
padding: 0 10rpx;
height: 36rpx;
font-size: 22rpx;
line-height: 36rpx;
color: #A92924;
text-align: center;
background-color: rgba(169, 41, 36, 0.13);
}
.date, .op-text {
font-size: 24rpx;
line-height: 40rpx;
color: #A92924;
}
.xiugai {
width: 130rpx;
height: 44rpx;
font-size: 24rpx;
line-height: 44rpx;
color: #ffffff;
text-align: center;
background: #A92924;
}
}
.trade-method-item {
cursor: pointer;
font-size: 25rpx;
margin-right: 15rpx;
line-height: 40rpx;
}
</style>
+470
View File
@@ -0,0 +1,470 @@
<template> <!-- 创建合同 -->
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<uititle :title="isAdd ? '创建合同' : '修改合同'"></uititle>
</u-sticky>
<view class="layout layout-create">
<view class="group flex align-center">
<view class="label">
<text>标题:</text>
<text class="required">*</text>
</view>
<view class="flex-1 m-left-10">
<u--input
placeholder="请输入内容"
border="bottom"
v-model="formData.title"
></u--input>
</view>
</view>
<view v-for="(item, index) in formData.thirdList" :key="index"
class="flex justify-start items-start my-10 flex-col">
<view class="text-left">第{{ ['三', '四', '五', '六', '七', '八', '九', '十'][index] }}方:</view>
<view class="mt-10 w-100p">
<el-input v-model="formData.thirdList[index].phone"
:placeholder="`请输入第${['三', '四', '五', '六', '七', '八', '九', '十'][index]}方手机号`"/>
</view>
<view class="mt-10 w-100p flex justify-start items-center">
<el-input v-model="formData.thirdList[index].signKeyword"
:placeholder="`请输入第${['三', '四', '五', '六', '七', '八', '九', '十'][index]}方签章关键字`"/>
<view class="flex justify-center items-center mt-10">
<i class="el-icon-circle-plus text-main text-50 ml-35" @click="addThird"/>
<i class="el-icon-remove text-50 ml-35" @click="removeThird(index)"/>
</view>
</view>
</view>
<p class="text-25 text-gray mt-20">如无第三方签约可忽略,签章关键字使用方法同下。</p>
<view class="group flex align-center m-top-30">
<view class="label">
<text>签署截止日期:</text>
<text class="required">*</text>
</view>
<view class="flex-1 m-left-10" @click="showDatePicker = true">
<u--input
style="pointer-events:none"
placeholder="点击选择签署截止日期"
border="surround"
v-model="signEndDate"
suffixIcon="calendar"
suffixIconStyle="font-size: 26px;color: #909399"
:customStyle="inputClass"
></u--input>
</view>
</view>
<view class="text-24 text-gray mt-10">
发起方填写签署截止日期和时间即为各签约方共同认可的签署时间,请酌情填写仔细阅读签署文件。
</view>
<view class="group flex flex-col justify-start items-start mt-20">
<view class="label">签约发起方关键字:</view>
<view class="w-100p">
<u--input
placeholder="发起方盖章关键字"
v-model="formData.buyerSignKeyword"
></u--input>
</view>
<view class="text-24 text-gray mt-10">
请先在手机办公软件上(Office、WPS等)内,复制粘贴或输入预盖章部位关键字核验确认位置和内容,再点击上传文档核实无误后可返回签署页面输入测验关键字后进行签署(如同一关键字文档多次使用无误后可考虑省略检测流程)。系统将按此关键字进行签章位置的定位,将电子章盖在这个关键字上面。凡出现关键字的地方均会盖上指定用户的电子章,建议关键字在合同中保持唯一。
</view>
</view>
<view class="group flex flex-col justify-start items-start mt-20">
<view class="label">签约接收方关键字:</view>
<view class="w-100p">
<u--input
placeholder="接收方盖章关键字"
v-model="formData.sellerSignKeyword"
></u--input>
</view>
<view class="text-24 text-gray mt-10">
请先在手机办公软件上(Office、WPS等)内,复制粘贴或输入预盖章部位关键字核验确认位置和内容,再点击上传文档核实无误后可返回签署页面输入测验关键字后进行签署(如同一关键字文档多次使用无误后可考虑省略检测流程)。系统将按此关键字进行签章位置的定位,将电子章盖在这个关键字上面。凡出现关键字的地方均会盖上指定用户的电子章,建议关键字在合同中保持唯一。
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="label">签署文档:</view>
</view>
<view class="file-box m-top-30">
<view class="file">
<view class="justify-between flex" v-if="formData.contractFile">
<view class="icon flex justify-start items-center text-25">
<file-pdf-one theme="outline" class="pointer" size="40" fill="#f5a623"
strokeLinecap="square" @click="previewDoc"/>
<text class="ml-10" v-if="Array.isArray(formData.contractFile)">
{{ formData.contractFile[formData.contractFile.length - 1].split('-').pop() }}
</text>
<text class="ml-10" v-else>{{ formData.contractFile.split('-').pop() }}</text>
</view>
<u-icon name="trash" size="26" @click="formData.contractFile = ''"></u-icon>
</view>
<view class="add" v-else @click="uploadContract">+上传合同</view>
</view>
</view>
<view class="text-25 text-gray flex-1 mt-15">
仅支持PDF文件,如有其他附件或多个单据签约请合并成一个PDF文档上传。且仅支持纵向文档上传,横向文档显示不完整。
电子签署文件中需添加以下内容以增强双方约束力和文件法律效力:签约双方均自愿通过以“电子签约”形式进行签约,电子签名和加盖电子印章双方均予以认可具有法律效力。
</view>
<!-- <view class="group flex items-start m-top-30 w-100p">-->
<!-- <view class="flex flex-col justify-start items-start flex-1">-->
<!-- <view class="flex justify-starts">-->
<!-- <view class="label">附件:</view>-->
<!-- <view class="nmb">({{ formData.otherFile.length }})</view>-->
<!-- </view>-->
<!-- <view class="text-20 text-gray mt-10">仅支持PDF</view>-->
<!-- </view>-->
<!-- <view class="add" @click="addOtherFile">+添加附件</view>-->
<!-- </view>-->
<!-- <view class="file-box m-top-30" v-if="formData.otherFile.length > 0">-->
<!-- <view class="file">-->
<!-- <view class="item flex justify-between" v-for="(item, index) in formData.otherFile" :key="index">-->
<!-- <view class="flex justify-start items-start">-->
<!-- <view class="icon">-->
<!-- <file-pdf-one theme="outline" class="pointer" size="40" fill="#f5a623"-->
<!-- strokeLinecap="square"/>-->
<!-- </view>-->
<!-- <view class="info flex-1 m-left-30">-->
<!-- <view class="name">附件{{ index + 1 }}</view>-->
<!-- </view>-->
<!-- </view>-->
<!-- <u-icon name="trash" size="26" @click="removeFile(index)"></u-icon>-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
</view>
<u-button class="public-btn" text="确定" @click="create"></u-button>
<u-datetime-picker :show="showDatePicker" v-model="expireTime" mode="datetime"
:minDate="minDate" @cancel="showDatePicker = false"
@confirm="handConfirmDate"></u-datetime-picker>
<el-dialog title="合同预览" :visible.sync="showPdf" width="90%" append-to-body>
<view style="height: 1000rpx">
<u-pdf :url="pdfUrl" v-if="pdfUrl" :showBottom="false" :show-timer="false" :disabled="false" viewHeight="800rpx"
@onClickReader="closePdf"/>
</view>
</el-dialog>
</view>
</template>
<script>
import uititle from '@/components/common/title'
import {FilePdfOne} from "@icon-park/vue";
import dayjs from "dayjs";
import md5 from 'js-md5';
import uPdf from '@/components/u-pdf/u-pdf.vue'
const SIGN_CONFIRM_CONTENT = `1、您确认,若全体各签约方未完成全部签约流程,本签约文件不发生法律效力,系统无法对该签约文件予以保存及提供司法调证服务;
2、您确认,当前签约的实名主体名称、手机号码与注册认证阶段提交的信息未发生变更;若发生变更,必须及时进行重新认证后方可继续签约,避免产生严重法律风险与经济损失;
3、您确认,本次签约为本系统实名认证主体操作,如若不是实名认证主体操作,授权委托人需本系统进行授权认证后签约;
4、您确认,您与其他签约方均系在平等、自愿的基础上完成本次签约;
5、你确认,此次签约内容符合《中华人民共和国电子签名法》《民法典》生效保护范畴;
6、如因法律法规、监管部门政策更新等原因,系统提示您重新进行实名认证、证书续期等重要提示时,请您必须在签约前完成,否则造成任何损失,平台不承担任何责任;以上签约条件您均已经知悉并确认,否则您有权拒绝本次签约。`
export default {
components: {
FilePdfOne,
uititle,
uPdf,
},
data() {
return {
inputClass: {
// height: '20px',
width: '200px',
borderRadius: 0,
},
formData: {
contractId: '',
signEndDate: '',
title: '',
contractFile: '',
buyerSignKeyword: '',
sellerSignKeyword: '',
otherFile: [],
thirdList: [{phone: '', signKeyword: ''}],
},
showDatePicker: false,
minDate: Number(new Date()),
signEndDate: '',
expireTime: '',
isAdd: true,
pdfUrl: '',
showPdf: false,
};
},
methods: {
handConfirmDate({value}) {
this.signEndDate = dayjs(value).format('YYYY-MM-DD HH:mm:ss')
this.formData.signEndDate = dayjs(value).toISOString()
this.showDatePicker = false
},
uploadContract() {
uni.chooseFile({
count: 1,
extension: ['.pdf'],
success: ({tempFiles}) => {
if ((new RegExp(/\s+/g).test(tempFiles[0].name))) {
uni.showToast({
title: '文件名不能有空格',
icon: 'none'
})
return
}
const filename = tempFiles[0].name.split('.')[0]
uniCloud.uploadFile({
filePath: tempFiles[0].path,
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + md5(tempFiles[0].name + Math.random().toString()) + '-' + filename + '.pdf',
success: ({fileID}) => {
uniCloud.getTempFileURL({
fileList: [fileID]
}).then(res => {
this.formData.contractFile = res.fileList[0].tempFileURL
})
}
})
}
});
},
addOtherFile() {
uni.chooseFile({
count: 9,
extension: ['.pdf'],
success: ({tempFiles}) => {
tempFiles.forEach(file => {
uniCloud.uploadFile({
filePath: file.path,
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + file.name,
success: ({fileID}) => {
uniCloud.getTempFileURL({
fileList: [fileID]
}).then(res => {
this.formData.otherFile.push(res.fileList[0].tempFileURL)
})
}
})
})
}
});
},
removeFile(index) {
this.formData.otherFile.splice(index, 1)
},
async create() {
if (!this.formData.title) return this.$message.error('标题不能为空')
if (!this.formData.signEndDate) return this.$message.error('签署截止日期不能为空')
if (!this.formData.buyerSignKeyword) return this.$message.error('签约发起方关键字不能为空')
if (!this.formData.sellerSignKeyword) return this.$message.error('签约接收方关键字不能为空')
if (!this.formData.contractFile) return this.$message.error('签署文档不能为空')
this.formData.thirdList = this.formData.thirdList.filter(item => item.phone && item.signKeyword)
if (this.formData.thirdList.length > 0) {
for (let i = 0; i < this.formData.thirdList.length; i++) {
const item = this.formData.thirdList[i]
if (item.phone === '') {
vk.toast('请填写手机号')
return false
}
if (item.signKeyword === '') {
vk.toast('请填写签章关键字')
return false
}
if (item.phone === this.formData.phone) {
vk.toast('第三方手机号不能与接收方手机号相同')
return false
}
}
}
const thirdKeywords = []
for (let i = 0; i < this.formData.thirdList.length; i++) {
const item = this.formData.thirdList[i]
if (item.phone && item.signKeyword) {
thirdKeywords.push(item.signKeyword)
}
}
uni.showLoading({title: '查验中'})
vk.request({
method: "POST",
url: 'https://hcsc.gxwebsoft.com/api/read-pdf',
header: {
"content-type": "application/json; charset=utf-8",
},
data: {
file: this.formData.contractFile,
buyerSignKeyword: this.formData.buyerSignKeyword,
sellerSignKeyword: this.formData.sellerSignKeyword,
thirdKeywords
},
success: async (pdfRes) => {
},
fail: (pdfRes) => {
uni.hideLoading()
this.$message.error(pdfRes.content.msg)
},
complete: async (pdfRes) => {
uni.hideLoading()
if (pdfRes.code !== 200) this.$message.error(pdfRes.content.msg)
else {
uni.removeStorageSync(`signInfo`)
uni.removeStorageSync(`fileName`)
uni.showModal({
title: '提示',
content: SIGN_CONFIRM_CONTENT,
showCancel: false,
confirmText: '知悉同意',
success: async res => {
if (res.confirm) {
await vk.callFunction({
url: 'client/contract/kh/launch',
title: '请求中...',
data: this.formData,
});
vk.redirectTo({url: '/pages/public/contract?tab=1'})
}
}
})
// 此处统一使用 SIGN_CONFIRM_CONTENT
// confirmButtonText: '知悉同意',
// showCancelButton: false,
// type: 'warning'
// })
//
}
console.log('complete:', pdfRes)
},
})
},
addThird() {
if (this.formData.thirdList.length < 8) this.formData.thirdList.push({
phone: '',
signKeyword: '',
})
},
removeThird(index) {
if (this.formData.thirdList.length === 1) return
this.formData.thirdList.splice(index, 1)
},
previewDoc() {
// uni.setStorageSync(`signInfo_${this.formData.contractId}`, JSON.stringify(this.formData))
// uni.setStorageSync(`fileName`, this.fileName)
// window.location.href = this.formData.contractFile
if (Array.isArray(this.formData.contractFile)) {
this.pdfUrl = this.formData.contractFile[0]
} else
this.pdfUrl = this.formData.contractFile
this.showPdf = true
},
closePdf() {
this.pdfUrl = ''
this.showPdf = false
}
},
async onLoad({contractId}) {
this.formData.contractId = contractId
const {data} = await vk.callFunction({
url: 'client/contract/kh/getDetail',
title: '请求中...',
data: {
contractId
},
});
this.signEndDate = dayjs(data.signEndDate).format('YYYY-MM-DD HH:mm:ss')
this.formData.signEndDate = data.signEndDate
this.formData.title = data.docTitle
if (Array.isArray(data.contractFile)) {
this.formData.contractFile = data.contractFile[0]
} else
this.formData.contractFile = data.contractFile
this.formData.buyerSignKeyword = data.buyerSignKeyword
this.formData.sellerSignKeyword = data.sellerSignKeyword
this.formData.otherFile = data.otherFile ?? []
this.formData.thirdList = (data.thirdList && data.thirdList.length > 0) ? data.thirdList : [{
phone: '',
signKeyword: ''
}]
console.log(this.formData.thirdList)
this.isAdd = data.status === 0
},
// onShow() {
// if (uni.getStorageSync(`signInfo_${this.formData.contractId}`)) {
// this.formData = JSON.parse(uni.getStorageSync(`signInfo_${this.formData.contractId}`))
// if (this.formData.signEndDate) this.signEndDate = dayjs(this.formData.signEndDate).format('YYYY-MM-DD')
// if (uni.getStorageSync('fileName')) this.fileName = uni.getStorageSync('fileName')
// }
// },
}
</script>
<style lang="scss">
page {
background: #ffffff;
}
.layout-create {
padding: 20rpx 30rpx;
}
.label {
font-size: 26rpx;
line-height: 40rpx;
color: #101010;
position: relative;
}
.nmb {
font-size: 26rpx;
font-weight: 600;
line-height: 40rpx;
color: #999999;
}
.add {
font-size: 26rpx;
line-height: 40rpx;
color: #A92924;
}
.file-box {
padding: 20rpx 20rpx;
border: 1px solid #f2f2f2;
.item {
margin-top: 20rpx;
padding: 10rpx 0;
.icon {
width: 90rpx;
height: 90rpx;
}
.info {
padding: 10rpx 0;
border-bottom: 1px solid #f9f9f9;
}
.name {
font-size: 26rpx;
line-height: 40rpx;
color: #666666;
}
.kb {
font-size: 24rpx;
line-height: 40rpx;
color: #999999;
}
}
}
.upload {
margin: 20rpx 0 0;
width: 200rpx;
height: 60rpx;
color: #A92924;
background-color: rgba(169, 41, 36, 0.3);
}
.public-btn {
width: 80%;
margin-top: 60rpx;
color: #ffffff;
background: #A92924;
}
</style>
+834
View File
@@ -0,0 +1,834 @@
<template> <!-- 合同管理 -->
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uititle title="金久信签约宝"></uititle>
</u-sticky>
<view class="p-20">
<common-swiper page="qyb"/>
<view class="layout layout-publish m-top-20 bg-white p-20">
<view class="pb-30">
<text class="text-main">您剩余金久信签约宝次数: {{ userInfo.qybNum }}次</text>
<view class="qyb-action-row flex justify-start items-center mt-20">
<view class="qyb-buy-action">
<u-button size="mini" type="primary" @click.native="dialogVisible = true"
:custom-style="{padding: 0, width: '100%'}">立即购买</u-button>
</view>
<view class="qyb-log-action ml-25">
<u-button size="mini" type="success" @click.native="openLog"
:custom-style="{padding: 0, width: '100%'}">明细</u-button>
</view>
</view>
</view>
<view class="text-main mt-10">温馨提示:尊敬的用户如果您的剩余金久信签约宝次数为0次,请先进行购买,再进行签约。</view>
<view class="card m-20">
<view class="flex justify-between items-center" @click="showSignIntro = !showSignIntro">
<text>金久信签约宝简介</text>
<u-icon name="arrow-down"></u-icon>
</view>
<view v-if="showSignIntro" class="py-15">
<u-parse class="w-100p" :content="signIntro"></u-parse>
</view>
</view>
<view class="card m-20">
<view class="flex justify-between items-center" @click="showSignFlow = !showSignFlow">
<text>{{ signFlowTitle }}</text>
<u-icon name="arrow-down"></u-icon>
</view>
<view v-if="showSignFlow" class="py-15">
<u-parse class="w-100p" :content="signFlow"></u-parse>
</view>
</view>
<view class="card m-20">
<view class="flex justify-between items-center" @click="showSignTips = !showSignTips">
<text>金久信签约宝重要提示</text>
<u-icon name="arrow-down"></u-icon>
</view>
<view v-if="showSignTips" class="py-15">
<u-parse class="w-100p" :content="signTips"></u-parse>
</view>
</view>
<view class="flex justify-start align-center m-top-30">
<view class="lb need m-right-20">签约内容:</view>
<u-radio-group
v-model="formData.signType"
placement="row"
>
<u-radio activeColor="#a92924" name='1' label="单据签约"
:customStyle="{marginRight: '30px'}"></u-radio>
<u-radio activeColor="#a92924" name='2' label="合同签约"></u-radio>
</u-radio-group>
</view>
<!-- <view class="flex justify-start align-center m-top-30">-->
<!-- <view class="lb need m-right-20">交易方式:</view>-->
<!-- <u-radio-group-->
<!-- v-model="formData.tradeMethod"-->
<!-- placement="row"-->
<!-- >-->
<!-- <u-radio activeColor="#a92924" :name='0' label="自主交易"-->
<!-- :customStyle="{marginRight: '30px'}"></u-radio>-->
<!-- <u-radio activeColor="#a92924" :name='1' label="金久信公正"></u-radio>-->
<!-- </u-radio-group>-->
<!-- </view>-->
<view class="flex justify-start align-center m-top-30">
<view class="lb need m-right-20">签约费用承担方:</view>
<u-radio-group
v-model="formData.payBy"
placement="row"
>
<u-radio activeColor="#a92924" :name='0' label="发起方"
:customStyle="{marginRight: '10px'}"></u-radio>
<u-radio activeColor="#a92924" :name='1' :customStyle="{marginRight: '10px'}" label="接收方"></u-radio>
<u-radio activeColor="#a92924" :name='2' label="第三方"></u-radio>
</u-radio-group>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need m-right-20">标题:</view>
<view class="vl flex-1">
<u--input
placeholder="请输入标题"
border="surround"
v-model="formData.title"
/>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need m-right-20">对方手机号:</view>
<view class="vl flex-1">
<u--input
placeholder="请输入对方手机号"
border="surround"
v-model="formData.phone"
/>
</view>
</view>
<view class="tips">手机号请连续输入,请勿添加空格和断开输入,系统无法准确识别。</view>
<view class="group flex align-center m-top-30">
<view class="lb need m-right-20">对方身份:</view>
<view class="vl flex-1" @click="showContactPicker = true">
<u--input
style="pointer-events:none"
disabledColor="#fff"
disabled
placeholder="请选择对方身份"
border="surround"
v-model="userType"
/>
</view>
</view>
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
<view class="lb">签署截止日期:</view>
<view class="vl flex-1 p-right-20" @click="showExpire = true">
<u--input placeholder="请选择" v-model="signEndDate" style="pointer-events:none"
fontSize="24rpx"
suffixIcon="arrow-down-fill"
suffixIconStyle="font-size: 10px;color: #d5d5d5"
:disabled="true"
disabledColor="#fff"></u--input>
</view>
</view>
<view class="text-24 text-gray mt-10">
发起方填写签署截止日期和时间即为各签约方共同认可的签署时间,请酌情填写仔细阅读签署文件。
</view>
<view class="group m-top-20">
<view class="lb m-right-20">签署文档:</view>
<view class="flex justify-between align-center m-top-20">
<view class="text-25 text-gray flex-1">
仅支持PDF文件,如有其他附件或多个单据签约请合并成一个PDF文档上传。且仅支持纵向文档上传,横向文档显示不完整。
电子签署文件中需添加以下内容以增强双方约束力和文件法律效力:签约双方均自愿通过以“电子签约”形式进行签约,电子签名和加盖电子印章双方均予以认可具有法律效力。
</view>
</view>
<view class="m-top-30">
<u-upload
accept="file"
:fileList="formData.files"
@afterRead="afterRead"
:maxCount="1"
:previewImage="false"
>
<u-button type="primary" v-if="!formData.files">点击上传</u-button>
<p class="mt-30" @click="previewDoc" v-if="fileName">预览: {{ fileName }}</p>
</u-upload>
</view>
</view>
<view class="group flex justify-start m-top-30 flex-col">
<view class="lb need m-right-20">签约发起方关键字:</view>
<view class="vl flex-1 mt-10">
<u--input
placeholder="请输入签约发起方关键字"
border="surround"
v-model="formData.buyerSignKeyword"
/>
</view>
<view class="mt-10 text-24 text-gray">
请先在手机办公软件上(Office、WPS等)内,复制粘贴或输入预盖章部位关键字核验确认位置和内容,再点击上传文档核实无误后可返回签署页面输入测验关键字后进行签署(如同一关键字文档多次使用无误后可考虑省略检测流程)。系统将按此关键字进行签章位置的定位,将电子章盖在这个关键字上面。凡出现关键字的地方均会盖上指定用户的电子章,建议关键字在合同中保持唯一。
</view>
</view>
<view class="group flex justify-start m-top-30 flex-col">
<view class="lb need m-right-20">签约接收方关键字:</view>
<view class="vl flex-1 mt-10">
<u--input
placeholder="请输入签约接收方关键字"
border="surround"
v-model="formData.sellerSignKeyword"
/>
</view>
<view class="mt-10 text-24 text-gray">
请先在手机办公软件上(Office、WPS等)内,复制粘贴或输入预盖章部位关键字核验确认位置和内容,再点击上传文档核实无误后可返回签署页面输入测验关键字后进行签署(如同一关键字文档多次使用无误后可考虑省略检测流程)。系统将按此关键字进行签章位置的定位,将电子章盖在这个关键字上面。凡出现关键字的地方均会盖上指定用户的电子章,建议关键字在合同中保持唯一。
</view>
</view>
<view v-for="(item, index) in formData.thirdList" :key="index"
class="flex justify-start items-start my-10 flex-col">
<view class="text-left">第{{ ['三', '四', '五', '六', '七', '八', '九', '十'][index] }}方:</view>
<view class="mt-10 w-100p">
<el-input v-model="formData.thirdList[index].phone"
:placeholder="`请输入第${['三', '四', '五', '六', '七', '八', '九', '十'][index]}方手机号`"/>
</view>
<view class="mt-10 w-100p flex justify-start items-center">
<el-input v-model="formData.thirdList[index].signKeyword"
:placeholder="`请输入第${['三', '四', '五', '六', '七', '八', '九', '十'][index]}方签章关键字`"/>
<view class="flex justify-center items-center mt-10">
<i class="el-icon-circle-plus text-main text-50 ml-35" @click="addThird"/>
<i class="el-icon-remove text-50 ml-35" @click="removeThird(index)"/>
</view>
</view>
</view>
<p class="text-25 text-gray mt-20">如无第三方签约可忽略,签章关键字使用方法同下。</p>
<p class="text-25 text-gray mt-20">手机号码请连续填写,不能断开或加入空格,否则系统无法识别。</p>
<view class="tips text-24 text-gray mt-30">注意事项(电子签名不适用文件):</view>
<view class="tips text-24 text-gray">1.婚姻、继承、收养等人身关系的;</view>
<view class="tips text-24 text-gray">2.涉及停止供水、供热、供气等公用事业服务的;</view>
<view class="tips text-24 text-gray">3.其他法律、行政法规规定的不适用电子文书的其他形式;</view>
<u-button class="m-top-30" type="primary" text="提交" @click="submit"></u-button>
</view>
</view>
<u-datetime-picker :show="showExpire" v-model="expireTime" mode="datetime" @cancel="showExpire = false"
:minDate="minDate"
@confirm="handConfirmDate"></u-datetime-picker>
<u-picker :show="showContactPicker" :columns="[userTypeList]" keyName="label"
@cancel="showContactPicker = false" @close="showContactPicker = false" closeOnClickOverlay
@confirm="confirmContact"/>
<el-dialog title="金久信签约宝次数" :visible.sync="dialogVisible" width="95%">
<div class="flex justify-center items-center w-100p">
<div class="flex flex-col justify-center items-center w-100p">
<div class="p-15 rounded m-10 shadow flex flex-col justify-center items-center flex-1 w-100p"
:class="[selectedQyb === item._id ? 'buy-quote-mode-active' : '']"
v-for="(item, index) in qybPackageList" :key="index"
@click="selectedQyb = item._id">
<p>{{ item.amount }}元</p>
<p>可获得{{ item.getNum }}次</p>
</div>
</div>
</div>
<div class="mt-20 text-main font-bold">
剩余金久信签约宝次数:{{ userInfo.qybNum }}次
</div>
<div class="mt-20 flex justify-center items-center">
<view class="flex-1 mx-20">
<u-button type="primary" :disabled="!selectedQyb" @click.native="doBuyQyb">确定
</u-button>
</view>
<view class="flex-1 mx-20">
<u-button plain @click.native="dialogVisible = false">取消</u-button>
</view>
</div>
</el-dialog>
<u-popup :show="showLog" title="金久信签约宝明细" mode="center" @close="showLog = false" z-index="997" :overlayStyle="{
zIndex: 997
}">
<view style="max-height: 80vh" class="p-20 overflow-y rounded">
<u-tabs :list="[{name: '使用明细'}, {name: '付费明细'}]" :activeStyle="{fontWeight: 'bold', fontSize: '18px'}" :current="logIndex" @click="changeLogTab"></u-tabs>
<view class="flex flex-col justify-center items-center m-20" style="max-height: 60vh;overflow-y: scroll">
<template v-if="logIndex === 0">
<view class="p-15 border-bottom w-100p" v-for="(item, index) in signLog.rows" :key="index">
<view>日期: {{ item._add_time_str }}</view>
<view>项目: {{ parseInt(item.contract.signType) === 1 ? '单据签约' : '合同签约' }}</view>
<view>合同编号: {{ item.contract.transactionId }}</view>
<view>签约身份: {{
item.mineContract ? (item.mineContract.role === 'third' ? '第三方' : (item.mineContract.userId === item.userId ? '发起方' : '接收方')) : ''
}}
</view>
<view>
<view>扣除次数: 1</view>
<view v-if="item.remainNum !== undefined && item.remainNum != null">剩余次数: {{
item.remainNum
}}
</view>
</view>
</view>
<view class="text-center mt-20">
<el-pagination
:page-size="10"
@current-change="getSignLog"
background
layout="prev, pager, next"
:total="signLog.total">
</el-pagination>
</view>
</template>
<template v-else>
<view class="p-15 border-bottom w-100p" v-for="(item, index) in signLog.rows" :key="index">
<view>日期: {{ item._add_time_str }}</view>
<view>项目: {{ item.type === 12 ? '合同司法调证' : '金久信签约宝续费' }}</view>
<view>流水号: {{ item.orderNo }}</view>
<view>缴费金额: {{ item.type === 12 ? item.amount : item.payAmount }}
</view>
<view>
<view>采购次数: {{ item.goods[0].goodsName }}</view>
<view v-if="item.remainNum">剩余次数: {{ item.remainNum }}</view>
</view>
<view class="flex justify-start items-center">
<text class="mr-15">操作:</text>
<el-button size="mini" @click="openInvoice(item._id)" type="primary"
v-if="!item.isInvoice">申请发票
</el-button>
<template v-else>
<el-button size="mini" v-if="item.isInvoice === 1">开票中</el-button>
<el-button size="mini" type="success" v-if="item.isInvoice === 2"
@click.native="copyInvoice(item)">下载
</el-button>
</template>
<el-button size="mini" style="margin-left: 10px"
v-if="item.type === 12 && item.certificate && item.certificate.paymentMethod === 'advance'"
@click.native="openPayVoucher(item.certificate)">查看支付凭证
</el-button>
</view>
</view>
<view class="text-center mt-20">
<el-pagination
:page-size="10"
@current-change="getSignBuyLog"
background
layout="prev, pager, next"
:total="signLog.total">
</el-pagination>
</view>
</template>
</view>
</view>
</u-popup>
<el-dialog title="申请发票" :visible.sync="showInvoice" width="80%" top="10px" append-to-body>
<p>请输入开票信息</p>
<u-form ref="invoiceForm" :model="invoiceForm" label-width="140px" labelPosition="top">
<u-form-item label="名称" required>
<u-input v-model="invoiceForm.name" placeholder="请输入企业名称或个人姓名"/>
</u-form-item>
<u-form-item label="税号/证号" required>
<u-input v-model="invoiceForm.code" placeholder="请输入税号或身份证号"/>
</u-form-item>
<u-form-item label="手机号" required>
<u-input v-model="invoiceForm.phone" placeholder="请输入手机号"/>
</u-form-item>
<u-form-item label="电子邮箱" required>
<u-input v-model="invoiceForm.email" placeholder="请输入电子邮箱"/>
</u-form-item>
<u-form-item label="开户行">
<u-input v-model="invoiceForm.bankName" placeholder="请输入开户行"/>
</u-form-item>
<u-form-item label="银行账号">
<u-input v-model="invoiceForm.bankAccount" placeholder="请输入银行账号"/>
</u-form-item>
<u-form-item label="地址" required>
<u-input v-model="invoiceForm.address" placeholder="请输入地址"/>
</u-form-item>
<u-form-item label="单位/个人电话">
<u-input v-model="invoiceForm.tel" placeholder="请输入单位/个人电话"/>
</u-form-item>
</u-form>
<div class="mt-20 flex justify-center items-center">
<el-button type="primary" @click.native="doInvoice">确定</el-button>
<el-button plain @click.native="showInvoice = false">取消</el-button>
</div>
</el-dialog>
<el-dialog title="合同预览" :visible.sync="showPdf" width="90%" append-to-body>
<view style="height: 1000rpx">
<u-pdf :url="pdfUrl" v-if="pdfUrl" :showBottom="false" :show-timer="false" :disabled="false" viewHeight="800rpx"
@onClickReader="closePdf"/>
</view>
</el-dialog>
<collapse></collapse>
</view>
</template>
<script>
import uititle from '@/components/common/title'
import cmsearch from '@/components/common/search'
import cmempty from '@/components/common/empty'
import dayjs from "dayjs";
import md5 from "js-md5";
import uPdf from '@/components/u-pdf/u-pdf.vue'
import Collapse from "@/components/index/collapse.vue";
const SIGN_CONFIRM_CONTENT = `1、您确认,若全体各签约方未完成全部签约流程,本签约文件不发生法律效力,系统无法对该签约文件予以保存及提供司法调证服务;
2、您确认,当前签约的实名主体名称、手机号码与注册认证阶段提交的信息未发生变更;若发生变更,必须及时进行重新认证后方可继续签约,避免产生严重法律风险与经济损失;
3、您确认,本次签约为本系统实名认证主体操作,如若不是实名认证主体操作,授权委托人需本系统进行授权认证后签约;
4、您确认,您与其他签约方均系在平等、自愿的基础上完成本次签约;
5、你确认,此次签约内容符合《中华人民共和国电子签名法》《民法典》生效保护范畴;
6、如因法律法规、监管部门政策更新等原因,系统提示您重新进行实名认证、证书续期等重要提示时,请您必须在签约前完成,否则造成任何损失,平台不承担任何责任;以上签约条件您均已经知悉并确认,否则您有权拒绝本次签约。`
export default {
components: {
Collapse,
uititle,
cmsearch,
cmempty,
uPdf,
},
data() {
return {
tabIndex: 0,
tableData: {},
userInfo: {
qybNum: 0
},
show: false,
title: '',
name: '',
companyMobile: '',
pdfUrl: '',
showPdf: false,
formData: {
signType: '1',
tradeMethod: 0,
payBy: 0,
title: null,
phone: null,
userType: null,
third: null,
signEndDate: null,
contractFile: '',
buyerSignKeyword: null,
sellerSignKeyword: null,
otherFile: null,
thirdList: [{phone: '', signKeyword: ''}],
},
showExpire: false,
expireTime: '',
minDate: dayjs().valueOf(),
showContactPicker: false,
invoiceForm: {
id: null,
name: null,
code: null,
phone: null,
email: null,
bankName: null,
bankAccount: null,
address: null,
tel: null,
},
userTypeList: [
{
value: 1,
label: "买家"
},
{
value: 2,
label: "卖家"
},
{
value: 3,
label: "甲方"
},
{
value: 4,
label: "乙方"
},
{
value: 5,
label: "授权签约方"
},
],
userType: '',
fileName: '',
dialogVisible: false,
qybPackageList: [],
selectedQyb: null,
showSignIntro: false,
showSignFlow: false,
signFlowTitle: '',
showSignTips: false,
signTips: '',
showLog: false,
signIntro: null,
signFlow: null,
signEndDate: null,
signLog: {},
logIndex: 0,
showInvoice: false,
}
},
methods: {
dayjs,
afterRead({file}) {
console.log(file)
if (!file) return
// 仅PDF
if (file.type !== 'application/pdf') {
uni.showToast({
title: '请上传PDF文件',
icon: 'none'
})
return
}
if ((new RegExp(/\s+/g).test(file.name))) {
uni.showToast({
title: '文件名不能有空格',
icon: 'none'
})
return
}
uniCloud.uploadFile({
filePath: file.url,
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + md5(file.name + Date.now().toString()) + `-${file.name}`,
success: ({fileID}) => {
console.log(fileID)
uniCloud.getTempFileURL({
fileList: [fileID]
}).then(res => {
console.log(res)
this.formData.contractFile = res.fileList[0].tempFileURL
this.fileName = file.name
// console.log(this.formData.contractFile)
})
}
})
},
addThird() {
if (this.formData.thirdList.length < 8) this.formData.thirdList.push({
phone: '',
signKeyword: '',
})
},
removeThird(index) {
if (this.formData.thirdList.length === 1) return
this.formData.thirdList.splice(index, 1)
},
handConfirmDate({value}) {
this.signEndDate = dayjs(value).format('YYYY-MM-DD HH:mm:ss')
this.formData.signEndDate = dayjs(value).toISOString()
console.log(this.formData.signEndDate)
this.showExpire = false
},
confirmContact({value}) {
this.formData.userType = value[0].value
this.userType = value[0].label
this.showContactPicker = false
},
async submit() {
if (!this.formData.title) return vk.toast('标题不能为空')
if (!this.formData.phone) return vk.toast('标题不能为空')
if (!this.signEndDate) return vk.toast('签署截止日期不能为空')
if (!this.formData.buyerSignKeyword) return vk.toast('签约发起方关键字不能为空')
if (!this.formData.sellerSignKeyword) return vk.toast('签约接收方关键字不能为空')
if (!this.formData.contractFile) return vk.toast('签署文档不能为空')
this.formData.thirdList = this.formData.thirdList.filter(item => item.phone && item.signKeyword)
if (this.formData.thirdList.length > 0) {
for (let i = 0; i < this.formData.thirdList.length; i++) {
const item = this.formData.thirdList[i]
if (item.phone === '') {
vk.toast('请填写手机号')
return false
}
if (item.signKeyword === '') {
vk.toast('请填写签章关键字')
return false
}
if (item.phone === this.formData.phone) {
vk.toast('第三方手机号不能与接收方手机号相同')
return false
}
}
}
const thirdKeywords = []
for (let i = 0; i < this.formData.thirdList.length; i++) {
const item = this.formData.thirdList[i]
if (item.phone && item.signKeyword) {
thirdKeywords.push(item.signKeyword)
}
}
uni.showLoading({title: '查验中'})
vk.request({
method: "POST",
url: 'https://hcsc.gxwebsoft.com/api/read-pdf',
header: {
"content-type": "application/json; charset=utf-8",
},
data: {
file: this.formData.contractFile,
buyerSignKeyword: this.formData.buyerSignKeyword,
sellerSignKeyword: this.formData.sellerSignKeyword,
thirdKeywords
},
success: async (pdfRes) => {
},
fail: (pdfRes) => {
uni.hideLoading()
this.$message.error(pdfRes.content.msg)
},
complete: async (pdfRes) => {
uni.hideLoading()
if (pdfRes.code !== 200) {
this.$message.error(pdfRes.content.msg)
} else {
uni.removeStorageSync(`signInfo`)
uni.removeStorageSync(`fileName`)
// 此处统一使用 SIGN_CONFIRM_CONTENT
// confirmButtonText: '知悉同意',
// showCancelButton: false,
// type: 'warning'
// })
uni.showModal({
title: '提示',
content: SIGN_CONFIRM_CONTENT,
showCancel: false,
confirmText: '知悉同意',
success: res => {
if (res.confirm) {
vk.callFunction({
url: 'client/contract/kh/addSign',
title: '请求中...',
data: this.formData,
success: (data) => {
// console.log(data)
vk.navigateTo('/pages/public/contract?tab=1')
},
fail: (err) => {
vk.confirm(err.msg, '提示');
},
});
}
}
})
}
console.log('complete:', pdfRes)
},
})
},
async doBuyQyb() {
const {data} = await vk.callFunction({
url: 'client/qyb/list/kh/buy',
title: '请求中...',
data: {
qybId: this.selectedQyb,
}
})
this.dialogVisible = false
vk.navigateTo({
url: `/pages/shop/pay?id=${data}`
})
},
async getQybPackage() {
const {rows} = await vk.callFunction({
url: 'client/qyb/list/pub/getList',
data: {
pageIndex: 1,
pageSize: 500
}
});
this.qybPackageList = rows
},
async getSignIntro() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: 'ef45322e671cece4110ec73b36ca2b7d'
},
})
this.signIntro = res.content
},
async getSignFlow() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: 'd77d384f686b9bd204bd4dc744cf75d0'
},
})
this.signFlow = res.content
this.signFlowTitle = res.name
},
async getSignTips() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '614937966875c18505570c357541c6e0'
},
})
this.signTips = res.content
},
previewDoc() {
// uni.setStorageSync(`signInfo_${this.formData.contractId}`, JSON.stringify(this.formData))
// uni.setStorageSync(`fileName`, this.fileName)
// window.location.href = this.formData.contractFile
if (Array.isArray(this.formData.contractFile)) {
this.pdfUrl = this.formData.contractFile[0]
} else
this.pdfUrl = this.formData.contractFile
this.showPdf = true
},
openLog() {
this.showLog = true
this.changeLogTab({index: 0})
},
changeLogTab({index}) {
this.logIndex = index
if (index === 0) this.getSignLog(1)
else this.getSignBuyLog(1)
},
async getSignLog(pageIndex) {
this.signLog = await vk.callFunction({
url: 'client/qyb/list/kh/payList',
data: {
pageIndex: pageIndex,
pageSize: 10
}
})
this.signLog.rows = this.signLog.rows.filter(item => !!item.contract)
this.$forceUpdate()
},
async getSignBuyLog(pageIndex) {
this.signLog = await vk.callFunction({
url: 'client/order/kh/getList',
data: {
isSeller: 0,
keyword: null,
orderStatus: 4,
pageIndex,
pageSize: 10,
signMethod: null,
type: [12, 13]
}
})
this.$forceUpdate()
},
openInvoice(id) {
this.invoiceForm.id = id
this.showInvoice = true
},
async doInvoice() {
if (!this.invoiceForm.name) return this.$message.error('请输入发票抬头')
if (!this.invoiceForm.code) return this.$message.error('请输入纳税人识别号')
if (!this.invoiceForm.phone) return this.$message.error('请输入手机号码')
if (!this.invoiceForm.email) return this.$message.error('请输入邮箱')
if (!this.invoiceForm.address) return this.$message.error('请输入地址')
await vk.callFunction({
url: 'client/order/kh/changeInvoice',
data: {
...this.invoiceForm,
isInvoice: 1
}
})
this.showInvoice = false
this.$message.success('申请成功')
await this.getSignBuyLog(1)
},
copyInvoice(row) {
// const url = row.invoiceUrl[0]
// document.oncopy = function (e) {
// e.clipboardData.setData('text', url);
// e.preventDefault();
// document.oncopy = null;
// }
// document.execCommand('Copy');
// this.$message({
// type: 'success',
// message: '已复制'
// })
window.location.href = row.invoiceUrl
},
closePdf() {
this.pdfUrl = ''
this.showPdf = false
},
openPayVoucher(row) {
// window.open(row.payVoucher)
uni.previewImage({
urls: [row.payVoucher],
})
},
},
onShow() {
this.getQybPackage()
this.getSignIntro()
this.getSignFlow()
this.getSignTips()
vk.userCenter.getCurrentUserInfo({
success: async (data) => {
this.userInfo = data.userInfo
if (!this.userInfo.fadadaConfirm) {
uni.showModal({
title: '提示',
content: '您尚未认证, 请前往认证',
showCancel: false,
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 0)
uni.switchTab({url: '/pages/user/user'})
}
}
})
}
this.invoiceForm.phone = this.userInfo.mobile
this.invoiceForm.email = this.userInfo.businessCard ? this.userInfo.businessCard.email : ''
if (this.userInfo.accountType === 2) {
if (this.userInfo.fadadaConfirm && this.userInfo.company) {
this.invoiceForm.name = this.userInfo.company.companyName
this.invoiceForm.code = this.userInfo.company.organization
this.invoiceForm.address = this.userInfo.company.addressDetail
this.invoiceForm.tel = this.userInfo.company.mobile
this.invoiceForm.bankName = this.userInfo.company.companyBankName
this.invoiceForm.bankAccount = this.userInfo.company.companyAccount
}
} else {
this.invoiceForm.name = this.userInfo.person.personName
this.invoiceForm.code = this.userInfo.person.idCard
this.invoiceForm.address = this.userInfo.person.address
this.invoiceForm.tel = this.userInfo.mobile
}
}
})
if (uni.getStorageSync('signInfo')) {
this.formData = JSON.parse(uni.getStorageSync('signInfo'))
if (this.formData.signEndDate) this.signEndDate = dayjs(this.formData.signEndDate).format('YYYY-MM-DD')
if (uni.getStorageSync('fileName')) this.fileName = uni.getStorageSync('fileName')
}
console.log(this.formData)
},
onLoad(e) {
if (e.tab && e.tab === 'signBuyLog') {
this.showLog = true
this.changeLogTab({index: 1})
}
}
}
</script>
<style lang="scss">
page {
background: #f7f7f7;
}
.buy-quote-mode-active {
border: 1px solid #a92924;
background-color: #f1c7c7;
}
.qyb-action-row {
width: 100%;
}
.qyb-buy-action {
flex: 0 0 28%;
}
.qyb-log-action {
flex: 1;
}
</style>
+150
View File
@@ -0,0 +1,150 @@
<template>
<view class="wrap">
<uititle title="金久信学堂"></uititle>
<view class="bg-white p-10">
<view class="group flex align-center m-top-30">
<view class="lb need m-right-20">标题:</view>
<view class="vl flex-1">
<u--input
placeholder="请输入标题"
border="surround"
v-model="formData.name"
/>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need m-right-20">分类:</view>
<view class="vl flex-1" @click="showPicker = true">
<u--input
style="pointer-events:none"
disabledColor="#fff"
disabled
placeholder="请选择分类"
border="surround"
v-model="cate"
/>
</view>
</view>
<view class="group m-top-20">
<view class="lb m-right-20">附件:</view>
<view class="m-top-30">
<u-upload
accept="file"
:fileList="formData.files"
@afterRead="afterRead"
:maxCount="1"
:previewImage="false"
>
<view class="w-100p">
<view>
<u-button size="mini" type="primary">点击上传</u-button>
</view>
<view class="mt-10 flex justify-between items-center w-100p" @click="delFiles(index)"
v-for="(item, index) in fileNameList" :key="index">
<text>{{ item }}</text>
<u-icon name="trash"/>
</view>
</view>
</u-upload>
</view>
</view>
<view class="lb need m-right-20 mt-20 border-top">内容:</view>
<piaoyiEditor :values="formData.content" :maxlength="99999" @changes="saveContents" :readOnly="false"/>
<u-button class="m-top-30" type="primary" text="提交" @click="save"></u-button>
</view>
<u-picker :show="showPicker" :columns="[cateList]" keyName="name"
@cancel="showPicker = false" @close="showPicker = false" closeOnClickOverlay
@confirm="confirmCate"/>
</view>
</template>
<script>
import uititle from '@/components/common/title'
import cmsearch from '@/components/common/search'
import cmempty from '@/components/common/empty'
import piaoyiEditor from '@/uni_modules/piaoyi-editor/components/piaoyi-editor/piaoyi-editor.vue';
import dayjs from "dayjs";
import md5 from "js-md5";
export default {
components: {
uititle,
cmsearch,
cmempty,
piaoyiEditor,
},
data() {
return {
editor: null,
toolbarConfig: {},
editorConfig: {placeholder: '请输入内容...'},
mode: 'default',
formData: {
name: null,
files: [],
parentId: null,
content: '',
},
cateList: [],
fileNameList: [],
showPicker: false,
cate: ''
}
},
methods: {
async getCateList() {
const {rows} = await vk.callFunction({
url: 'client/article/category/pub/getList'
})
this.cateList = rows
},
async save() {
if (!this.formData.name) return vk.toast('标题不能为空')
if (!this.formData.parentId) return vk.toast('分类不能为空')
if (!this.formData.content) return vk.toast('内容不能为空')
await vk.callFunction({
url: 'client/article/list/kh/add',
data: this.formData
})
vk.navigateBack()
},
saveContents({html}) {
this.formData.content = html
},
afterRead({file}) {
if (!file) return
uniCloud.uploadFile({
filePath: file.url,
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + md5(file.name + Date.now().toString()) + '.pdf',
success: ({fileID}) => {
uniCloud.getTempFileURL({
fileList: [fileID]
}).then(res => {
this.formData.files.push(res.fileList[0].tempFileURL)
this.fileNameList.push(file.name)
})
}
})
},
confirmCate({value}) {
this.formData.parentId = value[0]._id
this.cate = value[0].name
this.showPicker = false
},
delFiles(index){
this.formData.files.splice(index, 1)
this.fileNameList.splice(index, 1)
}
},
onShow() {
this.getCateList()
}
}
</script>
<style lang="scss">
page {
background: #f7f7f7;
}
</style>
+200
View File
@@ -0,0 +1,200 @@
<template>
<view class=" bg-white">
<u-sticky offset-top="0" customNavHeight="0">
<uititle title="详情"></uititle>
</u-sticky>
<view class="p-30">
<view class="mt-20 text-gray text-28 pb-20 border-bottom" v-if="userInfo && userInfo.userLevel === 0">
<span>剩余</span>
<span class="mx-15 text-main font-bold">{{ userInfo.remainArticleDownloadNum }}</span>
<span>次下载次数</span>
</view>
<text class="text-50 font-bold">{{ info.name }}</text>
<view class="mt-20 text-gray text-28 pb-20 border-bottom">{{ info._add_time_str }}</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>
<el-dialog title="文件查看" :visible.sync="dialogVisible" width="90%" :top="10">
<view style="width: 100%; height: 80vh">
<pdf
style="width: 100%; height: 100%"
ref="pdf"
:src="pdfUrl"
/>
</view>
</el-dialog>
</view>
</template>
<script>
import uititle from "@/components/common/title.vue";
import {FileExcel, FilePdfOne, FileWord, Star} from "@icon-park/vue";
import pdf from "vue-pdf";
export default {
name: "detail",
components: {uititle, FileWord, FilePdfOne, FileExcel, Star, pdf},
data() {
return {
info: {
name: '',
content: ''
},
hasCollect: false,
dialogVisible: false,
userInfo: null,
pdfUrl: null,
}
},
methods: {
async getInfo(id) {
this.info = await vk.callFunction({
url: `client/article/list/pub/getDetail`,
data: {id}
});
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%';
}
})
await this.checkCollect()
},
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/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.location.href = url
// this.pdfUrl = url
// this.dialogVisible = true
})
}
} else {
window.location.href = url
}
} else {
vk.callFunction({
url: 'client/article/list/pub/addDownload',
data: {
id: this.info._id
}
})
window.location.href = url
// this.pdfUrl = url
// this.dialogVisible = true
}
},
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
},
});
},
async getUserInfo() {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
this.userInfo = userInfo
},
},
onLoad({id}) {
this.getUserInfo(id)
this.getInfo(id)
this.addView(id)
const userInfo = vk.getStorageSync('uni_id_user_info')
if (userInfo) this.checkCollect()
}
}
</script>
+280
View File
@@ -0,0 +1,280 @@
<template> <!-- 学堂 -->
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uititle title="金久信学堂"></uititle>
<!-- 选项卡 -->
<view class="layout layout-tab flex justify-between align-center">
<view :class="['tab', {active: tabIndex == 0}]" @click="handTab(0)">我的上传</view>
<view :class="['tab', {active: tabIndex == 1}]" @click="handTab(1)">我的收藏</view>
<view :class="['tab', {active: tabIndex == 2}]" @click="handTab(2)">我的下载</view>
</view>
<!-- 统计数量和操作按钮 -->
<view class="layout layout-total flex justify-start align-center bg-white">
<template v-if="tabIndex == 0">
<view class="text">累计上传
<text class="red">{{ list.length }}</text>
篇
</view>
<!-- <view class="upload m-left-20">我要上传</view>-->
</template>
<template v-else-if="tabIndex == 1">
<view class="text">共计收藏
<text class="red">{{ list.length }}</text>
篇
</view>
</template>
<template v-else>
<view class="text">累计下载
<text class="red">{{ list.length }}</text>
篇
</view>
</template>
</view>
</u-sticky>
<!-- 材料专业资料列表 -->
<view class="layout layout-list">
<view class="item flex" v-for="(item, index) in list" :key="index" @click="jump(item._id)">
<view class="img" 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="60" fill="#4a90e2" strokeLinecap="square"/>
</template>
<template v-else-if="['xls', 'xlsx'].includes(item.files[0].split('.').pop())">
<file-excel theme="outline" class="pointer" size="60" fill="#417505" strokeLinecap="square"/>
</template>
<template v-else-if="['pdf'].includes(item.files[0].split('.').pop())">
<file-pdf-one theme="outline" class="pointer" size="60" 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>
</view>
<view class="info flex-1 p-left-30">
<view class="flex justify-between">
<view class="name flex-1">{{ item.name }}</view>
<!-- <view class="operate flex justify-center">-->
<!-- <u-button color="#A92924" size="mini" :plain="true" text="删除上传"></u-button>-->
<!-- <u-button class="m-left-20" color="#A92924" size="mini" :plain="true"-->
<!-- text="编辑修改"></u-button>-->
<!-- </view>-->
</view>
<view class="other">
<text>{{ item._add_time_str }}</text>
<text class="line">|</text>
<text>{{ item.viewNum }}人浏览</text>
<text class="line">|</text>
<text>{{ item.downloadNum }}次下载</text>
</view>
</view>
</view>
</view>
<view class="issue" @click="toAdd">
<u-icon name="plus" color="#fff" size="24"></u-icon>
</view>
<!-- 没有数据 u-empty是框架组件 cmempty是自己封装组件 -->
<u-empty mode="list" text="暂无更多内容~" v-if="list.length === 0"></u-empty>
<!-- <cmempty></cmempty> -->
</view>
</template>
<script>
import uititle from '@/components/common/title'
import cmsearch from '@/components/common/search'
import cmempty from '@/components/common/empty'
import {FileExcel, FilePdfOne, FileWord} from "@icon-park/vue";
export default {
components: {
uititle,
cmsearch,
cmempty,
FilePdfOne, FileExcel, FileWord
},
data() {
return {
tabIndex: 0,
total: 0,
pageSize: 500,
activeIndex: 0,
mode: 'list',
list: [],
cateList: [],
}
},
methods: {
handTab(index) {
this.tabIndex = index
this.list = []
this.mode = 'list'
if (index === 0) this.getList()
else if (index === 1) this.getCollectList()
else if (index === 2) this.getDownloadList()
},
async getList(pageIndex = 1) {
const {rows} = await vk.callFunction({
url: 'client/article/list/kh/getUserList',
pageIndex,
pageSize: this.pageSize
})
this.list = rows
},
async getCollectList(pageIndex = 1) {
const {rows} = await vk.callFunction({
url: 'client/article/collect/kh/getList',
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
})
},
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 = []
this.mode = 'list'
this.activeIndex = index
if (index === 0) this.getList()
else if (index === 1) this.getCollectList()
else if (index === 2) this.getDownloadList()
},
showAction() {
this.mode = 'action'
this.activeIndex = null
},
addSuccess() {
this.mode = 'list'
this.activeIndex = 0
this.getList()
},
toAdd(){
vk.navigateTo('/pages/school/add')
},
jump(id){
vk.navigateTo(`/pages/school/detail?id=${id}`)
}
},
onLoad() {
this.getList()
},
}
</script>
<style lang="scss">
.layout-tab {
height: 100rpx;
padding: 0 30rpx;
background: #f1f1f1;
.tab {
margin: 0 20rpx;
padding: 10rpx 0rpx;
font-size: 28rpx;
line-height: 40rpx;
color: #666666;
}
.active {
position: relative;
color: #A92924;
&::after {
position: absolute;
left: 0;
bottom: 0;
z-index: 9;
content: '';
width: 100%;
height: 1px;
background: #A92924;
}
}
}
.layout-total {
height: 60rpx;
padding: 10rpx 30rpx;
.text {
font-size: 26rpx;
line-height: 40rpx;
color: #333333;
}
.upload {
padding: 4rpx 16rpx;
font-size: 24rpx;
line-height: 40rpx;
color: #ffffff;
background: #A92924;
}
}
.layout-list {
margin: 20rpx 30rpx;
.item {
padding: 30rpx 20rpx;
border-bottom: 1px solid #f2f2f2;
background: #ffffff;
.img {
width: 130rpx;
height: 130rpx;
}
.name {
font-size: 32rpx;
font-weight: 500;
line-height: 44rpx;
color: #111111;
}
.text {
padding: 6rpx 0;
font-size: 26rpx;
line-height: 40rpx;
color: #666666;
}
.other {
font-size: 24rpx;
line-height: 32rpx;
color: #999999;
}
.line {
margin: 0 8rpx;
}
}
}
</style>
+339
View File
@@ -0,0 +1,339 @@
<template> <!-- 学堂 -->
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uiheader></uiheader>
<!-- 搜索栏 -->
<cmsearch></cmsearch>
<!-- 轮播图-传值:list="数组" -->
<cmswiper page="article" height="320rpx"></cmswiper>
<view class="layout-sch bg-white flex justify-between align-center">
<view class="select down" @click="handSelect">{{ pickText }}</view>
<view class="search flex justify-between align-center">
<input class="search-input p-left-20" type="text" placeholder="关键字搜索" v-model="keyword"/>
<view class="search-btn" @click="getContentList">搜索</view>
</view>
</view>
</u-sticky>
<!-- 材料专业资料列表 -->
<view class="layout layout-list" v-if="pickIndex == 0">
<view class="item flex" v-for="(item, index) in list" :key="index"
@click="$jump(`/pages/school/detail?id=${item._id}`)">
<view class="img">
<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="60" fill="#4a90e2" strokeLinecap="square"/>
</template>
<template v-else-if="['xls', 'xlsx'].includes(item.files[0].split('.').pop())">
<file-excel theme="outline" class="pointer" size="60" fill="#417505" strokeLinecap="square"/>
</template>
<template v-else-if="['pdf'].includes(item.files[0].split('.').pop())">
<file-pdf-one theme="outline" class="pointer" size="60" fill="#f5a623" strokeLinecap="square"/>
</template>
<template v-else>
<el-image :src="item.files[0]" style="width: 100rpx; height: 100rpx" fit="cover"
:preview-src-list="[item.files]"/>
</template>
</template>
</view>
<view class="info flex-1 p-left-30">
<view class="name">{{ item.name }}</view>
<!-- <view class="text">直缝焊管</view>-->
<view class="other">
<text>{{ item._add_time_str }}</text>
<text class="line">|</text>
<text>{{ item.viewNum }}人浏览</text>
<text class="line">|</text>
<text>{{ item.downloadNum }}次下载</text>
<!-- <text class="line">|</text>-->
<!-- <text>免费下载</text>-->
<!-- <text class="line">|</text>-->
<!-- <text>贡献者:</text>-->
</view>
</view>
</view>
</view>
<!-- 乐帮团列表 -->
<!-- <view class="layout layout-list" v-if="pickIndex == 1">-->
<!-- <view class="lebt">-->
<!-- <view class="title">这是什么钢?材质怎么样</view>-->
<!-- <view class="img-box m-top-20">-->
<!-- <view class="total">共3张</view>-->
<!-- <view class="imgs flex justify-start">-->
<!-- <image class="img" src="/static/img/abc-1.png" mode=""></image>-->
<!-- <image class="img" src="/static/img/abc-2.png" mode=""></image>-->
<!-- <image class="img" src="/static/img/abc-1.png" mode=""></image>-->
<!-- </view>-->
<!-- </view>-->
<!-- <view class="bottom flex justify-between align-center m-top-20">-->
<!-- <u-icon name="account-fill" color="#AFAFAF"></u-icon>-->
<!-- <text class="m-left-10 m-right-10">别来无恙</text>-->
<!-- <u-icon name="chat-fill" color="#AFAFAF"></u-icon>-->
<!-- <text class="m-left-10">19条评论</text>-->
<!-- <view class="flex-1"></view>-->
<!-- <text>2023-10-23 16:00发布</text>-->
<!-- </view>-->
<!-- </view>-->
<!-- <view class="lebt">-->
<!-- <view class="title">这是什么钢?材质怎么样</view>-->
<!-- <view class="img-box m-top-20">-->
<!-- <view class="total">共3张</view>-->
<!-- <view class="imgs flex justify-start">-->
<!-- <image class="img" src="/static/img/abc-1.png" mode=""></image>-->
<!-- <image class="img" src="/static/img/abc-2.png" mode=""></image>-->
<!-- <image class="img" src="/static/img/abc-1.png" mode=""></image>-->
<!-- </view>-->
<!-- </view>-->
<!-- <view class="bottom flex justify-between align-center m-top-20">-->
<!-- <u-icon name="account-fill" color="#AFAFAF"></u-icon>-->
<!-- <text class="m-left-10 m-right-10">别来无恙</text>-->
<!-- <u-icon name="chat-fill" color="#AFAFAF"></u-icon>-->
<!-- <text class="m-left-10">19条评论</text>-->
<!-- <view class="flex-1"></view>-->
<!-- <text>2023-10-23 16:00发布</text>-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<!-- 没有数据 u-empty是框架组件 cmempty是自己封装组件 -->
<u-empty mode="list" text="暂无更多内容~" v-if="list.length === 0"></u-empty>
<!-- <cmempty></cmempty> -->
<!-- 圆形按钮 -->
<view class="issue" @click="toList">
<u-icon name="plus" color="#fff" size="24"></u-icon>
</view>
<!-- 选择器 -->
<u-picker :show="isPick" :columns="[cateList]" keyName="name" @cancel="isPick=false"
@confirm="handConfirm"></u-picker>
</view>
</template>
<script>
import uiheader from '@/components/index/header'
import cmsearch from '@/components/common/search'
import cmempty from '@/components/common/empty'
import cmswiper from '@/components/common/swiper'
import {FilePdfOne, FileExcel, FileWord} from '@icon-park/vue'
export default {
components: {
uiheader,
cmsearch,
cmempty,
cmswiper,
FilePdfOne,
FileExcel,
FileWord
},
data() {
return {
isPick: false,
pickIndex: 0,
pickText: '',
pickList: [
[
{id: 0, label: ''},
{id: 1, label: ''},
]
],
cateList: [],
activeCateIndex: 0,
list: [],
keyword: null
}
},
methods: {
handSelect() {
this.isPick = true
},
handConfirm({indexs}) {
this.isPick = false
this.activeCateIndex = indexs[0]
this.pickText = this.cateList[indexs[0]].name
this.getContentList()
},
async getCateList() {
const {rows} = await vk.callFunction({
url: 'client/article/category/pub/getList'
})
this.cateList = rows
this.pickText = this.cateList[0].name
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
},
toList() {
vk.navigateTo('/pages/school/list')
},
},
async onLoad() {
await this.getCateList()
await this.getContentList()
},
}
</script>
<style lang="scss">
.layout-sch {
padding: 30rpx 30rpx;
.select {
position: relative;
flex: 0 0 275rpx;
margin-right: 10rpx;
//width: 200rpx;
height: 40rpx;
font-size: 28rpx;
line-height: 40rpx;
color: #333;
padding: 10rpx 30rpx 10rpx 20rpx;
border: 1px solid #f2f2f2;
overflow: hidden;
}
.down::after {
position: absolute;
right: 20rpx;
top: 50%;
z-index: 9;
content: '';
margin-top: -6rpx;
width: 0;
height: 0;
border-left: 10rpx solid transparent;
border-right: 10rpx solid transparent;
border-top: 12rpx solid #999999;
}
.search {
flex: 1;
//margin-left: 10rpx;
//width: 400rpx;
height: 60rpx;
border: 1px solid #A92924;
.search-input {
display: block;
//width: 250rpx;
height: 40rpx;
font-size: 28rpx;
line-height: 40rpx;
color: #666666;
}
.search-btn {
width: 120rpx;
height: 60rpx;
font-size: 28rpx;
line-height: 60rpx;
text-align: center;
color: #ffffff;
background: #A92924;
}
}
}
.layout-list {
margin: 20rpx 30rpx;
.item {
padding: 30rpx 20rpx;
border-bottom: 1px solid #f2f2f2;
background: #ffffff;
.img {
width: 130rpx;
height: 130rpx;
}
.name {
font-size: 32rpx;
font-weight: 500;
line-height: 44rpx;
color: #111111;
}
.text {
padding: 6rpx 0;
font-size: 26rpx;
line-height: 40rpx;
color: #666666;
}
.other {
font-size: 24rpx;
line-height: 32rpx;
color: #999999;
}
.line {
margin: 0 8rpx;
}
}
}
.lebt {
padding: 20rpx 20rpx;
border-bottom: 1px solid #f2f2f2;
background: #ffffff;
.title {
font-size: 28rpx;
font-weight: 500;
line-height: 40rpx;
color: #777777;
}
.bottom {
font-size: 24rpx;
line-height: 40rpx;
color: #AFAFAF;
}
.img-box {
position: relative;
width: 100%;
height: 160rpx;
.imgs {
width: 100%;
height: 160rpx;
overflow: hidden;
}
.img {
width: 200rpx;
height: 160rpx;
}
.img:nth-child(2) {
margin: 0 20rpx;
}
.total {
position: absolute;
left: 0;
top: 0;
z-index: 9;
padding: 0 10rpx;
font-size: 22rpx;
line-height: 36rpx;
color: #ffffff;
background-color: rgba(0, 0, 0, 0.33);
}
}
}
</style>
+444
View File
@@ -0,0 +1,444 @@
<template>
<view>
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uititle title="信誉实力考察"></uititle>
</u-sticky>
<view class="p-30">
<view v-for="(item, index) in configList" :key="index"
class="server-item my-20" :class="{'text-main': contentList.includes(index)}">
<u-checkbox-group>
<u-checkbox :name="index" :checked="contentList.includes(index)" @change="changeCheck(index, $event)">
</u-checkbox>
<view class="flex flex-col justify-start items-start ml-15 text-25">
<view class="flex flex-col justify-start items-start mb-20">
<view class="font-bold">{{ item.name }}</view>
<view class="mt-15">
<text>业务编号:</text>
<text v-if="item.contentIndex !== null">{{
item.contents[item.contentIndex].code
}}
</text>
</view>
<view class="server-item-content" style="line-height: 50rpx">
<text class="mr-15 mb-10">服务项目:</text>
<u-icon label-size="25rpx"
:label="getServiceLabel(item)"
name="arrow-down" label-pos="left" @click="selectContent(index)"/>
</view>
<text class="mt-15">金额:</text>
<view class="mt-15" v-if="item.contentIndex !== null && item.amountIndex !== null">
{{ item.contents[item.contentIndex].amountList[item.amountIndex].amount }}元/次
</view>
<view class="mt-15" v-else>
元/次
</view>
</view>
<text class="remark text-25" style="line-height: 30rpx">备注: {{ item.remark }}</text>
</view>
</u-checkbox-group>
</view>
<view class="card">
<u-form ref="form" :model="form" label-width="180rpx" :label-style="{fontSize: '25rpx'}">
<view v-for="(item, companyIndex) in companyList" :key="companyIndex">
<u-form-item label="个人/企业全称" required>
<u-input v-model="companyList[companyIndex].name"/>
</u-form-item>
<u-form-item label="个人身份证/企业信用代码 " required>
<u-input v-model="companyList[companyIndex].code"/>
</u-form-item>
<u-form-item label="个人/单位所在地:" required @click.native="showAddress(companyIndex)">
<u-input v-model="companyList[companyIndex].region" readonly placeholder="点击选择区域"
style="pointer-events:none"/>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="个人/单位详细地址:" required>
<u-input v-model="companyList[companyIndex].address" placeholder="请输入详细地址"/>
</u-form-item>
<view class="ml-20">
<u-button type="primary" size="small" plain @click.native="removeCompany(companyIndex)"
:disabled="companyList.length === 1">删除该对象
</u-button>
</view>
</view>
<u-divider/>
<u-form-item label="本次服务费用小计:">
<view class="flex justify-between items-start mb-20 w-100p">
<view class="flex justify-end items-center">
<text>¥{{ amount ? amount.toFixed(2) : 0 }}</text>
<view class="ml-20">
<u-button type="primary" size="mini" @click.native="addCompany">增加考察对象
</u-button>
</view>
</view>
</view>
</u-form-item>
<u-form-item label="接收文件电子邮箱:" required>
<u-input v-model="email"/>
</u-form-item>
<u-form-item label="接收文件微信:" required>
<u-input v-model="wechat"/>
</u-form-item>
<u-form-item label="接收文件寄件地址" required @click.native="showReceiveAddress">
<u-input v-model="region" readonly placeholder="点击选择区域" style="pointer-events:none"/>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="详细地址:" required>
<u-input v-model="receiveAddress" placeholder="请输入详细地址"/>
</u-form-item>
<p class="text-main text-25 text-center" style="margin-bottom: 80rpx">接收文件电子邮箱/ 接收文件微信/
接收文件寄件地址,以上三项选填一项即可</p>
<u-form-item label="申请人:" required>
<u-input v-model="requestName"/>
</u-form-item>
<u-form-item label="业务联系人:" required>
<u-input v-model="contactName"/>
</u-form-item>
<u-form-item label="业务咨询联系方式:" required>
<u-input v-model="contact"/>
</u-form-item>
<view class="mt-40 flex justify-center items-center text-25">
<view class="flex justify-center items-center">
<text>总价:</text>
<text class="text-main font-bold text-35">{{ totalAmount }}元</text>
</view>
<view class="ml-35">客服联系方式: 400-686-5559</view>
</view>
<view class="flex justify-start items-center text-25 mt-40">
<el-checkbox v-model="agree">我已阅读并同意</el-checkbox>
<span class="text-main font-bold" @click="show = true">《金久信自营交易协议》</span>
</view>
<view class="mt-40 flex justify-center items-center text-25">
<u-button type="primary" @click="newOrder"
:disabled="companyList.length === 0 || !companyList[0].name || !agree">
立即支付
</u-button>
</view>
</u-form>
</view>
</view>
<AddressSelect ref="AddressSelect" @confirm="regionConfirm"/>
<AddressSelect ref="ReceiveAddress" @confirm="regionReceiveConfirm"/>
<u-picker :show="showPicker" :columns="amountList" keyName="title"
@cancel="showPicker = false" @close="showPicker = false" closeOnClickOverlay
@confirm="confirm"></u-picker>
<u-popup closeable :show="show"
round="10"
mode="center"
:custom-style="{width: '80%'}"
@close="show = false">
<view style="height: 60vh; overflow-y: scroll" class="p-25">
<u-parse :content="agreement"></u-parse>
</view>
</u-popup>
</view>
</template>
<script>
import uititle from "@/components/common/title.vue";
import AddressSelect from "@/components/AddressSelect.vue";
export default {
name: "companyQuote",
components: {AddressSelect, uititle},
data() {
return {
form: {},
configList: [],
checkList: [],
contentList: [],
addressIndex: [[null, null, null]],
addressDetail: '',
receiveAddressIndex: [null, null, null],
receiveAddressDetail: '',
clickedCompanyIndex: null,
companyList: [
{
name: '',
code: '',
addressRegion: {
province: null,
city: null,
area: null,
},
address: '',
region: '',
}
],
email: '',
wechat: '',
receiveAddressRegion: {
province: null,
city: null,
area: null,
},
receiveAddress: '',
requestName: '',
contactName: '',
contact: '',
agreement: '',
agree: false,
showPicker: false,
amountList: [],
selectedAmountList: [],
clickedContentIndex: 0,
region: '',
show: false
}
},
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, checked) {
this.configList.forEach((item, index) => {
if (index !== itemIndex || !checked) {
item.contentIndex = null
item.amountIndex = null
}
})
this.contentList = checked ? [itemIndex] : []
this.selectedAmountList = []
},
addCompany() {
this.companyList.push({
name: '',
code: '',
addressRegion: {
province: null,
city: null,
area: null,
},
region: ''
})
},
removeCompany(index) {
if (this.companyList.length === 1) return
this.companyList.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.email && !this.wechat && !this.receiveAddressRegion.province) return this.$message({
message: '请选择接收文件地址/微信/邮箱',
type: 'error'
})
for (let i = 0; i < this.companyList.length; i++) {
if (!this.companyList[i].name) return this.$message({
message: '请填写考察公司/个人名称',
type: 'error'
})
if (!this.companyList[i].code) return this.$message({
type: 'error',
message: '请填写考察公司/个人统一信用代码',
})
if (!this.companyList[i].address) return this.$message({
type: 'error',
message: '请填写公司/个人地址',
})
if (!this.companyList[i].addressRegion.province) 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: '请填写联系人电话',
})
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/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
},
confirm({indexs}) {
this.selectedAmountList = indexs
this.showPicker = false
this.configList[this.clickedContentIndex].contentIndex = indexs[0]
this.configList[this.clickedContentIndex].amountIndex = indexs[1]
},
selectContent(index) {
if (!this.contentList.includes(index)) return this.$message.error('请先勾选服务')
this.clickedContentIndex = index
this.amountList = [this.configList[index].contents, this.configList[index].contents[0].amountList]
this.showPicker = true
},
getServiceLabel(item) {
if (item.contentIndex === null || item.amountIndex === null) {
return '点击选择'
}
const content = item.contents[item.contentIndex]
const amount = content.amountList[item.amountIndex]
return `${content.title},${amount.title}`
},
showAddress(index) {
this.clickedCompanyIndex = index
this.$refs.AddressSelect.open(this.companyList[index].addressRegion);
},
regionConfirm({province, city, area}) {
this.companyList[this.clickedCompanyIndex].addressRegion = {province, city, area}
this.companyList[this.clickedCompanyIndex].region = `${province.name} ${city.name} ${area.name}`
},
showReceiveAddress() {
this.$refs.ReceiveAddress.open(this.receiveAddress);
},
regionReceiveConfirm({province, city, area}) {
this.receiveAddressRegion = {province, city, area}
this.region = `${province.name} ${city.name} ${area.name}`
},
},
onLoad() {
const userInfo = vk.getStorageSync('uni_id_user_info')
// 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
} else {
this.requestName = userInfo.person.personName
this.contactName = userInfo.person.personName
this.contact = userInfo.person.personName
this.email = userInfo.person.mobile
}
this.getAgreement()
this.getConfigList()
},
computed: {
amount() {
let tmpAmount = 0
this.configList.forEach((item, index) => {
if (this.contentList.includes(index)) {
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 {
align-items: center;
margin-top: 15rpx;
display: inline-block;
word-break: break-all;
white-space: normal;
width: 600rpx !important;
}
.remark {
color: #999999;
font-weight: normal;
display: inline-block;
width: 600rpx !important;
word-break: break-all;
white-space: normal;
}
}
.divider-title {
font-size: 17px;
font-weight: bold;
}
</style>
+451
View File
@@ -0,0 +1,451 @@
<template>
<view>
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uititle title="造价询价服务"></uititle>
</u-sticky>
<view class="p-30">
<view v-for="(item, index) in configList" :key="index"
class="server-item my-20" :class="{'text-main': contentList.includes(index)}">
<u-checkbox-group>
<u-checkbox @change="changeCheck(index, item.name)">
</u-checkbox>
<view class="flex flex-col justify-start items-start ml-15">
<view class="flex flex-col justify-start items-start text-30 mb-20">
<view class="font-bold">{{ item.name }}</view>
<view class="mt-15">
<text>业务编号:</text>
<text v-if="item.contentIndex !== null">{{
item.contents[item.contentIndex].code
}}
</text>
</view>
<view class="server-item-content">
<text class="mr-15">服务服务项目:</text>
<u-icon v-if="configList[index].contentIndex === null"
label="点击选择"
name="arrow-down" label-pos="left" @click="selectContent(index)"/>
<view class="flex flex-col justify-start items-start text-25" v-else>
<text class="my-10">{{ item.contents[item.contentIndex].title }}</text>
<text>{{ item.contents[item.contentIndex].amountList[item.amountIndex].title }}</text>
</view>
</view>
</view>
<text class="remark text-25">备注: {{ item.remark }}</text>
</view>
</u-checkbox-group>
</view>
<view class="card">
<u-form ref="form" :model="form" label-width="140rpx">
<view v-for="(item, companyIndex) in productList" :key="companyIndex">
<u-form-item label="产品明细" required>
<u-upload
accept="file"
:fileList="files"
@afterRead="afterRead($event, companyIndex)"
@delete="deletePic($event)"
name="1"
multiple
:maxCount="10"
></u-upload>
</u-form-item>
<u-form-item label="产品应用地址" required @click.native="showAddress(companyIndex)">
<u-input v-model="productList[companyIndex].region" readonly placeholder="点击选择区域"
style="pointer-events:none"/>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="产品应用详细地址:" required>
<u-input v-model="productList[companyIndex].address" placeholder="请输入详细地址"/>
</u-form-item>
</view>
<u-divider/>
<u-form-item label="接收文件电子邮箱:" required>
<u-input v-model="email"/>
</u-form-item>
<u-form-item label="接收文件微信:" required>
<u-input v-model="wechat"/>
</u-form-item>
<u-form-item label="接收文件寄件地址" required @click.native="showReceiveAddress">
<u-input v-model="region" readonly placeholder="点击选择区域" style="pointer-events:none"/>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="详细地址:" required>
<u-input v-model="receiveAddress" placeholder="请输入详细地址"/>
</u-form-item>
<p class="text-main text-25 text-center" style="margin-bottom: 80rpx">接收文件电子邮箱/ 接收文件微信/
接收文件寄件地址,以上三项选填一项即可</p>
<u-form-item label="申请人:" required>
<u-input v-model="requestName"/>
</u-form-item>
<u-form-item label="业务联系人:" required>
<u-input v-model="contactName"/>
</u-form-item>
<u-form-item label="业务咨询联系方式:" required>
<u-input v-model="contact"/>
</u-form-item>
<view class="mt-40 flex justify-center items-center text-25">
<view class="ml-35">客服联系方式: 400-686-5559</view>
</view>
<view class="flex justify-start items-center text-25 mt-40">
<el-checkbox v-model="agree">我已阅读并同意</el-checkbox>
<span class="text-main font-bold" @click="show = true">《金久信自营交易协议》</span>
</view>
<view class="mt-40 flex justify-center items-center text-25">
<u-button type="primary" @click="newOrder"
:disabled="!productList[0].files.length === 0 || !agree">
立即提交
</u-button>
</view>
</u-form>
</view>
</view>
<AddressSelect ref="AddressSelect" @confirm="regionConfirm"/>
<AddressSelect ref="ReceiveAddress" @confirm="regionReceiveConfirm"/>
<!-- <u-picker :show="showPicker" :columns="amountList" keyName="title"-->
<!-- @cancel="showPicker = false" @close="showPicker = false" closeOnClickOverlay-->
<!-- @confirm="confirm"></u-picker>-->
<u-popup closeable :show="showPicker"
round="10"
mode="center"
:custom-style="{width: '80%'}"
@close="showPicker = false">
<view style="height: 60vh; overflow-y: scroll">
<view class="flex flex-col p-20 border-bottom" v-for="(item, index) in amountList[0]" :key="index">
<text class="font-bold text-30">{{ item.title }}</text>
<view class="border rounded p-20 my-15" @click="confirm({indexs: [index, amountIndex]})"
v-for="(amount, amountIndex) in item.amountList" :key="amountIndex">
{{ amount.title }}
</view>
</view>
</view>
</u-popup>
<u-popup closeable :show="show"
round="10"
mode="center"
:custom-style="{width: '80%'}"
@close="show = false">
<view style="height: 60vh; overflow-y: scroll" class="p-25">
<u-parse :content="agreement"></u-parse>
</view>
</u-popup>
</view>
</template>
<script>
import uititle from "@/components/common/title.vue";
import AddressSelect from "@/components/AddressSelect.vue";
import dayjs from "dayjs";
export default {
name: "companyQuote",
components: {AddressSelect, uititle},
data() {
return {
form: {},
configList: [],
checkList: [],
contentList: [],
addressIndex: [[null, null, null]],
addressDetail: '',
receiveAddressIndex: [null, null, null],
receiveAddressDetail: '',
clickedCompanyIndex: null,
productList: [
{
files: [],
addressRegion: {
province: null,
city: null,
area: null,
},
address: '',
region: '',
}
],
email: '',
wechat: '',
receiveAddressRegion: {
province: null,
city: null,
area: null,
},
receiveAddress: '',
requestName: '',
contactName: '',
contact: '',
agreement: '',
agree: false,
showPicker: false,
amountList: [],
selectedAmountList: [],
contentNameList: [],
clickedContentIndex: 0,
region: '',
files: [],
show: false
}
},
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
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.productList.push({
name: '',
code: '',
addressRegion: {
province: null,
city: null,
area: null,
},
region: ''
})
},
removeCompany(index) {
if (this.productList.length === 1) return
this.productList.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(amount._index)
}
})
}
})
})
if (amountList.length === 0) return this.$message({
message: '请至少选择一项服务',
type: 'error'
})
if (!this.email && !this.wechat && !this.receiveAddressRegion.province) return this.$message({
message: '请选择接收文件地址/微信/邮箱',
type: 'error'
})
for (let i = 0; i < this.productList.length; i++) {
if (this.productList[i].files.length === 0) return this.$message({
message: '请上传产品明细',
type: 'error'
})
if (!this.productList[i].address) return this.$message({
type: 'error',
message: '请填写产品取样地址',
})
if (!this.productList[i].addressRegion.province) 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: '请填写联系人电话',
})
const {data} = await vk.callFunction({
url: 'client/selfSupport/kh/addOrder',
title: '提交中...',
data: {
type: 2,
amountList,
contentList: this.productList,
receiveAddressRegion: this.receiveAddressRegion,
email: this.email,
wechat: this.wechat,
receiveAddress: this.receiveAddress,
requestName: this.requestName,
contactName: this.contactName,
contact: this.contact,
}
})
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
},
confirm({indexs}) {
this.configList[this.clickedContentIndex].contentIndex = indexs[0]
this.configList[this.clickedContentIndex].amountIndex = indexs[1]
this.showPicker = false
},
selectContent(index) {
this.clickedContentIndex = index
let content = this.configList[index].contents[0].amountList
if (content.length > 7) content = content.slice(0, 7) + "\n" + content.slice(7)
this.amountList = [this.configList[index].contents, content]
this.showPicker = true
},
showAddress(index) {
this.clickedCompanyIndex = index
this.$refs.AddressSelect.open(this.productList[index].addressRegion);
},
regionConfirm({province, city, area}) {
this.productList[this.clickedCompanyIndex].addressRegion = {province, city, area}
this.productList[this.clickedCompanyIndex].region = `${province.name} ${city.name} ${area.name}`
},
showReceiveAddress() {
this.$refs.ReceiveAddress.open(this.receiveAddress);
},
regionReceiveConfirm({province, city, area}) {
this.receiveAddressRegion = {province, city, area}
this.region = `${province.name} ${city.name} ${area.name}`
},
afterRead({file}, index) {
for (let i = 0; i < file.length; i++) {
const item = file[i]
uniCloud.uploadFile({
filePath: item.url,
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + item.name,
success: ({fileID}) => {
uniCloud.getTempFileURL({
fileList: [fileID]
}).then(res => {
this.files.push({url: res.fileList[0].tempFileURL})
this.productList[index].files.push(res.fileList[0].tempFileURL)
})
}
})
}
},
deletePic({index}) {
console.log(index)
this.files.splice(index, 1)
this.productList[0].files.splice(index, 1)
},
},
onLoad() {
const userInfo = vk.getStorageSync('uni_id_user_info')
// 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
} else {
this.requestName = userInfo.person.personName
this.contactName = userInfo.person.personName
this.contact = userInfo.person.personName
this.email = userInfo.person.mobile
}
this.getAgreement()
this.getConfigList()
},
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.productList.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 {
align-items: center;
margin-top: 15rpx;
display: inline-block;
word-break: break-all;
white-space: normal;
width: 600rpx !important;
}
.remark {
color: #999999;
font-weight: normal;
display: inline-block;
width: 600rpx !important;
word-break: break-all;
white-space: normal;
}
}
.divider-title {
font-size: 17px;
font-weight: bold;
}
</style>
+49
View File
@@ -0,0 +1,49 @@
<template>
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uititle title="我的询价"></uititle>
</u-sticky>
<view class="p-30">
<view v-for="(item, index) in list" :key="index" class="card mb-20 text-25">
<view class="mb-15">联系人:{{ item.name }}</view>
<view class="mb-15">询价区域:{{ item.province.name }}{{ item.city.name }}</view>
<view class="mb-15">联系方式:{{ item.phone }}</view>
<view class="mb-15">企业名称:{{ item.company }}</view>
<view class="mb-15">询价日期:{{ item._add_time_str }}</view>
<template v-if="item.files">
<view class="mb-15">附件列表</view>
<file-type v-for="(item0, index0) in item.files" :key="index0" :item="item0"/>
</template>
</view>
</view>
</view>
</template>
<script>
import uititle from "@/components/common/title.vue";
import FileType from "@/components/file-type/file-type.vue";
export default {
name: "list",
components: {FileType, uititle},
data() {
return {
list: []
}
},
methods: {
async getList() {
const {rows} = await vk.callFunction({
url: 'client/selfSupport/kh/getList',
})
this.list = rows
this.showList = true
},
},
onLoad() {
this.getList()
}
}
</script>
+179
View File
@@ -0,0 +1,179 @@
<template>
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uititle title="金久信自营下询价单"></uititle>
</u-sticky>
<view class="bg-white p-30">
<u-form ref="form" label-width="100px">
<u-form-item label="联系人" required @click.native="showPicker = true">
<!-- <u-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>-->
<!-- </u-select>-->
<u-input v-model="name" placeholder="点击选择联系人" style="pointer-events:none" readonly/>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="联系方式" required>
<u-input v-model="phone" placeholder="请输入联系方式" disabled/>
</u-form-item>
<u-form-item label="用户名称" required>
<u-input v-model="company" placeholder="请输入您的用户名称"/>
</u-form-item>
<u-form-item label="询价单附件" required>
<u-upload
accept="file"
:fileList="files"
@afterRead="afterRead"
@delete="deletePic"
multiple
:maxCount="10"
width="70"
height="70"
></u-upload>
<!-- <vk-data-upload v-model="files" accept="*" list-type="text">-->
<!-- </vk-data-upload>-->
</u-form-item>
<template v-if="files && files.length">
<view v-for="(item, index) in files" :key="index" class="mr-10 mb-10 text-main text-25"
@click="previewFile(item)">在线查看文件{{ index + 1 }}
</view>
</template>
<!-- <p class="text-red text-25 mt-10">平台目前仅支持PDF文档上传,请你谅解!</p>-->
</u-form>
<view class="mt-20 flex justify-center items-center">
<view>
<u-button size="small" color="#A92924" text="取消" plain
@click="back"></u-button>
</view>
<view class="ml-20">
<u-button size="small" color="#A92924" text="提交"
@click="addFiles"></u-button>
</view>
</view>
</view>
<u-picker :show="showPicker" :columns="[contactList]" keyName="name"
@cancel="showPicker = false" @close="showPicker = false" closeOnClickOverlay
@confirm="confirmContact"></u-picker>
</view>
</template>
<script>
import uiheader from "@/components/index/header.vue";
import uititle from "@/components/common/title.vue";
import dayjs from "dayjs";
import md5 from "js-md5";
export default {
name: "make",
components: {uititle, uiheader},
data() {
return {
files: [],
name: null,
phone: null,
company: null,
contactList: [],
showPicker: false,
province: null,
city: null,
}
},
methods: {
navToContact() {
uni.setStorageSync('user_tab', 8)
uni.switchTab({
url: '/pages/user/user?tab=8'
})
},
async getContactList() {
const {rows} = await vk.callFunction({
url: 'client/businessContact/kh/getList',
})
this.contactList = rows
},
confirmContact({value}) {
this.name = value[0].name
this.phone = value[0].phone
this.showPicker = false
},
afterRead({file}) {
for (let i = 0; i < file.length; i++) {
const item = file[i]
// if (item.type !== 'application/pdf') {
// uni.showToast({
// title: '请上传PDF文件',
// icon: 'none'
// })
// return
// }
const suffix = item.name.split('.').pop()
uniCloud.uploadFile({
filePath: item.url,
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + md5(item.name + Date.now().toString()) + `.${suffix}`,
success: ({fileID}) => {
uniCloud.getTempFileURL({
fileList: [fileID]
}).then(res => {
this.files.push({
url: res.fileList[0].tempFileURL,
name: item.name
})
})
}
})
}
},
deletePic({index}) {
this.files.splice(index, 1)
},
back() {
uni.navigateBack()
},
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: '请上传询价单附件'})
await vk.callFunction({
url: 'client/selfSupport/kh/add',
data: {
files: this.files.map(item => item.url),
city: this.city,
province: this.province,
name: this.name,
phone: this.phone,
company: this.company,
}
})
this.$message({
message: '下单成功',
type: 'success'
})
uni.navigateBack()
},
previewFile(item) {
window.location.href = item.url
}
},
onLoad({province, city}) {
this.province = JSON.parse(province)
this.city = JSON.parse(city)
this.getContactList()
const user = uni.getStorageSync('uni_id_user_info')
this.company = user.accountType === 2 ? user.company.companyName : user.person.personName
}
}
</script>
+288
View File
@@ -0,0 +1,288 @@
<template>
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uititle title="报价单"></uititle>
</u-sticky>
<quote-remain-num v-if="reloaded"/>
<view class="layout layout-title m-top-20">填写报价信息</view>
<view class="layout layout-publish m-top-20 bg-white">
<view class="card-title m-top-30">询价文件</view>
<view class="flex justify-start items-start flex-wrap">
<file-type v-for="(item, index) in sheet.files" :key="index" :item="item"/>
</view>
<view class="card-title m-top-30">报价信息</view>
<view class="group flex align-center m-top-30">
<view class="lb need m-right-20 w-25p">货款总价:</view>
<view class="vl flex-1">
<u--input
@blur="formatter"
placeholder="请输入货款总价"
border="surround"
v-model="formData.amount"
suffixIcon="元"
suffixIconStyle="font-size: 24rpx;color: #909399"
></u--input>
</view>
</view>
<view class="group flex items-start m-top-30">
<view class="lb m-right-20 w-25p mt-20">报价单详情:</view>
<view class="vl flex-1">
<u-textarea
placeholder="请输入报价单详情"
border="surround"
v-model="formData.remark"
suffixIconStyle="font-size: 24rpx;color: #909399"
></u-textarea>
</view>
</view>
<view class="card-title m-top-30">附件信息</view>
<view class="group m-top-20">
<!-- <view class="lb m-right-20">附件内容:</view>-->
<!-- <view class="flex justify-between align-center m-top-20">-->
<!-- <view class="lbx flex-1">上传自有报价单图片或文档,支持jpg/png/word/excel。</view>-->
<!-- <view class="download">报价单样板下载</view>-->
<!-- </view>-->
<view class="m-top-30">
<u-upload
:fileList="formData.files"
@afterRead="afterRead"
@delete="deletePic"
accept="file"
:maxCount="10"
multiple
:previewImage="false"
>
<view class="w-100p">
<view>
<u-button size="mini" type="primary">点击上传</u-button>
</view>
<view class="mt-10 flex justify-between items-center w-100p" @click="delFiles(index)"
v-for="(item, index) in fileNameList" :key="index">
<text>{{ item }}</text>
<u-icon name="trash"/>
</view>
</view>
</u-upload>
</view>
</view>
</view>
<u-button class="public-btn m-top-30" text="提交报价" @click="submit"></u-button>
</view>
</template>
<script>
import uititle from '@/components/common/title'
import dayjs from "dayjs";
import QuoteRemainNum from "@/components/quote-remain-num/quote-remain-num.vue";
import md5 from "js-md5";
import FileType from "@/components/file-type/file-type.vue";
export default {
components: {
FileType,
QuoteRemainNum,
uititle,
},
data() {
return {
enquiryId: null,
sheet: null,
formData: {
amount: '',
files: [],
remark: '',
supplierExt: '',
},
reloaded: false,
fileNameList: []
};
},
methods: {
handTag(val) {
val.checked = !val.checked
},
afterRead({file}) {
for (let i = 0; i < file.length; i++) {
const item = file[i]
if (item.type !== 'application/pdf') {
uni.showToast({
title: '请上传PDF文件',
icon: 'none'
})
return
}
uniCloud.uploadFile({
filePath: item.url,
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + md5(item.name + Date.now().toString()) + '.pdf',
success: ({fileID}) => {
uniCloud.getTempFileURL({
fileList: [fileID]
}).then(res => {
this.formData.files.push(res.fileList[0].tempFileURL)
this.fileNameList.push(item.name)
})
}
})
}
},
deletePic({index}) {
this.formData.files.splice(index, 1)
},
async submit() {
if (!this.formData.totalPrice) return this.$message.error('请填写金额')
// if (this.formData.files.length > 0) this.formData.files = this.formData.files.map(item => item.url)
vk.callFunction({
url: 'client/selfSupport/kh/addQuote',
title: '请求中...',
data: {
sheetId: this.enquiryId,
...this.formData
},
success: (data) => {
this.$message({
message: "报价成功",
type: 'success'
})
uni.navigateBack()
}
});
},
/**
* 获取询价单详情
*/
getEnquiryDetail() {
vk.callFunction({
url: 'client/selfSupport/kh/getDetail',
title: '请求中...',
data: {
_id: this.enquiryId
},
success: (res) => {
this.sheet = res
}
});
},
delFiles(index){
this.formData.files.splice(index, 1)
this.fileNameList.splice(index, 1)
},
formatter(val){
this.formData.totalPrice = parseFloat(val).toFixed(2)
},
},
onLoad({id}) {
this.enquiryId = id
this.getEnquiryDetail()
},
onShow() {
this.reloaded = false
setTimeout(() => {
this.reloaded = true
}, 500)
}
}
</script>
<style lang="scss">
.layout-title {
padding: 20rpx 30rpx;
font-size: 28rpx;
font-weight: 600;
line-height: 44rpx;
color: #A92924;
}
.card-title {
position: relative;
padding-left: 20rpx;
font-size: 26rpx;
font-weight: 600;
line-height: 48rpx;
color: #A92924;
&:before {
position: absolute;
left: 0;
top: 50%;
z-index: 9;
margin-top: -14rpx;
content: '';
width: 4rpx;
height: 28rpx;
background: #A92924;
}
}
.public-btn {
width: 80%;
margin-top: 60rpx;
color: #ffffff;
background: #A92924;
}
.layout-publish {
margin: 20rpx 30rpx;
padding: 50rpx 30rpx;
border-radius: 18rpx;
}
.tag-title {
font-size: 26rpx;
line-height: 40rpx;
color: #000000;
.limit {
font-size: 24rpx;
color: #999999;
}
}
.tag-box {
padding: 20rpx 0;
.item {
padding: 6rpx 10rpx;
font-size: 24rpx;
line-height: 32rpx;
color: #555555;
}
.active {
color: #A92924;
}
}
.lb, .fix {
position: relative;
font-size: 26rpx;
line-height: 40rpx;
color: #666666;
}
.lbx {
font-size: 24rpx;
color: #999999;
}
.download {
padding: 8rpx 20rpx;
font-size: 24rpx;
line-height: 36rpx;
color: #A92924;
border: 1px solid #A92924;
}
.need::before {
position: absolute;
left: -16rpx;
top: 50%;
z-index: 9;
margin-top: -12rpx;
content: '*';
color: #A92924;
font-size: 32rpx;
line-height: 1;
}
</style>
+530
View File
@@ -0,0 +1,530 @@
<template>
<view>
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uititle title="检测产品"></uititle>
</u-sticky>
<view class="p-30">
<view class="flex justify-end items-center text-main pointer my-20 " @click="demoDownload">示例下载</view>
<view v-for="(item, index) in configList" :key="index"
class="server-item my-20" :class="{'text-main': contentList.includes(index)}">
<u-checkbox-group>
<u-checkbox @change="changeCheck(index, item.name)">
</u-checkbox>
<view class="flex flex-col justify-start items-start ml-15">
<view class="flex flex-col justify-start items-start text-30 mb-20">
<view class="font-bold">{{ item.name }}</view>
<view class="mt-15">
<text>业务编号:</text>
<text v-if="item.contentIndex !== null">{{
item.contents[item.contentIndex].code
}}
</text>
</view>
<view class="server-item-content">
<text class="mr-15">服务服务项目:</text>
<u-icon v-if="configList[index].contentIndex === null"
label="点击选择"
name="arrow-down" label-pos="left" @click="selectContent(index)"/>
<view class="flex flex-col justify-start items-start text-25" v-else>
<text class="my-10">{{ item.contents[item.contentIndex].title }}</text>
<text>{{ item.contents[item.contentIndex].amountList[item.amountIndex].title }}</text>
</view>
</view>
<text class="mt-15">金额:</text>
<view class="mt-15" v-if="configList[index].contentIndex !== null">
{{
item.contents[item.contentIndex].amountList[item.amountIndex].amount
}}元/次
</view>
<view class="mt-15" v-else>
元/次
</view>
</view>
<text class="remark text-25 my-15">备注: {{ item.remark }}</text>
<u-button type="primary" size="small"
@click="addToAmountList(index, configList[index].contentIndex, item.amountIndex)"
:disabled="item.amountIndex === null">
添加
</u-button>
</view>
</u-checkbox-group>
</view>
<view class="card">
<u-form ref="form" :model="form" label-width="180rpx">
<view v-for="(item, companyIndex) in productList" :key="companyIndex">
<u-form-item label="检测产品" required>
<u-input v-model="productList[companyIndex].name"/>
</u-form-item>
<u-form-item label="检测内容" required>
{{ contentNameList.join() }}
</u-form-item>
<u-form-item label="取样所在地" required @click.native="showAddress(companyIndex)">
<u-input v-model="productList[companyIndex].region" readonly placeholder="点击选择区域"
style="pointer-events:none"/>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="取样详细地址:" required>
<u-input v-model="productList[companyIndex].address" placeholder="请输入详细地址"/>
</u-form-item>
<view class="ml-20">
<u-button type="primary" size="mini" plain @click.native="removeCompany(companyIndex)"
:disabled="productList.length === 1">删除该对象
</u-button>
</view>
</view>
<u-divider/>
<u-form-item label="本次服务费用小计:">
<view class="flex justify-between items-start mb-20 w-100p">
<view class="flex justify-end items-center">
<text>¥{{ amount ? amount.toFixed(2) : 0 }}</text>
<view class="ml-20">
<u-button type="primary" size="mini" @click.native="addCompany">增加考察对象
</u-button>
</view>
</view>
</view>
</u-form-item>
<u-form-item label="接收文件电子邮箱:" required>
<u-input v-model="email"/>
</u-form-item>
<u-form-item label="接收文件微信:" required>
<u-input v-model="wechat"/>
</u-form-item>
<u-form-item label="接收文件寄件地址" required @click.native="showReceiveAddress">
<u-input v-model="region" readonly placeholder="点击选择区域" style="pointer-events:none"/>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="详细地址:" required>
<u-input v-model="receiveAddress" placeholder="请输入详细地址"/>
</u-form-item>
<p class="text-main text-25 text-center" style="margin-bottom: 80rpx">接收文件电子邮箱/ 接收文件微信/
接收文件寄件地址,以上三项选填一项即可</p>
<u-form-item label="申请人:" required>
<u-input v-model="requestName"/>
</u-form-item>
<u-form-item label="业务联系人:" required>
<u-input v-model="contactName"/>
</u-form-item>
<u-form-item label="业务咨询联系方式:" required>
<u-input v-model="contact"/>
</u-form-item>
<u-form-item label="备注:">
<u-input v-model="remark"/>
</u-form-item>
<view class="mt-20">
<view>已选项目:</view>
<view v-for="(item, index) in amountList" :key="index" class="mt-20 flex justify-start items-center">
<view>
<u-button type="primary" size="small" @click="removeFromAmountList(index)">删除</u-button>
</view>
<view class="ml-20 text-25" v-if="configList[item.index]">
<text>{{ configList[item.index].name }} --</text>
<text>{{ configList[item.index].contents[item.contentIndex].title }} --</text>
<text>{{
configList[item.index].contents[item.contentIndex].amountList[item.amountIndex].title
}},{{ configList[item.index].contents[item.contentIndex].amountList[item.amountIndex].amount }}元
</text>
</view>
</view>
</view>
<view class="mt-40 flex justify-center items-center text-25">
<view class="flex justify-center items-center">
<text>总价:</text>
<text class="text-main font-bold text-35">{{ totalAmount }}元</text>
</view>
<view class="ml-35">客服联系方式: 400-686-5559</view>
</view>
<view class="flex justify-start items-center text-25 mt-40">
<el-checkbox v-model="agree">我已阅读并同意</el-checkbox>
<span class="text-main font-bold" @click="show = true">《金久信自营交易协议》</span>
</view>
<view class="mt-40 flex justify-center items-center text-25">
<u-button type="primary" @click="newOrder"
:disabled="productList.length === 0 || !productList[0].name || !agree">
立即支付
</u-button>
</view>
</u-form>
</view>
</view>
<AddressSelect ref="AddressSelect" @confirm="regionConfirm"/>
<AddressSelect ref="ReceiveAddress" @confirm="regionReceiveConfirm"/>
<!-- <u-picker :show="showPicker" :columns="amountItemList" keyName="title"-->
<!-- @cancel="showPicker = false" @close="showPicker = false" closeOnClickOverlay-->
<!-- @confirm="confirm"></u-picker>-->
<u-popup closeable :show="showPicker"
round="10"
mode="center"
:custom-style="{width: '80%'}"
@close="showPicker = false">
<view style="height: 60vh; overflow-y: scroll">
<view class="flex flex-col p-20 border-bottom" v-for="(item, index) in amountItemList[0]" :key="index">
<text class="font-bold text-30">{{ item.title }}</text>
<view class="border rounded p-20 my-15 flex justify-between items-center"
:class="[amountList.find(amount => amount.index === index && amount.contentIndex === amountIndex) ? 'amount-active' : '']"
@click="confirm({indexs: [index, amountIndex]})"
v-for="(amount, amountIndex) in item.amountList" :key="amountIndex">
<text>{{ amount.title }}</text>
<text class="text-24"
v-if="amountList.find(amount => amount.index === index && amount.contentIndex === amountIndex)">已选择
</text>
</view>
</view>
</view>
</u-popup>
<u-popup closeable :show="show"
round="10"
mode="center"
:custom-style="{width: '80%'}"
@close="show = false">
<view style="height: 60vh; overflow-y: scroll" class="p-25">
<u-parse :content="agreement"></u-parse>
</view>
</u-popup>
</view>
</template>
<script>
import uititle from "@/components/common/title.vue";
import AddressSelect from "@/components/AddressSelect.vue";
export default {
name: "companyQuote",
components: {AddressSelect, uititle},
data() {
return {
form: {},
configList: [],
checkList: [],
contentList: [],
addressIndex: [[null, null, null]],
addressDetail: '',
receiveAddressIndex: [null, null, null],
receiveAddressDetail: '',
clickedCompanyIndex: null,
productList: [
{
name: '',
code: '',
addressRegion: {
province: null,
city: null,
area: null,
},
address: '',
region: '',
}
],
email: '',
wechat: '',
receiveAddressRegion: {
province: null,
city: null,
area: null,
},
receiveAddress: '',
requestName: '',
contactName: '',
contact: '',
remark: '',
agreement: '',
agree: false,
showPicker: false,
amountList: [],
amountItemList: [],
selectedAmountList: [],
contentNameList: [],
clickedContentIndex: 0,
region: '',
show: false,
}
},
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
})
}
},
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.productList.push({
name: '',
code: '',
addressRegion: {
province: null,
city: null,
area: null,
},
region: ''
})
},
removeCompany(index) {
if (this.productList.length === 1) return
this.productList.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(amount._index)
// }
// })
// }
// })
// })
if (this.amountList.length === 0) return this.$message({
message: '请至少选择一项服务',
type: 'error'
})
if (!this.email && !this.wechat && !this.receiveAddressRegion.province) return this.$message({
message: '请选择接收文件地址/微信/邮箱',
type: 'error'
})
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.productList[i].addressRegion.province) 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: '请填写联系人电话',
})
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/shop/pay?id=${data}`
})
},
showAgreement() {
this.$confirm(`<div style="width: 95vw">${this.agreement}</div>`, '金久信自营交易协议', {
cancelButtonText: '关闭',
showConfirmButton: false,
dangerouslyUseHTMLString: true,
})
},
async getAgreement() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '65885d4c09664c1c8d8e8476'
},
})
this.agreement = res.content
},
confirm({indexs}) {
if (this.amountList.find(amount => amount.index === indexs[0] && amount.contentIndex === indexs[1])) return
uni.showToast({
title: '已选择',
icon: 'none'
})
this.configList[this.clickedContentIndex].contentIndex = indexs[0]
this.configList[this.clickedContentIndex].amountIndex = indexs[1]
this.showPicker = false
console.log(this.configList)
},
selectContent(index) {
console.log(this.configList[index].contents)
this.clickedContentIndex = index
this.amountItemList = [this.configList[index].contents, this.configList[index].contents[0].amountList]
this.showPicker = true
},
showAddress(index) {
this.clickedCompanyIndex = index
this.$refs.AddressSelect.open(this.productList[index].addressRegion);
},
regionConfirm({province, city, area}) {
this.productList[this.clickedCompanyIndex].addressRegion = {province, city, area}
this.productList[this.clickedCompanyIndex].region = `${province.name} ${city.name} ${area.name}`
},
showReceiveAddress() {
this.$refs.ReceiveAddress.open(this.receiveAddress);
},
regionReceiveConfirm({province, city, area}) {
this.receiveAddressRegion = {province, city, area}
this.region = `${province.name} ${city.name} ${area.name}`
},
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)
},
demoDownload() {
vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '6588648da7c432e4a360bb34'
},
success: res => {
window.location.href = res.content
// window.open(res.content)
}
})
}
},
onLoad() {
const userInfo = vk.getStorageSync('uni_id_user_info')
// 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
} else {
this.requestName = userInfo.person.personName
this.contactName = userInfo.person.personName
this.contact = userInfo.person.personName
this.email = userInfo.person.mobile
}
this.getAgreement()
this.getConfigList()
},
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>
<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 {
align-items: center;
margin-top: 15rpx;
display: inline-block;
word-break: break-all;
white-space: normal;
width: 600rpx !important;
}
.remark {
color: #999999;
font-weight: normal;
display: inline-block;
width: 600rpx !important;
word-break: break-all;
white-space: normal;
}
}
.divider-title {
font-size: 17px;
font-weight: bold;
}
.amount-active {
background-color: #fdd7d6;
border-color: #a92924;
color: #a92924
}
</style>
+302
View File
@@ -0,0 +1,302 @@
<template>
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uiheader></uiheader>
<!-- 搜索栏 -->
<!-- <cmsearch></cmsearch>-->
<!-- 轮播图-传值:list="数组" -->
<cmswiper page="self-support-index" height="280rpx"></cmswiper>
<view class="bar">
<text class="active">自营钢城</text>
<text class="" @click="$jump('/pages/self/supportIndex')">平台服务</text>
<text class="" @click="$jump('/pages/shop/shop')">特产商城</text>
</view>
<!-- 选择器 -->
<view class="layout-select flex justify-start align-center bg-white">
<u-icon name="map" color="#A92924" size="18"></u-icon>
<text class="text" @click="showAddress">交易区域:</text>
<view class="ip all text-center" @click="showAddress">
{{ address.province ? `${address.province.name} ${address.city.name}` : '全国' }}
</view>
<view class="mx-20" @click="showAddress">
<u-icon name="arrow-down-fill"/>
</view>
<u-icon name="reload" v-if="address.province" @click="reload"/>
</view>
<!-- 统计 -->
<view class="layout-total flex justify-between align-center">
<view class="total">
共
<text class="red">{{ companyList.length }}</text>
个合作商
</view>
<view class="flex justify-end items-center">
<view class="link" @click="makeOrder">下单询价></view>
<view class="link-plain ml-20" @click="$jump('/pages/self/list')">我的询价</view>
</view>
</view>
</u-sticky>
<!-- 列表数据 -->
<view class="layout-self flex justify-between flex-wrap bg-white">
<view class="item" v-for="(item, index) in companyList" :key="index" @click="detailLink(item._id)">
<view class="company flex justify-center align-center flex-nowrap">
<view class="icon">
<image class="radius" :src="item.businessCard.logo" mode=""
v-if="item.businessCard && item.businessCard.logo"></image>
<image class="radius" src="/static/img/no-logo.jpg" mode="" v-else></image>
</view>
<view class="text flex-1 p-left-20 text-single">{{ item.name }}</view>
</view>
<view class="main text-single m-top-10">
主营:{{ item.mainSpotCategory.join() }}
</view>
</view>
</view>
<!-- 没有数据 -->
<cmempty></cmempty>
<AddressSelect ref="AddressSelect" @confirm="regionConfirm"/>
</view>
</template>
<script>
import uiheader from '@/components/index/header'
import cmsearch from '@/components/common/search'
import cmempty from '@/components/common/empty'
import cmswiper from '@/components/common/swiper'
import AddressSelect from "@/components/AddressSelect.vue";
export default {
components: {
AddressSelect,
uiheader,
cmsearch,
cmempty,
cmswiper,
},
data() {
return {
isLogin: false,
allChildCate: [],
companyList: [],
address: {
province: null,
city: null,
}
};
},
methods: {
showAddress() {
this.$refs.AddressSelect.open(this.address);
},
regionConfirm({province, city, area}) {
this.address = {province, city, area}
this.getCompanyList()
},
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()
}
});
},
async getCompanyList() {
const {rows} = await vk.callFunction({
url: 'client/user/pub/getCompany',
data: {
isCoop: 1,
province: this.address.province ? [this.address.province.code] : []
}
})
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
})
},
reload() {
this.address = {
province: null,
city: null
}
this.getCompanyList()
},
makeOrder() {
if (!this.address.province) return this.$message({type: 'error', message: '请选择交易区域'})
this.$jump(`/pages/self/make?province=${JSON.stringify(this.address.province)}&city=${JSON.stringify(this.address.city)}`)
},
detailLink(id) {
vk.navigateTo(`/pages/yellow/detail?id=${id}`)
},
},
onLoad() {
this.getCategoryTreeData()
}
}
</script>
<style lang="scss">
page {
background: #ffffff;
}
.layout-select {
// width: 690rpx;
height: 68rpx;
padding: 0 30rpx;
font-size: 24rpx;
line-height: 40rpx;
color: #101010;
.text {
color: #A92924;
}
.ip {
position: relative;
//width: 180rpx;
height: 40rpx;
padding: 0 10rpx;
overflow: hidden;
border: 1px solid #f2f2f2;
}
//.all {
// width: 70rpx !important;
//}
.down::after {
position: absolute;
right: 10rpx;
top: 50%;
z-index: 9;
content: '';
margin-top: -6rpx;
width: 0;
height: 0;
border-left: 12rpx solid transparent;
border-right: 12rpx solid transparent;
border-top: 12rpx solid #999999;
}
}
.layout-total {
height: 60rpx;
padding: 10rpx 30rpx;
background: #F5F9FA;
.total {
font-size: 24rpx;
line-height: 40rpx;
color: #101010;
}
.link {
padding: 0 12rpx;
font-size: 24rpx;
line-height: 44rpx;
color: #ffffff;
text-align: center;
background: #A92924;
border-radius: 8rpx;
}
.link-plain {
padding: 0 12rpx;
font-size: 24rpx;
line-height: 44rpx;
color: #A92924;
text-align: center;
border-radius: 8rpx;
border: 1px solid #A92924;
}
}
.layout-self {
padding: 20rpx 30rpx;
.item {
position: relative;
width: 50%;
height: 160rpx;
padding: 20rpx 10rpx;
box-sizing: border-box;
border-bottom: 1px solid #f2f2f2;
.main {
height: 36rpx;
font-size: 24rpx;
line-height: 36rpx;
color: #666666;
}
.company {
width: 100%;
height: 64rpx;
.icon {
width: 64rpx;
height: 64rpx;
}
.text {
font-size: 26rpx;
font-weight: 600;
line-height: 48rpx;
color: #101010;
}
}
}
.item:nth-child(2n+1) {
border-right: 1px solid #f2f2f2;
}
}
.red {
color: #A92924 !important;
}
.bar {
//height: 50px;
color: #ffffff;
font-size: 25rpx;
background-color: #bf2b28;
display: flex;
align-items: center;
justify-content: center;
text {
padding: 20rpx;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
text:hover {
background-color: #941411
}
.active {
background-color: #941411
}
}
</style>
+72
View File
@@ -0,0 +1,72 @@
<template>
<view>
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uititle title="平台服务"></uititle>
</u-sticky>
<cmswiper page="self-support-main" height="280rpx"></cmswiper>
<image :src="companyImg" class="w-100p mb-20" mode="widthFix"
@click="$jump('/pages/self/companyQuote')"/>
<image :src="productImg" class="w-100p mb-20" mode="widthFix"
@click="$jump('/pages/self/productQuote')"/>
<image :src="costImg" class="w-100p mb-20" mode="widthFix"
@click="$jump('/pages/self/costQuote')"/>
</view>
</template>
<script>
import uititle from "@/components/common/title.vue";
import cmswiper from "@/components/common/swiper.vue";
export default {
name: "suportIndex",
components: {cmswiper, uititle},
data() {
return {
companyImg: '',
productImg: '',
costImg: '',
}
},
methods: {
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]
}
})
},
},
onShow() {
this.getCompanyImg()
this.getProductImg()
this.getCostImg()
},
}
</script>
+323
View File
@@ -0,0 +1,323 @@
<template>
<view class="wrap">
<u-sticky offset-top="0" customNavHeight="0">
<uititle title="购物车"></uititle>
</u-sticky>
<view class="cart-box">
<view class="item flex" v-for="(item,index) in list" :key="index">
<view class="check-box">
<view class="check" :class="{ on: selectedList.includes(item._id) }"
@click="changeCheck(item._id)"></view>
</view>
<view class="img">
<image :src="item.goods.cover" mode=""></image>
</view>
<view class="info flex-1">
<view class="name ellipsis">{{ item.goods.name }}</view>
<view class="spc ellipsis">{{ item.sku.label }}</view>
<view class="price ellipsis">{{ item.sku.values }}元</view>
<view class="other">
<view class="subtract" @click="sub(item,index)">-</view>
<view class="num">{{ item.num }}</view>
<view class="increase" @click="add(item,index)">+</view>
</view>
<view class="delete">
<image src="/static/image/delete.png" mode=""></image>
</view>
</view>
</view>
</view>
<view class="fixed flex justify-start items-center">
<view class="p-20" v-if="selectedList.length > 0">
<u-button type="primary" plain size="mini" @click="removeMulti">移出购物车</u-button>
</view>
<view class="total flex-1">合计:&yen;{{ amount }}</view>
<view class="btn" @click="addFromCart">立即结算</view>
</view>
</view>
</template>
<script>
import uititle from "@/components/common/title.vue";
export default {
components: {uititle},
data() {
return {
totalPrice: 0,
list: [],
selectedList: [],
selectedAll: false,
};
},
methods: {
selected(item, index) {
if (item.check == 0) {
this.cartList[index].check = 1
this.selectedList.push(item)
this.getTotalPrice()
} else {
this.cartList[index].check = 0
this.selectedList = this.selectedList.filter(val => val.id != this.cartList[index].id)
console.log(this.selectedList)
this.getTotalPrice()
}
},
// 减少数量(执行接口)
sub(item, index) {
if (this.list[index].num <= 1) {
return;
}
this.list[index].num--;
this.getTotalPrice()
this.changeNum(index)
},
// 增加数量(执行接口)
add(item, index) {
this.list[index].num++;
this.getTotalPrice()
this.changeNum(index)
},
getTotalPrice() {
this.totalPrice = 0
if (this.selectedList.length > 0) {
this.selectedList.forEach(val => {
this.totalPrice += (Math.floor(val.num * 100) * Math.floor(val.price * 100)) / 10000
})
} else {
this.totalPrice = 0
}
},
async getList() {
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(index) {
vk.callFunction({
url: "client/cart/kh/changeNum",
data: {
id: this.list[index]._id,
num: this.list[index].num
}
})
},
changeCheck(id) {
const index = this.selectedList.indexOf(id)
if (index === -1) this.selectedList.push(id)
else this.selectedList.splice(index, 1)
this.selectedAll = this.selectedList.length === this.list.length
},
remove(index) {
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/shop/pay?id=${data}`
})
}
},
onShow() {
this.getList()
},
computed: {
amount() {
let tmpAmount = 0
this.list.forEach(item => {
if (this.selectedList.includes(item._id)) tmpAmount += parseFloat(item.sku.values) * parseInt(item.num)
})
return tmpAmount
}
}
}
</script>
<style lang="scss">
page {
background-color: #fafafa;
}
.wrap {
padding-bottom: 110rpx;
}
.flex {
display: flex;
}
.flex-1 {
flex: 1;
}
.fixed {
position: fixed;
left: 0;
bottom: 0;
z-index: 99;
width: 100%;
height: 100rpx;
background-color: #FFFFFF;
.btn {
width: 300rpx;
background-color: #fb080e;
font-size: 30rpx;
line-height: 100rpx;
color: #FFFFFF;
text-align: center;
}
.total {
padding-left: 20rpx;
font-size: 28rpx;
color: #222;
line-height: 100rpx;
text {
color: #fb080e;
}
}
}
.item {
margin-bottom: 25rpx;
padding: 10rpx 20rpx;
background-color: #FFFFFF;
.check-box {
display: flex;
justify-content: center;
align-items: center;
.check {
width: 45rpx;
height: 45rpx;
border: 1px solid #C0C0C0;
border-radius: 50%;
}
.on {
border-color: #04c2ae;
background-color: #04c2ae;
}
}
.img {
margin-left: 30rpx;
margin-right: 30rpx;
width: 166rpx;
height: 166rpx;
image {
width: 100%;
height: 100%;
}
}
.info {
position: relative;
.delete {
position: absolute;
bottom: 30rpx;
right: 40rpx;
z-index: 9;
width: 34rpx;
height: 34rpx;
image {
width: 34rpx;
height: 34rpx;
}
}
.name {
width: 100%;
//height: 46rpx;
font-size: 28rpx;
color: #000;
line-height: 46rpx;
}
.spc {
width: 100%;
height: 32rpx;
font-size: 24rpx;
color: #555;
line-height: 32rpx;
}
.price {
// margin-top: 10rpx;
width: 100%;
height: 50rpx;
font-size: 28rpx;
line-height: 50rpx;
color: #e88a00;
}
.other {
position: relative;
width: 100%;
height: 60rpx;
display: flex;
justify-content: flex-start;
.increase, .subtract {
width: 42rpx;
height: 42rpx;
border-radius: 50%;
font-size: 30rpx;
line-height: 42rpx;
text-align: center;
color: #FFFFFF;
background-color: #04c2ae;
}
.num {
padding: 0 10rpx;
font-size: 30rpx;
line-height: 42rpx;
color: #04c2ae;
}
}
}
}
</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>
+108
View File
@@ -0,0 +1,108 @@
<template>
<view>
<view class="py-20">
<view class="py-20 mb-20 flex justify-between items-center w-100p border-bottom" v-for="(item, index) in goods"
:key="index">
<view class="flex justify-start items-start">
<view class="flex justify-start items-start">
<el-image :src="getGoodsImage(item)" class="cover ml-20" fit="cover" v-if="getGoodsImage(item)"/>
<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 class="flex justify-start items-center mt-20">
<text class="text-25 font-bold" v-if="order.type === 0">¥{{
item.sku.values
}}
</text>
<text class="text-25 font-bold" v-else>¥{{ item.goodsPrice }}</text>
<text class="text-25 ml-35">x{{ item.num }}</text>
</view>
</view>
</view>
</view>
<view>
<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>
</view>
</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">
<p style="margin-bottom: .5rem" v-for="(item, index) in selfProduct.contentList" :key="index">
{{ item.name }}({{
item.code
}})--{{ item.addressRegion.province.name }}{{
item.addressRegion.city.name
}}{{ item.addressRegion.area.name }}{{ item.address }}</p>
</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>
</view>
</view>
</view>
</template>
<script>
export default {
name: "goods",
props: {
goods: Array,
order: Object,
selfProduct: Object,
},
data() {
return {}
},
methods: {
getGoodsImage(item) {
if (!item) return ''
if (item.sku && item.sku.image) return item.sku.image
if (item.goods && item.goods.cover) return item.goods.cover
return ''
}
}
}
</script>
<style lang="scss" scoped>
.cover {
width: 80px;
height: 80px;
}
</style>
+234
View File
@@ -0,0 +1,234 @@
<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>
<div class="text-main text-25 my-25" style="line-height: 1.9;">
<p>情况1、如遇有大额多车次,多批次交易,应涉及进度款,如100万合同,前期到两车,可以申请进度款;</p>
<p>情况2、如果单次可一次性送达则实行全款。</p>
<p>情况3、如为定制产品,双方协商可给协商比例的进度款。</p>
<p>情况4、有可能有剩余款项,交易完成可申请平台退款。</p>
<p>情况5、有可能实际发货量大于订货量,货款不足。</p>
</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">
<u-upload
multiple
:fileList="payInfo.photos"
@afterRead="afterRead($event, 'photos')"
@delete="deletePic($event, 'photos')"
width="120rpx"
height="120rpx"
></u-upload>
<!-- <vk-data-upload v-model="payInfo.photos"></vk-data-upload>-->
</el-form-item>
<el-form-item label="凭证" v-else required>
<u-upload
multiple
:fileList="payInfo.expressPhoto"
@afterRead="afterRead($event, 'expressPhoto')"
@delete="deletePic($event, 'expressPhoto')"
height="120rpx"
></u-upload>
<!-- <vk-data-upload v-model="payInfo.expressPhoto"></vk-data-upload>-->
</el-form-item>
</template>
</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>
import dayjs from "dayjs";
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,
},
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.photos && this.payInfo.photos.length > 0) this.payInfo.photos = this.payInfo.photos.map(i => i.url)
if (this.payInfo.expressPhoto && this.payInfo.expressPhoto.length > 0) this.payInfo.expressPhoto = this.payInfo.expressPhoto.map(i => i.url)
if (this.payInfo.isExpress) {
uni.showModal({
title: '提示',
content: '发货状态一旦确定无法修改,请谨慎操作',
success: async res => {
if (res.confirm) {
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)
},
afterRead({file}, field) {
file.forEach(item => {
console.log(item)
uniCloud.uploadFile({
filePath: item.url,
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + item.name,
success: ({fileID}) => {
uniCloud.getTempFileURL({
fileList: [fileID]
}).then(res => {
this.payInfo[field].push({url: res.fileList[0].tempFileURL})
console.log(this.payInfo[field])
})
}
})
})
},
deletePic({index}, field) {
this.payInfo[field].splice(index, 1)
},
},
mounted() {
this.getOrderInfo()
}
}
</script>
+250
View File
@@ -0,0 +1,250 @@
<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 class="rounded shadow p-10 mb-40" v-for="(item, index) in payList" :key="index">
<view class="mb-10">支付类目: {{ item.type }}</view>
<view class="mb-10">支付金额: {{ item.amount }}元</view>
<view class="mb-10">
<template v-if="!item.buyerRefuse">
<text v-if="item.isSeller && !item.hasPaid">待买方支付</text>
<view v-else-if="item.paidVoucher">
<el-image :src="item.paidVoucher[0]" style="width: 120rpx; height: 120rpx" fit="cover"
:preview-src-list="item.paidVoucher"/>
</view>
<view v-else-if="!item.paidVoucher">
<text>未上传凭证</text>
</view>
</template>
<text v-else class="text-main">买家已拒绝: {{ item.refuseReason }}</text>
</view>
<view class="mb-10">
<view>物流凭证:</view>
<el-image v-for="(photo, photoIndex) in item.expressPhoto" :key="photoIndex" :src="photo"
style="width: 120rpx; height: 120rpx" fit="cover"
:preview-src-list="item.expressPhoto"/>
</view>
<view class="mb-10">备注: {{ item.remark ? item.remark : '无' }}</view>
<view class="mb-10">买家备注: {{ item.buyerRemark ? item.buyerRemark : '无' }}</view>
<view class="mb-10">图片:
<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>
<text v-else>无</text>
</view>
<view class="mb-10">状态:
<text v-if="!item.hasPaid && !item.buyerRefuse">待上传凭证</text>
<text v-if="!item.sellerConfirm && item.hasPaid">待确认收款</text>
<text v-if="item.sellerConfirm && item.hasPaid">已完成</text>
</view>
<view v-if="!item.buyerRefuse" class="flex justify-end items-center">
<view class="mx-15">
<u-button plain type="primary" size="mini" @click="showPay(item)"
v-if="item.status === 0 && item.isBuyer && !item.hasPaid">上传支付凭证
</u-button>
</view>
<view class="mx-15">
<u-button type="primary" size="mini" class="mx-20" @click="confirmPay(item)"
v-if="item.hasPaid && item.isSeller && !item.sellerConfirm">
确认收款
</u-button>
</view>
<view class="mx-15">
<u-button plain type="primary" size="mini" class="mx-20" @click="paidRefuse(item)"
v-if="item.isBuyer && item.status === 0 && item.paidVoucher.length === 0">
驳回
</u-button>
</view>
</view>
<view>
<span>我方状态:</span>
<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>
</view>
<view>
<span>对方状态:</span>
<!-- 自己是卖家则对方是买家-->
<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>
</view>
</view>
<u-button @click="close()">关闭</u-button>
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="100%" 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>
<u-upload
multiple
:fileList="payInfo.paidVoucher"
@afterRead="afterRead($event, 'paidVoucher')"
@delete="deletePic($event, 'paidVoucher')"
width="120rpx"
height="120rpx"
></u-upload>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="payInfo.buyerRemark"/>
</el-form-item>
<el-form-item label="图片">
<u-upload
multiple
:fileList="payInfo.buyerPhotos"
@afterRead="afterRead($event, 'buyerPhotos')"
@delete="deletePic($event, 'buyerPhotos')"
width="120rpx"
height="120rpx"
></u-upload>
</el-form-item>
</el-form>
<el-row>
<el-col :text="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";
import dayjs from "dayjs";
export default {
name: "payList",
components: {MakePay, SetExpress, Goods, ExpressInfo},
props: {
payList: {
type: Array,
default: []
}
},
data() {
return {
dialogVisible: false,
dialogType: '',
dialogTitle: '',
payInfo: {
amount: '',
paidVoucher: [],
buyerRemark: '',
buyerPhotos: []
}
}
},
methods: {
showPay(item) {
this.payInfo = item;
this.payInfo.amount = ''
this.payInfo.paidVoucher = []
this.payInfo.buyerRemark = ''
this.payInfo.buyerPhotos = []
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}) {
uni.showModal({
title: '请输入驳回理由',
content: '',
editable: true,
success: async res => {
if (res.confirm) {
await vk.callFunction({
url: 'client/order/kh/payRefuse',
title: '请求中...',
data: {
id: _id,
refuseReason: res.content,
}
})
this.$emit('refresh')
this.$message({
type: 'success',
message: '驳回成功'
})
}
}
})
},
async uploadPayVoucher() {
if (this.payInfo.paidVoucher.length === 0) return this.$message.error('请上传支付凭证')
if (this.payInfo.paidVoucher && this.payInfo.paidVoucher.length > 0) this.payInfo.paidVoucher = this.payInfo.paidVoucher.map(i => i.url)
if (this.payInfo.buyerPhotos && this.payInfo.buyerPhotos.length > 0) this.payInfo.buyerPhotos = this.payInfo.buyerPhotos.map(i => i.url)
await vk.callFunction({
url: 'client/order/kh/uploadPayVoucher',
title: '请求中...',
data: this.payInfo
})
this.$message({
type: 'success',
message: '上传成功'
})
this.$emit('refresh')
this.dialogVisible = false
},
close() {
this.$emit('close')
},
afterRead({file}, field) {
file.forEach(item => {
uniCloud.uploadFile({
filePath: item.url,
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + item.name,
success: ({fileID}) => {
uniCloud.getTempFileURL({
fileList: [fileID]
}).then(res => {
this.payInfo[field].push({url: res.fileList[0].tempFileURL})
})
}
})
})
},
deletePic({index}, field) {
this.payInfo[field].splice(index, 1)
},
}
}
</script>
+115
View File
@@ -0,0 +1,115 @@
<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>
<u-upload
multiple
:fileList="expressPhotoList"
@afterRead="afterRead"
@delete="deletePic"
width="120rpx"
height="120rpx"
></u-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>
import dayjs from "dayjs";
import md5 from "js-md5";
export default {
name: "setExpress",
props: {
id: Number | String,
info: Object
},
data() {
return {
expressName: null,
expressNo: null,
remark: null,
expressPhoto: [],
expressPhotoList: [],
}
},
methods: {
afterRead({file}) {
file.forEach(item => {
const suffix = item.name.split('.').pop()
uniCloud.uploadFile({
filePath: item.url,
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + md5(item.name + Date.now().toString()) + `.${suffix}`,
success: ({fileID}) => {
uniCloud.getTempFileURL({
fileList: [fileID]
}).then(res => {
this.expressPhotoList.push({url: res.fileList[0].tempFileURL})
this.expressPhoto.push(res.fileList[0].tempFileURL)
})
}
})
})
},
deletePic({index}) {
this.expressPhoto.splice(index, 1)
},
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>
+89
View File
@@ -0,0 +1,89 @@
<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="图片">
<u-upload
multiple
:fileList="refundPhotos"
@afterRead="afterRead"
@delete="deletePic"
width="120rpx"
height="120rpx"
></u-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>
import dayjs from "dayjs";
import md5 from "js-md5";
export default {
name: "setRefund",
props: {
id: Number | String
},
data() {
return {
refundReason: null,
refundPhotos: [],
}
},
methods: {
afterRead({file}) {
file.forEach(item => {
const suffix = item.name.split('.').pop()
uniCloud.uploadFile({
filePath: item.url,
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + md5(item.name + Date.now().toString()) + `.${suffix}`,
success: ({fileID}) => {
uniCloud.getTempFileURL({
fileList: [fileID]
}).then(res => {
this.refundPhotos.push({url: res.fileList[0].tempFileURL})
})
}
})
})
},
deletePic({index}) {
this.refundPhotos.splice(index, 1)
},
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>
+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/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>
+310
View File
@@ -0,0 +1,310 @@
<template> <!-- 商品详情 -->
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<uititle :title="info.name"></uititle>
</u-sticky>
<!-- 轮播图 -->
<view class="layout layout-swiper" style="height: 750rpx">
<u-swiper
:list="info.album"
keyName="image"
:autoplay="true"
circular
height="750rpx"
></u-swiper>
</view>
<!-- 信息 -->
<view class="layout layout-detail bg-white">
<view class="price flex justify-between align-center">
<view class="price-left">
<text class="mr-10">零售价: </text>
<text class="current">&yen;{{ info.amount }}</text>
</view>
<text>已售: {{ info.sales }}</text>
</view>
<view class="title">
{{ info.name }}
</view>
<view class="mt-20 flex justify-start items-center text-25">
<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 text-25" v-if="info.ensureService">
<like theme="outline" size="16" fill="#9b9b9b" strokeLinecap="square"/>
<text class="ml-10">{{ info.ensureService }}</text>
</view>
<view class="text-25 mt-20 text-gray">{{ info.desc }}</view>
</view>
<view class="layout layout-parse bg-white" v-if="info.video">
<view class="parse-title">视频介绍</view>
<video :src="info.video" controls style="width: 100%; height: 400rpx" autoplay=""></video>
</view>
<!-- 详情 -->
<view class="layout layout-parse bg-white">
<view class="parse-title">商品介绍</view>
<u-parse :content="info.content"></u-parse>
</view>
<!-- 底部 -->
<view class="fiexd-bottom flex justify-between align-center">
<view class="home flex direction-column align-center" @click="homeLink">
<view class="icon">
<image class="full" src="/static/img/home.png" mode=""></image>
</view>
<view class="text">首页</view>
</view>
<view class="home flex direction-column align-center ml-20 pos-r" @click="$jump('/pages/shop/cart')">
<view class="icon">
<u-icon name="shopping-cart" size="24" color="#A92924"></u-icon>
</view>
<text class="cartNum" v-if="cartNum > 0">{{ cartNum }}</text>
<view class="text">购物车</view>
</view>
<view class="home flex direction-column align-center ml-20" @click="call">
<view class="icon">
<image class="full" src="/static/img/service.png" mode=""></image>
</view>
<view class="text">客服</view>
</view>
<view class="flex-1"></view>
<view class="shop-btn" @click="show = true">加入购物车</view>
<view class="shop-btn full-btn m-left-30" @click="show = true">立即购买</view>
</view>
<u-popup :show="show" mode="bottom" round="15" closeable @close="show = false">
<view class="p-50">
<view class="flex justify-start items-start">
<u-image
:src="info.sku.find(item => item._index === selectedSku) ? info.sku.find(item => item._index === selectedSku).image : info.cover"
width="200rpx" height="200rpx" radius="10rpx"></u-image>
<view class="ml-20 font-bold flex justify-start items-start flex-col">
<text>{{ info.name }}</text>
<text class="text-main">¥{{ info.sku.find(item => item._index === selectedSku).values }}</text>
</view>
</view>
<view class="flex justify-start items-start mt-20 flex-wrap">
<view v-for="(item, index) in info.sku" :key="index" class="mr-15 mb-15">
<u-tag type="primary" :plain="selectedSku !== item._index" :text="item.label"
@click="selectedSku = item._index"/>
</view>
</view>
<view class="font-bold my-20">数量</view>
<u-number-box v-model="num" class="pb-20"/>
<view class="flex justify-center items-center pt-20 border-top">
<view class="shop-btn" @click="addToCart">加入购物车</view>
<view class="shop-btn full-btn m-left-30" @click="newOrder">立即购买</view>
</view>
</view>
</u-popup>
</view>
</template>
<script>
import uititle from '@/components/common/title'
import cmsearch from '@/components/common/search'
import cmempty from '@/components/common/empty'
import {Transporter, Like} from '@icon-park/vue'
export default {
components: {
uititle,
cmsearch,
cmempty,
Transporter,
Like,
},
data() {
return {
id: null,
info: {
name: ''
},
num: 1,
selectedSku: null,
show: false,
cartNum: 0,
};
},
methods: {
homeLink() {
vk.navigateTo('pages/index/index')
},
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() {
this.show = false
vk.callFunction({
url: 'client/cart/kh/add',
data: {
goodsId: this.id,
skuId: this.selectedSku,
num: this.num,
},
success: (res) => {
this.$message({
type: 'success',
message: '添加成功'
})
this.getCartNum()
}
})
},
async newOrder() {
this.show = false
const {data} = await vk.callFunction({
url: 'client/order/kh/add',
title: '请求中...',
data: {
goodsId: this.id,
skuId: this.selectedSku,
num: this.num,
type: 0
}
})
vk.navigateTo({
url: `/pages/shop/pay?id=${data}`
})
},
getCartNum() {
vk.callFunction({
url: 'client/cart/kh/getNum',
}).then(({data}) => {
this.cartNum = data
})
},
call(){
window.open('tel:400-686-5559')
}
},
onLoad({id}) {
this.id = id
this.getInfo(id)
this.getCartNum()
}
}
</script>
<style lang="scss">
page {
padding-bottom: 120rpx;
}
.layout-swiper {
height: 600rpx;
}
.layout-detail {
margin: 20rpx 30rpx 10rpx;
padding: 20rpx 20rpx;
border-radius: 12rpx;
.price {
font-size: 24rpx;
line-height: 36rpx;
color: #999999;
}
.current {
font-size: 32rpx;
font-weight: 600;
color: #A92924;
}
.cost {
text-decoration: line-through;
}
.title {
padding: 20rpx 0;
font-size: 28rpx;
font-weight: 500;
line-height: 36rpx;
color: #101010;
}
}
.layout-parse {
padding: 20rpx 30rpx;
.parse-title {
font-size: 28rpx;
font-weight: 600;
line-height: 40rpx;
color: #101010;
}
}
.fiexd-bottom {
position: fixed;
bottom: 0;
left: 0;
z-index: 99;
width: 690rpx;
height: 120rpx;
padding: 0 30rpx;
background: #ffffff;
.home {
.icon {
width: 40rpx;
height: 40rpx;
}
.text {
font-size: 24rpx;
line-height: 40rpx;
text-align: center;
color: #101010;
}
}
}
.shop-btn {
width: 180rpx;
height: 60rpx;
font-size: 28rpx;
line-height: 60rpx;
text-align: center;
color: #A92924;
border: 1px solid #A92924;
border-radius: 8rpx;
}
.full-btn {
color: #ffffff;
background: #A92924;
}
.cartNum {
position: absolute;
right: -10rpx;
top: -10rpx;
background-color: #FFFFFF;
color: #bf2b28;
font-size: 20rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 25rpx;
width: 25rpx;
height: 25rpx;
border: 1px solid #bf2b28;
}
</style>
+784
View File
@@ -0,0 +1,784 @@
<template> <!-- 订单列表 -->
<view class="wrap">
<u-sticky offset-top="0" customNavHeight="0">
<uititle title="订单管理"></uititle>
</u-sticky>
<u-subsection :list="subsectionList" :current="subsectionActive" activeColor="#A92924"
@change="sectionChange" fontSize="16"></u-subsection>
<view class="tab-box">
<view class="item" :class="{active: activeName === 'all'}" @click="handTab('all')">全部</view>
<view class="item" :class="{active: activeName === 0}" @click="handTab(0)">待付款</view>
<view class="item" :class="{active: activeName === 1}" @click="handTab(1)">待发货</view>
<view class="item" :class="{active: activeName === 2}" @click="handTab(2)">待收货</view>
<view class="item" :class="{active: activeName === 5}" @click="handTab(5)">待退款</view>
<view class="item" :class="{active: activeName === 4}" @click="handTab(4)">已完成</view>
<view class="item" :class="{active: activeName === 6}" @click="handTab(6)">退款成功</view>
<view class="item" :class="{active: activeName === 7}" @click="handTab(7)">退款失败</view>
</view>
<view class="p-20 flex justify-start items-center">
<view class="mr-15">
<u-icon name="arrow-down" label-pos="left" :label="typeStr" @click="showTypeFilter = true"/>
</view>
<u-search v-model="keyword" placeholder="请输入订单号" @blur="query(1)" @custom="query(1)"
@clear="query(1)"/>
</view>
<view class="list-box">
<!-- 1 -->
<view class="item bg-white" v-for="(item, index) in tableData.rows" :key="index">
<view class="state">
<view class="no">{{ item.orderNo }}</view>
<view class="bage" v-if="item.signMethod !== 1">{{
orderStatusList[item.orderStatus]
}}
</view>
</view>
<view class="mt-15 text-25 text-gray flex justify-start items-center">
<text>{{ orderTypeList[item.type] }}</text>
<text class="text-25 text-gray" v-if="item.type === 1">({{
item.subType === 0 ? '企业' : '产品'
}})
</text>
</view>
<text class=" text-25 text-main" v-if="item.type === 3">(过期时间:{{
item.upgradeExpiredAt
}})
</text>
<text class=" text-25 text-main" v-if="item.type === 8 && item.spot && item.spot.topExpiredAt">过期时间:{{
dayjs(item.spot.topExpiredAt).format('YYYY-MM-DD HH:mm:ss')
}}({{
item.goods[0].goodsId === '-1' ? '全国' : provincesData.find(province => parseInt(province.code) === parseInt(item.goods[0].goodsId)).name
}})
</text>
<view class="mt-15 text-25 text-gray">{{ item._add_time_str }}</view>
<text class="mt-15 text-25 text-main" v-if="item.type > 3 && item.payList">
最新支付状态:{{ item.buyerStatusStr }}
</text>
<text class="mt-15 text-25 text-main" v-if="item.type < 4 && item.orderStatus === 7">
退款拒绝原因:{{ item.refundRefuseReason }}
</text>
<template v-if="item.type === 0">
<view class="p-20 mb-20 flex justify-start items-start" v-for="(goods, goodsIndex) in item.goods"
:key="goodsIndex">
<u-image :src="getGoodsImage(goods)" width="150rpx" height="150rpx" v-if="getGoodsImage(goods)"/>
<view class="flex flex-col justify-start items-start ml-20 text-25">
<text class="font-bold mb-15 text-28">{{ goods.goodsName }}</text>
<text class="text-gray" v-if="item.type === 0 && goods.sku">{{ goods.sku.label }}</text>
<text class=" font-bold text-main" v-if="item.type === 0 && goods.sku">¥{{
goods.sku.values
}}
</text>
<text class=" font-bold flex-1" v-else>¥{{ goods.goodsPrice }}</text>
<text class="">x{{ goods.num }}</text>
</view>
<text class="text-35 font-bold flex-1 text-main" v-if="item.type === 0 && goods.sku">¥{{
parseFloat(goods.sku.values) * goods.num
}}
</text>
<text class="text-35 font-bold flex-1 text-main" v-else>¥{{
parseFloat(goods.goodsPrice) * goods.num
}}
</text>
</view>
</template>
<view class="tool" v-if="item.type < 4 || (item.type > 6 && item.type !== 14)">
<view class="price">
<text class="mr-10" v-if="item.orderStatus !== 10">总金额:</text>
<text v-else class="red mr-10">待报价:</text>
<template v-if="item.orderStatus !== 10">
<text
:class="[parseFloat(item.offAmount) !== parseFloat(item.amount) ? 'text-line-through text-gray': 'red']">
¥{{ item.amount ? parseFloat(item.amount).toFixed(2) : '' }}
</text>
<text class="red"
v-if="parseFloat(item.offAmount) !== parseFloat(item.amount)">
¥{{ item.offAmount }}
</text>
</template>
</view>
<view class="status">
<view class="icon">
<img v-if="item.orderStatus === 0" src="/static/images/order/toBePaid.png"
alt=""/>
</view>
</view>
</view>
<view class="operate">
<template v-if="(item.type > 3 && item.type < 7) || [14, 15].includes(item.type)">
<view class="mx-15">
<u-button plain size="mini" class="btn-buy pointer" @click="showOtherUser(item)">
联系交易方
</u-button>
</view>
<template v-if="item.type > 3 && item.orderStatus < 3 && item.isSeller">
<template
v-if="!item.payList || !['尾款', '货到付款'].includes(item.payList.type) || (['尾款', '货到付款'].includes(item.payList.type) && item.payList.buyerRefuse)">
<view class="mx-15">
<u-button type="primary" size="mini" class="pointer"
@click="makePayList(item)">
创建支付单
</u-button>
</view>
</template>
</template>
<template v-if="item.type > 3 && item.payStatus > 0">
<view class="mx-15">
<u-button type="warning" size="mini" class="pointer"
@click="showPayList(item)">
查看支付单
</u-button>
</view>
</template>
<template v-if="item.contractId">
<view class="mx-15">
<u-button plain size="mini" class="btn-buy pointer"
@click="viewContract(item.contractId)">
查看合同
</u-button>
</view>
</template>
</template>
<template v-if="[0, 1, 2, 3, 7, 8, 9].includes(item.type)">
<view class="mx-15">
<u-button plain size="mini" type="primary"
v-if="[0, 1].includes(item.type)"
@click="showGoods(item)">商品列表
</u-button>
</view>
<template v-if="item.orderStatus === 0">
<view class="mx-15">
<u-button plain size="mini" type="primary" class="btn-close pointer"
@click="navTo(`/pages/shop/pay?id=${item._id}`)"
>去支付
</u-button>
</view>
<view class="mx-15">
<u-button plain size="mini" class="pointer" type="info"
@click="cancel(item)"
>取消订单
</u-button>
</view>
<template v-if="item.orderStatus === 4">
<view class="mx-15">
<u-button plain size="mini"
@click="showServicePhone()">客服电话
</u-button>
</view>
<view class="mx-15">
<u-button plain size="mini"
@click="showServiceQR()">客服二维码
</u-button>
</view>
</template>
</template>
<template v-if="item.orderStatus >= 2 && item.type === 0">
<view class="mx-15">
<u-button plain size="mini" class="btn-buy pointer"
@click="showExpressInfo(item)">
物流信息
</u-button>
</view>
<template v-if="item.isBuyer && item.orderStatus === 2">
<view class="mx-15">
<u-button size="mini" type="success"
@click="confirmExpress(item._id)">
确认收货
</u-button>
</view>
</template>
</template>
<view class="mx-15">
<u-button size="mini" type="success" v-if="item.orderStatus === 11 && item.isSeller"
@click.native="changeOrderStatus(item._id, 3)">已完成
</u-button>
</view>
<view class="mx-15">
<u-button size="mini" type="success" v-if="item.orderStatus === 3 && item.isBuyer"
@click.native="changeOrderStatus(item._id, 4)">确认完成
</u-button>
</view>
</template>
<view v-if="item.orderStatus === 1 && item.isSeller && item.type === 0">
<u-button plain size="mini" type="primary" @click="setExpress(item)">发货</u-button>
</view>
<view class="mx-15"
v-if="([1, 2, 4, 7, 8, 9].includes(item.orderStatus)
&& ((item.type > 3 && item.hasPay && item.isBuyer)
|| (item.type < 3 && [1, 2, 3, 4, 7, 8, 9].includes(item.orderStatus) && item.isBuyer)
))">
<u-button plain size="mini" class="btn-close pointer"
@click="showRefund(item)">申请退款
</u-button>
</view>
</view>
</view>
</view>
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="100%">
<make-pay v-if="dialogVisible && clickedInfo && dialogType === 'create'" :info="clickedInfo"
@close="dialogVisible = false;query(1)" :pay-type-list="payTypeList"/>
<pay-list v-else-if="dialogVisible && dialogType === 'pay-list'" :pay-list="payList"
@refresh="payRefresh" @close="dialogVisible = false"/>
<goods v-if="dialogVisible && dialogType === 'goods-list'" :goods="clickedInfo.goods" :order="clickedInfo"
:selfProduct="clickedInfo.selfProduct"/>
<set-express v-if="dialogVisible && dialogType === 'set-express'" :id="clickedInfo._id" :info="clickedInfo"
@close="dialogVisible = false;query(1)"/>
<set-refund v-if="dialogVisible && dialogType === 'set-refund'" :id="clickedInfo._id"
@close="dialogVisible = false;query(1)"/>
<express-info v-if="dialogVisible && dialogType === 'express-info'" :info="clickedInfo"
@close="dialogVisible = false;"/>
</el-dialog>
<contact-modal ref="contactModal"/>
<u-picker :show="showTypeFilter" :columns="[subsectionActive === 0 ? sellerTypeFilter : otherTypeFilter]" keyName="label"
@cancel="showTypeFilter = false" @close="showTypeFilter = false" closeOnClickOverlay
@confirm="confirmType">
<template #more>
<text @click="reset">重置</text>
</template>
</u-picker>
</view>
</template>
<script>
import uititle from "@/components/common/title.vue";
import MakePay from "@/pages/shop/components/makePay.vue";
import PayList from "@/pages/shop/components/payList.vue";
import Goods from "./components/goods.vue";
import SetExpress from "@/pages/shop/components/setExpress.vue";
import SetRefund from "@/pages/shop/components/setRefund.vue";
import ExpressInfo from "@/pages/shop/components/expressInfo.vue";
import dayjs from "dayjs";
import provinces from '@/util/address/provinces.json'
import citys from '@/util/address/citys.json'
import areas from '@/util/address/areas.json'
import ContactModal from "@/components/ContactModal.vue";
const CREATE_PAY_LIST_CONFIRM_CONTENT = `1、您已充分知悉、了解并认可本订单及合同的全部内容以及各方的权利义务;
2、请您按照订单或合同约定创建支付单,否则将存在被驳回的风险。若申请被驳回,请及时沟通处理,完成整改后再次提交。`
export default {
components: {ContactModal, ExpressInfo, SetRefund, SetExpress, Goods, PayList, MakePay, uititle},
data() {
return {
provincesData: provinces,
isLoadMore: false, //默认关闭,请求列表数据超过一屏之后开启
subsectionList: ['我卖出的', '我购买的', '线下交易'],
subsectionActive: 0,
dialogVisible: false,
dialogType: '',
dialogTitle: '',
clickedInfo: null,
activeName: 'all',
value: '',
options: [{
value: '自主交易',
label: '自主交易'
}],
pageIndex: 1,
menuIndex: '0',
formData: {
status: null,
tradeMethod: null
},
tableData: {
total: 0,
rows: []
},
pageSize: 500,
orderType: null,
orderTypeList: [
'商城订单',
'金久信自营增值服务',
'保证金',
'会员升级',
'询价订单',
'加工订单',
'旧货订单',
'报价次数',
'现货广告',
'旧货加急',
'旧货次数',
'金久信学堂下载次数',
'合同下载',
'金久信签约宝次数',
'金久信签约宝',
'金久信自营询价',
],
orderStatusList: [
'待支付',
'待发货',
'待收货',
'待确认',
'已完成',
'退款审核中',
'退款成功',
'退款拒绝',
'',
'',
'待报价',
'已派单待完成',
],
payList: [],
keyword: '',
orderPayList: [],
payInfo: {},
payTypeList: ['预付款', '进度款', '尾款', '货到付款', '全款'],
topExpiredAt: '',
typeStr: '全部类型',
showTypeFilter: false,
sellerTypeFilter: [
{
label: '商城订单',
value: 0
},
{
label: '询价订单',
value: 4
},
{
label: '加工订单',
value: 5
},
{
label: '旧货交易订单',
value: 6
},
],
otherTypeFilter: [
{
label: '商城订单',
value: 0
},
{
label: '询价订单',
value: 4
},
{
label: '加工订单',
value: 5
},
{
label: '旧货交易订单',
value: 6
},
],
};
},
methods: {
dayjs,
getGoodsImage(goods) {
if (!goods) return ''
if (goods.sku && goods.sku.image) return goods.sku.image
if (goods.goods && goods.goods.cover) return goods.goods.cover
return ''
},
sectionChange(index) {
this.subsectionActive = index
this.query()
},
handTab(index) {
this.activeName = index
this.query()
},
async query(pageIndex = 1, resetFilter = false, activeName = null) {
if (resetFilter) {
this.keyword = null
this.orderType = null
}
if (activeName) this.activeName = activeName
this.tableData = await vk.callFunction({
url: 'client/order/kh/getList',
title: '请求中...',
data: {
pageIndex,
pageSize: this.pageSize,
keyword: this.keyword,
isSeller: this.subsectionActive === 0 ? 1 : 0,
type: this.orderType,
signMethod: this.subsectionActive === 2 ? 1 : null,
orderStatus: this.activeName === 'all ' ? null : parseInt(this.activeName),
},
});
this.tableData.rows.map(item => {
item.buyerStatusStr = ''
if (item.type > 3 && item.payList) {
item.buyerStatusStr = `${item.payList.type}-`
if (item.payList.buyerRefuse) {
item.buyerStatusStr += `买家已拒绝:${item.payList.refuseReason}。`
if (item.isSeller) item.buyerStatusStr += '请等待卖家重新创建支付单'
else item.buyerStatusStr += '请重新创建支付单'
} else {
if (item.payList.hasPaid) {
if (item.payList.sellerConfirm) item.buyerStatusStr += '卖家已确认收款'
else item.buyerStatusStr += '买家已支付,待卖家确认收款'
} else item.buyerStatusStr += '买家未支付'
}
}
return item
})
},
reset() {
this.orderType = null
this.typeStr = '全部类型'
this.keyword = null
this.showTypeFilter = false
this.query(1)
},
contact(item) {
try {
const mobile = item.isBuyer ? item.seller.mobile : item.buyer.mobile
uni.showModal({
title: '',
content: `交易方联系方式:${mobile}`,
showCancel: false
})
} catch (e) {
uni.showModal({
title: '',
content: `交易方未留下联系方式`,
showCancel: false
})
}
},
async makePayList(item) {
const confirmed = await new Promise(resolve => {
uni.showModal({
title: '创建支付单', content: CREATE_PAY_LIST_CONFIRM_CONTENT,
confirmText: '我已知晓', cancelText: '取消', showCancel: true,
success: res => resolve(res.confirm), fail: () => resolve(false)
})
})
if (!confirmed) return
const {rows} = await vk.callFunction({
url: 'client/order/kh/orderPayList',
title: '请求中...',
data: {
id: item._id
},
});
if (rows.length > 0 && !rows[rows.length - 1].buyerRefuse && !rows[rows.length - 1].sellerConfirm) {
return this.$message.error('还有未确认的支付单,无法继续创建。请到支付单中查看并确认收款')
}
this.orderPayList = rows
this.clickedInfo = item
this.dialogType = 'create'
this.dialogTitle = '创建支付单'
this.dialogVisible = true
},
async showPayList(item) {
this.clickedInfo = item
await this.getPayList()
this.dialogVisible = true
this.dialogTitle = '查看支付单'
this.dialogType = 'pay-list'
},
async getPayList() {
const {rows} = await vk.callFunction({
url: 'client/order/kh/orderPayList',
title: '请求中...',
data: {id: this.clickedInfo._id}
})
this.payList = rows
},
viewContract(contractId) {
vk.callFunction({
url: 'client/contract/kh/viewContract',
title: '请求中...',
data: {
contractId
},
success: (res) => {
// window.open(res.data)
window.location.href = res.data
}
});
},
navTo(url) {
vk.navigateTo({
url: url
})
},
async buyerRefuse(index) {
this.payList[index].buyerRefuse = true
await vk.callFunction({
url: 'client/order/kh/payRefuse',
title: '请求中...',
data: {
id: this.payList[index]._id
}
})
},
showGoods(item) {
this.clickedInfo = item;
this.dialogTitle = '商品列表'
this.dialogType = 'goods-list';
this.dialogVisible = true
},
showRefund(item) {
this.clickedInfo = item;
this.dialogTitle = '退款申请'
this.dialogType = 'set-refund';
this.dialogVisible = true
},
setExpress(item) {
this.clickedInfo = item;
this.dialogTitle = '发货'
this.dialogType = 'set-express';
this.dialogVisible = true
},
showExpressInfo(item) {
this.clickedInfo = item;
this.dialogTitle = '发货详情'
this.dialogType = 'express-info';
this.dialogVisible = true
},
confirmExpress(id) {
uni.showModal({
title: '提示',
content: '只确认数量和金额,质保按双方合同约定内容执行',
success: async res => {
if (res.confirm) {
await vk.callFunction({
url: 'client/order/kh/changeOrderStatus',
title: '请求中...',
data: {
id,
orderStatus: 4
}
})
this.activeName = '4'
await this.query(1)
}
}
})
},
payRefresh(menuIndex) {
this.getPayList()
this.query(1, null, menuIndex)
},
async cancel({_id}) {
uni.showModal({
title: '提示',
content: '确认取消订单吗?',
success: async res => {
if (res.confirm) {
await vk.callFunction({
url: 'client/order/kh/changeOrderStatus',
title: '请求中...',
data: {
id: _id,
orderStatus: -1
}
})
await this.query(1)
}
}
})
},
async showServicePhone() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '657d8fca55b337cfadbe1063'
}
})
uni.showModal({
title: '平台客服',
content: res.content,
showCancel: false
})
},
async showServiceQR() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '657d9025e0ec19b5040feb40'
}
})
const h = this.$createElement;
this.$confirm(`<image src="${res.content}" style="width: 100px;height: 100px;"/>`, '平台客服二维码', {
cancelButtonText: '关闭',
showConfirmButton: false,
dangerouslyUseHTMLString: true
})
},
async changeOrderStatus(id, orderStatus) {
await vk.callFunction({
url: 'client/order/kh/changeOrderStatus',
data: {
id,
orderStatus
}
})
await this.query(1)
},
showOtherUser(item) {
const mine = item.isBuyer ? item.buyer : item.seller
const otherUser = item.isBuyer ? item.seller : item.buyer
const mineName = mine.accountType === 2 ? mine.company.companyName : mine.person.personName
const otherName = otherUser.accountType === 2 ? otherUser.company.companyName : otherUser.person.personName
this.$refs.contactModal.open(otherUser.businessCard.companyMobile, mine.businessCard.companyMobile, otherName, mineName)
},
confirmType({value}) {
this.orderType = value[0].value
this.typeStr = value[0].label
this.query(1)
this.showTypeFilter = false
}
},
onLoad(option) {
if (option.menuIndex) this.subsectionActive = parseInt(option.menuIndex)
if (option.keyword) this.keyword = option.keyword
this.query()
},
/*上拉加载更多*/
onReachBottom() {
// uni.showToast({title: '加载更多……', icon: 'none'})
// /*防止重复请求*/
// if (!this.isLoadMore) {
// this.isLoadMore = true
// }
}
}
</script>
<style lang="scss">
/deep/ .u-button--mini {
padding: 0 1px !important;
}
.tab-box {
display: flex;
justify-content: space-between;
margin: 0 30rpx;
border-bottom: 1px solid #e5e5e5;
font-size: 26rpx;
line-height: 88rpx;
color: #2d2d2d;
overflow-x: scroll;
.active {
position: relative;
color: #A92924;
}
.active::after {
position: absolute;
left: 50%;
bottom: -3px;
z-index: 9;
margin-left: -34rpx;
display: block;
content: '';
width: 68rpx;
height: 4px;
border-radius: 2px;
background-color: #A92924;
}
.item {
flex-shrink: 0;
margin-right: 20rpx;
}
}
.list-box {
padding: 10rpx 30rpx;
.item {
margin-top: 30rpx;
padding: 16rpx 30rpx 10rpx;
// border: 1px solid #e3e3e3;
border-radius: 20rpx;
box-shadow: 0 0 3px 3px #e3e3e3;
.info-box {
display: flex;
padding: 16rpx 0;
.img {
width: 180rpx;
height: 106rpx;
border-radius: 10rpx;
overflow: hidden;
}
.info {
flex: 1;
flex-wrap: wrap;
padding-left: 20rpx;
.title {
width: 100%;
height: 36rpx;
font-size: 28rpx;
line-height: 36rpx;
color: #2a2a2a;
overflow: hidden;
}
.type {
font-size: 24rpx;
line-height: 32rpx;
color: #A92924;
}
.code {
font-size: 24rpx;
line-height: 32rpx;
color: #d7d7d7;
}
}
}
.state {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 28rpx;
line-height: 30rpx;
font-weight: bold;
.no {
color: #222222;
}
.bage {
font-size: 25rpx;
color: #ff9600;
}
}
.operate {
display: flex;
justify-content: flex-end;
align-items: center;
padding: 20rpx 0;
font-size: 24rpx;
line-height: 48rpx;
color: #2a2a2a;
.link {
margin-left: 20rpx;
// width: 156rpx;
height: 48rpx;
padding: 0 12rpx;
text-align: center;
border-radius: 12rpx;
}
.link-1 {
color: #FFFFFF;
border: 1px solid #A92924;
background-color: #A92924;
}
.link-2 {
color: #999999;
border: 1px solid #999999;
background-color: #FFFFFF;
}
}
}
}
</style>
+455
View File
@@ -0,0 +1,455 @@
<template>
<view class="wrap">
<u-sticky offset-top="0" customNavHeight="0">
<uititle title="支付"></uititle>
</u-sticky>
<view class="p-30">
<view class="card">
<view class="text-25 text-gray pb-20 border-bottom">订单号{{ info.orderNo }}</view>
<template v-if="info.type === 0">
<view class="p-20 rounded border m-30 pointer address" v-if="!address" @click="showAddress">
点击选择地址
</view>
<view v-else
class="py-20 flex justify-between items-center">
<view class="flex flex-col justify-start items-start">
<view class="flex justify-start items-center">
<text class="font-bold">{{ address.name }}</text>
</view>
<text>{{ address.phone }}</text>
<text>{{ address.addressRegion.province.name }}{{
address.addressRegion.city.name
}}{{ address.addressRegion.area.name }}{{ address.addressDetail }}
</text>
</view>
<view class="flex justify-center items-center">
<u-button type="primary" @click="showAddress" size="mini">
变更
</u-button>
</view>
</view>
</template>
<view class="py-20 font-bold">商品详情</view>
<view class="flex justify-start items-start my-20 text-25" v-for="(item, index) in info.goods"
:key="index">
<text v-if="info.type === 0">
<u-image :src="item.goodsCover" mode="aspectFit" width="150rpx" height="150rpx" radius="15"/>
</text>
<template v-if="info.type === 0">
<view class="flex flex-col justify-start items-start ">
<text class=" font-bold text-30">{{ item.goodsName }}</text>
<text class="mt-15 text-gray">{{ item.sku.label }}</text>
<text class="mt-15 text-main">¥{{ item.sku.values }}</text>
</view>
<text class="w-15p">x{{ item.num }}</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 ">
<text class=" font-bold text-30">{{ 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 class="mt-40 font-bold text-main">您的会员等级:
{{ getUserLevelLabel(userInfo.userLevel) }}
{{ info.offRate !== 100 ? `,享受${info.offRate / 10}折优惠,已为您优惠${info.saveAmount}元` : '' }}
</view>
<view class="mt-40 flex flex-col justify-center items-center m-a">
<text class=" mb-20"
:class="[info.amount !== info.offAmount ? 'text-line-through text-25' : 'text-main font-bold text-30']"
v-if="info">
订单金额:¥{{ info.amount }}
</text>
<text class="text-main font-bold text-40 mb-20" v-if="info && info.offAmount && info.amount !== info.offAmount">
优惠后金额:¥{{ info.offAmount ? parseFloat(info.offAmount).toFixed(2) : '' }}
</text>
<view class="border rounded flex justify-start items-center p-10 w-100p "
@click="payType = 'alipay'"
:class="[payType === 'alipay' ? 'border-main bg-main-light text-main' : '']">
<u-icon name="/static/img/alipay.png" size="40rpx"/>
<text class="text-25 ml-25">支付宝</text>
</view>
<view class="border rounded flex justify-start items-center p-10 w-100p my-25"
@click="payType = 'wechat'"
:class="[payType === 'wechat' ? 'border-main bg-main-light text-main' : '']">
<u-icon name="/static/img/wechat-pay.png" size="40rpx"/>
<text class="text-25 ml-25">微信支付</text>
</view>
<u-button type="primary" shape="circle"
:disabled="(info.type === 0 && !address)" @click="onPay">
立即支付
</u-button>
</view>
</view>
</view>
<el-dialog :visible.sync="dialogVisible" :title="dialogTitle" width="95%" :close-on-click-modal="false"
@close="dialogVisible = false">
<template v-if="dialogVisible && dialogType === 'address-list'">
<view v-for="(item, index) in addressList" :key="index"
class="py-20 border-bottom flex justify-between items-center">
<view class="flex flex-col justify-start items-start">
<view class="flex justify-start items-center">
<text v-if="item.isDefault" class="default-address">默</text>
<text class="font-bold">{{ item.name }}</text>
</view>
<text>{{ item.phone }}</text>
<text>{{ item.addressRegion.province.name }}{{
item.addressRegion.city.name
}}{{ item.addressRegion.area.name }}{{ item.addressDetail }}
</text>
</view>
<view class="flex justify-center items-center flex-col">
<u-button type="primary" @click="address = item; dialogVisible = false" size="small">
选择
</u-button>
<u-button type="warning" @click="addressEdit(item)" plain size="small" class="mt-20">
编辑
</u-button>
</view>
</view>
<view class="flex justify-center mt-50">
<view class="flex-1 px-30">
<u-button size="small" type="primary"
@click="dialogType = 'address-action'; dialogTitle = '新增地址'">
新增地址
</u-button>
</view>
<view class="flex-1 px-30">
<u-button size="small" plain @click="dialogVisible = false">取消</u-button>
</view>
</view>
</template>
<view class="flex flex-col justify-start" v-else-if="dialogVisible && dialogType === 'address-action'">
<el-form ref="form" label-width="100px">
<el-form-item label="收件人姓名">
<el-input v-model="name" placeholder="请输入收件人姓名"/>
</el-form-item>
<el-form-item label="收件人手机号">
<el-input v-model="phone" placeholder="请输入收件人手机号"/>
</el-form-item>
<el-form-item label="收件人地址" @click.native="doShowAddress">
<u-input v-model="addressRegionStr" disabled suffix-icon="arrow-right"
style="pointer-events:none"/>
</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>
<view class="flex justify-center items-center">
<view class="flex-1 px-30">
<u-button size="small" type="primary" @click="onAddressAction">保存</u-button>
</view>
<view class="flex-1 px-30">
<u-button size="small" @click="dialogTitle = '地址列表'; dialogType = 'address-list'">取消
</u-button>
</view>
</view>
</view>
<AddressSelect ref="AddressSelect" @confirm="regionConfirm"/>
</el-dialog>
</view>
</template>
<script>
import uititle from "@/components/common/title.vue";
import {getUserLevelLabel} from "@/util";
import AddressSelect from "@/components/AddressSelect.vue";
import dayjs from 'dayjs'
import {Loading} from "element-ui";
const OpenSdk = require('@/util/base').default;
const appId = '8a81c1db8fc5238d01910b9e312d0692'
const appKey = 'a15ceac60f5b464eb758c4fe7800ee9f'
const sdk = new OpenSdk({
appId,
appKey
})
export default {
name: "pay",
components: {AddressSelect, uititle},
data() {
return {
id: null,
info: {
type: null,
offRate: 100
},
addressIndex: [null, null, null],
addressDetail: '',
addressRegion: null,
addressRegionStr: null,
name: '',
phone: '',
billQRCode: null,
checkPayInterval: null,
dialogVisible: false,
dialogTitle: '',
dialogType: '',
address: null,
addressList: [],
selectedAddressId: null,
isDefault: false,
userInfo: null,
payType: 'alipay'
}
},
methods: {
getUserLevelLabel,
doShowAddress() {
this.$refs.AddressSelect.open(this.addressRegion);
},
regionConfirm({province, city, area}) {
this.addressRegion = {province, city, area}
this.addressRegionStr = `${province.name}${city.name}${area.name}`
},
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: this.info.addressRegion,
}
}
if (this.info.orderStatus === -1) {
this.$message.error('订单已取消')
if (this.checkPayInterval) clearInterval(this.checkPayInterval)
vk.redirectTo({
url: '/pages/shop/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, 10].includes(this.info.type)) {
vk.navigateBack()
} else if (this.info.type === 13) {
vk.redirectTo({
url: '/pages/public/sign?tab=signBuyLog',
})
} else {
vk.redirectTo({
url: '/pages/shop/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,
}
})
}
// 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.amount * 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.amount * 100 - subOrderAmount
const queryUrl = this.payType === 'alipay' ? 'https://api-mop.chinaums.com/v1/netpay/trade/h5-pay' : ' https://api-mop.chinaums.com/v1/netpay/wxpay/h5-to-minipay'
let returnUrl = 'https://m.jinjiuxinzg.cn/pages/shop/order'
if (this.info.type === 13) {
returnUrl = 'https://m.jinjiuxinzg.cn/pages/public/sign'
} else {
returnUrl = 'https://m.jinjiuxinzg.cn/pages/shop/order?menuIndex=1'
}
let attachedData = this.info.goods[0].goodsName
if (this.info.goods.length > 1) attachedData += `等${this.info.goods.length - 1}件商品`
let data = {
queryUrl,
'timestamp': timestamp,
'nonce': 'rp84ufhfn20yneo3tp',
'content': {
'merOrderId': this.info.orderNo,
'requestTimestamp': requestTimestamp,
'mid': '898450100001680',
'tid': 'FS7JH7XH',
'instMid': 'H5DEFAULT',
'totalAmount': parseFloat(this.info.offAmount * 100).toFixed(0),
// notifyUrl: 'https://fc-mp-0737e52b-fffa-4223-bcdf-d4ad3d9968a5.next.bspapp.com/pay_notify',
'notifyUrl': 'https://tcb-n44byxi8bmrfrki-d4bn1c4a206d.service.tcloudbase.com/pay_notify',
returnUrl,
'feeRatio': 'aaa',
'goods': goodsList,
'merAppId': 'wxebcff8cf982b9e65',
attachedData,
billDesc: attachedData,
},
'authorization': 0,
}
const content = JSON.stringify(data.content);
const signature = sdk.generateSignature(data)
const Url = `${data.queryUrl}?authorization=OPEN-FORM-PARAM&appId=${appId}&timestamp=${data.timestamp}&nonce=${data.nonce}&content=${encodeURIComponent(content)}&signature=${signature}`
window.location.href = Url
/**
* 调用函数
*/
// const loadingInstance = Loading.service({fullscreen: true, text: '请求中'});
// uni.showLoading({title: '请求中'})
// 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)
// // }
// console.log(res)
// }).catch(err => {
// this.$nextTick(() => {
// // loadingInstance.close();
// uni.hideLoading()
// });
// this.$message({
// type: 'error',
// message: '服务器繁忙,请稍后再试或联系平台客服'
// })
// setTimeout(() => {
// vk.redirectTo({
// url: '/pages/shop/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.addressRegion.province === null) return this.$message({
type: 'error',
message: '请填写地址'
})
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.addressRegion = null
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.addressRegion = item.addressRegion
this.addressRegionStr = `${item.addressRegion.province.name} ${item.addressRegion.city.name} ${item.addressRegion.area.name}`
this.dialogType = 'address-action';
this.dialogTitle = ' 编辑地址'
}
},
onLoad({id}) {
this.id = id
},
onShow() {
this.getInfo(true)
this.getUserAddress()
this.userInfo = vk.getStorageSync('uni_id_user_info')
},
beforeDestroy() {
if (this.checkPayInterval) clearInterval(this.checkPayInterval)
},
onUnload() {
if (this.checkPayInterval) clearInterval(this.checkPayInterval)
}
}
</script>
+358
View File
@@ -0,0 +1,358 @@
<template> <!-- 商城 -->
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uiheader title="金久信特产商城"></uiheader>
<!-- 搜索栏 -->
<cmsearch :k="keyword" @search="search" placeholder="请输入商品名称等搜索"></cmsearch>
<!-- 轮播图-传值:list="数组" -->
<cmswiper page="shop" height="320rpx"></cmswiper>
<view class="layout-sch bg-white flex justify-between align-center" @click="showAddress">
<view class="select down flex-1">{{ locationValue ? locationValue : '选择地区' }}</view>
<!-- <view class="flex-1"></view>-->
<view class="logo">
<image class="full" src="/static/img/shoplogo.png" mode=""></image>
</view>
<!-- <view class="name m-left-10">金久信特产商城</view>-->
</view>
<!-- 滑动区 -->
<view class="flex justify-start items-center bg-white">
<scroll-view class="scroll-box flex-1" @scroll="onCateScroll" scroll-x="true">
<view class="item" :class="{ active: categoryId === null }" @click="selectCate(null)">
<view class="text break">全部</view>
</view>
<view class="item" :class="{ active: categoryId === item._id }" v-for="(item,index) in categoryList"
:key="index" @click="selectCate(item._id)">
<view class="text break">{{ item.name }}</view>
</view>
</scroll-view>
<view >
<u-icon name="arrow-right-double" :color="hasMore ? '#A92924' : '#AAAAAA'"/>
</view>
</view>
</u-sticky>
<!-- 列表 -->
<uiswiper :ad="27" padding="10rpx 20rpx"></uiswiper>
<uiswiper :ad="28" padding="10rpx 20rpx"></uiswiper>
<uiswiper :ad="29" padding="10rpx 20rpx"></uiswiper>
<uiswiper :ad="30" padding="10rpx 20rpx"></uiswiper>
<uiswiper :ad="31" padding="10rpx 20rpx"></uiswiper>
<view class="layout layout-shop flex justify-between flex-wrap">
<view class="item pos-r" @click="detailLink(item._id)" v-for="(item, index) in goodsList" :key="index">
<view class="img">
<image class="full" :src="item.cover" mode="aspectFill"/>
</view>
<text class="recommend" v-if="item.recommend === 1">荐</text>
<view class="info">
<view class="title text-both">
{{ item.name }}
</view>
<view class="price m-top-10">
<text class="current">&yen;<text class="blod">{{ item.amount }}</text>
到手价
</text>
<!-- <text class="cost m-left-10">&yen;35.5</text>-->
</view>
</view>
</view>
</view>
<!-- 没有数据 u-empty是框架组件 cmempty是自己封装组件 -->
<u-empty mode="list" text="暂无更多内容~" v-if="goodsList.length === 0"></u-empty>
<!-- <cmempty></cmempty> -->
<collapse></collapse>
<AddressSelect ref="AddressSelect" @confirm="regionConfirm"/>
<view class="issue" @click="$jump('/pages/shop/cart')">
<u-icon name="shopping-cart" color="#fff" size="24"></u-icon>
<text class="cartNum" v-if="cartNum > 0">{{ cartNum }}</text>
</view>
</view>
</template>
<script>
import uiheader from '@/components/index/header'
import cmsearch from '@/components/common/search'
import cmempty from '@/components/common/empty'
import cmswiper from '@/components/common/swiper'
import Collapse from "@/components/index/collapse.vue";
import AddressSelect from "@/components/AddressSelect.vue";
import uiswiper from "@/components/index/swiper.vue";
export default {
components: {
uiswiper,
AddressSelect,
Collapse,
uiheader,
cmsearch,
cmempty,
cmswiper,
},
data() {
return {
categoryList: [],
goodsList: [],
options: [],
address: [],
pageIndex: 1,
pageSize: 20,
total: 0,
categoryId: null,
keyword: null,
locationValue: null,
region: {
province: {
code: null,
name: null,
},
city: {
code: null,
name: null,
},
},
cartNum: 0,
hasMore: true
}
},
methods: {
showAddress() {
this.$refs.AddressSelect.open(this.region, 2, true);
},
regionConfirm({province, city}) {
this.region = {province, city}
this.locationValue = `${province.name}${city.name}`
this.getGoodsList()
},
handTab(val, index) {
this.custIndex = index
},
detailLink(id) {
vk.navigateTo(`/pages/shop/detail?id=${id}`, {
id,
})
},
getCategoryList() {
vk.callFunction({
url: 'client/goods/category/pub/getList'
}).then(res => {
this.categoryList = res.rows
})
},
search(keyword) {
this.keyword = keyword
this.getGoodsList()
},
getGoodsList(pageIndex = 1) {
vk.callFunction({
url: 'client/goods/list/pub/getList',
data: {
pageIndex,
pageSize: this.pageSize,
city: this.region.city ? this.region.city.code : null,
parentId: this.categoryId,
keyword: this.keyword
}
}).then(res => {
this.goodsList = res.rows
})
},
getCartNum() {
vk.callFunction({
url: 'client/cart/kh/getNum',
}).then(({data}) => {
this.cartNum = data
})
},
selectCate(cateId) {
if (this.categoryId === cateId) this.categoryId = null
else this.categoryId = cateId
this.getGoodsList()
},
onCateScroll({detail: {scrollLeft, scrollWidth}}) {
const wrapWidth = uni.upx2px(690)
const maxScrollLeft = scrollWidth - wrapWidth
console.log(maxScrollLeft, scrollLeft)
this.hasMore = scrollLeft + 50 < maxScrollLeft
}
},
onLoad(option) {
if (option.keyword) this.keyword = option.keyword
this.getCategoryList()
this.getGoodsList()
this.getCartNum()
}
}
</script>
<style lang="scss">
.layout-sch {
padding: 30rpx 30rpx;
.select {
position: relative;
width: 260rpx;
height: 40rpx;
font-size: 28rpx;
line-height: 40rpx;
color: #333;
padding: 10rpx 30rpx 10rpx 20rpx;
border: 1px solid #f2f2f2;
overflow: hidden;
}
.down::after {
position: absolute;
right: 20rpx;
top: 50%;
z-index: 9;
content: '';
margin-top: -6rpx;
width: 0;
height: 0;
border-left: 10rpx solid transparent;
border-right: 10rpx solid transparent;
border-top: 12rpx solid #999999;
}
.logo {
width: 80rpx;
height: 60rpx;
}
.name {
font-size: 32rpx;
font-weight: 600;
line-height: 44rpx;
color: #101010;
}
}
.scroll-box {
// width: 690rpx;
width: 690rpx;
//height: 80rpx;
padding: 0 30rpx;
box-sizing: border-box;
display: flex;
align-items: center;
white-space: nowrap;
background: #ffffff;
.item {
display: inline-block;
margin-right: 10rpx;
height: 60rpx;
padding: 0 20rpx;
font-size: 28rpx;
line-height: 60rpx;
text-align: center;
color: #454545;
border-radius: 6rpx;
background: #f2f2f2;
&:last-child {
margin-right: 0;
}
}
.active {
color: #ffffff;
background: #A92924;
}
}
.layout-shop {
margin: 20rpx 30rpx;
.item {
margin-top: 30rpx;
width: 330rpx;
height: auto;
background: #ffffff;
border-radius: 20rpx;
overflow: hidden;
&:nth-child(1), &:nth-child(2) {
margin-top: 0rpx;
}
.img {
width: 100%;
height: 320rpx;
}
.info {
padding: 20rpx 10rpx;
.title {
width: 100%;
height: 72rpx;
font-size: 28rpx;
line-height: 36rpx;
color: #101010;
}
.bs {
font-size: 22rpx;
line-height: 32rpx;
color: #ffffff;
padding: 0 8rpx;
background: #A92924;
border-radius: 12rpx;
}
.price {
width: 100%;
//height: 32rpx;
overflow: hidden;
}
.current {
font-size: 24rpx;
line-height: 32rpx;
color: #A92924;
.blod {
font-size: 28rpx;
font-weight: 600;
}
}
.cost {
font-size: 24rpx;
line-height: 32rpx;
color: #666666;
}
}
}
}
.recommend {
position: absolute;
right: 0;
top: 0;
padding: 5px;
background-color: #bf2b28;
color: white;
font-size: 30rpx;
z-index: 1;
}
.cartNum {
position: absolute;
right: -10rpx;
top: -10rpx;
padding: 5px;
background-color: #FFFFFF;
color: #bf2b28;
font-size: 20rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 25rpx;
width: 25rpx;
height: 25rpx;
border: 1px solid #bf2b28;
}
</style>
+792
View File
@@ -0,0 +1,792 @@
<template> <!-- 买家中心 -->
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uititle title="买家中心"></uititle>
<!-- 选项卡 -->
<view class="layout layout-tab flex justify-between align-center">
<view :class="['tab', {active: menuIndex === 1}]" @click="handTab(1)">询价单</view>
<view :class="['tab', {active: menuIndex === 0}]" @click="handTab(0)">加工单</view>
<view :class="['tab', {active: menuIndex === 3}]" @click="handTab(3)">旧货</view>
<view :class="['tab', {active: menuIndex === 2}]" @click="handTab(2)">自营询价</view>
</view>
<!-- 统计数量和操作按钮 -->
<view class="layout layout-total bg-white">
<view class="tp-box flex justify-center align-center" v-if="menuIndex !== 2">
<view :class="['tp flex-1 text-center', {active: activeName === 'all'}]"
@click="changeStatus('all')">全部
</view>
<view :class="['tp flex-1 text-center', {active: activeName === 'noQuote'}]"
@click="changeStatus('noQuote')">
待报价
</view>
<view :class="['tp flex-1 text-center', {active: activeName === 'notPick'}]"
@click="changeStatus('notPick')">
待选商
</view>
<view :class="['tp flex-1 text-center', {active: activeName === 'picked'}]"
@click="changeStatus('picked')">
已成交
</view>
</view>
<!-- <view class="search-box flex justify-between m-top-30">-->
<!-- <view class="date" @click="isCalendar = true">-->
<!-- <u&#45;&#45;input-->
<!-- placeholder="日期"-->
<!-- v-model="calendarValue"-->
<!-- suffixIcon="calendar"-->
<!-- prefixIconStyle="font-size: 32px;color: #909399"-->
<!-- :customStyle="inputClass"-->
<!-- :disabled="true"-->
<!-- disabledColor="#fff"-->
<!-- ></u&#45;&#45;input>-->
<!-- </view>-->
<!-- <view style="width: 30rpx;"></view>-->
<!-- <u&#45;&#45;input-->
<!-- placeholder="搜索编号或品名"-->
<!-- suffixIcon="search"-->
<!-- prefixIconStyle="font-size: 32px;color: #909399"-->
<!-- :customStyle="inputClass"-->
<!-- ></u&#45;&#45;input>-->
<!-- </view>-->
</view>
</u-sticky>
<!-- 列表 -->
<view class="layout layout-list">
<template v-if="menuIndex === 0">
<view class="item" v-for="(item, index) in processList" :key="index">
<view class="hava flex justify-start">
<view class="ing">{{ item.status === 0 ? '发布中' : '已选商' }}</view>
<view class="ed m-left-10">{{ item.title }}</view>
</view>
<view class="flex justify-between items-center w-100p">
<view class="text-main text-25 p-10">{{
item.signMethod === 1 ? '线下签单' : '线上签约'
}}
</view>
<view class="flex justify-start m-top-10" v-if="item.status === 1 && item.signMethod === 1">
<view class="bao bao-2 m-left-10" @click="processChangeToOnlineSign(item._id, index)">
切换线上交易
</view>
</view>
<view @click="showProcessModal(item)">
<u-text size="small" type="primary" :text="`收到${ item.quoteNum }个报价`"/>
</view>
</view>
<view class="text red m-top-10 font-bold">
加工量:{{ item.num }}
</view>
<view class="text date m-top-10">
<text class="m-right-20">交易编码:{{ item.orderNo }}</text>
<text>{{ item._add_time_str }}发布</text>
</view>
<!-- 按钮 -->
<!-- <text @click="showProcessModal(item)">收到{{ item.quoteNum }}个报价</text>-->
<!-- <view class="op-btn btn-2 btnredplain">编辑报价</view>-->
<!-- 章 -->
<view class="zhang">
<image class="full" src="/static/img/unchoose.png" mode="" v-if="item.status === 0"></image>
<image class="full" src="/static/img/choose.png" mode="" v-else></image>
</view>
<view class="flex justify-end items-center mt-10">
<view class="mr-10">
<u-button size="mini" type="success"
v-if="item.status !== 0 && item.signMethod !== 1 && item.contract"
@click.native="$jump(`/pages/public/contract?tab=${item.contract ? (item.contract.status === 1 ? 1 : (item.contract.status === 2 ) ? 2 : 0) : 0}`)"
>
{{
item.contract ? (item.contract.status === 1 ? '去签署合同' : (item.contract.status === 0) ? '去创建合同' : '查看合同')
: '去创建合同'
}}
</u-button>
</view>
<view class="mr-10" v-if="item.status === 0">
<u-button size="mini" type="error"
@click.native="openCooperationDialog('process', item)"
>查看意向合作列表
</u-button>
</view>
<view v-else>
<u-button size="mini" type="success" plain
@click.native="showOtherUser(item)"
>查看交易方
</u-button>
</view>
</view>
</view>
</template>
<template v-if="menuIndex === 1">
<view class="item" v-for="(item, index) in enquiryList" :key="index">
<view class="hava flex justify-start">
<view class="ing">{{ item.status === 0 ? '发布中' : '已选商' }}</view>
<view class="ed m-left-10">{{ item.title }}</view>
</view>
<view class="flex justify-between items-center w-100p">
<view class="text-main text-25 p-10">{{
item.signMethod === 1 ? '线下签单' : '线上签约'
}}
</view>
<view class="flex justify-start m-top-10" v-if="item.status === 1 && item.signMethod === 1">
<view class="bao bao-2 m-left-10" @click="enquiryChangeToOnlineSign(item._id, index)">
切换线上交易
</view>
</view>
<view @click="showEnquiryModal(item)">
<u-text size="small" type="primary" :text="`收到${ item.quoteNum }个报价`"/>
</view>
</view>
<view class="text red m-top-10">
{{ item.productNum }} | {{ item.fullAddress }}
</view>
<view class="text date m-top-10">
<text class="m-right-20">交易编码:{{ item.enquiryNo }}</text>
<text>{{ item._add_time_str }}更新</text>
</view>
<!-- 按钮 -->
<!-- <view class="op-btn btn-2 btnredplain">编辑报价</view>-->
<!-- 章 -->
<view class="zhang">
<image class="full" src="/static/img/unchoose.png" mode="" v-if="item.status === 0"></image>
<image class="full" src="/static/img/choose.png" mode="" v-else></image>
</view>
<view class="flex justify-end items-center mt-15">
<view class="mr-15" v-if="item.status === 1 && item.signMethod !== 1">
<u-button size="mini" type="success"
@click.native="$jump(`/pages/public/contract?tab=${item.contract ? (item.contract.status === 1 ? 1 : (item.contract.status === 2 ) ? 2 : 0) : 0}`)">
{{
item.contract ? (item.contract.status === 1 ? '去签署合同' : (item.contract.status === 0) ? '去创建合同' : '查看合同')
: '去创建合同'
}}
</u-button>
</view>
<view class="mr-15" v-if="item.status === 2 && parseInt(item.tradeMethod) === 1">
<u-button size="mini" type="success" plain
@click.native="$jump('/pages/shop/order')">去订单
</u-button>
</view>
<view class="mr-15" v-if="item.status === 0">
<u-button size="mini" type="error"
@click.native="openCooperationDialog('enquiry', item)"
>查看意向合作列表
</u-button>
</view>
<view v-else>
<u-button size="mini" type="success" plain
@click.native="showOtherUser(item)">查看交易方
</u-button>
</view>
</view>
</view>
</template>
<template v-if="menuIndex === 2">
<view class="item" v-for="(item, index) in selfSupportList.rows" :key="index">
<view class="hava flex justify-start">
<view class="ing">{{
item.status === 0 ? '待报价' : (item.status === 1 ? '待选商' : '已选商')
}}
</view>
<view class="ed m-left-10">询价地址</view>
</view>
<view class="text red m-top-10">
{{ item.province.name }}{{ item.city.name }}
</view>
<view class="text date m-top-10">
<text>{{ item._add_time_str }}更新</text>
</view>
<view class="zhang" style="top: 40%">
<image class="full" src="/static/img/unchoose.png" mode="" v-if="item.status === 1"></image>
<image class="full" src="/static/img/choose.png" mode="" v-if="item.status === 2"></image>
</view>
<view class="flex justify-end items-center mt-15">
<view class="mr-15" v-if="item.status !== 0 && item.signMethod !== 1 && item.contract">
<u-button size="mini" type="success"
@click.native="$jump(`/pages/public/contract?tab=${item.contract ? (item.contract.status === 1 ? 1 : (item.contract.status === 2 ) ? 2 : 0) : 0}`)">
{{
item.contract ? (item.contract.status === 1 ? '去签署合同' : (item.contract.status === 0) ? '去创建合同' : '查看合同')
: '去创建合同'
}}
</u-button>
</view>
<view class="mr-15">
<u-button size="mini" plain
@click.native="showDetail(item)">查看详情
</u-button>
</view>
<view>
<u-button size="mini" type="success" plain v-if="item.status === 2"
@click.native="showOtherUser(item)">查看交易方
</u-button>
</view>
</view>
</view>
</template>
<template v-if="menuIndex === 3">
<view class="item" v-for="(item, index) in oldList" :key="index">
<view class="hava flex justify-start">
<view class="ing">{{ item.status === 0 ? '发布中' : '已选商' }}</view>
<view class="ed m-left-10">{{ item.title }}</view>
</view>
<view class="text-main text-25 p-10">{{ item.signMethod === 1 ? '线下签单' : '线上签约' }}</view>
<view class="flex justify-start m-top-10" v-if="item.status === 1 && item.signMethod === 1">
<view class="bao bao-2 m-left-10" @click="oldChangeToOnlineSign(item._id, index)">切换线上交易
</view>
</view>
<view class="text red m-top-10">
{{ item.typeStr }} | {{
(item.addressRegion && item.addressRegion.province) ? `${item.addressRegion.province.name}${item.addressRegion.city.name}${item.addressRegion.area.name}${item.addressDetail}` : ''
}}
</view>
<view class="text date m-top-10 flex flex-col justify-start items-start">
<text class="m-right-20">交易编码:{{ item._id }}</text>
<text>{{ item._add_time_str }}发布</text>
</view>
<view class="flex justify-end items-center">
<view class="mr-15"
v-if="item.status !== 0 && item.signMethod !== 1 && item.contract && item.contract.status === 1">
<u-button size="mini" type="success"
@click.native="$jump('/pages/public/contract?tab=1')">
签署合同
</u-button>
</view>
<view class="mr-15"
v-if="item.status !== 0 && item.signMethod !== 1 && item.contract && item.contract.status === 2">
<u-button size="mini" type="success"
@click.native="$jump('/pages/public/contract?tab=2')">
查看合同
</u-button>
</view>
<view class="mr-15"
v-if="item.status !== 0 && item.signMethod !== 1 && (!item.contract || item.contract.status === 0)">
<u-button size="mini" type="success"
@click.native="$jump('/pages/public/contract?tab=0')">
合同待创建
</u-button>
</view>
<view class="mr-15">
<u-button size="mini" type="success" plain
@click.native="showOtherUser(item)">查看交易方
</u-button>
</view>
</view>
</view>
</template>
</view>
<u-calendar
:show="isCalendar"
mode="single"
@confirm="handCalendarConfirm"
@close="isCalendar = false"
></u-calendar>
<enquiry-modal ref="enquiryModal"/>
<process-modal ref="processModal"/>
<self-support-modal ref="selfSupportModal"/>
<contact-modal ref="contactModal"/>
<u-modal
:show="isCooperationTip"
title="重点提示"
confirmText="同意悉知"
cancelText="取消"
confirmColor="#A92924"
showCancelButton
@confirm="confirmCooperationDialog"
@cancel="closeCooperationDialog"
>
<view class="cooperation-tip-content">
<view v-for="(item, index) in cooperationTipList" :key="index" class="cooperation-tip-item">
{{ item }}
</view>
</view>
</u-modal>
</view>
</template>
<script>
import uititle from '@/components/common/title'
import cmsearch from '@/components/common/search'
import cmempty from '@/components/common/empty'
import EnquiryModal from "./components/enquiryModal.vue";
import ProcessModal from "./components/processModal.vue";
import EnquiryData from "./components/enquiryData.vue";
import SelfSupportModal from "./components/selfSupportModal.vue";
import ContactModal from "@/components/ContactModal.vue";
const d = new Date()
const year = d.getFullYear()
let month = d.getMonth() + 1
month = month < 10 ? `0${month}` : month
const date = d.getDate()
export default {
components: {
ContactModal,
uititle,
cmsearch,
cmempty,
EnquiryData,
ProcessModal,
EnquiryModal,
SelfSupportModal,
},
data() {
return {
defaultDate: '${year}-${month}-${date}',
isCalendar: false,
calendarValue: '',
inputClass: {
height: '20px',
borderRadius: 0,
},
tpIndex: 0,
activeName: 'all',
value: '',
value1: '',
options: [{
value: '金久信自营',
label: '金久信自营'
}],
menuIndex: 1,
formData: {
status: 0,
tradeMethod: null
},
tableData: {},
pageSize: 10,
enquiryList: [],
processList: [],
selfSupportList: {},
total: 0,
notPickNum: 0,
pickedNum: 0,
noQuoteNum: 0,
allNum: 0,
userInfo: null,
oldList: [],
isCooperationTip: false,
cooperationDialogType: '',
cooperationDialogItem: null,
cooperationTipList: [
'1、请您谨慎点击"选择",选择供应商后,系统将自动关闭您此条询价信息,无法返回,只能再次发布询价信息;',
'2、点击"选择"前,您可通过供应商联系方式,仔细商讨:商品明细、数量、单价、执行标准、交货方式、交货期、验收方式、合同条款等细节关键题确认,各种交易细节无误后要求供应商进行最终报价;',
'3、您承诺对此次交易的内容用途已经完全了解并知悉经过严格仔细审核后实施,此次交易为合法经营,如违反相关法律规定,您将承担全部责任,与平台无关。您确认以上描述无误后请点击"选择"。'
]
}
},
methods: {
handTab(index) {
this.menuIndex = index
this.handleCurrentChange(1)
},
handTp(index) {
this.tpIndex = index
},
handCalendarConfirm(e) {
this.calendarValue = e[0]
this.isCalendar = false
},
handCreate() {
vk.navigateTo('/pages/public/create')
},
menuSelect(e) {
this.menuIndex = parseInt(e)
this.formData.status = parseInt(e)
this.handleCurrentChange(1)
},
handleCurrentChange(page) {
if (this.menuIndex === 1) this.getEnquiryList(page)
else if (this.menuIndex === 0) this.getProcessList(page)
else if (this.menuIndex === 2) this.getSelfSupportList(page)
else if (this.menuIndex === 3) this.getOldList(page)
},
changeStatus(status) {
this.activeName = status
if (this.menuIndex === 1) this.getEnquiryList(1)
else if (this.menuIndex === 0) this.getProcessList(1)
else if (this.menuIndex === 2) this.getSelfSupportList(1)
else if (this.menuIndex === 3) this.getOldList(1)
},
getEnquiryList(pageIndex = 1) {
vk.callFunction({
url: 'client/enquiry/sheet/kh/getList',
title: '加载中...',
data: {
userId: this.userInfo._id,
pageIndex,
pageSize: this.pageSize,
status: this.activeName
},
success: (res) => {
this.enquiryList = res.rows.map(val => {
let str = ''
val.productNum = ''
// if (val.productList !== undefined && val.productList.length > 0 && val.productList[0].addressRegion !== undefined && 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
// }
const productNumList = []
val.productList.forEach((item, index) => {
if (item.procureNumber) productNumList.push(item.procureNumber + item.procureUnit)
})
val.productNum = productNumList.join('/')
val.fullAddress = val.addressRegion.province.name + '-' + val.addressRegion.city.name + '-' + val.addressRegion.area.name + '-' + val.addressDetail
return val
})
this.total = res.total
this.allNum = res.all
this.notPickNum = res.notPickNum
this.noQuoteNum = res.noQuoteNum
this.pickedNum = res.pickedNum
this.quoteNum = res.quoteNum
}
})
},
getProcessList(pageIndex = 1) {
vk.callFunction({
url: 'client/process/sheet/pub/getList',
title: '加载中...',
data: {
isUser: true,
userId: this.userInfo._id,
pageIndex,
pageSize: this.pageSize,
status: this.activeName
},
success: (res) => {
this.processList = res.rows
this.total = res.total
this.allNum = res.all
this.notPickNum = res.notPickNum
this.pickedNum = res.pickedNum
this.quoteNum = res.quoteNum
this.noQuoteNum = res.noQuoteNum
}
})
},
async getSelfSupportList(pageIndex = 1) {
this.selfSupportList = await vk.callFunction({
url: 'client/selfSupport/kh/getList',
data: {
pageIndex,
pageSize: this.pageSize,
}
})
this.showList = true
},
showEnquiryModal(item) {
this.$refs.enquiryModal.open(item)
},
showProcessModal(item) {
this.$refs.processModal.open(item)
},
openCooperationDialog(type, item) {
this.cooperationDialogType = type
this.cooperationDialogItem = item
this.isCooperationTip = true
},
closeCooperationDialog() {
this.isCooperationTip = false
this.cooperationDialogType = ''
this.cooperationDialogItem = null
},
confirmCooperationDialog() {
const type = this.cooperationDialogType
const item = this.cooperationDialogItem
this.closeCooperationDialog()
if (type === 'process') this.showProcessModal(item)
else this.showEnquiryModal(item)
},
editEnquiry(id) {
vk.navigateTo(`/pages/enquiry/release?id=${id}`)
},
enquiryChangeToOnlineSign(id, index) {
uni.showModal({
title: '提示',
content: `确认将该订单转为线上签订吗?`,
success: async res => {
if (res.confirm) {
await vk.callFunction({
url: ' client/enquiry/sheet/kh/changeToOnlineSign',
title: '加载中...',
data: {
id
}
})
uni.showModal({
title: '提示',
content: `切换成功,是否去创建合同?`,
success: res => {
if (res.confirm) vk.navigateTo({url: '/pages/public/contract'});
}
})
this.enquiryList[index].signMethod = 0
}
}
})
},
processChangeToOnlineSign(id, index) {
uni.showModal({
title: '提示',
content: `确认将该订单转为线上签订吗?`,
success: async res => {
if (res.confirm) {
await vk.callFunction({
url: 'client/process/sheet/kh/changeToOnlineSign',
title: '加载中...',
data: {
id
}
})
uni.showModal({
title: '提示',
content: `切换成功,是否去创建合同?`,
success: res => {
if (res.confirm) vk.navigateTo({url: '/pages/public/contract'});
}
})
this.processList[index].signMethod = 0
}
}
})
},
showOtherUser(item) {
const mine = this.userInfo._id === item.uid ? item.user : item.otherUser
const otherUser = this.userInfo._id === item.uid ? item.otherUser : item.user
const mineName = mine.accountType === 2 ? mine.company.companyName : mine.person.personName
const otherName = otherUser.accountType === 2 ? otherUser.company.companyName : otherUser.person.personName
this.$refs.contactModal.open(otherUser.businessCard.companyMobile, mine.businessCard.companyMobile, otherName, mineName)
},
showDetail(info) {
this.$refs.selfSupportModal.open(info)
},
getOldList(pageIndex = 1) {
vk.callFunction({
url: 'client/old/kh/getList',
data: {
quoteUid: this.userInfo._id,
pageIndex,
pageSize: this.pageSize,
buyerOnly: true,
// signMethod: 'all',
signMethod: this.oldSignMethod === 'all' ? null : this.oldSignMethod
},
success: (res) => {
this.oldList = res.rows.map(item => {
if (item.type === 0) item.typeStr = '拍卖'
else if (item.type === 1) item.typeStr = '采购'
else if (item.type === 2) item.typeStr = '租赁'
else if (item.type === 3) item.typeStr = '物资回收'
if (item.addressRegion && item.addressRegion.length > 0)
item.address = item?.addressRegion[0]?.name + item?.addressRegion[1]?.name + item?.addressRegion[2]?.name + item.addressDetail
return item
})
this.total = res.total
}
})
},
},
onLoad(options) {
this.userInfo = vk.getStorageSync('uni_id_user_info')
if (options.menuIndex) {
this.menuIndex = parseInt(options.menuIndex)
}
if (this.menuIndex === 1) this.getEnquiryList()
else if (this.menuIndex === 0) this.getProcessList()
else if (this.menuIndex === 2) this.getSelfSupportList()
else if (this.menuIndex === 3) this.getOldList()
},
}
</script>
<style lang="scss">
.layout-tab {
height: 100rpx;
padding: 0 30rpx;
background: #f1f1f1;
.tab {
margin: 0 20rpx;
padding: 10rpx 0rpx;
font-size: 28rpx;
line-height: 40rpx;
color: #666666;
}
.active {
position: relative;
color: #A92924;
&::after {
position: absolute;
left: 0;
bottom: 0;
z-index: 9;
content: '';
width: 100%;
height: 1px;
background: #A92924;
}
}
}
.layout-total {
padding: 0rpx 30rpx 20rpx;
.tp-box {
border-bottom: 1px solid #f2f2f2;
}
.tp {
position: relative;
margin-right: 30rpx;
padding: 20rpx 10rpx;
font-size: 28rpx;
line-height: 40rpx;
color: #333333;
&:last-child {
margin-right: 0;
}
}
.active {
color: #A92924;
border-bottom: 1px solid #A92924;
}
}
.layout-list {
margin: 20rpx 20rpx;
.item {
position: relative;
margin-top: 30rpx;
padding: 30rpx 20rpx;
background: #ffffff;
border-radius: 10rpx;
&:nth-child(1) {
margin-top: 0;
}
.text {
font-size: 24rpx;
line-height: 40rpx;
color: #A92924;
}
.date {
color: #9a9a9a;
}
.ing {
width: 100rpx;
height: 40rpx;
padding-left: 10rpx;
font-size: 22rpx;
line-height: 40rpx;
color: #ffffff;
background: url('~@/static/img/ing.png') center no-repeat;
background-size: 100% 100%;
}
.ed {
font-size: 28rpx;
line-height: 44rpx;
color: #4f4f4f;
}
.bao {
// transform: scale(.8);
padding: 2rpx 10rpx;
font-size: 24rpx;
line-height: 32rpx;
color: #A92924;
border: 1px solid #A92924;
}
.bao-2 {
color: #ffffff;
border-color: #E99D42;
background: #E99D42;
}
.zhang {
position: absolute;
right: 10rpx;
top: 60%;
z-index: 90;
margin-top: -60rpx;
width: 80rpx;
height: 70rpx;
}
.op-btn {
position: absolute;
right: 20rpx;
top: 40rpx;
z-index: 90;
width: 140rpx;
height: 40rpx;
font-size: 24rpx;
line-height: 40rpx;
text-align: center;
border: 1px solid #ffffff;
}
.btnred {
color: #ffffff;
border-color: #A92924;
background: #A92924;
}
.btnredplain {
color: #A92924;
border-color: #A92924;
}
.btngreen {
color: #ffffff;
border-color: #81B337;
background: #81B337;
}
.btngreenplain {
color: #81B337;
border-color: #81B337;
}
.btn-2 {
top: 100rpx;
}
}
}
.cooperation-tip-content {
text-align: left;
}
.cooperation-tip-item {
padding-bottom: 12rpx;
font-size: 26rpx;
line-height: 40rpx;
color: #333333;
}
</style>
+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 "@/static/style/common.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: $u-primary;
font-size: 18px;
line-height: 18px;
border-left: 4px solid $u-primary;
}
}
}
</style>
+125
View File
@@ -0,0 +1,125 @@
<template>
<el-dialog
title="报价列表"
:visible.sync="dialogVisible"
width="100%"
:before-close="handleClose">
<view slot="title" class="text-main text-40 m-30 flex justify-between items-center">
<text>收到的报价</text>
</view>
<view class="quote" v-for="(item, index) in quoteList" :key="index">
<text class="mt-10">供应商: {{ item.subjectName }}</text>
<text class="mt-10">联系方式: {{ item.subjectMobile }}</text>
<text class="mt-10">货款总价: {{ item.totalPrice }}元</text>
<text class="mt-10">报价单详情: {{ item.remark }}</text>
<text class="mt-10">供应商合同补充条款: {{ item.supplierExt }}</text>
<view class="flex justify-start items-center">
<text class="mt-10">附件: </text>
<text class="mt-10" 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)"/>
</text>
</view>
<text class="mt-10">报价时间: {{ item._add_time_str }}</text>
<text class="mt-10">
<u-button type="primary" size="mini" v-if="item.status === 0" @click.native="confirm(item)">选择
</u-button>
</text>
</view>
</el-dialog>
</template>
<script>
import provinces from "@/util/address/provinces.json";
import citys from "@/util/address/citys.json";
import areas from "@/util/address/areas.json";
import FileType from "../../../components/file-type/file-type.vue";
export default {
name: "enquiryModal",
components: {FileType},
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
id: null,
dialogVisible: false,
quoteList: [],
info: null
}
},
methods: {
open(info) {
this.info = info
this.quoteList = info.quoteList
this.dialogVisible = true
},
handleClose() {
this.dialogVisible = false
},
toRelease() {
uni.navigateTo({
url: '/pages/enquiry/release'
})
},
confirm(item) {
vk.callFunction({
url: 'client/enquiry/quote/kh/confirmQuote',
title: '请求中...',
data: {
quoteId: item._id,
},
success: (data) => {
this.dialogVisible = false
this.$message({
type: 'success',
message: '报价确认成功'
})
setTimeout(() => {
if (this.info.signMethod === 0) vk.navigateTo('/pages/public/contract?tab=1')
else {
if (this.info.signMethod === 1) vk.navigateTo('/pages/user/buyer')
else vk.navigateTo('/pages/public/contract?tab=0')
}
}, 500)
}
});
},
openDownload(url) {
window.location.href = 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: 1px solid #EDEDED;
display: flex;
align-items: flex-start;
justify-content: flex-start;
flex-direction: column;
padding: 15px;
margin-bottom: 10rpx;
text {
text-align: center;
}
}
</style>
File diff suppressed because one or more lines are too long
+150
View File
@@ -0,0 +1,150 @@
<template>
<view>
<el-dialog
title="报价列表"
:visible.sync="dialogVisible"
width="100%"
:before-close="handleClose">
<view slot="title" class="text-main text-40 m-30 flex justify-between items-center">
<text>收到的报价列表</text>
</view>
<view class="py-20 border-bottom text-25" v-for="(item, index) in quoteList" :key="index">
<view class="flex justify-start items-center mb-20">
<text class="mr-10">报价方:</text>
<text>{{ item.subjectName }}</text>
</view>
<view class="flex justify-start items-center mb-20">
<text class="mr-10">报价时间:</text>
<text>{{ item._add_time_str }}</text>
</view>
<view class="flex justify-start items-center mb-20">
<text class="mr-10">联系方式:</text>
<text>{{ item.user.mobile }}</text>
</view>
<view class="flex justify-start items-center mb-20">
<text class="mr-10">报价:</text>
<text>{{ item.totalPrice }}元</text>
</view>
<view class="flex justify-start items-center mb-20">
<text class="mr-10">详情:</text>
<text>{{ item.remark }}</text>
</view>
<view class="flex justify-start items-center mb-20">
<text class="mr-10">附件:</text>
<template v-if="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>
</view>
<u-button v-if="status === 0 && type !== 3"
size="mini" type="error" text="选择" style="width: 60rpx;"
@click="confirmQuote(item._id)"
></u-button>
</view>
</el-dialog>
</view>
</template>
<script>
import provinces from "@/util/address/provinces.json";
import citys from "@/util/address/citys.json";
import areas from "@/util/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,
type: 0,
}
},
methods: {
open(id, status, quoteList, signMethod, type) {
this.id = id
this.status = status
this.quoteList = quoteList
this.signMethod = signMethod
this.type = type
this.dialogVisible = true
},
handleClose() {
this.dialogVisible = false
},
toQuote() {
vk.navigateTo(`/pages/process/quote?sheetId=${this.id}`)
},
async confirmQuote(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/public/contract?tab=1')
else {
if (this.signMethod === 1) vk.navigateTo('/pages/user/seller?menuIndex=2')
else vk.navigateTo('/pages/public/contract')
}
},
openDownload(url) {
// window.open(url)
window.location.href = 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>
+156
View File
@@ -0,0 +1,156 @@
<template>
<el-dialog
title="报价列表"
:visible.sync="dialogVisible"
width="100%"
:before-close="handleClose">
<view slot="title" class="text-main text-40 m-30 flex justify-between items-center">
<text>收到的加工申请</text>
</view>
<view v-for="(item, index) in quoteList.rows" :key="index" class="border-bottom py-20 ">
<view class="flex justify-start items-center">
<text class="mr-10">加工商:</text>
<text v-if="item.user">{{
item.user.accountType === 1 ? item.user.person.personName : item.user.company.companyName
}}
</text>
</view>
<view class="flex justify-start items-center">
<text class="mr-10">报价:</text>
<text>{{ item.totalPrice }}元</text>
</view>
<view class="flex justify-start items-center">
<text class="mr-10">加工方补充条款:</text>
<text>{{ item.supplierExt ? item.supplierExt : '无' }}</text>
</view>
<view class="flex justify-start items-center">
<text class="mr-10">附件:</text>
<template v-if="item.files && item.files.length">
<file-type :item="file" v-for="(file, fileIndex) in item.files" :key="fileIndex"
@click.native="openDownload(file)"/>
</template>
<text v-else>无</text>
</view>
<!-- <view class="flex justify-start items-center">-->
<!-- <text class="mr-10">报价详情:</text>-->
<!-- <text>{{ item.remark ? item.remark : '无' }}</text>-->
<!-- </view>-->
<view class="flex justify-start items-center">
<text class="mr-10">申请时间:</text>
<text>{{ item._add_time_str }}</text>
</view>
<view class="flex justify-start items-center mt-25">
<u-button
size="mini"
type="error"
text="选择"
style="width: 40rpx;"
@click.native="createContract(item)" v-if="info.status === 0"
></u-button>
</view>
</view>
</el-dialog>
</template>
<script>
import provinces from "@/util/address/provinces.json";
import citys from "@/util/address/citys.json";
import areas from "@/util/address/areas.json";
import FileType from "../../../components/file-type/file-type.vue";
export default {
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
console.log(this.quoteList.rows)
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.getStorageSync('uni_id_user_info')._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/public/contract?tab=1')
else {
if (this.info.signMethod === 1) vk.navigateTo('/pages/user/buyer')
else vk.navigateTo('/pages/public/contract?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;
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>
+125
View File
@@ -0,0 +1,125 @@
<template>
<el-dialog
title="自营询价详情"
:visible.sync="dialogVisible"
width="100%"
:before-close="handleClose">
<el-descriptions border size="small" :column="1">
<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.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 "@/util/address/provinces.json";
import citys from "@/util/address/citys.json";
import areas from "@/util/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.location.href = 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,109 @@
<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 "@/util/address/provinces.json";
import citys from "@/util/address/citys.json";
import areas from "@/util/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)
window.location.href = 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>
+148
View File
@@ -0,0 +1,148 @@
<template>
<view>
<el-dialog
title="报价列表"
:visible.sync="dialogVisible"
width="100%"
:before-close="handleClose">
<view slot="title" class="text-main text-40 m-30 flex justify-between items-center">
<text>收到的申请合作列表</text>
</view>
<view v-if="cooperateList">
<view v-for="(item, index) in cooperateList" :key="index" class="p-20 border-bottom">
<view class="flex flex-col justify-start items-start" v-for="(item, index) in cooperateList" :key="index">
<text class="flex-1 mb-10" v-if="item.user.accountType === 2">公司名称: {{ item.user.company.companyName }}</text>
<text class="flex-1 mb-10">联系人: {{ item.name }}</text>
<text class="flex-1 mb-10">联系方式: {{ item.mobile }}</text>
<text class="flex-1 mb-10">备注: {{ item.remark }}</text>
<view class="flex-1 mb-10">附件:
<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>
</view>
</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 "@/util/address/provinces.json";
import citys from "@/util/address/citys.json";
import areas from "@/util/address/areas.json";
export default {
name: "spotModal",
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
id: null,
dialogVisible: false,
cooperateList: [],
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,
}
},
methods: {
open(status, cooperateList) {
this.cooperateList = cooperateList
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)
})
},
doShowInfo(info) {
this.info = info
this.showInfo = true
}
}
}
</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>
+395
View File
@@ -0,0 +1,395 @@
<template>
<view>
<uititle title="升级会员"></uititle>
<el-card>
<view class="grade-list">
<view class="item pointer" v-for="(item,index) in gradeList" :key="index"
:class="[parseInt(gradeIndex) === index ? 'active' : '', item.disabled ? 'disabled' : '']"
@click="onChange(index)">
<view class="flex justify-between items-center p-20">
<view class="title">{{ item.name }}</view>
<view class="flex flex-col justify-center items-end text-25" style="margin-right: 50rpx">
<p>{{ item.amount }}元/年</p>
<p class="mt-20" v-if="parseFloat(item.ensureAmount) > 0">+交易保证金({{ item.ensureAmount }}元)</p>
</view>
</view>
<view class="select">
<view class="icon">
<i class="el-icon-check"></i>
</view>
</view>
</view>
<view class="item pointer" @click="onChange(-2)"
:class="[parseInt(gradeIndex) === -2 ? 'active' : '']">
<view class="flex justify-between items-center p-20">
<view class="title">交易保证金缴纳</view>
<view class="flex flex-col justify-center items-end text-25" style="margin-right: 50rpx">
<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>
</view>
</view>
<view class="select">
<view class="icon">
<i class="el-icon-check"></i>
</view>
</view>
</view>
</view>
<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>
<view class="mt-20">
<u-button type="primary" size="mini" v-if="gradeIndex > -1" @click="show = true">权益详情</u-button>
</view>
<view class="bzj-readme">
<view class="sub-title">保证金协议</view>
<u-parse :content="desc"></u-parse>
</view>
<view class="payment">
<view class="sub-title">支付方式</view>
<view class="content">
<!-- <el-radio-group v-model="paymentIndex" class="ml-4">-->
<!-- <el-radio v-for="(item,index) in payment" :key="index" :label="index"-->
<!-- size="large">{{ item }}-->
<!-- </el-radio>-->
<!-- </el-radio-group>-->
<view class="flex justify-start items-center">
<image src="@/static/img/unionpay.png" style="width: 70rpx; height: 30rpx" mode="widthFix"></image>
<text class="ml-15 text-28 text-main">银联支付</text>
</view>
</view>
</view>
<view class="pay-price">
<view class="sub-title">支付金额:¥{{ amount }}元</view>
</view>
<view class="pay-price" v-if="billQRCode">
<uv-qrcode ref="qrcode" size="240px" :value="billQRCode"></uv-qrcode>
<view class="pay-desc">请打开手机微信,扫一扫完成支付</view>
<el-button type="success" @click="onPayStatus">已完成支付</el-button>
</view>
<el-button v-else type="danger" @click="onPay">立即支付</el-button>
</el-card>
<u-popup :show="show" mode="bottom" round="15" closeable @close="show = false">
<view class="p-50 text-25" v-if="gradeIndex > -1">
<view class="flex justify-start items-center border-bottom py-15">
<u-icon :name="gradeList[gradeIndex].icon[0]" size="100rpx" :label="gradeList[gradeIndex].name"/>
</view>
<view class="p-15 flex justify-between items-center">
<text>获得身份方式</text>
<text>
购买{{ gradeList[gradeIndex].amount }}元/年{{
`${gradeList[gradeIndex].ensureAmount > 0 ? `+交易保证金(${gradeList[gradeIndex].ensureAmount})` : ``}`
}}
</text>
</view>
<view class="p-15 flex justify-between items-center">
<text>升级方式</text>
<text>交易额每{{ parseFloat(gradeList[gradeIndex].upgradeAmount) / 10000 }}万升一级,共十级</text>
</view>
<view class="p-15 flex justify-between items-center">
<text>询报价权益</text>
<text>{{
parseInt(gradeList[gradeIndex].offerOffRate) === 0 ? '不限次数,免费' :
(parseInt(gradeList[gradeIndex].offerOffRate) === 100 ? '-' : `${parseInt(gradeList[gradeIndex].offerOffRate) / 10}折`)
}}
</text>
</view>
<view class="p-15 flex justify-between items-center">
<text>增值服务</text>
<text>
{{
(parseInt(gradeList[gradeIndex].valueAddRate) === 100 ? '-' : `${parseInt(gradeList[gradeIndex].valueAddRate) / 10}折`)
}}
</text>
</view>
<view class="p-15 flex justify-between items-center">
<text>加工厂店铺</text>
<text>可授权</text>
</view>
</view>
</u-popup>
</view>
</template>
<script>
import uititle from "@/components/common/title.vue";
const OpenSdk = require('@/lib/base').default;
const sdk = new OpenSdk({
appId: '10037e6f6823b20801682b6a5e5a0006',
appKey: '1c4e3b16066244ae9b236a09e5b312e8'
})
export default {
components: {uititle},
data() {
return {
paymentIndex: 0,
payment: ["银联支付"],
showQrcode: false,
billQRCode: '',
gradeIndex: null,
gradeList: [],
desc: '',
ensureList: [],
ensureAmount: null,
ensureIndex: 0,
show: false,
}
},
created() {
this.getDesc()
this.getEnsureConfig()
this.getUserLevelList()
},
methods: {
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
},
getUserInfo() {
vk.userCenter.getCurrentUserInfo({
success: (data) => {
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
}
}
}
});
},
onChange(index) {
if (index === -2) this.gradeIndex = index
else {
if (this.gradeList[index].disabled) return
this.gradeIndex = index
}
},
async onPay() {
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,
}
})
}
vk.redirectTo({url: `/pages/shop/pay?id=${res.data}`})
},
getUserLevelList() {
vk.callFunction({
url: 'client/userLevel/pub/getList',
data: {
pageIndex: 1,
pageSize: 200
},
success: (data) => {
this.gradeList = data.rows.filter(item => parseFloat(item.amount) > 0)
this.getUserInfo()
}
});
}
},
computed: {
amount() {
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)
}
},
}
</script>
<style lang="scss" scoped>
.clearfix {
font-weight: bold;
font-size: 18px;
}
.grade-list {
display: flex;
flex-direction: column;
justify-content: space-between;
.item {
position: relative;
border: 1px solid #eee;
.item-box {
display: flex;
.title {
padding: 10px;
display: flex;
align-items: center;
flex: 1;
justify-content: center;
text-align: center;
}
.info {
padding: 10px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 230px;
.price {
font-size: 28px;
}
.desc {
color: #ccc;
}
}
}
.select {
display: none;
}
}
.active {
border: 2px solid #bf2b28 !important;
.item-box {
.title {
color: #bf2b28;
}
.info {
.price {
color: #bf2b28;
}
.desc {
color: #ccc;
}
}
}
.select {
position: absolute;
right: 0;
bottom: 0;
border-top: 20px solid transparent;
border-right: 20px solid #bf2b28;
border-left: 20px solid transparent;
border-bottom: 20px solid #bf2b28;
display: flex;
.icon {
position: relative;
.el-icon-check {
position: absolute;
left: 0;
top: 0;
color: #fff;
}
}
}
}
}
.box-card {
margin-top: 20px;
border: none;
}
.sub-title {
color: #bf2b28;
font-size: 18px;
font-weight: bold;
border-left: 5px solid #bf2b28;
padding-left: 10px;
height: 20px;
line-height: 20px;
margin: 20px auto;
}
.bzj-readme {
margin-top: 20px;
}
.payment {
margin-top: 20px;
}
.pay-price {
margin-top: 20px;
}
.pay-desc {
font-size: 16px;
line-height: 2em;
}
.disabled {
cursor: not-allowed;
background-color: #F0F0F0;
}
</style>
+819
View File
@@ -0,0 +1,819 @@
<template> <!-- 卖家中心 -->
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uititle title="卖家中心"></uititle>
<!-- 选项卡 -->
<view class="layout layout-tab flex justify-between align-center">
<view :class="['tab', {active: menuIndex === 1}]" @click="handTab(1)">询价单</view>
<view :class="['tab', {active: menuIndex === 0}]" @click="handTab(0)">现货</view>
<view :class="['tab', {active: menuIndex === 4}]" @click="handTab(4)">加工</view>
<view :class="['tab', {active: menuIndex === 2}]" @click="handTab(2)">旧货</view>
<view :class="['tab', {active: menuIndex === 3}]" @click="handTab(3)">自营询价
</view>
<view :class="['tab', {active: menuIndex === 5}]" @click="handTab(5)">金久信公正银联资料</view>
</view>
<!-- 统计数量和操作按钮 -->
<!-- <view class="layout layout-total bg-white">-->
<!-- <view class="search-box flex justify-between m-top-30">-->
<!-- <view class="date" @click="isCalendar = true">-->
<!-- <u&#45;&#45;input-->
<!-- placeholder="日期"-->
<!-- v-model="calendarValue"-->
<!-- suffixIcon="calendar"-->
<!-- prefixIconStyle="font-size: 32px;color: #909399"-->
<!-- :customStyle="inputClass"-->
<!-- :disabled="true"-->
<!-- disabledColor="#fff"-->
<!-- ></u&#45;&#45;input>-->
<!-- </view>-->
<!-- <view style="width: 30rpx;"></view>-->
<!-- <u&#45;&#45;input-->
<!-- placeholder="搜索编号或品名"-->
<!-- suffixIcon="search"-->
<!-- prefixIconStyle="font-size: 32px;color: #909399"-->
<!-- :customStyle="inputClass"-->
<!-- ></u&#45;&#45;input>-->
<!-- </view>-->
<!-- </view>-->
</u-sticky>
<!-- 列表 -->
<view class="layout layout-list">
<template v-if="menuIndex === 0">
<view class="item" v-for="(item, index) in spotList" :key="index">
<view class="hava flex justify-start">
<view class="ing">{{ item.status === 0 ? '发布中' : '已选商' }}</view>
<view class="ed m-left-10">{{ item.name }}</view>
</view>
<view class="text red m-top-10">
约{{ item.stock }}吨 | {{
item.address.province.name + "-" + item.address.city.name + "-" + item.address.area.name
}}
</view>
<view class="text date m-top-10">
<text>{{ item._add_time_str }}更新</text>
</view>
<!-- 按钮 -->
<view class="op-btn btn-1 btnred">收到{{ item.quoteNum }}个报价</view>
<view class="flex justify-end items-center">
<view class="mr-10">
<u-button size="mini" plain type="error"
@click.native="$jump(`/pages/goods/detail?id=${item._id}`)">
查看详情
</u-button>
</view>
<view class="mr-10" v-if="item.status !== 0 && item.signMethod !== 1">
<u-button size="mini" type="success"
@click.native="$jump('/pages/public/contract')">去创建合同
</u-button>
</view>
<view class="mr-10" v-if="item.status === 0">
<u-button size="mini" type="error"
@click.native="showSpotModal(item)"
>查看意向合作列表
</u-button>
</view>
<view class="mr-10" v-else>
<u-button size="mini" type="success" plain
>查看交易方
</u-button>
</view>
</view>
</view>
<u-empty v-if="!spotList.length"></u-empty>
</template>
<template v-if="menuIndex === 1">
<view class="item" v-for="(item, index) in enquiryList" :key="index">
<view class="hava flex justify-start">
<view class="ing">{{ item.status === 0 ? '发布中' : '已选商' }}</view>
<view class="ed m-left-10">{{ item.title }}</view>
</view>
<view class="text-main text-25 p-10">{{ item.signMethod === 1 ? '线下签单' : '线上签约' }}</view>
<view class="flex justify-start m-top-10" v-if="item.status === 1 && item.signMethod === 1">
<view class="bao bao-2 m-left-10" @click="enquiryChangeToOnlineSign(item._id, index)">
切换线上交易
</view>
</view>
<view class="text red m-top-10">
{{ item.productNum }} | {{ item.fullAddress }}
</view>
<view class="text date m-top-10">
<text class="m-right-20">交易编码:{{ item.enquiryNo }}</text>
<text>{{ item._add_time_str }}更新</text>
</view>
<!-- 按钮 -->
<!-- <view class="op-btn btn-2 btnredplain">编辑报价</view>-->
<!-- 章 -->
<view class="zhang">
<image class="full" src="/static/img/unchoose.png" mode="" v-if="item.status === 0"></image>
<image class="full" src="/static/img/choose.png" mode="" v-else></image>
</view>
<view class="flex justify-end items-center mt-10">
<view class="mr-15"
v-if="item.status !== 0 && item.signMethod !== 1 && item.contract && item.contract.status === 1">
<u-button size="mini" type="success"
@click.native="$jump('/pages/public/contract?tab=1')">
签署合同
</u-button>
</view>
<view class="mr-15"
v-if="item.status !== 0 && item.signMethod !== 1 && item.contract && item.contract.status === 2">
<u-button size="mini" type="success"
@click.native="$jump('/pages/public/contract?tab=2')">
查看合同
</u-button>
</view>
<view class="mx-15"
v-if="item.status !== 0 && item.signMethod !== 1 && (!item.contract || item.contract.status === 0)">
<u-button size="mini" type="success"
@click.native="$jump('/pages/public/contract?tab=0')">
合同待创建
</u-button>
</view>
<view class="mr-15" v-if="item.status === 2">
<u-button size="mini" type="success" plain
@click.native="$jump('/pages/order/order')">去订单
</u-button>
</view>
<view>
<u-button size="mini" type="success" plain
@click.native="showOtherUser(item)">查看交易方
</u-button>
</view>
</view>
</view>
<u-empty v-if="!enquiryList.length"></u-empty>
</template>
<template v-if="menuIndex === 2">
<view class="item" v-for="(item, index) in oldList" :key="index">
<view class="hava flex justify-start">
<view class="ing">{{ item.status === 0 ? '发布中' : '已选商' }}</view>
<view class="ed m-left-10">{{ item.title }}</view>
</view>
<view class="text-main text-25 p-10">{{ item.signMethod === 1 ? '线下签单' : '线上签约' }}</view>
<view class="flex justify-start m-top-10" v-if="item.status === 1 && item.signMethod === 1">
<view class="bao bao-2 m-left-10" @click="oldChangeToOnlineSign(item._id, index)">切换线上交易
</view>
</view>
<view class="text red m-top-10" v-if="item.type !== 1 && item.type !== 2">
{{ item.typeStr }} | {{
(item.addressRegion && item.addressRegion.province) ? `${item.addressRegion.province.name}${item.addressRegion.city.name}${item.addressRegion.area.name}${item.addressDetail}` : ''
}}
</view>
<view class="text red m-top-10" v-else>
{{ item.typeStr }} | {{
(item.deliverAddressRegion && item.deliverAddressRegion.province) ? `${item.deliverAddressRegion.province.name}${item.deliverAddressRegion.city.name}${item.deliverAddressRegion.area.name}${item.deliverAddressDetail}` : ''
}}
</view>
<view class="text date m-top-10 flex flex-col justify-start items-start">
<text class="m-right-20">交易编码:{{ item._id }}</text>
<text>{{ item._add_time_str }}发布</text>
</view>
<!-- 按钮 -->
<view class="op-btn btn-1 btnred">收到{{ item.quoteNum }}个报价</view>
<!-- <view class="op-btn btn-2 btnredplain">编辑报价</view>-->
<!-- 章 -->
<view class="zhang">
<image class="full" src="/static/img/unchoose.png" mode="" v-if="item.status === 0"></image>
<image class="full" src="/static/img/choose.png" mode="" v-else></image>
</view>
<view class="flex justify-end items-center">
<view class="mr-15"
v-if="item.status !== 0 && item.signMethod !== 1 && item.contract && item.contract.status === 1">
<u-button size="mini" type="success"
@click.native="$jump('/pages/public/contract?tab=1')">
签署合同
</u-button>
</view>
<view class="mr-15"
v-if="item.status !== 0 && item.signMethod !== 1 && item.contract && item.contract.status === 2">
<u-button size="mini" type="success"
@click.native="$jump('/pages/public/contract?tab=2')">
查看合同
</u-button>
</view>
<view class="mr-15"
v-if="item.status !== 0 && item.signMethod !== 1 && (!item.contract || item.contract.status === 0)">
<u-button size="mini" type="success"
@click.native="$jump('/pages/public/contract?tab=0')">
合同待创建
</u-button>
</view>
<view class="mr-15" v-if="item.status === 0">
<u-button size="mini" type="primary"
@click.native="showOldModal(item)"
>查看意向合作列表
</u-button>
</view>
<view class="mr-15" v-else>
<u-button size="mini" type="success" plain
@click.native="showOtherUser(item)">查看交易方
</u-button>
</view>
</view>
</view>
<u-empty v-if="!oldList.length"></u-empty>
</template>
<template v-if="menuIndex === 3">
<view class="item" v-for="(item, index) in selfSupportList.rows" :key="index">
<view class="hava flex justify-start">
<view class="ing">{{
item.sheet.status === 0 ? '待报价' : (item.sheet.status === 1 ? '待选商' : '已选商')
}}
</view>
</view>
<view class="font-bold m-top-10">询价地址</view>
<view class="text red m-top-10">{{ item.sheet.province.name }}{{ item.sheet.city.name }}</view>
<view class="text date m-top-10">
<text>{{ item._add_time_str }}发布</text>
</view>
<!-- 章 -->
<view class="zhang" style="top: 40%">
<image class="full" src="/static/img/unchoose.png" mode="" v-if="item.status === 0"></image>
<image class="full" src="/static/img/choose.png" mode="" v-else></image>
</view>
<view class="flex justify-end items-center">
<view class="mr-15"
v-if="item.status !== 0 && item.contract && item.contract.status === 1">
<u-button size="mini" type="success"
@click.native="$jump('/pages/public/contract?tab=1')">
签署合同
</u-button>
</view>
<view class="mr-15"
v-if="item.status !== 0 && item.contract && item.contract.status === 2">
<u-button size="mini" type="success"
@click.native="$jump('/pages/public/contract?tab=2')">
查看合同
</u-button>
</view>
<view class="mr-15"
v-if="item.status !== 0 && (!item.contract || item.contract.status === 0)">
<u-button size="mini" type="success"
@click.native="$jump('/pages/public/contract?tab=0')">
合同待创建
</u-button>
</view>
<view class="mr-15">
<u-button size="mini" plain
@click.native="showDetail(item)">查看详情
</u-button>
</view>
<view class="mr-15" v-if="item.sheet.status === 1">
<u-button size="mini" type="success"
@click.native="toSelfSupportQuote(item)">立即报价
</u-button>
</view>
<view class="mr-15" v-if="item.sheet.status === 2">
<u-button size="mini" type="success" plain
@click.native="showOtherUser(item)">查看交易方
</u-button>
</view>
</view>
</view>
<u-empty v-if="!selfSupportList.length"></u-empty>
</template>
<template v-if="menuIndex === 4">
<view class="item" v-for="(item, index) in processList" :key="index">
<view class="hava flex justify-start items-center">
<view class="ing">{{
item.status === 0 ? '待报价' : (item.status === 1 ? '待选商' : '已选商')
}}
</view>
<text>{{ item.title }}</text>
</view>
<view class="text-red my-10 text-25">{{ item.signMethod === 1 ? '线下签单' : '线上签约' }}</view>
<view class="flex justify-start items-center">
<view class="font-bold m-top-10 mr-10">加工量:</view>
<view class="text red m-top-10">{{ item.num }}</view>
</view>
<view class="text date m-top-10">
<text class="mr-25">交易编号:{{ item.orderNo }}</text>
<text>{{ item._add_time_str }}发布</text>
</view>
<!-- 章 -->
<view class="zhang" style="top: 40%">
<image class="full" src="/static/img/unchoose.png" mode="" v-if="item.status === 0"></image>
<image class="full" src="/static/img/choose.png" mode="" v-else></image>
</view>
<view class="flex justify-end items-center">
<view class="mr-10"
v-if="item.status !== 0 && item.signMethod !== 1 && item.contract && item.contract.status === 1">
<u-button size="mini" type="success"
@click.native="$jump('/pages/public/contract?tab=1')">
签署合同
</u-button>
</view>
<view class="mr-10"
v-if="item.status !== 0 && item.signMethod !== 1 && item.contract && item.contract.status === 2">
<u-button size="mini" type="success"
@click.native="$jump('/pages/public/contract?tab=2')">
查看合同
</u-button>
</view>
<view class="mr-10"
v-if="item.status !== 0 && item.signMethod !== 1 && (!item.contract || item.contract.status === 0)">
<u-button size="mini" type="success"
@click.native="$jump('/pages/public/contract?tab=0')">
合同待创建
</u-button>
</view>
<view>
<u-button size="mini" type="success" plain @click.native="showOtherUser(item)">查看交易方
</u-button>
</view>
</view>
</view>
<u-empty v-if="!processList.length"></u-empty>
</template>
<template v-if="menuIndex === 5">
<notary-union-pay :user-data="userInfo"></notary-union-pay>
</template>
</view>
<!-- 没有数据 u-empty是框架组件 cmempty是自己封装组件 -->
<!-- <u-empty mode="list" text="暂无更多内容~"></u-empty>-->
<!-- <cmempty></cmempty> -->
<!-- 日历 -->
<u-calendar
:show="isCalendar"
mode="single"
@confirm="handCalendarConfirm"
@close="isCalendar = false"
></u-calendar>
<enquiry-modal ref="enquiryModal"/>
<process-modal ref="processModal"/>
<spot-modal ref="spotModal"/>
<old-modal ref="oldModal"/>
<self-support-quote-modal ref="selfSupportQuoteModal"/>
<self-support-modal ref="selfSupportModal"/>
<contact-modal ref="contactModal"/>
</view>
</template>
<script>
import uititle from '@/components/common/title'
import cmsearch from '@/components/common/search'
import cmempty from '@/components/common/empty'
import OldModal from "@/pages/user/components/oldModal.vue";
import EnquiryModal from "@/pages/user/components/enquiryModal.vue";
import ProcessModal from "@/pages/user/components/processModal.vue";
import SpotModal from "@/pages/user/components/spotModal.vue";
import SelfSupportQuoteModal from "@/pages/user/components/selfSupportQuoteModal.vue";
import SelfSupportModal from "@/pages/user/components/selfSupportModal.vue";
import ContactModal from "@/components/ContactModal.vue";
import NotaryUnionPay from "@/components/user/notary-union-pay.vue";
const d = new Date()
const year = d.getFullYear()
let month = d.getMonth() + 1
month = month < 10 ? `0${month}` : month
const date = d.getDate()
export default {
components: {
NotaryUnionPay,
ContactModal,
SelfSupportModal,
SelfSupportQuoteModal,
SpotModal,
ProcessModal,
EnquiryModal,
OldModal,
uititle,
cmsearch,
cmempty,
},
data() {
return {
defaultDate: '${year}-${month}-${date}',
isCalendar: false,
calendarValue: '',
inputClass: {
height: '20px',
borderRadius: 0,
},
tpIndex: 0,
activeName: 'all',
menuIndex: 1,
formData: {
status: 0,
tradeMethod: null
},
tableData: {},
pageSize: 10,
enquiryList: [],
spotList: [],
oldList: [],
selfSupportList: [],
total: 0,
notPickNum: 0,
pickedNum: 0,
noQuoteNum: 0,
allNum: 0,
userInfo: null,
processList: []
}
},
methods: {
handTab(index) {
this.menuIndex = index
this.handleCurrentChange(1)
},
handTp(index) {
this.tpIndex = index
},
handCalendarConfirm(e) {
this.calendarValue = e[0]
this.isCalendar = false
},
handCreate() {
vk.navigateTo('/pages/public/create')
},
handleCurrentChange(page) {
if (this.menuIndex === 1) this.getEnquiryList(page)
else if (this.menuIndex === 0) this.getSpotList(page)
else if (this.menuIndex === 2) this.getOldList(page)
else if (this.menuIndex === 3) this.getSelfSupportList(page)
else if (this.menuIndex === 4) this.getProcessList(page)
else if (this.menuIndex === 5) return
},
getEnquiryList(pageIndex = 1) {
vk.callFunction({
url: 'client/enquiry/sheet/kh/getList',
title: '加载中...',
data: {
userId: this.userInfo._id,
pageIndex,
pageSize: this.pageSize,
status: this.activeName,
isSeller: true
},
success: (res) => {
this.enquiryList = res.rows.map(val => {
let str = ''
val.productNum = ''
// if (val.productList !== undefined && val.productList.length > 0 && val.productList[0].addressRegion !== undefined && 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
// }
const productNumList = []
val.productList.forEach((item, index) => {
if (item.procureNumber) productNumList.push(item.procureNumber + item.procureUnit)
})
val.productNum = productNumList.join('/')
val.fullAddress = val.addressRegion.province.name + '-' + val.addressRegion.city.name + '-' + val.addressRegion.area.name + '-' + val.addressDetail
return val
})
this.total = res.total
this.allNum = res.all
this.notPickNum = res.notPickNum
this.noQuoteNum = res.noQuoteNum
this.pickedNum = res.pickedNum
this.quoteNum = res.quoteNum
}
})
},
getSpotList(pageIndex = 1) {
vk.callFunction({
url: 'client/spot/goods/kh/getSelfOne',
data: {
userId: this.userInfo._id,
},
success: (res) => {
this.spotList = res.rows
this.total = res.total
this.allNum = res.all
this.notPickNum = res.notPickNum
this.pickedNum = res.pickedNum
this.quoteNum = res.quoteNum
}
})
},
getOldList(pageIndex = 1) {
vk.callFunction({
url: 'client/old/kh/getList',
data: {
userId: this.userInfo._id,
pageIndex,
pageSize: this.pageSize
},
success: (res) => {
this.oldList = res.rows.map(item => {
if (item.type === 0) item.typeStr = '拍卖'
else if (item.type === 1) item.typeStr = '采购'
else if (item.type === 2) item.typeStr = '租赁'
else if (item.type === 3) item.typeStr = '物资回收'
if (item.addressRegion && item.addressRegion.length > 0)
item.address = item?.addressRegion[0]?.name + item?.addressRegion[1]?.name + item?.addressRegion[2]?.name + item.addressDetail
return item
})
this.total = res.total
}
})
},
getSelfSupportList(pageIndex = 1) {
vk.callFunction({
url: 'client/selfSupport/kh/getQuoteList',
data: {
pageIndex,
pageSize: this.pageSize
},
success: (res) => {
this.selfSupportList = res
this.total = res.total
}
})
},
getProcessList(pageIndex = 1) {
vk.callFunction({
url: 'client/process/sheet/pub/getList',
title: '加载中...',
data: {
isUser: true,
otherUid: this.userInfo._id,
pageIndex,
pageSize: this.pageSize,
status: this.activeName
},
success: (res) => {
this.processList = res.rows
}
})
},
toSelfSupportQuote(item) {
vk.navigateTo({url: `/pages/self/makeQuote?id=${item.quoteId}`})
},
showEnquiryModal({status, quoteList}) {
this.$refs.enquiryModal.open(status, quoteList)
},
showSpotModal({status, cooperateList}) {
this.$refs.spotModal.open(status, cooperateList)
},
showOldModal({_id, status, quoteList, signMethod, type}) {
this.$refs.oldModal.open(_id, status, quoteList, signMethod, type)
},
editEnquiry(id) {
vk.navigateTo({
url: `/pages/enquiry/release?id=${id}`
})
},
enquiryChangeToOnlineSign(id, index) {
uni.showModal({
title: '提示',
content: `确认将该订单转为线上签订吗?`,
success: async res => {
if (res.confirm) {
await vk.callFunction({
url: 'client/enquiry/sheet/kh/changeToOnlineSign',
title: '加载中...',
data: {
id
}
})
uni.showModal({
title: '提示',
content: `切换成功,是否去创建合同?`,
success: res => {
if (res.confirm) vk.navigateTo({url: '/pages/public/contract'});
}
})
this.enquiryList[index].signMethod = 0
}
}
})
},
showOtherUser(item) {
const mine = this.userInfo._id === item.uid ? item.user : item.otherUser
const otherUser = this.userInfo._id === item.uid ? item.otherUser : item.user
const mineName = mine.accountType === 2 ? mine.company.companyName : mine.person.personName
const otherName = otherUser.accountType === 2 ? otherUser.company.companyName : otherUser.person.personName
this.$refs.contactModal.open(otherUser.businessCard.companyMobile, mine.businessCard.companyMobile, otherName, mineName)
},
oldChangeToOnlineSign(id, index) {
uni.showModal({
title: '提示',
content: `确认将该订单转为线上签订吗?`,
success: async res => {
if (res.confirm) {
await vk.callFunction({
url: 'client/old/kh/changeToOnlineSign',
title: '加载中...',
data: {
id
}
})
uni.showModal({
title: '提示',
content: `切换成功,是否去创建合同?`,
success: res => {
if (res.confirm) vk.navigateTo({url: '/pages/public/contract'});
}
})
this.enquiryList[index].signMethod = 0
}
}
})
},
showDetail(info) {
info.sheet.quote = info
this.$refs.selfSupportModal.open(info.sheet)
},
changeOldStatus() {
this.getOldList(1)
},
},
onLoad(options) {
this.userInfo = vk.getStorageSync('uni_id_user_info')
if (options.menuIndex) {
this.menuIndex = parseInt(options.menuIndex)
}
this.handleCurrentChange(1)
},
}
</script>
<style lang="scss">
.layout-tab {
height: 100rpx;
padding: 0 30rpx;
background: #f1f1f1;
.tab {
margin: 0 20rpx;
padding: 10rpx 0rpx;
font-size: 28rpx;
line-height: 40rpx;
color: #666666;
}
.active {
position: relative;
color: #A92924;
&::after {
position: absolute;
left: 0;
bottom: 0;
z-index: 9;
content: '';
width: 100%;
height: 1px;
background: #A92924;
}
}
}
.layout-total {
padding: 0rpx 30rpx 20rpx;
.tp-box {
border-bottom: 1px solid #f2f2f2;
}
.tp {
position: relative;
margin-right: 30rpx;
padding: 20rpx 10rpx;
font-size: 28rpx;
line-height: 40rpx;
color: #333333;
&:last-child {
margin-right: 0;
}
}
.active {
color: #A92924;
border-bottom: 1px solid #A92924;
}
}
.layout-list {
margin: 20rpx 20rpx;
.item {
position: relative;
margin-top: 30rpx;
padding: 30rpx 20rpx;
background: #ffffff;
border-radius: 10rpx;
&:nth-child(1) {
margin-top: 0;
}
.text {
font-size: 24rpx;
line-height: 40rpx;
color: #A92924;
}
.date {
color: #9a9a9a;
}
.ing {
width: 100rpx;
height: 40rpx;
padding-left: 10rpx;
font-size: 22rpx;
line-height: 40rpx;
color: #ffffff;
background: url('~@/static/img/ing.png') center no-repeat;
background-size: 100% 100%;
}
.ed {
font-size: 28rpx;
line-height: 44rpx;
color: #4f4f4f;
}
.bao {
// transform: scale(.8);
padding: 2rpx 10rpx;
font-size: 24rpx;
line-height: 32rpx;
color: #A92924;
border: 1px solid #A92924;
}
.bao-2 {
color: #ffffff;
border-color: #E99D42;
background: #E99D42;
}
.zhang {
position: absolute;
right: 10rpx;
top: 60%;
z-index: 90;
margin-top: -60rpx;
width: 80rpx;
height: 70rpx;
}
.op-btn {
position: absolute;
right: 20rpx;
top: 40rpx;
z-index: 90;
width: 140rpx;
height: 40rpx;
font-size: 24rpx;
line-height: 40rpx;
text-align: center;
border: 1px solid #ffffff;
}
.btnred {
color: #ffffff;
border-color: #A92924;
background: #A92924;
}
.btnredplain {
color: #A92924;
border-color: #A92924;
}
.btngreen {
color: #ffffff;
border-color: #81B337;
background: #81B337;
}
.btngreenplain {
color: #81B337;
border-color: #81B337;
}
.btn-2 {
top: 100rpx;
}
}
}
</style>
+161
View File
@@ -0,0 +1,161 @@
<template>
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<uititle title="个人中心" :show-back="false"></uititle>
<!-- 选项卡 -->
<view class="layout layout-tab flex justify-start align-center">
<view :class="['tab', {active: tabIndex === 0}]" @click="handTab(0)">实名认证</view>
<view :class="['tab', {active: tabIndex === 1}]" @click="handTab(1)">我的名片</view>
<view :class="['tab', {active: tabIndex === 8}]" @click="handTab(8)">业务联系人</view>
<view :class="['tab', {active: tabIndex === 3}]" @click="handTab(3)">我的消息</view>
<view :class="['tab', {active: tabIndex === 4}]" @click="handTab(4)">平台权益</view>
<view :class="['tab', {active: tabIndex === 5}]" @click="handTab(5)">我的邀请</view>
<view :class="['tab', {active: tabIndex === 6}]" @click="handTab(6)">我的加工厂</view>
<view :class="['tab', {active: tabIndex === 7}]" @click="handTab(7)">收款账号</view>
<view :class="['tab', {active: tabIndex === 9}]" @click="handTab(9)" v-if="userData.userLevel > 1">新闻动态</view>
<view :class="['tab', {active: tabIndex === 2}]" @click="handTab(2)">修改密码</view>
</view>
</u-sticky>
<!-- 主要内容 -->
<view class="layout layout-content">
<template v-if="tabIndex === 0 && userData">
<!-- 企业认证 -->
<usident :user-data="userData"></usident>
</template>
<template v-if="tabIndex === 1 && userData">
<!-- 我的名片 -->
<uscard :user-data="userData"></uscard>
</template>
<template v-if="tabIndex === 2 && userData">
<!-- 账户管理 -->
<usaccount :user-data="userData"></usaccount>
</template>
<template v-if="tabIndex === 3 && userData">
<!-- 我的消息 -->
<usnotice></usnotice>
</template>
<template v-if="tabIndex === 4 && userData">
<!-- 平台权益 -->
<usequity :user-data="userData"></usequity>
</template>
<template v-if="tabIndex === 5 && userData">
<!-- 我的邀请 -->
<usinvite :user-data="userData"></usinvite>
</template>
<template v-if="tabIndex === 6 && userData">
<!-- 我的加工厂 -->
<factory :user-data="userData"></factory>
</template>
<template v-if="tabIndex === 7 && userData">
<!-- 收款账号 -->
<payee-account :user-data="userData"></payee-account>
</template>
<template v-if="tabIndex === 8 && userData">
<!-- 业务联系人 -->
<business-contact :user-data="userData"></business-contact>
</template>
<template v-if="tabIndex === 9 && userData">
<!-- 业务联系人 -->
<news :user-data="userData"></news>
</template>
</view>
</view>
</template>
<script>
import uititle from '@/components/common/title'
import cmsearch from '@/components/common/search'
import cmempty from '@/components/common/empty'
import usnotice from '@/components/user/notice'
import usaccount from '@/components/user/account'
import uscard from '@/components/user/card'
import usequity from '@/components/user/equity'
import usinvite from '@/components/user/invite'
import usident from '@/components/user/ident'
import Factory from "@/components/user/factory.vue";
import PayeeAccount from "@/components/user/payeeAccount.vue";
import BusinessContact from "@/components/user/business-contact.vue";
import News from "@/pages/user/components/news.vue";
export default {
components: {
News,
BusinessContact,
PayeeAccount,
Factory,
uititle,
cmsearch,
cmempty,
usnotice,
usaccount,
uscard,
usequity,
usinvite,
usident,
},
data() {
return {
tabIndex: 0,
userData: null
}
},
methods: {
handTab(index) {
this.tabIndex = index
},
async getUserInfo(){
const {userInfo} = await vk.userCenter.getCurrentUserInfo()
this.userData = userInfo
}
},
onShow() {
this.userData = vk.getStorageSync('uni_id_user_info')
if (!this.userData) vk.navigateTo('/pages/login/login')
this.getUserInfo()
const userTab = uni.getStorageSync('user_tab')
if (userTab) {
this.tabIndex = parseInt(userTab)
uni.removeStorageSync('user_tab')
}
},
}
</script>
<style lang="scss">
page {
background: #ffffff;
}
.layout-tab {
height: 100rpx;
padding: 0 30rpx;
background: #f1f1f1;
overflow-x: scroll;
.tab {
padding: 10rpx 0rpx;
font-size: 26rpx;
line-height: 40rpx;
color: #666666;
flex-shrink: 0;
margin-right: 20rpx;
}
.active {
position: relative;
color: #A92924;
&::after {
position: absolute;
left: 0;
bottom: 0;
z-index: 9;
content: '';
width: 100%;
height: 1px;
background: #A92924;
}
}
}
</style>
+254
View File
@@ -0,0 +1,254 @@
<template>
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<!-- 标题 -->
<uititle title="申请加工"></uititle>
</u-sticky>
<view class="layout layout-title m-top-20">填写合作信息</view>
<quote-remain-num v-if="reloaded && sheet" :amount="sheet.quoteAmount" type="process" :id="sheetId"/>
<view class="layout layout-publish m-top-20 bg-white">
<view class="card-title m-top-30">报价信息</view>
<view class="group flex align-center m-top-30">
<view class="lb need m-right-20">加工费总价:</view>
<view class="vl flex-1">
<u--input
placeholder="请输入内容"
border="surround"
v-model="formData.totalPrice"
suffixIcon="元"
suffixIconStyle="font-size: 24rpx;color: #909399"
></u--input>
</view>
</view>
<!-- <view class="group flex align-center m-top-30">-->
<!-- <view class="lb need m-right-20">人民币大写:</view>-->
<!-- <view class="vl flex-1">-->
<!-- <u&#45;&#45;input-->
<!-- placeholder="请输入内容"-->
<!-- border="surround"-->
<!-- v-model="value"-->
<!-- @change="change"-->
<!-- ></u&#45;&#45;input>-->
<!-- </view>-->
<!-- </view>-->
<view class="group flex items-start m-top-30">
<view class="lb m-right-20 w-25p mt-20">报价单详情:</view>
<view class="vl flex-1">
<u-textarea
placeholder="请输入报价单详情"
border="surround"
v-model="formData.remark"
suffixIconStyle="font-size: 24rpx;color: #909399"
></u-textarea>
</view>
</view>
<view class="card-title m-top-30">附件信息</view>
<view class="group m-top-20">
<view class="lb need m-right-20">附件内容:</view>
<view class="flex justify-between align-center m-top-20">
<!-- <view class="lbx flex-1">上传自有申请单图片或文档,支持jpg/png/word/excel。</view>-->
<!-- <view class="download">申请单样板下载</view>-->
</view>
<view class="m-top-30">
<u-upload
accept="file"
:fileList="files"
@afterRead="afterRead"
@delete="deletePic"
multiple
:maxCount="10"
></u-upload>
</view>
</view>
</view>
<u-button class="public-btn m-top-30" text="提交申请" @click="submit"></u-button>
</view>
</template>
<script>
import uititle from '@/components/common/title'
import dayjs from "dayjs";
import md5 from "js-md5";
export default {
components: {
uititle,
},
data() {
return {
sheet: null,
fileList1: [],
sheetId: null,
formData: {
totalPrice: '',
files: [],
remark: '',
},
reloaded: false,
files: []
};
},
methods: {
handTag(val) {
val.checked = !val.checked
},
afterRead({file}) {
file.forEach(item => {
const suffix = item.name.split('.').pop()
uniCloud.uploadFile({
filePath: item.url,
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + md5(item.name + Date.now().toString()) + `.${suffix}`,
success: ({fileID}) => {
uniCloud.getTempFileURL({
fileList: [fileID]
}).then(res => {
this.formData.files.push(res.fileList[0].tempFileURL)
this.files.push({
url: res.fileList[0].tempFileURL,
name: item.name
})
})
}
})
})
},
deletePic({index}) {
this.formData.files.splice(index, 1)
},
async submit() {
const data = await vk.userCenter.getCurrentUserInfo();
const {userInfo} = data
if (userInfo.quoteTimes > 3) {
}
vk.callFunction({
url: 'client/process/quote/kh/addQuote',
title: '请求中...',
data: {
sheetId: this.sheetId,
...this.formData
},
success: (data) => {
this.$message({
message: "报价成功",
type: 'success'
})
vk.navigateBack()
}
});
},
getDetail() {
vk.callFunction({
url: 'client/process/sheet/pub/getInfo',
title: '请求中...',
data: {
id: this.sheetId
},
success: (res) => {
this.sheet = res
}
});
},
},
onLoad({sheetId}) {
this.sheetId = sheetId
this.getDetail()
},
onShow() {
this.reloaded = false
setTimeout(() => {
this.reloaded = true
}, 500)
}
}
</script>
<style lang="scss">
.layout-title {
padding: 20rpx 30rpx;
font-size: 28rpx;
font-weight: 600;
line-height: 44rpx;
color: #A92924;
}
.card-title {
position: relative;
padding-left: 20rpx;
font-size: 26rpx;
font-weight: 600;
line-height: 48rpx;
color: #A92924;
&:before {
position: absolute;
left: 0;
top: 50%;
z-index: 9;
margin-top: -14rpx;
content: '';
width: 4rpx;
height: 28rpx;
background: #A92924;
}
}
.public-btn {
width: 80%;
margin-top: 60rpx;
color: #ffffff;
background: #A92924;
}
.layout-publish {
margin: 20rpx 30rpx;
padding: 50rpx 30rpx;
border-radius: 18rpx;
}
.tag-title {
font-size: 26rpx;
line-height: 40rpx;
color: #000000;
.limit {
font-size: 24rpx;
color: #999999;
}
}
.tag-box {
padding: 20rpx 0;
.item {
padding: 6rpx 10rpx;
font-size: 24rpx;
line-height: 32rpx;
color: #555555;
}
.active {
color: #A92924;
}
}
.lb,.fix {
position: relative;
font-size: 26rpx;
line-height: 40rpx;
color: #666666;
}
.lbx {
font-size: 24rpx;
color: #999999;
}
.download {
padding: 8rpx 20rpx;
font-size: 24rpx;
line-height: 36rpx;
color: #A92924;
border: 1px solid #A92924;
}
.need::before {
position: absolute;
left: -16rpx;
top: 50%;
z-index: 9;
margin-top: -12rpx;
content: '*';
color: #A92924;
font-size: 32rpx;
line-height: 1;
}
</style>
+566
View File
@@ -0,0 +1,566 @@
<template> <!-- 加工单详情 -->
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uititle title="加工详情"></uititle>
</u-sticky>
<!-- 内容 -->
<view class="layout layout-detail" v-if="info">
<view class="company flex m-top-20">
<!-- <view class="logo">-->
<!-- <image v-if="info.user && info.user.businessCard" class="full" :src="info.user.businessCard.logo"-->
<!-- mode=""></image>-->
<!-- <image v-else class="full" src="/static/no-logo.jpg" mode=""></image>-->
<!-- </view>-->
<view class="info flex-1 p-left-20">
<view class="name flex justify-start align-center">
<view class="name-text">{{ info.user.company.companyName }}</view>
<!-- 认证图标 -->
<!-- <view class="name-icon m-left-20">-->
<!-- <image class="full" src="/static/img/idente.png" mode=""></image>-->
<!-- </view>-->
</view>
<!-- <view class="zhu">-->
<!-- 主营业务:{{-->
<!-- (info.user.company.mainSpotCategory && info.user.company.mainSpotCategory.length > 0) ? info.user.company.mainSpotCategory.join() : ''-->
<!-- }}-->
<!-- </view>-->
<view class="zhu">
加工询价单编号:{{ info.orderNo }}
</view>
<view class="zhu">
{{ info._add_time_str }} 发布
</view>
</view>
</view>
<!-- <view class="card-title m-top-30">现货详情</view> -->
<view class="detail m-top-20">
<view class="detail-title">{{ info.title }}</view>
</view>
<view class="card-title m-top-30">上传的附件</view>
<view class="m-top-20" v-if="info && info.files">
<file-type v-for="(item, index) in info.files" :key="index" :item="item"/>
</view>
<template v-if="info.addressRegion">
<view class="card-title m-top-30">加工产品交货地址</view>
<view class="detail-text">
{{
info.addressRegion ? `${info.addressRegion.province.name}${info.addressRegion.city.name}${info.addressRegion.area ? info.addressRegion.area.name : ''}` : ``
}}{{
info.addressDetail ? info.addressDetail : ''
}}
</view>
</template>
<template v-if="info.remark">
<view class="card-title m-top-30">加工商其他要求</view>
<view class="detail-text">
{{ info.remark }}
</view>
<file-type :item="item" v-for="(item, index) in info.multiFiles" :key="index"
@click.native="openDownload(item)"/>
</template>
<view class="card-title m-top-30">主要商品</view>
<view class="detail-text">{{ info.title }}</view>
<view class="detail-text">加工产品简述:{{ info.detail }}</view>
<view class="detail-text">加工量:{{ info.num }}</view>
<view class="card-title m-top-30">合同条款</view>
<view class="detail-text">是否含税:{{ info.invoice ? '含税' : '不含税' }}</view>
<template v-if="info.invoice">
<view class="detail-text">开票时间:{{ WRITE_INVOICE_TIME()[info.writeInvoiceTime] }}</view>
<view class="detail-text" v-if="info.invoiceOther">税票要求:{{ info.invoiceOther }}</view>
<template v-else>
<view class="detail-text">纳税人身份:{{ info.taxType ? info.taxType : '无' }}</view>
<view class="detail-text">发票种类:{{ info.invoiceType ? info.invoiceType : '无' }}</view>
<view class="detail-text">税率:{{ info.taxRate ? info.taxRate : '无' }}</view>
</template>
</template>
<view class="card-title m-top-30">运输要求</view>
<view class="detail-text" v-if="info.transportDocuments && info.transportDocuments.length > 0">
随货资料:{{ info.transportDocuments.join() }}
</view>
<view class="detail-text" v-if="info.otherTransportDocuments">其他要求:{{
info.otherTransportDocuments
}}
</view>
<view class="detail-text">运输限制:{{ info.transportLimit ? '有' : '无' }}</view>
<view class="detail-text" v-if="info.transportLimit && info.otherTransportRequest">
运输限制说明:{{ info.otherTransportRequest }}
</view>
<view class="card-title m-top-30">交易模式</view>
<view class="detail-text">{{ info.tradeMethod === 0 ? '自主交易' : '金久信公证' }}</view>
<view class="card-title m-top-30">交易说明</view>
<view class="detail-text">付款方式:{{ PROCESS_PAY_METHOD()[info.payMethod] }}{{
info.payMethod === 0 ? `${info.advancePayRate}%货到付全款` : ''
}}{{
info.payMethod === 3 ? `${info.reputationPayDay}天` :
(info.payMethod === 4 ? `:${info.otherPayMethod}` : '')
}}
</view>
<view class="detail-text">报价形式:{{ info.offerType === 0 ? '整单报价' : '可分项报价' }}</view>
<view class="detail-text">报价期限:
<text v-if="info.answerStartTime && info.answerEndTime">{{
dayjs(info.answerStartTime).format('YYYY-MM-DD')
}}~{{ dayjs(info.answerEndTime).format('YYYY-MM-DD') }}
</text>
</view>
<view class="card-title m-top-30">交易保证金要求</view>
<view class="detail-text">{{ info.earnestMoney ? info.earnestMoney : '无' }}</view>
<view class="card-title m-top-30">采购商信息</view>
<view class="detail-text">
<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="card-title m-top-30">签约模式</view>
<view class="detail-text">
<view>{{
info.signMethod === 0 ? '线上签约-标准合同' : (info.signMethod !== 1 ? '线上签约-双方协商合同' : '线下签约')
}}
</view>
</view>
<view class="text-25" v-if="info.signMethod === 0">
<view class="card-title m-top-30">合同条款</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>
<view class="card-title m-top-30">已收到的加工申请</view>
<view class="table-box m-top-30">
<view class="thead">
<view class="tr">
<view class="th">加工商</view>
<view class="th">申请时间</view>
</view>
</view>
<view class="tbody">
<view class="tr" v-for="(item, index) in info.quoteList.rows" :key="index">
<view class="td" v-if="info.user">{{
item.user.accountType === 1 ? item.user.person.personName : item.user.company.companyName
}}
</view>
<view class="td">{{ item._add_time_str }}</view>
</view>
</view>
</view>
</view>
<!-- 底部 -->
<view class="fiexd-bottom flex justify-between align-center bg-white" v-if="info">
<u-icon name="integral" color="#A92924" size="26"></u-icon>
<view class="text red flex-1 m-left-20" v-if="info">{{ info.quoteNum }}家已经申请合作</view>
<view class="apply-btn" @click="toQuote" v-if="userInfo._id !== info.userId && info.status === 0">{{
info.disabled ? '已超时无法报价' : '申请合作'
}}
</view>
<view class="apply-btn" @click="isPopup = true" v-else-if="userInfo._id === info.userId">收到的报价</view>
</view>
<!-- 弹出窗 -->
<u-popup :show="isPopup" mode="center" @close="isPopup = false" @open="open" :customStyle="{width: '95%'}">
<view class="popup-box" v-if="info">
<view class="popup-title flex justify-between align-center">
<view class="title">收到的合作申请列表</view>
<view class="close" @click="isPopup = false">关闭</view>
</view>
<view v-for="(item, index) in info.quoteList.rows" :key="index" class="border-bottom py-20 ">
<view class="flex justify-start items-center">
<text class="mr-10">加工商:</text>
<text v-if="item.user">{{
item.user.accountType === 1 ? item.user.person.personName : item.user.company.companyName
}}
</text>
</view>
<view class="flex justify-start items-center">
<text class="mr-10">报价:</text>
<text>{{ item.totalPrice }}元</text>
</view>
<view class="flex justify-start items-center">
<text class="mr-10">附件:</text>
<template v-if="item.files.length">
<file-type :item="file" v-for="(file, fileIndex) in item.files" :key="fileIndex"
@click.native="openDownload(file)"/>
</template>
<text v-else>无</text>
</view>
<view class="flex justify-start items-center">
<text class="mr-10">报价详情:</text>
<text>{{ item.remark ? item.remark : '无' }}</text>
</view>
<view class="flex justify-start items-center">
<text class="mr-10">申请时间:</text>
<text>{{ item._add_time_str }}</text>
</view>
<view class="flex justify-start items-center mt-25">
<u-button
size="mini"
type="error"
text="选择"
style="width: 40rpx;"
@click.native="createContract(item)" v-if="info.status === 0"
></u-button>
</view>
</view>
</view>
</u-popup>
</view>
</template>
<script>
import uiheader from '@/components/index/header'
import uititle from '@/components/common/title'
import dayjs from "dayjs";
import {INVOICE_TYPE, PROCESS_PAY_METHOD, WRITE_INVOICE_TIME} from "../../util";
import FileType from "@/components/file-type/file-type.vue";
export default {
components: {
FileType,
uiheader,
uititle,
},
data() {
return {
isPopup: false,
id: null,
info: null,
userInfo: null,
};
},
methods: {
PROCESS_PAY_METHOD() {
return PROCESS_PAY_METHOD
},
INVOICE_TYPE() {
return INVOICE_TYPE
},
WRITE_INVOICE_TIME() {
return WRITE_INVOICE_TIME
},
dayjs,
applyLink() {
uni.$u.route('/pages/work/apply', {
id: 0,
});
},
getInfo() {
vk.callFunction({
url: 'client/process/sheet/pub/getInfo',
data: {
id: this.id
}
}).then((res) => {
if (!this.info || !this.info.userId) {
uni.showModal({
title: '提示',
content: '该加工单已下架',
showCancel: false,
confirmText: '返回',
success: res => {
uni.navigateBack()
}
})
}
this.info = res
this.info.disabled = (!this.info.answerEndTime || dayjs(this.info.answerEndTime).isBefore(dayjs()))
})
},
async toQuote() {
if (this.info.disabled) return
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)) {
uni.showModal({
title: '提示',
content: '您尚未认证, 是否前往认证?',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 0)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
uni.showModal({
title: '提示',
content: '请完善名片信息',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 1)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (accountNum === 0) {
uni.showModal({
title: '提示',
content: '请先到个人中心添加收款账户',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 7)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else {
if (userInfo.businessCard.status !== 1) {
uni.showModal({
title: '提示',
content: '您的名片信息未审核,请耐心等待',
})
return
}
vk.navigateTo(`/pages/work/apply?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.getStorageSync('uni_id_user_info')._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/public/contract')
else {
if (this.info.signMethod === 1) vk.navigateTo('/pages/user/buyer?menuIndex=0')
else vk.navigateTo('/pages/public/contract?tab=1')
}
}, 1500)
})
},
openDownload(url) {
window.location.href = url
}
},
onLoad({id}) {
this.id = id
this.userInfo = vk.getStorageSync('uni_id_user_info')
this.getInfo()
}
}
</script>
<style lang="scss">
page {
padding-bottom: 150rpx;
background: #ffffff;
}
.card-title {
position: relative;
padding-left: 20rpx;
font-size: 28rpx;
font-weight: 600;
line-height: 48rpx;
color: #A92924;
&:before {
position: absolute;
left: 0;
top: 50%;
z-index: 9;
margin-top: -14rpx;
content: '';
width: 6rpx;
height: 28rpx;
background: #A92924;
}
.more {
font-size: 24rpx;
font-weight: normal;
color: #999999;
}
}
.layout-detail {
padding: 20rpx 30rpx;
}
.company {
padding-bottom: 40rpx;
border-bottom: 1px solid #f2f2f2;
.logo {
width: 120rpx;
height: 120rpx;
}
.name-text {
//max-width: 380rpx;
font-size: 30rpx;
font-weight: 600;
line-height: 40rpx;
color: #333333;
}
.name-icon {
width: 80rpx;
height: 32rpx;
}
.zhu {
margin-top: 10rpx;
font-size: 24rpx;
line-height: 32rpx;
color: #999999;
}
}
.detail-title {
font-size: 26rpx;
font-weight: 600;
line-height: 40rpx;
color: #101010;
}
.detail-text {
padding: 15rpx 0;
font-size: 26rpx;
line-height: 40rpx;
color: #333333;
}
.fiexd-bottom {
position: fixed;
left: 0;
bottom: 0;
z-index: 99;
width: 100%;
height: 130rpx;
padding: 0 30rpx;
box-sizing: border-box;
border-top: 1px solid #f2f2f2;
.text {
font-size: 26rpx;
line-height: 40rpx;
}
.apply-btn {
width: 220rpx;
height: 70rpx;
font-size: 26rpx;
line-height: 70rpx;
text-align: center;
color: #ffffff;
background: #A92924;
}
}
.table-box {
font-size: 24rpx;
line-height: 28rpx;
text-align: center;
}
.tr {
display: flex;
justify-content: space-between;
align-items: center;
}
.th {
color: #666 !important;
background: #FFF8F2;
}
.th, .td {
display: flex;
justify-content: center;
align-items: center;
width: 50%;
height: 76rpx;
color: #999;
overflow: hidden;
box-sizing: border-box;
border-left: 1px solid #f2f2f2;
border-right: 1px solid #f2f2f2;
border-bottom: 1px solid #f2f2f2;
}
.td {
border-right: 1px solid #f2f2f2;
border-bottom: 1px solid #f2f2f2;
background: #ffffff;
}
.td-3 {
width: 33.33%;
}
.popup-box {
padding: 20rpx 20rpx;
}
.popup-title {
padding: 18rpx 0;
border-bottom: 1px solid #A92924;
.title {
font-size: 24rpx;
line-height: 40rpx;
color: #A92924;
}
.close {
width: 80rpx;
height: 40rpx;
font-size: 22rpx;
line-height: 40rpx;
text-align: center;
color: #ffffff;
background: #A92924;
}
}
</style>
+111
View File
@@ -0,0 +1,111 @@
<template>
<view>
<u-sticky offset-top="0" customNavHeight="0">
<uititle title="加工厂信息"></uititle>
</u-sticky>
<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="1">
<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="服务信息">
<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>
<view v-for="(item, index) in info.deviceList" :key="index"
class="fle flex-col justify-start items-start border-bottom">
<view class="flex justify-center">
<p class="mb-10 flex-1">设备名称:{{ item.name }}</p>
<p class="mb-10 flex-1">设备数量:{{ item.num }}台</p>
</view>
<view class="flex justify-center">
<p class="mb-10 flex-1">设备来源:{{ item.source }}</p>
<p class="mb-10 flex-1">设备类型:{{ item.type }}</p>
</view>
<p class="mb-10">品牌:{{ item.brand }}</p>
<p class="mb-10">型号:{{ item.model }}</p>
<p class="mb-10">投产年限:{{ item.year }}年</p>
<p class="mb-10">特点描述:{{ item.desc }}</p>
</view>
<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>
</view>
</template>
<script>
import uititle from "@/components/common/title.vue";
export default {
name: "factory",
components: {uititle},
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>
+515
View File
@@ -0,0 +1,515 @@
<template>
<view>
<u-sticky offset-top="0" customNavHeight="0">
<uititle title="加工厂列表"></uititle>
</u-sticky>
<!-- 商品列表 -->
<cmswiper page="factory" height="320rpx"></cmswiper>
<cmsearch :k="keyword" @search="afterSearch" :show-back="false"></cmsearch>
<view class="layout-pick flex justify-between align-center bg-white text-25" >
<view class="flex justify-start items-center">
<view class="flex-1 ip down" @click="isPick = true">分类: {{ pickValue ? pickValue : '全部分类' }}</view>
</view>
<view class="ip down" @click="showAddress" style="width: 300rpx">省份:{{ locationValue }}</view>
</view>
<view class="goods-list">
<uiswiper :ad="12" :category-name="cateId ? pickValue : ''"
:category-names="cateId ? [pickValue] : []" :region="region" padding="10rpx 0"></uiswiper>
<uiswiper :ad="122" :category-name="cateId ? pickValue : ''"
:category-names="cateId ? [pickValue] : []" :region="region" padding="10rpx 0"></uiswiper>
<view v-for="(item, index) in list.rows" :key="index" class="goods">
<view class="goods-info">
<!-- <el-image src="https://oss.wsdns.cn/20231204/d35332fa6a3b4596b522edf9527ac612.png"-->
<!-- class="goods-img"/>-->
<view class="info" @click="$jump(`/pages/work/factory?userId=${item.uid}`)">
<view class="field w-100p">
<view class="desc">
<view class="text">企 业</view>
<view v-if="item.user">
{{ item.user.accountType === 2 ? item.user.company.companyName : item.user.person.personName }}
</view>
</view>
<view class="desc"></view>
<view class="desc">
<view class="text">所在地区</view>
<view>{{ item.addressRegion.province.name }}{{ item.addressRegion.city.name }}</view>
</view>
<view class="flex justify-start items-center w-100p">
<view class="desc flex-1">
<view class="text">成立年限</view>
<view>{{ item.year }}年</view>
</view>
<view class="desc flex-1">
<view class="text">年产值</view>
<view>{{ item.yearsIncome }}万元</view>
</view>
</view>
<view class="flex justify-start items-center w-100p">
<view class="desc flex-1">
<view class="text">员工人数</view>
<view>{{ item.employeeNum }}人</view>
</view>
<view class="desc flex-1">
<view class="text">流水线数量</view>
<view>{{ item.flowNum }}条</view>
</view>
</view>
<view class="flex justify-start items-center w-100p">
<view class="desc flex-1">
<view class="text">厂房归属</view>
<view>{{ item.blongTo }}</view>
</view>
<view class="desc flex-1">
<view class="text">厂房面积</view>
<view>{{ item.size }}㎡</view>
</view>
</view>
<view class="desc">
<view class="text">服务信息</view>
<view>{{ item.serviceInfo }}</view>
</view>
<view class="desc">
<view class="text mr-15" style="width: 240rpx">主营工艺和业务范围</view>
<view class="flex-1">{{ 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" plain @click="doShowWechat(index)">添加微信
</button>
<button type="default" class="btn" plain @click="$jump(`/pages/work/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>
<AddressSelect ref="AddressSelect" @confirm="regionConfirm"/>
<u-picker v-if="isPick" :show="isPick" :columns="[categoryTreeData]"
key-name="name" @confirm="handConfirmPick" @cancel="isPick = false">
<template #more>
<text @click="resetCate">重置</text>
</template>
</u-picker>
</view>
</template>
<script>
import uititle from "@/components/common/title.vue";
import cmswiper from "@/components/common/swiper.vue";
import uiswiper from "@/components/index/swiper.vue";
import cmsearch from "@/components/common/search.vue";
import AddressSelect from "@/components/AddressSelect.vue";
export default {
components: {AddressSelect, cmsearch, uiswiper, cmswiper, uititle},
data() {
return {
checkCategoryList: [],
clickedCateIndex: -1,
checkProvinceList: [],
categoryTreeData: [],
allChildCate: [],
keyword: '',
list: {
total: 0,
rows: []
},
showAllProvince: false,
type: 0,
pageSize: 500,
pickValue: '全部',
isPick: false,
locationValue: '全国',
region: {
province: {
code: null,
name: null,
}
},
};
},
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: {
showAddress() {
this.$refs.AddressSelect.open(this.region, 1, true);
},
navTo(url) {
vk.navigateTo({
url
})
},
afterSearch(keyword) {
this.keyword = keyword
this.search()
},
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)
},
toMyEnquiry() {
vk.navigateTo({
url: '/pages/process/my'
})
},
search(pageIndex) {
// const categoryIds = []
// this.allChildCate.map(item => {
// if (this.checkCategoryList.indexOf(item._id) > -1) categoryIds.push(item.name)
// })
console.log(this.region)
vk.callFunction({
url: 'client/factory/pub/getList',
title: '加载中...',
data: {
pageIndex,
pageSize: this.pageSize,
keyword: this.keyword,
mainSpotCategory: this.cateId ? this.pickValue : null,
province: this.region ? this.region.province.code : null
},
success: ({data}) => {
data.rows.map(item => {
item.showWechat = false
item.showContract = false
return item
})
this.list = data
console.log(this.list)
}
});
},
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
},
handConfirmPick({value}) {
console.log(value)
this.pickValue = value[0].name
this.cateId = value[0]._id
this.isPick = false
this.search(1)
},
resetCate() {
this.cateIndex = [0, 0]
this.pickValue = '全部'
this.cateId = null
this.region = null
this.isPick = false
this.search(1)
},
regionConfirm({province}) {
this.region = {province}
this.locationValue = `${province.name}`
this.search(1)
},
},
}
</script>
<style lang="scss" scoped>
.carousel {
//width: 1200px;
margin: 20rpx auto;
}
.page-nav {
display: flex;
justify-content: space-between;
}
.carousel-img {
width: 100%;
height: 100%;
}
.goods-options {
background-color: #FFFFFF;
padding: 20rpx;
}
.filter-outer {
//width: 1200px;
margin: 20rpx auto;
background-color: #FFFFFF;
padding: 20rpx;
}
.tags {
display: flex;
flex-wrap: wrap;
.el-tag {
margin-right: 10px;
}
}
.goods-list {
//width: 1200px;
//margin: 20rpx auto;
//display: flex;
//flex-direction: column;
//justify-content: space-between;
//flex-wrap: wrap;
padding: 30rpx;
font-size: 25rpx;
}
.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: 20rpx;
display: flex;
justify-content: flex-start;
flex-direction: column;
.goods-info {
display: flex;
.goods-img {
width: 200rpx;
height: 150px;
}
.info {
width: 700rpx;
text-align: left;
margin-left: 20rpx;
.goods-name {
font-size: 20rpx;
font-weight: 500;
line-height: 2.5em;
}
.field {
display: flex;
justify-content: flex-start;
flex-direction: column;
align-items: flex-start;
.desc {
display: flex;
//width: 700rpx;
line-height: 45rpx;
.text {
width: 140rpx;
color: #999999;
}
}
}
}
}
.buttons {
width: 100%;
display: flex;
justify-content: space-around;
position: relative;
.btn {
font-size: 25rpx;
width: 200rpx;
}
.green {
background-color: #7ec050 !important;
color: #ffffff;
}
.wechat {
position: absolute;
left: 260rpx;
top: -200rpx;
width: 150rpx;
height: 150rpx;
background-color: white;
border-radius: 10px;
padding: 5px;
box-shadow: 0 1px 10px 0 #eee
}
.mobile {
position: absolute;
left: 10rpx;
top: -80rpx;
background-color: white;
border-radius: 10px;
padding: 5px;
box-shadow: 0 1px 10px 0 #999;
display: flex;
align-items: center;
justify-content: center;
}
}
&-title {
font-size: 15px;
color: #101010;
height: 62px;
padding-top: 20rpx;
font-weight: bold;
}
&-stock {
font-size: 12px;
color: #BD3124;
}
&-address {
font-size: 12px;
margin: 10px 0;
}
&-image {
width: 200rpx;
height: 70px;
margin: 0 auto;
image {
width: 100%;
height: 100%;
}
}
&-company {
color: #4F4F4F;
font-size: 14px;
margin: 10px 0;
}
&-buy {
width: 108rpx;
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%;
}
}
.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;
}
.layout-pick {
// width: 690rpx;
height: 68rpx;
padding: 0 30rpx;
font-size: 24rpx;
line-height: 40rpx;
color: #4F4F4F;
.ip {
position: relative;
//width: ;
//max-width: 33.333%;
width: 300rpx;
height: 40rpx;
padding-right: 30rpx;
overflow: hidden;
box-sizing: border-box;
}
.down::after {
position: absolute;
right: 10rpx;
top: 50%;
z-index: 9;
content: '';
margin-top: -6rpx;
width: 0;
height: 0;
border-left: 10rpx solid transparent;
border-right: 10rpx solid transparent;
border-top: 12rpx solid #999999;
}
}
</style>
+202
View File
@@ -0,0 +1,202 @@
<template>
<view class="wrap">
<u-sticky offset-top="0" customNavHeight="0">
<uititle title="我发布的加工"></uititle>
</u-sticky>
<view class="issue" @click="toRelease">
<u-icon name="plus" color="#fff" size="24"></u-icon>
</view>
<view class="layout-goods">
<view class="goods-box p-top-10" v-if="list.length">
<view class="item bg-white" v-for="(item, index) in list"
:key="index">
<view @click="detailLink(item._id)" class="askfor">查看详情</view>
<view @click="detailLink(item._id)" class="text-25 text-gray text-single">单号{{ item.orderNo }}</view>
<view @click="detailLink(item._id)" class="title text-single">{{ item.title }}</view>
<view @click="detailLink(item._id)" class="text m-top-10">
<text class="red">加工量:{{ parseInt(item.num) }}</text>
<text class="red">{{ item.quoteNum }}家已报价</text>
</view>
<text @click="detailLink(item._id)" class="text-25 text-gray" v-if="item.remark">备注:{{ item.remark }}</text>
<view @click="detailLink(item._id)" class="date">{{ item._add_time_str }} 发布</view>
<view>
<u-button type="primary" plain size="mini" @click="del(item._id)">删除</u-button>
</view>
</view>
</view>
<u-empty v-else text="您未发布加工单"></u-empty>
</view>
</view>
</template>
<script>
import uititle from '@/components/common/title'
export default {
name: "my",
components: {uititle},
data() {
return {
list: [],
userInfo: null
}
},
methods: {
detailLink(id) {
vk.navigateTo(`/pages/work/detail?id=${id}`);
},
async getList() {
const {rows} = await vk.callFunction({
url: 'client/process/sheet/pub/getList',
data: {
userId: this.userInfo._id,
isUser: true
}
})
this.list = rows
},
async toRelease() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
uni.showModal({
title: '提示',
content: '您尚未认证, 是否前往认证?',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 0)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
uni.showModal({
title: '提示',
content: '请完善名片信息',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 1)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (accountNum === 0) {
uni.showModal({
title: '提示',
content: '请先到个人中心添加收款账户',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 7)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else {
vk.navigateTo({
url: '/pages/work/publish'
})
}
},
del(_id) {
uni.showModal({
title: '提示',
content: '如果你要删除此条信息,之前其他客户填写的留言将无法查看',
success: res => {
if (res.confirm) {
vk.callFunction({
url: 'client/process/sheet/kh/delete',
title: '请求中...',
data: {
_id
},
}).then(res => {
this.getList()
})
}
}
})
}
},
onShow() {
this.userInfo = vk.getStorageSync('uni_id_user_info')
this.getList()
}
}
</script>
<style lang="scss" scoped>
.layout-goods {
// width: 690rpx;
padding: 10rpx 30rpx;
.item {
position: relative;
margin-top: 30rpx;
padding: 10rpx 20rpx 20rpx;
border-radius: 12rpx;
.title {
width: 90%;
font-size: 30rpx;
font-weight: 600;
line-height: 48rpx;
color: #101010;
}
.link, .askfor {
position: absolute;
right: 20rpx;
top: 16rpx;
z-index: 9;
font-size: 24rpx;
line-height: 36rpx;
color: #A92924;
padding: 4rpx 8rpx;
}
.link {
border: 1px solid #A92924;
}
.text {
font-size: 24rpx;
line-height: 36rpx;
color: #999999;
}
.red {
margin-right: 20rpx;
color: #A92924;
}
.date {
font-size: 24rpx;
line-height: 36rpx;
color: #9a9a9a;
}
.company {
height: 40rpx;
.icon {
width: 40rpx;
height: 40rpx;
}
.text {
//width: 300rpx;
height: 40rpx;
font-size: 26rpx;
line-height: 40rpx;
color: #4f4f4f;
}
}
}
.item:nth-child(1) {
margin-top: 0 !important;
}
}
</style>
+175
View File
@@ -0,0 +1,175 @@
<template>
<view class="wrap">
<u-sticky offset-top="0" customNavHeight="0">
<uititle title="我的报价"></uititle>
</u-sticky>
<view class="issue" @click="toRelease">
<u-icon name="plus" color="#fff" size="24"></u-icon>
</view>
<view class="layout-goods">
<view class="goods-box p-top-10" v-if="list.length">
<view class="item bg-white" @click="detailLink(item.sheetId)" v-for="(item, index) in list"
:key="index">
<view class="askfor">查看详情</view>
<view class="title text-single">{{ item.sheet.title }}</view>
<view class="text m-top-10">
<text class="red">加工量:{{ parseInt(item.sheet.num) }}</text>
<text class="red">金额:{{ parseInt(item.totalPrice) }}元</text>
</view>
<text class="text-25 text-gray" v-if="item.remark">备注:{{ item.remark }}</text>
<view class="date">{{ item._add_time_str }} 发布</view>
</view>
</view>
<u-empty v-else text="您未报价"></u-empty>
</view>
</view>
</template>
<script>
import uititle from '@/components/common/title'
export default {
name: "my",
components: {uititle},
data() {
return {
list: [],
userInfo: null
}
},
methods: {
detailLink(sheetId) {
vk.navigateTo(`/pages/work/detail?id=${sheetId}`);
},
async getList() {
const {rows} = await vk.callFunction({
url: 'client/process/quote/kh/getList'
})
this.list = rows
},
async toRelease() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
uni.showModal({
title: '提示',
content: '您尚未认证, 是否前往认证?',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 0)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
uni.showModal({
title: '提示',
content: '请完善名片信息',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 1)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (accountNum === 0) {
uni.showModal({
title: '提示',
content: '请先到个人中心添加收款账户',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 7)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else {
vk.navigateTo({
url: '/pages/work/publish'
})
}
},
},
onShow() {
this.userInfo = vk.getStorageSync('uni_id_user_info')
this.getList()
}
}
</script>
<style lang="scss" scoped>
.layout-goods {
// width: 690rpx;
padding: 10rpx 30rpx;
.item {
position: relative;
margin-top: 10rpx;
padding: 10rpx 20rpx 20rpx;
border-radius: 12rpx;
.title {
width: 90%;
font-size: 30rpx;
font-weight: 600;
line-height: 48rpx;
color: #101010;
}
.link, .askfor {
position: absolute;
right: 20rpx;
top: 16rpx;
z-index: 9;
font-size: 24rpx;
line-height: 36rpx;
color: #A92924;
padding: 4rpx 8rpx;
}
.link {
border: 1px solid #A92924;
}
.text {
font-size: 24rpx;
line-height: 36rpx;
color: #999999;
}
.red {
margin-right: 20rpx;
color: #A92924;
}
.date {
font-size: 24rpx;
line-height: 36rpx;
color: #9a9a9a;
}
.company {
height: 40rpx;
.icon {
width: 40rpx;
height: 40rpx;
}
.text {
//width: 300rpx;
height: 40rpx;
font-size: 26rpx;
line-height: 40rpx;
color: #4f4f4f;
}
}
}
.item:nth-child(1) {
margin-top: 0 !important;
}
}
</style>
File diff suppressed because it is too large Load Diff
+439
View File
@@ -0,0 +1,439 @@
<template> <!-- 找加工 -->
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uiheader title="找加工"></uiheader>
<!-- 搜索栏 -->
<cmsearch :k="keyword" @search="afterSearch" :show-back="false"></cmsearch>
<!-- 轮播图-传值:list="数组" -->
<cmswiper page="process" height="320rpx"></cmswiper>
<!-- 选择器 -->
<view class="bg-white p-20 flex justify-center items-center">
<view class="flex-1 mx-20">
<u-button type="primary" shape="circle" size="small" @click="toRelease">发布加工</u-button>
</view>
<view class="flex-1 mx-20">
<u-button type="primary" shape="circle" size="small" plain @click="toMyEnquiry">我发布的</u-button>
</view>
<view class="flex-1 mx-20">
<u-button type="primary" shape="circle" size="small" plain @click="toMyQuote">我的报价</u-button>
</view>
<view class="flex-1 mx-20">
<u-button type="success" shape="circle" size="small" plain @click="$jump('/pages/work/factoryList')">
加工厂列表
</u-button>
</view>
</view>
<view class="layout-pick flex flex-col justify-start items-start bg-white text-25">
<view class="flex justify-start items-center">
<view class="flex-1 ip down" @click="isPick = true">分类: {{ pickValue ? pickValue : '全部分类' }}</view>
</view>
<view class="flex justify-between items-center mt-15 w-100p">
<view class="ip down" @click="isPickStatus = true">询价状态: {{ status }}</view>
<view class="ip down" @click="showAddress">地区:{{ locationValue }}</view>
</view>
</view>
</u-sticky>
<!-- 数据列表 -->
<view class="layout layout-work">
<uiswiper :ad="13" :category-id="cateId" :category-ids="cateId ? [cateId] : []" :region="region"
padding="10rpx 0"></uiswiper>
<uiswiper :ad="14" :category-id="cateId" :category-ids="cateId ? [cateId] : []" :region="region"
padding="10rpx 0"></uiswiper>
<view class="table-box">
<view class="thead">
<view class="tr">
<view class="flex justify-center items-center font-bold" style="width: 41%; height: 50rpx">标题</view>
<view class="flex justify-center items-center w-15p font-bold" style="height: 50rpx">加工量</view>
<view class="flex justify-center items-center font-bold" style="width: 32%; height: 50rpx">收货地</view>
<view class="flex justify-center items-center w-12p font-bold" style="height: 50rpx">操作</view>
</view>
</view>
<view class="tbody mt-10">
<view class="flex justify-center items-center" v-for="(item, index) in list.rows" :key="index">
<view class="td-n flex justify-center items-center" @click="toDetail(item._id)" style="width: 41%;">
<text class="u-line-2 flex justify-center items-center">{{ item.title }}</text>
</view>
<view class="td-n w-15p flex justify-center items-center">{{ item.num }}</view>
<view class="td-n flex justify-center items-center" style="width: 32%">
<text class="u-line-2 flex justify-center items-center">{{
(item.addressRegion && item.addressRegion.province && item.addressRegion.city && item.addressRegion.area) ?
`${item.addressRegion.province.name}${item.addressRegion.city.name}${item.addressRegion.area.name}` : ''
}}
</text>
</view>
<view class="td-n w-12p flex justify-center items-center">
<u-button
class="minibtn"
size="mini"
type="error"
plain
text="查看"
@click="toDetail(item._id)"
></u-button>
</view>
</view>
</view>
</view>
</view>
<!-- 暂无数据 -->
<u-empty mode="list" text="暂无更多内容~" v-if="list.rows.length === 0"></u-empty>
<!-- <cmempty></cmempty> -->
<!-- 圆形按钮 -->
<!-- <view v-if="showMore" class="more-btns">-->
<!-- <view class="item" @click="$jump('/pages/work/factoryList')">-->
<!-- <factory-building theme="outline" size="24" fill="#a92924"/>-->
<!-- </view>-->
<!-- <view class="item" @click="toMyQuote">-->
<!-- <u-icon name="order" color="#A92924" size="24"></u-icon>-->
<!-- </view>-->
<!-- <view class="item" @click="toMyEnquiry">-->
<!-- <u-icon name="account" color="#A92924" size="24"></u-icon>-->
<!-- </view>-->
<!-- <view class="item" @click="toRelease">-->
<!-- <u-icon name="plus" color="#A92924" size="24"></u-icon>-->
<!-- </view>-->
<!-- </view>-->
<!-- <view class="issue" @click="showMore = !showMore">-->
<!-- <u-icon :name="showMore ? 'close' : 'plus'" color="#fff" size="24"></u-icon>-->
<!-- </view>-->
<AddressSelect ref="AddressSelect" @confirm="regionConfirm"/>
<u-picker v-if="isPick" :show="isPick" :columns="[categoryTreeData]"
key-name="name" @confirm="handConfirmPick" @cancel="isPick = false">
<template #more>
<text @click="resetCate">重置</text>
</template>
</u-picker>
<collapse></collapse>
<u-picker v-if="isPickStatus" :show="isPickStatus"
:columns="[[{name: '正在询价', value: 0}, {name: '合作成交', value: 1}, ]]"
key-name="name" @confirm="handConfirmStatusPick" @cancel="isPickStatus = false">
</u-picker>
</view>
</template>
<script>
import uiheader from '@/components/index/header'
import cmsearch from '@/components/common/search'
import cmempty from '@/components/common/empty'
import cmswiper from '@/components/common/swiper'
import {FactoryBuilding} from '@icon-park/vue'
import AddressSelect from "@/components/AddressSelect.vue";
import Collapse from "@/components/index/collapse.vue";
import uiswiper from "@/components/index/swiper.vue";
export default {
components: {
uiswiper,
Collapse,
AddressSelect,
uiheader,
cmsearch,
cmempty,
cmswiper,
FactoryBuilding,
},
data() {
return {
allChildCate: [],
categoryTreeData: [],
pageSize: 500,
keyword: '',
checkCategoryList: [],
checkProvinceList: [],
list: {
rows: []
},
showMore: false,
locationValue: '全国',
region: {
province: {
code: null,
name: null,
}
},
pickValue: '全部',
isPick: false,
cateId: null,
cateIndex: [0, 0],
status: '正在询价',
statusVal: 0,
isPickStatus: false,
};
},
methods: {
handleChangeCate({indexs}) {
this.cateIndex = indexs
},
handConfirmPick({value}) {
this.pickValue = value[0].name
this.cateId = value[0]._id
this.isPick = false
this.search(1)
},
handConfirmStatusPick({value}) {
this.status = value[0].name
this.statusVal = value[0].value
this.isPickStatus = false
this.search(1)
},
resetCate() {
this.cateIndex = [0, 0]
this.pickValue = '全部'
this.cateId = null
this.isPick = false
this.search(1)
},
getCateList() {
vk.callFunction({
url: 'client/process/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)
})
})
}
});
},
showAddress() {
this.$refs.AddressSelect.open(this.region, 1, true);
},
regionConfirm({province}) {
this.region = {province}
this.locationValue = `${province.name}`
this.search(1)
},
afterSearch(keyword) {
this.keyword = keyword
this.search()
},
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.cateId ? [this.cateId] : null,
provinceCodes: this.region.province.code ? [this.region.province.code] : null,
status: this.statusVal
},
success: (data) => {
this.list = data
this.loading = false
}
});
},
toMyEnquiry() {
vk.navigateTo({
url: '/pages/work/my'
})
},
toMyQuote() {
vk.navigateTo({
url: '/pages/work/myQuote'
})
},
async toRelease() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
uni.showModal({
title: '提示',
content: '您尚未认证, 是否前往认证?',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 0)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
uni.showModal({
title: '提示',
content: '请完善名片信息',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 1)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (accountNum === 0) {
uni.showModal({
title: '提示',
content: '请先到个人中心添加收款账户',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 7)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else {
if (userInfo.businessCard.status !== 1) {
uni.showModal({
title: '提示',
content: '您的名片信息未审核,请耐心等待',
})
return
}
vk.navigateTo({
url: '/pages/work/publish'
})
}
},
async toDetail(id) {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
uni.showModal({
title: '提示',
content: '您尚未认证, 是否前往认证?',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 0)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
uni.showModal({
title: '提示',
content: '请完善名片信息',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 1)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else {
vk.navigateTo(`/pages/work/detail?id=${id}`)
}
},
},
onLoad(option) {
if (option.keyword) this.keyword = option.keyword
this.getCateList()
this.search()
}
}
</script>
<style lang="scss">
.u-button--small {
padding: 0 !important;
}
.minibtn {
width: 60rpx;
font-size: 20rpx;
color: #A92924 !important;
border-color: #A92924;
}
.layout-pick {
// width: 690rpx;
//height: 68rpx;
padding: 0 30rpx;
font-size: 24rpx;
line-height: 40rpx;
color: #4F4F4F;
.ip {
position: relative;
//width: 150rpx;
//max-width: 33.333%;
height: 40rpx;
padding-right: 30rpx;
overflow: hidden;
box-sizing: border-box;
}
.down::after {
position: absolute;
right: 10rpx;
top: 50%;
z-index: 9;
content: '';
margin-top: -6rpx;
width: 0;
height: 0;
border-left: 10rpx solid transparent;
border-right: 10rpx solid transparent;
border-top: 12rpx solid #999999;
}
}
.layout-work {
margin: 20rpx 10rpx;
}
.tr {
display: flex;
justify-content: space-between;
align-items: center;
}
.table-box {
font-size: 24rpx;
line-height: 28rpx;
text-align: center;
}
.th, .td {
display: flex;
justify-content: center;
align-items: center;
width: 20%;
height: 76rpx;
color: #000;
overflow: hidden;
box-sizing: border-box;
}
.td-n {
border-right: 1px solid #f2f2f2;
border-bottom: 1px solid #f2f2f2;
background: #ffffff;
height: 60rpx;
&:first-child {
color: #A92924;
}
&:last-child {
border-right: none;
}
}
.more-btns {
position: fixed;
right: 30rpx;
bottom: 220rpx;
z-index: 99;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 90rpx;
border-radius: 999rpx;
background: white;
border: 1px solid #A92924;
.item {
margin: 20rpx 0;
}
}
</style>
+791
View File
@@ -0,0 +1,791 @@
<template> <!-- 黄页详情 -->
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0" zIndex="9999">
<!-- 顶部 -->
<uititle :title="info.company.companyName ? info.company.companyName : ''"></uititle>
</u-sticky>
<!-- 基础信息 -->
<view class="layout layout-base">
<view class="company flex m-top-20">
<view class="logo">
<image v-if="info && info.businessCard" class="full" :src="info.businessCard.logo"
mode="aspectFit"></image>
<image v-else class="full" src="/static/no-logo.jpg" mode=""></image>
</view>
<view class="info flex-1 p-left-20">
<view class="name flex justify-start align-center">
<view class="name-text">{{ info.company.companyName }}</view>
<!-- 认证图标 -->
<!-- <view class="name-icon m-left-20">-->
<!-- <image class="full" src="/static/img/idente.png" mode=""></image>-->
<!-- </view>-->
</view>
<view class="zhu" v-if="info.company.mainSpotCategory && info.company.mainSpotCategory.length">
主营业务:{{ info.company.mainSpotCategory.join() }}
</view>
<view class="zhu" v-else>
主营业务:{{ info.company.mainSpotCategorySelf }}
</view>
</view>
</view>
<view class="flex justify-between align-center m-top-20">
<u-icon name="rmb-circle" color="#A92924" size="18"></u-icon>
<view class="half-text">平台累计交易
<text class="red">{{ info.transactionAmount.toFixed(2) }}</text>
元
</view>
<view class="flex-1"></view>
<template v-if="info.paidEnsure && info.paidEnsure > 0">
<u-icon name="checkmark-circle" color="#A92924" size="18"></u-icon>
<view class="half-text">已缴纳交易保证金
<text class="red">{{ info.paidEnsure }}</text>
元
</view>
</template>
</view>
</view>
<el-carousel height="210rpx`" :style="{width: '100%', height: '210rpx'}" 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%'}">
<u-image :src="item" mode="aspectFit" width="100%" height="210rpx"/>
</el-carousel-item>
</template>
<template v-else>
<el-carousel-item :style="{width: '100%'}">
<u-image :src="info.businessCard.album" mode="aspectFit" width="100%" height="210rpx"/>
</el-carousel-item>
</template>
</el-carousel>
<!-- 企业简介 -->
<view class="layout layout-company">
<view class="card-title m-top-30">企业简介</view>
<view class="company-text" v-if="info.businessCard.companyIntroduction"
v-html="info.businessCard.companyIntroduction"/>
<text v-else>商家暂未填写</text>
</view>
<view class="flex flex-col justify-start items-start mb-20 layout-company"
v-if="info.businessCard && info.businessCard.video">
<view class="card-title m-top-30">企业视频</view>
<video :src="info.businessCard.video" controls style="width: 100%" autoplay/>
</view>
<view class="flex flex-col justify-start items-start mb-20 layout-company"
v-if="info.businessCard && info.businessCard.productImageList">
<view class="card-title m-top-30">产品展示</view>
<view class="flex justify-start items-start flex-wrap">
<el-image :src="item" v-for="(item, index) in info.businessCard.productImageList"
:key="index" fit="cover" :preview-src-list="info.businessCard.productImageList"
style="width: 5rem; height: 5rem; margin: 0 1rem 1rem 0"/>
</view>
</view>
<view class="flex flex-col justify-start items-start mb-20 layout-company "
v-if="info.businessCard && info.businessCard.exampleImageList">
<view class="card-title m-top-30">案例展示</view>
<view class="flex justify-start items-start flex-wrap">
<el-image :src="item" v-for="(item, index) in info.businessCard.exampleImageList"
:key="index" fit="cover"
:preview-src-list="info.businessCard.exampleImageList"
style="width: 5rem; height: 5rem; margin: 0 1rem 1rem 0"/>
</view>
</view>
<view class="flex flex-col justify-start items-start mb-20 layout-company"
v-if="canShowMapLocation">
<view class="card-title m-top-30">地图定位</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 layout-company"
v-if="userArticle.length > 0">
<view class="card-title m-top-30">新闻动态</view>
<view class="flex justify-start items-start flex-col w-100p">
<view class="flex flex-col items-start 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="layout layout-card">
<!-- <view class="card-title m-top-10">我的名片</view> -->
<view class="card-body">
<!-- 联系信息 -->
<view class="card-title m-top-30">联系我们</view>
<view class="detail m-top-10">
<view class="p clear">
<view class="lb fl flex justify-start align-center">
<u-icon name="map" size="18"></u-icon>
<view class="text">地址:</view>
</view>
<view class="vl">
{{ info.manager.address }}
</view>
</view>
<view class="p clear">
<view class="lb fl flex justify-start align-center">
<u-icon name="phone" size="18"></u-icon>
<view class="text">电话:</view>
</view>
<view class="vl">{{
info.businessCard.companyMobile ? info.businessCard.companyMobile : '商家暂未填写'
}}
</view>
</view>
<view class="p clear">
<view class="lb fl flex justify-start align-center">
<u-icon name="email" size="18"></u-icon>
<view class="text">邮箱:</view>
</view>
<view class="vl">{{ info.businessCard.email ? info.businessCard.email : '商家暂未填写' }}</view>
</view>
<view class="p clear">
<view class="lb fl flex justify-start align-center">
<u-icon name="kefu-ermai" size="18"></u-icon>
<view class="text">手机:</view>
</view>
<view class="vl">{{ info.manager.mobile ? info.manager.mobile : '商家暂未填写' }}</view>
</view>
<view class="p clear" v-if="info.userLevel > 1">
<view class="lb fl flex justify-start align-center">
<u-icon name="ie" size="18"></u-icon>
<view class="text">网址:</view>
</view>
<view class="vl">
<u--text mode="link" :text="info.businessCard.website"
:href="info.businessCard.website"></u--text>
</view>
</view>
<!-- <view class="p clear">-->
<!-- <view class="lb fl flex justify-start align-center">-->
<!-- <u-icon name="account" size="18"></u-icon>-->
<!-- <view class="text">总经理:</view>-->
<!-- </view>-->
<!-- <view class="vl">王星星</view>-->
<!-- </view>-->
</view>
</view>
</view>
<!-- 发布的现货 -->
<template v-if="parseInt(info.userLevel) > 0">
<view class="layout-goods" v-if="info.spotList">
<view class="card-title m-top-20 flex justify-between">
<view class="text">发布的现货</view>
<!-- <view class="more">查看更多</view>-->
</view>
<view class="goods-box m-top-20">
<view class="item bg-white">
<view class="title text-single">{{ info.spotList.name }}</view>
<view class="text m-top-10">
<text class="red">库存:{{ 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="flex flex-col justify-start m-top-10">
<view class="company flex justify-center align-center flex-nowrap">
<view class="text flex-1">{{ info.company.companyName }}</view>
</view>
<view class="date">{{ info.spotList._add_time_str }}发布</view>
</view>
<view class="askfor" @click.native="$jump('/pages/goods/detail?id=' + info.spotList._id)">
+申请合作
</view>
</view>
</view>
</view>
<!-- 发布的询价单 -->
<view class="layout layout-table">
<view class="card-title m-top-20 flex justify-between">
<view class="text">发布的询价单</view>
<view class="more" @click.native="$jump('/pages/price/price?');">查看更多</view>
</view>
<view class="table-box m-top-20">
<view class="thead">
<view class="tr">
<view class="th" style="width: 60%;">品名、材质</view>
<view class="th" style="width: 20%;">采购量</view>
<view class="th" style="width: 20%;">操作</view>
</view>
</view>
<view class="tbody" v-for="(item, index) in info.enquiryList" :key="index">
<view class="tr">
<view class="td" style="width: 60%;">{{ item.productList[0].goodsName }}</view>
<view class="td" style="width: 20%;">{{ item.productList[0].procureNumber }}{{
item.productList[0].procureUnit
}}
</view>
<view class="td" style="width: 20%;">
<u-button
@click.native="$jump('/pages/price/detail?id=' + item._id);"
class="minibtn"
size="mini"
type="error"
plain
text="查看详情"
></u-button>
</view>
</view>
</view>
</view>
</view>
<!-- 发布的加工单 -->
<view class="layout layout-table">
<view class="card-title m-top-20 flex justify-between">
<view class="text">发布的加工单</view>
<view class="more" @click="$jump('/pages/work/work')">查看更多</view>
</view>
<view class="table-box m-top-20">
<view class="thead">
<view class="tr">
<view class="th" style="width: 60%;">品名、材质</view>
<view class="th" style="width: 20%;">加工量</view>
<view class="th" style="width: 20%;">操作</view>
</view>
</view>
<view class="tbody">
<view class="tr" v-for="(item, index) in info.processList" :key="index">
<view class="td" style="width: 60%;">{{ item.title }}</view>
<view class="td" style="width: 20%;">{{ item.num }}</view>
<view class="td" style="width: 20%;">
<u-button
@click.native="$jump(`/pages/work/detail?id=${item._id}`)"
class="minibtn"
size="mini"
type="error"
plain
text="查看详情"
></u-button>
</view>
</view>
</view>
</view>
</view>
<!-- 发布的旧货信息 -->
<!-- <view class="layout layout-junk">-->
<!-- <view class="card-title m-top-20 flex justify-between">-->
<!-- <view class="text">发布的旧货信息</view>-->
<!-- <view class="more">查看更多</view>-->
<!-- </view>-->
<!-- <view class="junk-box">-->
<!-- <view class="item flex">-->
<!-- <view class="img">-->
<!-- <image class="full" src="/static/img/abc-1.png" mode=""></image>-->
<!-- </view>-->
<!-- <view class="info flex-1 p-left-30">-->
<!-- <view class="title text-single">直缝钢管20吨</view>-->
<!-- <view class="flex justify-between flex-wrap">-->
<!-- <view class="p half">-->
<!-- <text class="lb">所属分类</text>-->
<!-- 成品钢材-->
<!-- </view>-->
<!-- <view class="p half">-->
<!-- <text class="lb">发布时间</text>-->
<!-- 2022.12.23-->
<!-- </view>-->
<!-- <view class="p half">-->
<!-- <text class="lb">所在区域</text>-->
<!-- 广西-南宁-->
<!-- </view>-->
<!-- <view class="p half">-->
<!-- <text class="lb">有效期至</text>-->
<!-- 2022.12.23-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<!-- <view class="item flex">-->
<!-- <view class="img">-->
<!-- <image class="full" src="/static/img/abc-1.png" mode=""></image>-->
<!-- </view>-->
<!-- <view class="info flex-1 p-left-30">-->
<!-- <view class="title text-single">直缝钢管20吨</view>-->
<!-- <view class="flex justify-between flex-wrap">-->
<!-- <view class="p half">-->
<!-- <text class="lb">所属分类</text>-->
<!-- 成品钢材-->
<!-- </view>-->
<!-- <view class="p half">-->
<!-- <text class="lb">发布时间</text>-->
<!-- 2022.12.23-->
<!-- </view>-->
<!-- <view class="p half">-->
<!-- <text class="lb">所在区域</text>-->
<!-- 广西-南宁-->
<!-- </view>-->
<!-- <view class="p half">-->
<!-- <text class="lb">有效期至</text>-->
<!-- 2022.12.23-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<el-dialog v-if="articleIndex > -1 && dialogVisible"
title="新闻动态"
:visible.sync="dialogVisible"
width="100%">
<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">
<u-button @click="dialogVisible = false">关 闭</u-button>
</div>
</el-dialog>
</template>
</view>
</template>
<script>
import uititle from '@/components/common/title'
import cmsearch from '@/components/common/search'
import cmempty from '@/components/common/empty'
import usnotice from '@/components/user/notice'
import usaccount from '@/components/user/account'
import uscard from '@/components/user/card'
export default {
components: {
uititle,
cmsearch,
cmempty,
usnotice,
usaccount,
uscard,
},
data() {
return {
id: null,
info: {
transactionAmount: 0,
paidEnsure: 0,
spotList: [],
enquiryList: [],
processList: [],
company: {
companyName: ''
}
},
allChildCate: [],
userArticle: [],
articleIndex: -1,
dialogVisible: false
};
},
computed: {
canShowMapLocation() {
return this.info.businessCard
&& this.info.businessCard.longitude
&& parseInt(this.info.accountType) === 2
&& parseInt(this.info.userLevel) > 1
}
},
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()
}
});
},
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
})
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%';
}
})
}
});
},
getUserArticle() {
vk.callFunction({
url: 'client/userArticle/pub/getList',
title: '请求中...',
data: {
userId: this.id
},
success: (data) => {
this.userArticle = data.rows
console.log(this.userArticle)
}
});
},
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({id}) {
this.id = id
this.getCategoryTreeData()
this.getUserArticle()
}
}
</script>
<style lang="scss">
img {
width: 100% !important;
}
page {
background: #ffffff;
}
.minibtn {
width: 60rpx;
font-size: 20rpx;
color: #A92924 !important;
border-color: #A92924;
}
.card-title {
position: relative;
padding-left: 20rpx;
font-size: 28rpx;
font-weight: 600;
line-height: 48rpx;
color: #A92924;
&:before {
position: absolute;
left: 0;
top: 50%;
z-index: 9;
margin-top: -14rpx;
content: '';
width: 6rpx;
height: 28rpx;
background: #A92924;
}
.more {
font-size: 24rpx;
font-weight: normal;
color: #999999;
}
}
.layout-base {
padding: 10rpx 30rpx;
.logo {
width: 80rpx;
height: 80rpx;
}
.info {
.name-text {
//max-width: 380rpx;
font-size: 30rpx;
line-height: 40rpx;
color: #666666;
}
.name-icon {
width: 80rpx;
height: 32rpx;
}
.zhu {
margin-top: 8rpx;
font-size: 24rpx;
line-height: 32rpx;
color: #999999;
}
}
.half-text {
margin-left: 6rpx;
font-size: 24rpx;
line-height: 40rpx;
color: #333333;
}
}
.layout-company {
padding: 10rpx 30rpx;
.company-text {
padding: 20rpx 0;
font-size: 28rpx;
line-height: 44rpx;
color: #A7A7A7;
}
.company-img {
image {
width: 100%;
height: auto;
}
}
}
.layout-card {
padding: 10rpx 30rpx;
.card-tip {
font-size: 26rpx;
line-height: 48rpx;
color: #333333;
}
.detail {
padding: 10rpx 0;
.p {
position: relative;
padding: 14rpx 0;
.lb {
position: absolute;
left: 0;
top: 10rpx;
z-index: 9;
width: 180rpx;
height: auto;
.text {
padding-left: 6rpx;
font-size: 28rpx;
line-height: 40rpx;
color: #666666;
}
}
.vl {
padding-left: 150rpx;
min-height: 40rpx;
font-size: 28rpx;
line-height: 40rpx;
color: #666666;
}
}
}
}
.layout-junk {
padding: 30rpx 30rpx;
.item {
margin-top: 30rpx;
padding: 30rpx 30rpx;
background: #f8f8f8;
.img {
width: 160rpx;
height: 130rpx;
}
.title {
font-size: 28rpx;
font-weight: 600;
line-height: 40rpx;
color: #4b4b4b;
}
.p {
padding: 5rpx 0;
height: 40rpx;
overflow: hidden;
font-size: 24rpx;
line-height: 40rpx;
color: #4b4b4b;
}
.lb {
padding-right: 6rpx;
color: #999999;
}
}
}
.layout-table {
padding: 20rpx 30rpx;
}
.tr {
display: flex;
justify-content: space-between;
align-items: center;
}
.table-box {
font-size: 24rpx;
line-height: 28rpx;
text-align: center;
}
.thead {
background: #f8f8f8;
}
.th, .td {
display: flex;
justify-content: center;
align-items: center;
width: 20%;
height: 76rpx;
color: #000;
overflow: hidden;
box-sizing: border-box;
}
.td {
border-right: 1px solid #f2f2f2;
border-bottom: 1px solid #f2f2f2;
background: #ffffff;
// &:first-child {
// color: #f56c6c;
// }
&:last-child {
border-right: none;
}
}
.layout-goods {
width: 690rpx;
padding: 10rpx 30rpx;
.item {
position: relative;
margin-top: 30rpx;
padding: 10rpx 20rpx 20rpx;
background: #f8f8f8;
border-radius: 12rpx;
.title {
width: 90%;
font-size: 32rpx;
font-weight: 600;
line-height: 48rpx;
color: #101010;
}
.link {
position: absolute;
right: 20rpx;
top: 16rpx;
z-index: 9;
font-size: 24rpx;
line-height: 36rpx;
color: #A92924;
padding: 4rpx 8rpx;
}
.link {
border: 1px solid #A92924;
}
.askfor {
display: flex;
justify-content: flex-end;
margin-top: 20rpx;
font-size: 24rpx;
line-height: 36rpx;
color: #A92924;
padding: 4rpx 8rpx;
}
.text {
font-size: 28rpx;
line-height: 36rpx;
color: #999999;
}
.red {
margin-right: 20rpx;
color: #A92924;
}
.date {
font-size: 26rpx;
line-height: 36rpx;
color: #9a9a9a;
}
.company {
height: 40rpx;
.icon {
width: 40rpx;
height: 40rpx;
}
.text {
//width: 300rpx;
height: 40rpx;
font-size: 32rpx;
line-height: 40rpx;
color: #4f4f4f;
}
}
}
.item:nth-child(1) {
margin-top: 0 !important;
}
}
.mapDiv {
width: 100%;
height: 300px;
}
</style>
+441
View File
@@ -0,0 +1,441 @@
<template> <!-- 黄页 -->
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uiheader title="金久信黄页"></uiheader>
<!-- 搜索栏 -->
<cmsearch></cmsearch>
<!-- 轮播图-传值:list="数组" -->
<cmswiper page="yellowPage" height="320rpx"></cmswiper>
<!-- 选择器 -->
<view class="layout-pick flex justify-between align-center bg-white">
<view class="ip down" @click="showIndustry = true">行业:{{ industry }}</view>
</view>
<view class="layout-pick flex justify-between align-center bg-white">
<view style="max-width: 60%" class="ip down" @click="isPick = true">主营类目:{{ pickValue }}</view>
<view style="max-width: 40%" class="ip down" @click="showAddress">省份:{{ locationValue }}</view>
</view>
</u-sticky>
<!-- 广告图(可封装组件) -->
<!-- <view class="layout layout-banner">-->
<!-- <view class="banner">-->
<!-- <image class="full" src="/static/img/yellow-1.png" mode=""></image>-->
<!-- </view>-->
<!-- <view class="banner">-->
<!-- <image class="full" src="/static/img/yellow-2.png" mode=""></image>-->
<!-- </view>-->
<!-- <view class="banner">-->
<!-- <image class="full" src="/static/img/yellow-3.png" mode=""></image>-->
<!-- </view>-->
<!-- </view>-->
<!-- 列表 -->
<view class="layout layout-list">
<view class="item " style="line-height: 40rpx!important;" v-for="(item, index) in companyList" :key="index"
@click="detailLink(item._id)">
<!-- 基础信息 -->
<view class="company flex">
<view class="logo">
<image v-if="item && item.businessCard" style="width: 120rpx; height: 120rpx" mode="widthFix"
:src="item.businessCard.logo"/>
<image v-else class="full" src="/static/no-logo.jpg" style="width: 120rpx; height: 120rpx" mode=""></image>
</view>
<view class="info flex-1 flex flex-col justify-center items-start p-left-20" style="height: 120rpx">
<view class="name flex justify-start align-center">
<view class="name-text text-single font-bold">{{ item.company.companyName }}</view>
<!-- 认证图标 -->
</view>
<!-- <view class="rate">-->
<!-- <u-rate :count="5" v-model="rate"></u-rate>-->
<!-- </view>-->
<view class="people flex justify-start align-center">
<u-icon name="account" size="18"></u-icon>
<text class="xm p-left-10" v-if="item.manager">{{ item.manager.personName }}</text>
<text class="job p-left-20" v-if="item.businessCard">{{ item.businessCard.position }}</text>
</view>
</view>
</view>
<!-- 联系信息 -->
<view class="detail">
<view class="text-25 flex justify-start items-start">
<view class="flex justify-start align-center w-20p flex-shrink">
<u-icon name="map" size="18"></u-icon>
<view class="text">地址:</view>
</view>
<view style="line-height: 30rpx"
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
}}
</view>
</view>
<view class="mt-10 text-25 flex justify-start items-center">
<view class="flex justify-start items-center w-20p flex-shrink">
<u-icon name="phone" size="18"></u-icon>
<view class="text">电话:</view>
</view>
<view>{{ item.businessCard.companyMobile ? item.businessCard.companyMobile : '商家暂未填写' }}</view>
</view>
<view class="mt-10 text-25 flex justify-start items-center">
<view class="flex justify-start items-center w-20p flex-shrink">
<u-icon name="email" size="18"></u-icon>
<view class="text">邮箱:</view>
</view>
<view>{{ item.businessCard.email ? item.businessCard.email : '商家暂未填写' }}</view>
</view>
<view class="mt-10 text-25 flex justify-start items-center">
<view class="flex justify-start items-center w-20p flex-shrink">
<u-icon name="kefu-ermai" size="18"></u-icon>
<view class="text">手机:</view>
</view>
<view>{{ item.manager.mobile ? item.manager.mobile : '商家暂未填写' }}</view>
</view>
<view class="mt-10 text-25 flex justify-start items-center" v-if="item.userLevel > 1">
<view class="flex justify-start items-center w-20p flex-shrink">
<u-icon name="ie" size="18"></u-icon>
<view class="text">网址:</view>
</view>
<view>{{ item.businessCard ? item.businessCard.website : '商家暂未填写' }}</view>
</view>
</view>
<!-- 主营业务 -->
<view class="flex justify-start mt-25 text-25">
<text class="red w-20p flex-shrink">主营业务:</text>
<!-- <text class="text-left" style="line-height: 30rpx">{{-->
<!-- item.mainSpotCategory.length > 0 ? item.mainSpotCategory.join() : '无'-->
<!-- }}-->
<!-- </text>-->
<text class="ml-20 flex-1" style="line-height: 30rpx" v-if="item.mainSpotCategory.length">
{{ item.mainSpotCategory.join() }}
</text>
<text class="ml-20 flex-1" style="line-height: 30rpx"
v-if="!item.mainSpotCategory.length && item.company.mainSpotCategorySelf">
{{ item.company.mainSpotCategorySelf }}
</text>
</view>
<view class="flex justify-between items-center w-100p">
<view class="link mt-25">查看详情</view>
<view class="flex justify-end items-center">
<image src="/static/img/idente.png" class="ml-10" mode="" style="width: 80rpx; height: 28rpx"></image>
<i class="el-icon-star-off text-main ml-20"/>
</view>
</view>
</view>
</view>
<!-- 没有数据 -->
<u-empty mode="list" text="暂无更多内容~" v-if="companyList.length === 0"></u-empty>
<!-- <cmempty></cmempty> -->
<uiswiper :ad="23" padding="10rpx 0"></uiswiper>
<uiswiper :ad="24" padding="10rpx 0"></uiswiper>
<uiswiper :ad="25" padding="10rpx 0"></uiswiper>
<uiswiper :ad="26" padding="10rpx 0"></uiswiper>
<collapse></collapse>
<AddressSelect ref="AddressSelect" @confirm="regionConfirm"/>
<u-picker v-if="isPick" :show="isPick" :columns="[categoryTreeData, categoryTreeData[cateIndex[0]].children]"
key-name="name" @confirm="handConfirmPick" @change="handleChangeCate" @cancel="isPick = false">
<template #more>
<text @click="resetCate">重置</text>
</template>
</u-picker>
<u-picker v-if="showIndustry" :show="showIndustry" :columns="[industryList]"
key-name="name" @confirm="handConfirmPickIndustry" @cancel="showIndustry = false">
<template #more>
<text @click="resetIndustry">重置</text>
</template>
</u-picker>
</view>
</template>
<script>
import uiheader from '@/components/index/header'
import cmsearch from '@/components/common/search'
import cmempty from '@/components/common/empty'
import cmswiper from '@/components/common/swiper'
import Collapse from "@/components/index/collapse.vue";
import AddressSelect from "@/components/AddressSelect.vue";
import uiswiper from "@/components/index/swiper.vue";
export default {
components: {
uiswiper,
AddressSelect,
Collapse,
uiheader,
cmsearch,
cmempty,
cmswiper,
},
data() {
return {
rate: 3,
checkProvinceList: [],
keyword: '',
checkCategoryList: [],
industryList: [],
selectedIndustryList: [],
categoryTreeData: [],
allChildCate: [],
companyList: [],
locationValue: '全国',
region: {
province: {
code: null,
name: null,
}
},
pickValue: '全部',
isPick: false,
showIndustry: false,
industry: '全部',
cateId: null,
cateIndex: [0, 0],
};
},
methods: {
handleChangeCate({indexs}) {
this.cateIndex = indexs
},
handConfirmPick({value}) {
this.pickValue = value[1].name
this.cateId = value[1]._id
this.isPick = false
this.getCompany()
},
resetCate() {
this.cateIndex = [0, 0]
this.pickValue = '全部'
this.cateId = null
this.isPick = false
this.getCompany()
},
handConfirmPickIndustry({value}) {
this.industry = value[0].name
this.showIndustry = false
this.getCompany()
},
resetIndustry() {
this.industry = '全部'
this.showIndustry = false
this.getCompany()
},
showAddress() {
this.$refs.AddressSelect.open(this.region, 1, true);
},
regionConfirm({province}) {
this.region = {province}
this.locationValue = `${province.name}`
this.getCompany()
},
detailLink(id) {
vk.navigateTo(`/pages/yellow/detail?id=${id}`)
},
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()
}
});
},
getCompany() {
vk.callFunction({
url: 'client/user/pub/getCompany',
title: '请求中...',
data: {
province: this.region.province.code ? [this.region.province.code] : null,
keyword: this.keyword,
mainSpotCategoryIds: this.cateId ? [this.cateId] : null,
showInYellow: 1,
// factoryFilter: this.factoryFilter,
industryList: this.industry === '全部' ? null : [this.industry]
},
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
})
}
});
},
async getIndustryList() {
const {rows} = await vk.callFunction({
url: 'client/industry/pub/getList'
})
this.industryList = rows
},
},
onLoad() {
this.getIndustryList()
this.getCategoryTreeData()
}
}
</script>
<style lang="scss">
.layout-pick {
// width: 690rpx;
height: 68rpx;
padding: 0 10rpx;
font-size: 24rpx;
line-height: 40rpx;
color: #4F4F4F;
.ip {
position: relative;
max-width: 50%;
height: 40rpx;
padding-right: 25rpx;
overflow: hidden;
box-sizing: border-box;
}
.down::after {
position: absolute;
right: 5rpx;
top: 50%;
z-index: 9;
content: '';
margin-top: -6rpx;
width: 0;
height: 0;
border-left: 10rpx solid transparent;
border-right: 10rpx solid transparent;
border-top: 12rpx solid #999999;
}
}
.layout-banner {
padding: 0rpx 30rpx;
.banner {
margin-top: 20rpx;
width: 100%;
height: 126rpx;
}
}
.layout-list {
margin: 30rpx 30rpx;
.item {
margin-top: 20rpx;
padding: 20rpx 20rpx;
background: #ffffff;
border-radius: 12rpx;
}
.item:nth-child(1) {
margin-top: 0;
}
.company {
.logo {
width: 120rpx;
height: 120rpx;
}
.info {
.name-text {
max-width: 380rpx;
font-size: 30rpx;
line-height: 40rpx;
color: #666666;
}
.name-icon {
width: 80rpx;
height: 28rpx;
}
.rate {
padding: 10rpx 0;
}
.xm {
font-size: 28rpx;
line-height: 40rpx;
color: #666666;
}
.job {
font-size: 24rpx;
line-height: 40rpx;
color: #999999;
}
}
}
.detail {
padding: 10rpx 0;
.p {
position: relative;
padding: 10rpx 0;
.lb {
position: absolute;
left: 0;
top: 10rpx;
z-index: 9;
width: 150rpx;
height: auto;
.text {
padding-left: 6rpx;
font-size: 28rpx;
line-height: 40rpx;
color: #666666;
}
}
.vl {
padding-left: 120rpx;
font-size: 28rpx;
line-height: 40rpx;
color: #666666;
}
}
}
.main {
padding: 10rpx 0;
font-size: 26rpx;
line-height: 40rpx;
text-align: center;
color: #666666;
}
.link {
width: 140rpx;
height: 60rpx;
font-size: 24rpx;
line-height: 60rpx;
text-align: center;
color: #ffffff;
background: #A92924;
}
}
</style>