1、新增旧货市场

2、新增用户等级
This commit is contained in:
2023-12-10 14:53:07 +08:00
parent a45d185c64
commit 17b2d8f117
112 changed files with 10795 additions and 6362 deletions
+1156 -1158
View File
File diff suppressed because it is too large Load Diff
+421
View File
@@ -0,0 +1,421 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="page-nav">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item>
<navigator style="display: inline-block;" url="/pages/old">旧货交易</navigator>
</el-breadcrumb-item>
<el-breadcrumb-item>旧货详情</el-breadcrumb-item>
</el-breadcrumb>
</view>
<view class="page-main" v-if="sheet">
<view class="flex justify-between items-center">
<text class="text-gray">发布时间:{{ sheet._add_time_str }}</text>
</view>
<view class="my-25 flex justify-between items-center">
<!-- <view class="flex justify-start items-center">-->
<!-- <text class="text-40 font-bold">{{ sheet.title }}</text>-->
<!-- <view class="ml-20 flex justify-start items-center">-->
<!-- <building-one theme="outline" size="24" fill="#a92924" strokeLinecap="square"/>-->
<!-- <view class="text-main ">-->
<!-- <text class="mx-20">{{-->
<!-- (sheet.quoteList && sheet.quoteList.length > 0) ? sheet.quoteList.length : 0-->
<!-- }}-->
<!-- </text>-->
<!-- <text>家已报价</text>-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<view class="flex justify-end items-end"
v-if="sheet.expiredTime && dayjs().diff(dayjs(sheet.expiredTime), 'second') > 0">
<text>距离报价结束还有:</text>
<view class="border-main countdown text-main">{{
dayjs().diff(dayjs(sheet.expiredTime), 'day')
}}
</view>
<text>天</text>
<view class="border-main countdown text-main">
{{ (dayjs().diff(dayjs(sheet.expiredTime), 'hour')) % 24 }}
</view>
<text>时</text>
</view>
</view>
<view class="my-25 flex justify-between items-center pb-20 border-bottom">
<view class="flex justify-start items-center">
<id-card theme="outline" size="24" fill="#a92924" strokeLinecap="square"/>
<text class="ml-15 text-gray">
{{
sheet.supplier.companyName
}}
</text>
</view>
<!-- <el-button type="primary" @click.native="toQuote"-->
<!-- v-if="vk.getVuex('$user.userInfo._id') !== sheet.userId && sheet.status === 0">我要报价-->
<!-- </el-button>-->
<!-- <el-button type="primary" @click.native="showDialog = true"-->
<!-- v-else-if="vk.getVuex('$user.userInfo._id') === sheet.userId">查看收到的申请报价-->
<!-- </el-button>-->
</view>
<view class="item-wrap" v-if="sheet.files && sheet.files.length > 0">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
实物
</view>
</view>
</view>
<view class="mt-15 mr-15" v-for="(item, index) in sheet.files" :key="index">
<el-image :src="item" style="width: 100px; height: 100px" fit="cover"
:preview-src-list="sheet.files"/>
</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
详情
</view>
</view>
</view>
<view class="mt-15">{{ sheet.desc }}</view>
</view>
<!-- <view class="item-wrap">-->
<!-- <view class="form-title-wrap">-->
<!-- <view class="goods-sheet-title">-->
<!-- <view class="form-title">-->
<!-- 纳税和税票-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<!-- <view class="mt-15">是否含税:{{ sheet.invoice ? '含税' : '不含税' }}</view>-->
<!-- <view class="mt-15">开票时间:{{ WRITE_INVOICE_TIME[sheet.writeInvoiceTime] }}</view>-->
<!-- <view class="mt-15">发票种类:{{ INVOICE_TYPE[sheet.invoiceType] }}</view>-->
<!-- <view class="mt-15">其他要求:{{ sheet.invoiceOther }}</view>-->
<!-- </view>-->
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
交易说明
</view>
</view>
</view>
<view class="mt-15">付款方式:{{ sheet.payMethod }}</view>
<!-- <view class="mt-15">报价形式:{{ sheet.offerType === 0 ? '整单报价' : '可分项报价' }}</view>-->
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
简易合同备注和其他补充条款
</view>
</view>
</view>
<view class="mt-15">违约责任:</view>
<view class="mt-15">
1.乙方所交产品品种、型号、规格、质量不符合规定的,如果甲方同意利用,应当按质论价;如果甲方不能利用的,应根据产品的具体情况,由乙方负责包换或包修,并承担修理、调换或退货而支付的实际费用;2.乙方不予供货违约责任为甲方的实际损失+违约金,如乙方材料符合订货标准,甲方不能退货和不收货,甲方无条件应按实际本合同订货数量支付100%货款,并支付乙方因此产生的实际费用。带有甲乙双方单位相关收货人和发货人签字的本合同的发货清单事项和内容均视为本合同的补充合同,与本合同有相同的法律效力,双方应共同遵照执行。
</view>
<view class="mt-15">解决纠纷的方法:</view>
<view class="mt-15">
1、凡因本合同引起的或与本合同有关的任何争议,均可友好协商或仲裁解决,协商或仲裁不成的,双方协商同意在合同签订地人民法院管辖地起诉,违约一方或对合同争议承担主要责任的一方,应承担对方因仲裁和起诉而产生的全部律师代理费、鉴定(检验)费、诉讼保全费、诉讼保险费、公告费、差旅费、执行费、误工費和获取证据产生费用等其他相关费用。2、双方本合同相关权利放弃均应有双方书面作出并加盖公章或授权委托人签字后生效。
</view>
<view class="mt-15">不可抗力:</view>
<view class="mt-15">
甲乙双方的任何一方由于不可抗力或突发公共事件的原因不能履行合同时,应及时向对方通报不能履行或不能完全履行的理由,以减轻可能给对方造成的损失,在取得有关机构证明以后,允许延期履行、部分履行或者不履行合同,并根据情况可部分或全部免予承担违约责任。
</view>
<view class="mt-15">其他:</view>
<view class="mt-15">
本合同的全部内容由双方平等共同协商一致,共同起草制定,非一方事先拟定,不属于格式条款。本合同自双方签字盖章后生效(包括电子签字、盖章),按本合同内容地址、联系方式寄送的一切文书、函件送达与否,均为视为送达有法律效力,通知途径和本合同内联系方式或地址送达文件双方均予以验证。
</view>
<view class="mt-15">采购方补充条款: 供货方逾期供货承担采购方一切损失</view>
<view class="mt-15"> 供应方补充条款:</view>
</view>
<!-- <view class="item-wrap">-->
<!-- <view class="form-title-wrap">-->
<!-- <view class="goods-info-title">-->
<!-- <view class="form-title">-->
<!-- 已收到的加工申请-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<!-- &lt;!&ndash; 报价列表 &ndash;&gt;-->
<!-- <vk-data-table :data="sheet.quoteList" :columns="table1.columns" title="adasda "-->
<!-- :customRightBtns="table1.customRightBtns"></vk-data-table>-->
<!-- </view>-->
</view>
<common-footer></common-footer>
<!-- <el-dialog :visible.sync="showDialog" width="70%" :show-close="false">-->
<!-- <view slot="title" class="text-main text-40 m-30 flex justify-between items-center">-->
<!-- <text>收到的报价</text>-->
<!-- <el-button type="primary" @click.native="showDialog = false">关闭</el-button>-->
<!-- </view>-->
<!-- <view class="mt-15">-->
<!-- <view class="request-header">-->
<!-- <text class="flex-1">供应商</text>-->
<!-- <text class="flex-1">报价时间</text>-->
<!-- <text class="flex-1">联系方式</text>-->
<!-- <text class="flex-1">报价</text>-->
<!-- <text class="flex-1">操作</text>-->
<!-- </view>-->
<!-- <view class="quote" v-for="(item, index) in sheet.quoteList" :key="index">-->
<!-- <text class="flex-1">{{ item.subjectName }}</text>-->
<!-- <text class="flex-1">{{ item._add_time_str }}</text>-->
<!-- <text class="flex-1">{{ item.subjectMobile }}</text>-->
<!-- <text class="flex-1">{{ item.totalPrice }}元</text>-->
<!-- <text class="flex-1">-->
<!-- <el-button type="primary" v-if="sheet.status === 0">选择</el-button>-->
<!-- </text>-->
<!-- </view>-->
<!-- </view>-->
<!-- </el-dialog>-->
</view>
</template>
<script>
import {BuildingOne, IdCard} from "@icon-park/vue";
import dayjs from "dayjs";
import {WRITE_INVOICE_TIME, INVOICE_TYPE, PROCESS_PAY_METHOD} from '@/util'
export default {
components: {BuildingOne, IdCard},
data() {
return {
WRITE_INVOICE_TIME,
INVOICE_TYPE,
PROCESS_PAY_METHOD,
id: undefined,
showDialog: false,
productList: [],
sheetTitle: '',
sheet: {
user: {},
productList: [],
transportDocuments: []
},
table1: {
// 表格数据
data: [],
// 表格字段显示规则
columns: [{
key: "subjectName",
title: "供应商",
type: "text",
width: 300,
formatter: (val, row, column, index) => {
if (vk.getVuex('$user.userInfo._id') == this.sheet.userId) {
return val
}
if (row.accountType == 1) {
return vk.pubfn.hidden(val, 1, 1);
} else {
return vk.pubfn.hidden(val, 2, 4);
}
}
},
{
key: "_add_time_str",
title: "报价时间",
type: "text",
width: 200
},
{
key: "subjectMobile",
title: "联系方式",
type: "text",
width: 120,
formatter: (val, row, column, index) => {
let str = val
if (row.managerMobile) {
str = row.managerMobile
}
if (vk.getVuex('$user.userInfo._id') == this.sheet.userId) {
return str
}
return vk.pubfn.hidden(str, 3, 4);
}
},
{
key: "totalPrice",
title: "报价",
type: "textarea",
width: 130,
formatter: (val, row, column, index) => {
let str = val
if (row.managerMobile) {
str = row.managerMobile
}
if (vk.getVuex('$user.userInfo._id') == this.sheet.userId) {
return val
}
return "******";
}
},
],
customRightBtns: [
{
title: '合同',
type: 'primary',
icon: 'el-icon-search',
show: (row) => {
return vk.getVuex('$user.userInfo._id') == this.sheet.userId && row.status == 1
},
onClick: (item) => {
vk.navigateTo('/pages/contract/index');
},
},
{
title: '选择',
type: 'primary',
icon: 'el-icon-search',
show: (row) => {
return vk.getVuex('$user.userInfo._id') == this.sheet.userId && row.status == 0
},
onClick: (item) => {
vk.callFunction({
url: 'client/enquiry/quote/kh/confirmQuote',
title: '请求中...',
data: {
quoteId: item._id,
},
success: (data) => {
vk.navigateTo('/pages/contract/index');
}
});
},
},
{
title: '查看报价详情',
type: 'primary',
icon: 'el-icon-search',
disabled: (item) => {
return vk.getVuex('$user.userInfo._id') != this.sheet.userId
},
onClick: (item) => {
this.showDialog = true
}
},
]
},
};
},
onLoad(options = {}) {
const {
id
} = options
if (!id) {
vk.navigateTo('/pages/enquiry/list');
return
}
this.id = id
this.getDetail()
},
methods: {
dayjs,
/**
* 获取询价单详情
*/
getDetail() {
vk.callFunction({
url: 'client/old/pub/getDetail',
title: '请求中...',
data: {
id: this.id
},
success: (res) => {
this.sheet = res
}
});
}
}
}
</script>
<style lang="scss" scoped>
@import "@/common/css/app.scss";
.page-main {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
border-radius: 5px;
}
.countdown {
padding: 2px 5px;
margin: 0 5px;
}
.item-wrap {
margin: 24px 0;
.form-title-wrap {
display: flex;
align-items: center;
justify-content: space-between;
.goods-info-title {
display: flex;
align-items: center;
justify-content: flex-start;
}
.form-title {
padding-left: 10px;
color: $--color-primary;
font-size: 18px;
line-height: 18px;
border-left: 4px solid $--color-primary;
}
}
}
.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>
+35 -28
View File
@@ -88,50 +88,48 @@
<view class="goods-list">
<view v-for="(item, index) in goodsData.rows" :key="index" class="goods">
<view class="goods-info">
<el-image src="https://oss.wsdns.cn/20231204/d35332fa6a3b4596b522edf9527ac612.png"
class="goods-img"/>
<!-- <el-image src="https://oss.wsdns.cn/20231204/d35332fa6a3b4596b522edf9527ac612.png"-->
<!-- class="goods-img"/>-->
<view class="info">
<view class="goods-name">高强螺栓 2000套</view>
<view class="goods-name pointer" @click="navTo(`/pages/index/old/detail?id=${item._id}`)">{{ item.title }}</view>
<view class="field">
<view class="desc">
<view class="text">企 业</view>
<view>广西聚钱财实业有限公司</view>
<view>{{ item.buyer.companyName }}</view>
</view>
<view class="desc"></view>
<view class="desc">
<view class="text">所属分类</view>
<view>成品钢材</view>
<view>{{ item.category }}</view>
</view>
<view class="desc">
<view class="text">发布时间</view>
<view>2022-09-30</view>
<view>{{ item._add_time_str }}</view>
</view>
<view class="desc">
<view class="text">所在地区</view>
<view>广西壮族自治区-河池市</view>
<view>{{ item.addressStr }}</view>
</view>
<view class="desc">
<view class="text">有效日期</view>
<view>2022-09-30</view>
<view>{{ item.expiredTime }}</view>
</view>
</view>
</view>
</view>
<view class="buttons">
<button type="default" class="btn"
@click="vk.navigateTo('/pages/spot/goods/detail?id=' + item._id);" plain>查看电话
<button type="default" class="btn" plain @click="showCntract(item)">查看电话
</button>
<button type="default" class="btn green"
@click="vk.navigateTo('/pages/spot/goods/detail?id=' + item._id);" plain>添加微信
<button type="default" class="btn green" plain>添加微信
</button>
<button type="default" class="btn"
@click="vk.navigateTo('/pages/spot/goods/detail?id=' + item._id);" plain>向此卖家询价
<button type="default" class="btn" plain>向此卖家询价
</button>
</view>
</view>
<view class="paginatio">
<el-pagination @current-change="search" background layout="prev, pager, next" :total="goodsData.total">
<el-pagination @current-change="search" background layout="prev, pager, next" :total="goodsData.total"
:page-size="pageSize">
</el-pagination>
</view>
</view>
@@ -141,6 +139,7 @@
<script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import dayjs from "dayjs";
export default {
data() {
@@ -156,9 +155,14 @@ export default {
total: 0,
rows: []
},
showAllProvince: false
showAllProvince: false,
type: 0,
pageSize: 20,
};
},
onLoad(option) {
if (option.type) this.type = option.type
},
onShow() {
this.search(1)
vk.callFunction({
@@ -177,6 +181,11 @@ export default {
});
},
methods: {
navTo(url) {
vk.navigateTo({
url
})
},
selectCate(id) {
const index = this.checkCategoryList.indexOf(id)
if (index === -1) this.checkCategoryList.push(id)
@@ -220,7 +229,7 @@ export default {
})
} else {
vk.navigateTo({
url: '/pages/spot/release/release'
url: '/pages/index/old/release'
})
}
},
@@ -248,30 +257,28 @@ export default {
})
} else {
vk.navigateTo({
url: '/pages/spot/goods/my'
url: '/pages/index/old/my'
})
}
},
search(pageIndex) {
vk.callFunction({
url: 'client/spot/goods/pub/getList',
url: 'client/old/pub/getList',
data: {
pageIndex: pageIndex,
pageSize: 20,
pageIndex,
pageSize: this.pageSize,
keyword: this.keyword,
type: this.type,
categoryIds: this.checkCategoryList,
provinceCodes: this.checkProvinceList
},
success: (data) => {
console.log('data: ', data);
data.rows.forEach(item => {
try {
item.addressStr = item.address.province.name + "-" + item.address.city
.name + "-" + item.address.area.name
} catch (err) {
item.addressStr = ""
}
data.rows.map(item => {
item.addressStr = item.addressRegion[0].name + "-" + item.addressRegion[1].name
item.expiredTime = dayjs(item.expiredTime).format('YYYY-MM-DD')
return item
})
this.goodsData = data
}
+231 -8
View File
@@ -1,13 +1,236 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<!-- <view class="page-nav">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item><navigator url="/pages/spot/goods/goods">现货市场</navigator></el-breadcrumb-item>
</el-breadcrumb>
</view> -->
<view class="carousel">
<el-carousel height="170px">
<el-carousel-item v-for="item in 4" :key="item">
<image class="carousel-img"
src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"
mode="aspectFill"></image>
</el-carousel-item>
</el-carousel>
<view class="goods-options">
<el-row class="">
<el-button @click="toRelease" type="primary" round>发布旧货交易</el-button>
<!-- <el-button type="primary" round plain>我发布的询价单</el-button> -->
</el-row>
</view>
</view>
<!-- 商品列表 -->
<view class="sheet-list">
<vk-data-table ref="table1" :action="table1.action" :columns="table1.columns" :customRightBtns="table1.customRightBtns"
:pagination="true" :query-form-param="queryForm1"></vk-data-table>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
name: "my",
data() {
return {}
},
methods: {}
}
</script>
export default {
data() {
return {
keyword: '',
// 表格相关开始 -----------------------------------------------------------
queryForm1: {
formData: {
userId: vk.getVuex('$user.userInfo._id')
},
columns: [
{ key:"userId", title:"发布人ID", type:"text", width:160, mode:"=" },
]
},
table1: {
// 表格数据请求地址
action: "client/old/kh/getList",
customRightBtns: [
{
title: '详情',
icon: 'el-icon-search',
type: 'primary',
onClick: (item) => {
vk.navigateTo('/pages/index/old/detail?id=' + item._id);
}
},
{
title: '删除',
icon: 'el-icon-delete',
type: 'primary',
onClick: (item) => {
this.$confirm('').then(()=> {
}).then(() => {
vk.callFunction({
url: 'client/old/kh/delete',
title: '请求中...',
data: {
id: item._id
},
}).then(res => {
this.$refs.table1.refresh()
})
})
}
},
],
// 表格字段显示规则
columns: [
{
key: "标题",
title: "title",
type: "text",
width: 280
},
{
key: "productList",
title: "所在地",
type: "text",
minWidth: 200,
formatter: (val, row, column, index) => {
let str = ""
try {
str = val.map(item=>{
return item.addressRegion[0].name + "-" + item.addressRegion[1].name
}).join("/")
} catch(err){
str = ""
}
return str
}
},
{
key: "supplier.companyName",
title: "供应商",
type: "text",
},
{
key: "_add_time_srt",
title: "添加时间",
type: "time",
width: 160
},
],
// 多选框选中的值
multipleSelection: [],
// 当前高亮的记录
selectItem: "",
},
// 表格相关结束 -----------------------------------------------------------
};
},
onLoad() {
},
methods: {
toRelease() {
if (!vk.getVuex('$user.userInfo.fadadaConfirm')) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.getCertUrl()
})
} else if (vk.pubfn.isNull(vk.getVuex('$user.userInfo.businessCard'))) {
this.$confirm('请完善名片信息', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=business-card');
})
} else {
uni.navigateTo({
url: '/pages/index/old/release'
})
}
},
},
computed: {
checkCategoryArr() {
let arr = []
this.checkCategoryList.forEach(item => {
arr.push(...item)
})
this.checkProvinceList.forEach(item => {
arr.push({
...item
})
})
return arr
}
}
}
</script>
<style lang="scss" scoped>
.carousel {
width: 1200px;
margin: 20px auto;
}
.carousel-img {
width: 100%;
height: 100%;
}
.goods-options {
background-color: #FFFFFF;
padding: 20px;
}
.filter-outer {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
}
.tags {
display: flex;
.el-tag {
margin-right: 10px;
}
}
.sheet-list {
width: 1200px;
margin: 20px auto;
// display: flex;
}
.paginatio {
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
}
</style>
+42 -71
View File
@@ -13,26 +13,27 @@
<view class="goods-options">
<el-row class="">
<el-button @click="navTo('/pages/index/old/release')" type="primary" round>发布旧货交易</el-button>
<el-button @click="toMy" type="primary" round plain class="empty-bg-plain-btn">我发布的信息
<el-button @click="navTo('/pages/index/old/my')" type="primary" round plain
class="empty-bg-plain-btn">我发布的信息
</el-button>
</el-row>
</view>
</view>
<view class="nav-tool">
<view class="btn">
<view class="btn pointer" @click="navTo('/pages/index/old/list/list')">
<image src="https://oss.wsdns.cn/20231204/bbd54039c69e4d0292c6889bce0ac088.png" mode="widthFix"/>
<text>拍卖信息</text>
</view>
<view class="btn">
<view class="btn pointer" @click="navTo('/pages/index/old/list/list?type=1')">
<image src="https://oss.wsdns.cn/20231204/bbd54039c69e4d0292c6889bce0ac088.png" mode="widthFix"/>
<text>采购信息</text>
</view>
<view class="btn">
<view class="btn pointer" @click="navTo('/pages/index/old/list/list?type=2')">
<image src="https://oss.wsdns.cn/20231204/bbd54039c69e4d0292c6889bce0ac088.png" mode="widthFix"/>
<text>租赁信息</text>
</view>
<view class="btn">
<view class="btn pointer" @click="navTo('/pages/index/old/list/list?type=3')">
<image src="https://oss.wsdns.cn/20231204/bbd54039c69e4d0292c6889bce0ac088.png" mode="widthFix"/>
<text>物资回收信息</text>
</view>
@@ -79,66 +80,20 @@
</view>
<view class="news-gg">
<el-row class="wrap" type="flex" :gutter="0" justify="space-between">
<el-col :span="12">
<el-col :span="12" v-for="(item, index) in Math.ceil(noticeList.length / 3)" :key="index">
<view class="item">
<view class="new-avatar">
<el-image class="image"
src="http://jyx.gxwebsoft.com/public/index/images/%E5%90%8E%E5%8F%B0%E4%B8%8A%E4%BC%A08.jpg"/>
<el-image class="image" fit="cover"
:src="noticeList[index].cover[0]"/>
</view>
<view class="list3">
<view class="text"><span>[南宁]</span> 标题标题标题标题标题标题标题标题标题标题...
</view>
<view class="text"><span>[南宁]</span> 标题标题标题标题标题标题标题标题标题标题...
</view>
<view class="text"><span>[南宁]</span> 标题标题标题标题标题标题标题标题标题标题...
</view>
</view>
</view>
</el-col>
<el-col :span="12">
<view class="item">
<view class="new-avatar">
<el-image class="image"
src="http://jyx.gxwebsoft.com/public/index/images/%E5%90%8E%E5%8F%B0%E4%B8%8A%E4%BC%A08.jpg"/>
</view>
<view class="list3">
<view class="text"><span>[南宁]</span> 标题标题标题标题标题标题标题标题标题标题...
</view>
<view class="text"><span>[南宁]</span> 标题标题标题标题标题标题标题标题标题标题...
</view>
<view class="text"><span>[南宁]</span> 标题标题标题标题标题标题标题标题标题标题...
</view>
</view>
</view>
</el-col>
<el-col :span="12">
<view class="item">
<view class="new-avatar">
<el-image class="image"
src="http://jyx.gxwebsoft.com/public/index/images/%E5%90%8E%E5%8F%B0%E4%B8%8A%E4%BC%A08.jpg"/>
</view>
<view class="list3">
<view class="text"><span>[南宁]</span> 标题标题标题标题标题标题标题标题标题标题...
</view>
<view class="text"><span>[南宁]</span> 标题标题标题标题标题标题标题标题标题标题...
</view>
<view class="text"><span>[南宁]</span> 标题标题标题标题标题标题标题标题标题标题...
</view>
</view>
</view>
</el-col>
<el-col :span="12">
<view class="item">
<view class="new-avatar">
<el-image class="image"
src="http://jyx.gxwebsoft.com/public/index/images/%E5%90%8E%E5%8F%B0%E4%B8%8A%E4%BC%A08.jpg"/>
</view>
<view class="list3">
<view class="text"><span>[南宁]</span> 标题标题标题标题标题标题标题标题标题标题...
</view>
<view class="text"><span>[南宁]</span> 标题标题标题标题标题标题标题标题标题标题...
</view>
<view class="text"><span>[南宁]</span> 标题标题标题标题标题标题标题标题标题标题...
<view v-for="(noticeItem, noticeIndex) in 3" :key="noticeIndex"
@click="navTo(`/pages/otherArticle/noticeDetail?id=${noticeList[index * 3 + noticeIndex]._id}`)">
<view class="text pointer" v-if="index * 3 + noticeIndex < noticeList.length">
<span>[{{ noticeList[index * 3 + noticeIndex].address.city.name }}]</span>
<text>{{ noticeList[index * 3 + noticeIndex].name }}</text>
<span class="ml-20">{{ noticeList[index * 3 + noticeIndex].addTime }}</span>
</view>
</view>
</view>
</view>
@@ -158,10 +113,11 @@
</el-button>
</div>
<view class="list8">
<view class="article" v-for="(item, index) in dataList[0]" :key="index">
<view class="article pointer" v-for="(item, index) in dataList[0]" :key="index"
@click="navTo(`/pages/index/old/detail?id=${item._id}`)">
<view class="title2" v-if="index < 3">
<span>[{{ item.addressRegion[1].name }}]</span>
<text class="line-1">{{ item.title }}</text>
<text class="line-1 ">{{ item.title }}</text>
</view>
<view class="date-time">{{ item.addDate }}</view>
</view>
@@ -173,14 +129,15 @@
<div slot="header" class="clearfix">
<span class="title">最新采购信息</span>
<el-button style="float: right; padding: 3px 0" type="text"
@click="navTo('/pages/index/old/list/list')">查看更多
@click="navTo('/pages/index/old/list/list?type=1')">查看更多
</el-button>
</div>
<view class="list8">
<view class="article" v-for="(item, index) in dataList[1]" :key="index">
<view class="article pointer" v-for="(item, index) in dataList[1]" :key="index"
@click="navTo(`/pages/index/old/detail?id=${item._id}`)">
<view class="title2" v-if="index < 3">
<span>[{{ item.addressRegion[1].name }}]</span>
<text class="line-1">{{ item.title }}</text>
<text class="line-1 ">{{ item.title }}</text>
</view>
<view class="date-time">{{ item.addDate }}</view>
</view>
@@ -192,11 +149,12 @@
<div slot="header" class="clearfix">
<span class="title">最新租赁信息</span>
<el-button style="float: right; padding: 3px 0" type="text"
@click="navTo('/pages/index/old/list/list')">查看更多
@click="navTo('/pages/index/old/list/list?type=2')">查看更多
</el-button>
</div>
<view class="list8">
<view class="article" v-for="(item, index) in dataList[2]" :key="index">
<view class="article pointer" v-for="(item, index) in dataList[2]" :key="index"
@click="navTo(`/pages/index/old/detail?id=${item._id}`)">
<view class="title2" v-if="index < 3">
<span>[{{ item.addressRegion[1].name }}]</span>
<text class="line-1">{{ item.title }}</text>
@@ -211,11 +169,12 @@
<div slot="header" class="clearfix">
<span class="title">最新物资回收信息</span>
<el-button style="float: right; padding: 3px 0" type="text"
@click="navTo('/pages/index/old/list/list')">查看更多
@click="navTo('/pages/index/old/list/list?type=3')">查看更多
</el-button>
</div>
<view class="list8">
<view class="article" v-for="(item, index) in dataList[3]" :key="index">
<view class="article pointer" v-for="(item, index) in dataList[3]" :key="index"
@click="navTo(`/pages/index/old/detail?id=${item._id}`)">
<view class="title2" v-if="index < 3">
<span>[{{ item.addressRegion[1].name }}]</span>
<text class="line-1">{{ item.title }}</text>
@@ -300,7 +259,8 @@ export default {
title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
}
],
dataList: []
dataList: [],
noticeList: [],
};
},
onLoad(options) {
@@ -309,6 +269,7 @@ export default {
}
this.getCompanyList()
this.getDataList()
this.getNoticeList()
},
methods: {
navTo(url) {
@@ -322,6 +283,15 @@ export default {
}
})
},
async getNoticeList() {
const {rows} = await vk.callFunction({
url: 'client/notice/list/pub/getList'
})
this.noticeList = rows.map(item => {
item.addTime = dayjs(item._add_time).format('MM-DD')
return item
})
},
async getCompanyList() {
const {rows} = await vk.callFunction({
url: 'client/user/pub/getCompany',
@@ -342,6 +312,7 @@ export default {
return item
})
}
console.log(this.dataList)
}
}
}
+1 -1
View File
@@ -95,7 +95,7 @@
</el-select>
</el-col>
<el-col :span="8">
<el-input v-model="form.addressDetail"
<el-input v-model="form.deliverAddressDetail"
placeholder="详细地址或几公里范围内"></el-input>
</el-col>
</el-row>
+212 -57
View File
@@ -8,60 +8,146 @@
<view class="bg-white p-40">
<view v-for="(item, index) in configList" :key="index"
class="my-20 flex flex-col justify-start items-start">
<el-checkbox @change="changeCheck(index)">
<view class="flex flex-col justify-start items-start">
<view class="flex justify-start items-center text-35 mb-20">
<text>服务内容:{{ item.name }}</text>
<view class="ml-35">
<text>业务编号:</text>
<text v-if="item.contentIndex !== null">{{
item.contents[item.contentIndex].code
}}
</text>
<view class="flex flex-col justify-start items-start">
<view class="flex justify-start items-center text-35 mb-20">
<text>服务内容:{{ item.name }}</text>
<view class="flex flex-col justify-start items-start">
<view v-for="(content, contentIndex) in item.contents" :key="contentIndex"
class="mb-40 flex justify-start items-center">
<view class="ml-35">
<text>业务编号:</text>
<text>{{ content.code }}</text>
</view>
<view class="flex justify-start items-center">
<text class="ml-35">服务服务项目:</text>
<el-checkbox v-model="configList[index].contents[contentIndex].checked"
:disabled="!content.amountList || content.amountList.length === 0">
{{ content.title }}
</el-checkbox>
</view>
<view class="flex justify-start items-center ml-35">
<el-select v-model="configList[index].contents[contentIndex].amountIndex"
clearable @change="selectAmount(index, contentIndex, $event)"
:disabled="!content.amountList || content.amountList.length === 0">
<el-option v-for="(amount, amountIndex) in content.amountList"
:key="amountIndex"
:label="amount.title" :value="amountIndex"/>
</el-select>
<text class="ml-35" v-if="content.amountIndex !== null">
{{ content.amountList[content.amountIndex].amount }}元/次
</text>
</view>
</view>
<view class="flex justify-start items-center">
<text class="ml-35">服务服务项目:</text>
<el-select v-model="configList[index].contentIndex" clearable>
<el-option v-for="(content, contentIndex) in item.contents" :key="contentIndex"
:label="content.title" :value="contentIndex"/>
</el-select>
</view>
<text class="ml-35" v-if="item.contentIndex !== null">
{{ item.contents[item.contentIndex].amount }}元/次
</text>
</view>
<view>备注: {{ item.remark }}</view>
</view>
</el-checkbox>
<view>备注: {{ item.remark }}</view>
</view>
</view>
<el-form ref="form" :model="form" label-width="200px">
<view v-for="(item, index) in companyList" :key="index">
<view v-for="(item, companyIndex) in companyList" :key="companyIndex">
<el-form-item label="考察对象(个人/企业全称):" required>
<el-input v-model="companyList[index].name"/>
<el-input v-model="companyList[companyIndex].name"/>
</el-form-item>
<el-form-item label="考察对象(个人身份证/企业信用代码):">
<el-input v-model="companyList[index].code"/>
<el-input v-model="companyList[companyIndex].code"/>
</el-form-item>
<el-form-item label="考察对象(个人/单位)所在地:">
<el-input v-model="companyList[index].address"/>
<el-row :gutter="10">
<el-col :span="4">
<el-select v-model="addressIndex[companyIndex][0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[companyIndex][1]" placeholder="请选择市"
:disabled="addressIndex[companyIndex].length === 0">
<template v-if="addressIndex[companyIndex][0] !== null">
<el-option v-for="(item, index) in cityData[addressIndex[companyIndex][0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[companyIndex][2]" placeholder="请选择区"
:disabled="addressIndex[companyIndex].length === 1">
<template
v-if="addressIndex[companyIndex][0] !== null && addressIndex[companyIndex][1] !== null">
<el-option
v-for="(item, index) in areaData[addressIndex[companyIndex][0]][addressIndex[companyIndex][1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="11">
<el-input v-model="companyList[companyIndex].address" placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="接收文件电子邮箱:">
<el-input v-model="companyList[index].email"/>
<el-input v-model="companyList[companyIndex].email"/>
</el-form-item>
<el-form-item label="接收文件微信:">
<el-input v-model="companyList[index].wechat"/>
<el-input v-model="companyList[companyIndex].wechat"/>
</el-form-item>
<el-form-item label="接收文件寄件地址">
<el-input v-model="companyList[index].receiveAddress"/>
<el-row :gutter="10">
<el-col :span="4">
<el-select v-model="receiveAddressIndex[companyIndex][0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[companyIndex][1]" placeholder="请选择市"
:disabled="receiveAddressIndex[companyIndex].length === 0">
<template v-if="receiveAddressIndex[companyIndex][0] !== null">
<el-option
v-for="(item, index) in cityData[receiveAddressIndex[companyIndex][0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[companyIndex][2]" placeholder="请选择区"
:disabled="receiveAddressIndex[companyIndex].length === 1">
<template
v-if="receiveAddressIndex[companyIndex][0] !== null && receiveAddressIndex[companyIndex][1] !== null">
<el-option
v-for="(item, index) in areaData[receiveAddressIndex[companyIndex][0]][receiveAddressIndex[companyIndex][1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="11">
<el-input v-model="companyList[companyIndex].receiveAddress" placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="申请人:">
<el-input v-model="companyList[index].requestName"/>
<el-input v-model="companyList[companyIndex].requestName"/>
</el-form-item>
<el-form-item label="联系人:">
<el-input v-model="companyList[index].contactName"/>
<el-input v-model="companyList[companyIndex].contactName"/>
</el-form-item>
<el-form-item label="联系方式:">
<el-input v-model="companyList[index].contact"/>
<el-input v-model="companyList[companyIndex].contact"/>
</el-form-item>
<el-form-item label="本次服务费用小计:">
<view class="flex justify-between items-start mb-20 w-100p">
@@ -72,7 +158,7 @@
</el-button>
</view>
<view class="ml-20">
<el-button type="primary" plain @click.native="removeCompany(index)"
<el-button type="primary" plain @click.native="removeCompany(companyIndex)"
class="ml-20"
:disabled="companyList.length === 1">删除该对象
</el-button>
@@ -91,18 +177,21 @@
</view>
<view class="mt-40 flex justify-center items-center">
<el-button type="primary" @click="newOrder"
:disabled="contentList.length === 0 || companyList.length === 0 || !companyList[0].name">
:disabled="companyList.length === 0 || !companyList[0].name">
立即支付
</el-button>
</view>
</view>
</view>
<gap></gap>
<gap/>
<common-footer></common-footer>
</view>
</template>
<script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
import Gap from "../../../components/gap/gap.vue";
export default {
@@ -110,6 +199,9 @@ export default {
components: {Gap},
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
list: [
{
image: '/static/images/selfSupport/swiper.jpg',
@@ -121,13 +213,27 @@ export default {
checkList: [],
contentList: [],
contentNameList: [],
addressIndex: [[null, null, null]],
addressDetail: '',
receiveAddressIndex: [[null, null, null]],
receiveAddressDetail: '',
companyList: [
{
name: '',
code: '',
addressRegion: {
province: null,
city: null,
area: null,
},
address: '',
email: '',
wechat: '',
receiveAddressRegion: {
province: null,
city: null,
area: null,
},
receiveAddress: '',
requestName: '',
contactName: '',
@@ -144,45 +250,88 @@ export default {
})
if (rows) {
this.configList = rows.map(item => {
item.contentIndex = null
item.contents.map(content => {
content.checked = false
content.amountIndex = null
return content
})
return item
})
}
},
changeCheck(itemIndex) {
const index = this.contentList.indexOf(itemIndex)
if (index === -1) {
this.contentList.push(itemIndex)
} else {
this.contentList.splice(index, 1)
}
},
addCompany() {
this.companyList.push({
name: '',
code: '',
addressRegion: {
province: null,
city: null,
area: null,
},
address: '',
email: '',
wechat: '',
receiveAddressRegion: {
province: null,
city: null,
area: null,
},
receiveAddress: '',
requestName: '',
contactName: '',
contact: '',
})
this.addressIndex.push([null, null, null])
this.receiveAddressIndex.push([null, null, null])
},
removeCompany() {
removeCompany(index) {
this.companyList.splice(index, 1)
this.addressIndex.splice(index, 1)
this.receiveAddressIndex.splice(index, 1)
},
async newOrder(){
const {data} = await vk.callFunction({
url: 'client/order/kh/addFromList',
data: {
type: 1,
list: [
]
async newOrder() {
const amountList = []
this.configList.forEach(item => {
item.contents.forEach(content => {
if (content.checked && content.amountList.length > 0) {
content.amountList.forEach((amount, amountIndex) => {
if (amountIndex === content.amountIndex) {
amountList.push(amount._index)
}
})
}
})
})
if (amountList.length === 0) return this.$message({
message: '请至少选择一项服务',
type: 'error'
})
this.companyList.forEach((item, index) => {
this.companyList[index].addressRegion = {
province: this.provinceData[this.addressIndex[index][0]],
city: this.cityData[this.addressIndex[index][0]][this.addressIndex[index][1]],
area: this.areaData[this.addressIndex[index][0]][this.addressIndex[index][1]][this.addressIndex[index][2]],
}
this.companyList[index].receiveAddressRegion = {
province: this.provinceData[this.receiveAddressIndex[index][0]],
city: this.cityData[this.receiveAddressIndex[index][0]][this.receiveAddressIndex[index][1]],
area: this.areaData[this.receiveAddressIndex[index][0]][this.receiveAddressIndex[index][1]][this.receiveAddressIndex[index][2]],
}
})
const {data} = await vk.callFunction({
url: 'client/selfSupport/kh/addOrder',
data: {
type: 0,
amountList,
contentList: this.companyList
}
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
},
selectAmount(index, contentIndex, e) {
console.log(index, contentIndex, e)
}
},
onLoad() {
@@ -191,10 +340,16 @@ export default {
computed: {
amount() {
let tmpAmount = 0
this.configList.forEach((item, index) => {
if (this.contentList.indexOf(index) !== -1 && item.contentIndex !== null) {
tmpAmount += parseFloat(item.contents[item.contentIndex].amount)
}
this.configList.forEach(item => {
item.contents.forEach(content => {
if (content.checked && content.amountList.length > 0) {
content.amountList.forEach((amount, amountIndex) => {
if (amountIndex === content.amountIndex) {
tmpAmount += parseFloat(amount.amount)
}
})
}
})
})
return tmpAmount
},
+224 -50
View File
@@ -8,71 +8,159 @@
<view class="bg-white p-40">
<view v-for="(item, index) in configList" :key="index"
class="my-20 flex flex-col justify-start items-start">
<el-checkbox @change="changeCheck(index)">
<view class="flex flex-col justify-start items-start">
<view class="flex justify-start items-center text-35 mb-20">
<text>服务内容:{{ item.name }}</text>
<view class="ml-35">
<text>业务编号:</text>
<text v-if="item.contentIndex !== null">{{
item.contents[item.contentIndex].code
}}
</text>
<view class="flex flex-col justify-start items-start">
<view class="flex justify-start items-center text-35 mb-20">
<text>服务内容:{{ item.name }}</text>
<view class="flex flex-col justify-start items-start">
<view v-for="(content, contentIndex) in item.contents" :key="contentIndex"
class="mb-40 flex justify-start items-center">
<view class="ml-35">
<text>业务编号:</text>
<text>{{ content.code }}</text>
</view>
<view class="flex justify-start items-center">
<text class="ml-35">服务服务项目:</text>
<el-checkbox v-model="configList[index].contents[contentIndex].checked"
@change="selectContent(content)"
:disabled="!content.amountList || content.amountList.length === 0">
{{ content.title }}
</el-checkbox>
</view>
<view class="flex justify-start items-center ml-35">
<el-select v-model="configList[index].contents[contentIndex].amountIndex"
clearable
:disabled="!content.amountList || content.amountList.length === 0">
<el-option v-for="(amount, amountIndex) in content.amountList"
:key="amountIndex"
:label="amount.title" :value="amountIndex"/>
</el-select>
<text class="ml-35" v-if="content.amountIndex !== null">
{{ content.amountList[content.amountIndex].amount }}元/次
</text>
</view>
</view>
<view class="flex justify-start items-center">
<text class="ml-35">服务服务项目:</text>
<el-select v-model="configList[index].contentIndex" clearable>
<el-option v-for="(content, contentIndex) in item.contents" :key="contentIndex"
:label="content.title" :value="contentIndex"/>
</el-select>
</view>
<text class="ml-35" v-if="item.contentIndex !== null">
{{ item.contents[item.contentIndex].amount }}元/次
</text>
</view>
<view>备注: {{ item.remark }}</view>
</view>
</el-checkbox>
<view>备注: {{ item.remark }}</view>
</view>
</view>
<el-form ref="form" :model="form" label-width="200px">
<view v-for="(item, index) in productList" :key="index">
<view v-for="(item, productIndex) in productList" :key="productIndex">
<el-form-item label="检测产品:" required>
<el-input v-model="productList[index].name"/>
<el-input v-model="productList[productIndex].name"/>
</el-form-item>
<el-form-item label="检测内容">
{{ contentNameList.join() }}
</el-form-item>
<el-form-item label="取样所在地">
<el-input v-model="productList[index].address"/>
<el-row :gutter="10">
<el-col :span="4">
<el-select v-model="addressIndex[productIndex][0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[productIndex][1]" placeholder="请选择市"
:disabled="addressIndex[productIndex].length === 0">
<template v-if="addressIndex[productIndex][0] !== null">
<el-option v-for="(item, index) in cityData[addressIndex[productIndex][0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[productIndex][2]" placeholder="请选择区"
:disabled="addressIndex[productIndex].length === 1">
<template
v-if="addressIndex[productIndex][0] !== null && addressIndex[productIndex][1] !== null">
<el-option
v-for="(item, index) in areaData[addressIndex[productIndex][0]][addressIndex[productIndex][1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="11">
<el-input v-model="productList[productIndex].address" placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="接收文件电子邮箱:">
<el-input v-model="productList[index].email"/>
<el-input v-model="productList[productIndex].email"/>
</el-form-item>
<el-form-item label="接收文件微信:">
<el-input v-model="productList[index].wechat"/>
<el-input v-model="productList[productIndex].wechat"/>
</el-form-item>
<el-form-item label="接收文件寄件地址">
<el-input v-model="productList[index].receiveAddress"/>
<el-row :gutter="10">
<el-col :span="4">
<el-select v-model="receiveAddressIndex[productIndex][0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[productIndex][1]" placeholder="请选择市"
:disabled="receiveAddressIndex[productIndex].length === 0">
<template v-if="receiveAddressIndex[productIndex][0] !== null">
<el-option
v-for="(item, index) in cityData[receiveAddressIndex[productIndex][0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[productIndex][2]" placeholder="请选择区"
:disabled="receiveAddressIndex[productIndex].length === 1">
<template
v-if="receiveAddressIndex[productIndex][0] !== null && receiveAddressIndex[productIndex][1] !== null">
<el-option
v-for="(item, index) in areaData[receiveAddressIndex[productIndex][0]][receiveAddressIndex[productIndex][1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="11">
<el-input v-model="productList[productIndex].receiveAddress" placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="申请人:">
<el-input v-model="productList[index].requestName"/>
<el-input v-model="productList[productIndex].requestName"/>
</el-form-item>
<el-form-item label="联系人:">
<el-input v-model="productList[index].contactName"/>
<el-input v-model="productList[productIndex].contactName"/>
</el-form-item>
<el-form-item label="联系方式:">
<el-input v-model="productList[index].contact"/>
<el-input v-model="productList[productIndex].contact"/>
</el-form-item>
<el-form-item label="本次服务费用小计:">
<view class="flex justify-between items-start mb-20 w-100p">
<view class="flex justify-start items-center">
<el-input v-model="amount" disabled/>
<view class="ml-20">
<el-button type="primary" @click.native="addCompany">增加考察对象
<el-button type="primary" @click.native="addProduct">增加考察对象
</el-button>
</view>
<view class="ml-20">
<el-button type="primary" plain @click.native="removeCompany(index)"
<el-button type="primary" plain @click.native="removeProduct(productIndex)"
class="ml-20"
:disabled="productList.length === 1">删除该对象
</el-button>
@@ -90,20 +178,30 @@
<view class="ml-35">客服联系方式: 0771-3923001</view>
</view>
<view class="mt-40 flex justify-center items-center">
<el-button type="primary" :disabled="contentList.length === 0 || productList.length === 0 || !productList[0].name">立即支付
<el-button type="primary" @click.native="newOrder"
:disabled="productList.length === 0 || !productList[0].name">
立即支付
</el-button>
</view>
</view>
</view>
<gap/>
<common-footer></common-footer>
</view>
</template>
<script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
export default {
name: "productQuote",
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
list: [
{
image: '/static/images/selfSupport/swiper.jpg',
@@ -115,13 +213,27 @@ export default {
checkList: [],
contentList: [],
contentNameList: [],
addressIndex: [[null, null, null]],
addressDetail: '',
receiveAddressIndex: [[null, null, null]],
receiveAddressDetail: '',
productList: [
{
name: '',
code: '',
addressRegion: {
province: null,
city: null,
area: null,
},
address: '',
email: '',
wechat: '',
receiveAddressRegion: {
province: null,
city: null,
area: null,
},
receiveAddress: '',
requestName: '',
contactName: '',
@@ -138,35 +250,91 @@ export default {
})
if (rows) {
this.configList = rows.map(item => {
item.contentIndex = null
item.contents.map(content => {
content.checked = false
content.amountIndex = null
return content
})
return item
})
}
},
changeCheck(itemIndex) {
const index = this.contentList.indexOf(itemIndex)
if (index === -1) {
this.contentList.push(itemIndex)
} else {
this.contentList.splice(index, 1)
}
},
addCompany() {
addProduct() {
this.productList.push({
name: '',
code: '',
addressRegion: {
province: null,
city: null,
area: null,
},
address: '',
email: '',
wechat: '',
receiveAddressRegion: {
province: null,
city: null,
area: null,
},
receiveAddress: '',
requestName: '',
contactName: '',
contact: '',
})
this.addressIndex.push([null, null, null])
this.receiveAddressIndex.push([null, null, null])
},
removeCompany() {
removeProduct(index) {
this.productList.splice(index, 1)
}
this.addressIndex.splice(index, 1)
this.receiveAddressIndex.splice(index, 1)
},
selectContent(content) {
const index = this.contentNameList.indexOf(content.title)
if (index === -1) this.contentNameList.push(content.title)
else this.contentNameList.splice(index, 1)
},
async newOrder() {
const amountList = []
this.configList.forEach(item => {
item.contents.forEach(content => {
if (content.checked && content.amountList.length > 0) {
content.amountList.forEach((amount, amountIndex) => {
if (amountIndex === content.amountIndex) {
amountList.push(amount._index)
}
})
}
})
})
if (amountList.length === 0) return this.$message({
message: '请至少选择一项服务',
type: 'error'
})
this.productList.forEach((item, index) => {
this.productList[index].addressRegion = {
province: this.provinceData[this.addressIndex[index][0]],
city: this.cityData[this.addressIndex[index][0]][this.addressIndex[index][1]],
area: this.areaData[this.addressIndex[index][0]][this.addressIndex[index][1]][this.addressIndex[index][2]],
}
this.productList[index].receiveAddressRegion = {
province: this.provinceData[this.receiveAddressIndex[index][0]],
city: this.cityData[this.receiveAddressIndex[index][0]][this.receiveAddressIndex[index][1]],
area: this.areaData[this.receiveAddressIndex[index][0]][this.receiveAddressIndex[index][1]][this.receiveAddressIndex[index][2]],
}
})
const {data} = await vk.callFunction({
url: 'client/selfSupport/kh/addOrder',
data: {
type: 1,
amountList,
contentList: this.productList
}
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
},
},
onLoad() {
this.getConfigList()
@@ -174,10 +342,16 @@ export default {
computed: {
amount() {
let tmpAmount = 0
this.configList.forEach((item, index) => {
if (this.contentList.indexOf(index) !== -1 && item.contentIndex !== null) {
tmpAmount += parseFloat(item.contents[item.contentIndex].amount)
}
this.configList.forEach(item => {
item.contents.forEach(content => {
if (content.checked && content.amountList.length > 0) {
content.amountList.forEach((amount, amountIndex) => {
if (amountIndex === content.amountIndex) {
tmpAmount += parseFloat(amount.amount)
}
})
}
})
})
return tmpAmount
},
+45 -38
View File
@@ -13,10 +13,14 @@
<view class="tool-bar">
<view class="search">
<text>交易区域:</text>
<el-cascader :options="options" :props="{label: 'name', value: 'code'}" v-model="address"/>
<el-cascader :options="options" :props="{label: 'name', value: 'code'}" v-model="address"
@change="getCompanyList" clearable/>
</view>
<view class="buy-btn">
<el-button type="primary" plain class="empty-bg-plain-btn" :disabled="address.length === 0">下单询价 ></el-button>
<el-button type="primary" plain class="empty-bg-plain-btn" :disabled="address.length === 0"
@click.native="dialogVisible = true">
下单询价>
</el-button>
</view>
</view>
<!-- 合作单位/联营单位-->
@@ -40,6 +44,15 @@
<gap height="50"/>
<right-bar></right-bar>
<common-footer></common-footer>
<el-dialog
title="下询价单"
:visible.sync="dialogVisible"
width="60%">
<vk-data-upload v-model="files" accept="*">
</vk-data-upload>
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="addFiles">确 定</el-button>
</el-dialog>
</view>
</template>
@@ -52,11 +65,14 @@ export default {
components: {UGap},
data() {
return {
dialogVisible: false,
address: [],
list: [{
image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
title: '昨夜星辰昨夜风,画楼西畔桂堂东'
},
files: [],
list: [
{
image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
title: '昨夜星辰昨夜风,画楼西畔桂堂东'
},
{
image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
title: '身无彩凤双飞翼,心有灵犀一点通'
@@ -66,37 +82,7 @@ export default {
title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
}
],
options: [{
value: 'zhinan',
label: '广西',
children: [{
value: 'shejiyuanze',
label: '南宁市',
children: [{
value: 'yizhi',
label: '良庆区'
}, {
value: 'fankui',
label: 'XXX'
}, {
value: 'xiaolv',
label: 'XXX'
}, {
value: 'kekong',
label: 'XXX'
}]
}, {
value: 'daohang',
label: '北海市',
children: [{
value: 'cexiangdaohang',
label: 'XXX'
}, {
value: 'dingbudaohang',
label: 'XXX'
}]
}]
}],
options: [],
companyList: []
};
},
@@ -125,9 +111,26 @@ export default {
async getCompanyList() {
const {rows} = await vk.callFunction({
url: 'client/user/pub/getCompany',
data: {isCoop: 1}
data: {
isCoop: 1,
city: this.address.length > 0 ? [this.address[1]] : []
}
})
this.companyList = rows
},
async addFiles() {
await vk.callFunction({
url: 'client/selfSupport/kh/add',
data: {
files: this.files,
city: this.address.length > 0 ? this.address[1] : []
}
})
this.$message({
message: '下单成功',
type: 'success'
})
this.dialogVisible = false
}
}
}
@@ -151,6 +154,10 @@ export default {
text {
margin: 0 20px;
}
text:hover {
color: #F2CFCE;
}
}
.tool-bar {
+119 -5
View File
@@ -5,7 +5,7 @@
<category-bar></category-bar>
<view class="w-1200 m-a">
<view class="mt-20 bg-white rounded p-20">
<view class="flex justify-between">
<view class="flex justify-between pb-20 border-bottom">
<text class="font-bold text-40">
购物车(全部{{ list.length }})
</text>
@@ -15,6 +15,75 @@
<el-button type="primary" round>结算</el-button>
</view>
</view>
<view class="py-20">
<el-row :gutter="10">
<el-col :span="3">
<el-checkbox v-model="selectedAll" @change="doSelectAll">
<view class="text-35 font-bold">全选</view>
</el-checkbox>
</el-col>
<el-col :span="9">
<text class="text-35 font-bold w-">商品信息</text>
</el-col>
<el-col :span="3">
<text class="text-35 font-bold flex-1">单价</text>
</el-col>
<el-col :span="3">
<text class="text-35 font-bold flex-1">数量</text>
</el-col>
<el-col :span="3">
<text class="text-35 font-bold flex-1">金额</text>
</el-col>
<el-col :span="3">
<text class="text-35 font-bold flex-1">操作</text>
</el-col>
</el-row>
</view>
<view class="p-20 mb-20" v-for="(item, index) in list" :key="index"
:class="[item.checked ? 'active' :'']">
<el-row :gutter="10">
<el-col :span="12">
<view class="flex justify-start items-start">
<el-checkbox v-model="list[index].checked" @change="changeCheck($event, item._id)">
</el-checkbox>
<el-image :src="item.goods.cover" class="cover ml-20" fit="fit"/>
<view class="flex flex-col justify-start items-start ml-20">
{{ item.goods.name }}
</view>
</view>
</el-col>
<el-col :span="3">
<text class="text-35 font-bold flex-1">¥{{ item.goods.amount }}</text>
</el-col>
<el-col :span="3">
<text class="text-35 font-bold flex-1">
<el-input-number v-model="list[index].num" @change="changeNum" :min="1" size="small"/>
</text>
</el-col>
<el-col :span="3">
<text class="text-35 font-bold flex-1 text-main">¥{{
parseFloat(item.goods.amount) * item.num
}}
</text>
</el-col>
<el-col :span="3">
<el-button type="info" @click.native="remove(index)">移出购物车</el-button>
</el-col>
</el-row>
</view>
<view class="mt-20 flex justify-between items-center">
<el-button type="text">移出购物车</el-button>
<view class="flex justify-end items-center">
<view>
<text>已选商品</text>
<text class="mx-15 font-bold text-35 text-main">{{ selectedList.length }}</text>
<text>件</text>
</view>
<text class="ml-35">合计(不含运费):</text>
<text class="mx-15 font-bold text-40 text-main">¥{{ amount }}</text>
<el-button type="primary" round :disabled="selectedList.length === 0">结算</el-button>
</view>
</view>
</view>
</view>
<gap height="50"/>
@@ -29,7 +98,7 @@ export default {
return {
list: [],
selectedList: [],
selectedAll: false,
}
},
methods: {
@@ -37,16 +106,61 @@ export default {
const {rows} = await vk.callFunction({
url: "client/cart/kh/getList"
})
this.list = rows
this.list = rows.map(item => {
item.checked = false
return item
})
},
doSelectAll() {
this.list.forEach((item, index) => {
this.list[index].checked = this.selectedAll
})
},
changeNum(e) {
console.log(e)
},
changeCheck(e, 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) {
this.list.splice(index, 1)
vk.callFunction({
url: "client/cart/kh/delete",
data: {
ids: [this.list[index]._id]
}
})
}
},
onShow() {
this.getList()
},
computed: {
amount() {
return 0
let tmpAmount = 0
this.list.forEach(item => {
console.log(item.checked)
if (item.checked) tmpAmount += parseFloat(item.goods.amount) * parseInt(item.num)
})
return tmpAmount
}
}
}
</script>
</script>
<style lang="scss" scoped>
.cover {
width: 80px;
height: 80px;
}
.active {
border: 1px solid #C23436;
border-radius: 10px;
background-color: #FFF9F6;
}
</style>
+70 -45
View File
@@ -12,14 +12,14 @@
<view class="my-20">
<text class="font-bold text-35">商品详情</text>
<view class="flex justify-start items-start my-20">
<text class="w-15p">封面</text>
<text class="w-15p" v-if="info.type === 0">封面</text>
<text class="w-40p">名称</text>
<text class="w-15p">数量</text>
<text class="w-15p">单价</text>
<text class="w-15p">小计</text>
</view>
<view class="flex justify-start items-start my-20" v-for="(item, index) in info.goods" :key="index">
<text class="w-15p">
<text class="w-15p" v-if="info.type === 0">
<image :src="item.goodsCover" mode="aspectFit" class="goods-cover"/>
</text>
<text class="w-40p font-bold text-35">{{ item.goodsName }}</text>
@@ -29,50 +29,56 @@
</view>
</view>
</template>
<el-row :gutter="10" class="mb-20">
<el-col :span="4">
<el-input v-model="name" placeholder="请输入收件人姓名"/>
</el-col>
<el-col :span="4">
<el-input v-model="phone" placeholder="请输入收件人手机号"/>
</el-col>
</el-row>
<el-row :gutter="10" class="border-bottom pb-20">
<el-col :span="4">
<el-select v-model="addressIndex[0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[1]" placeholder="请选择市" :disabled="addressIndex.length === 0">
<template v-if="addressIndex[0] !== null">
<el-option v-for="(item, index) in cityData[addressIndex[0]]" :key="index"
<template v-if="info.type === 0">
<el-row :gutter="10" class="mb-20">
<el-col :span="4">
<el-input v-model="name" placeholder="请输入收件人姓名"/>
</el-col>
<el-col :span="4">
<el-input v-model="phone" placeholder="请输入收件人手机号"/>
</el-col>
</el-row>
<el-row :gutter="10" class="border-bottom pb-20">
<el-col :span="4">
<el-select v-model="addressIndex[0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[2]" placeholder="请选择区" :disabled="addressIndex.length === 1">
<template v-if="addressIndex[0] !== null && addressIndex[1] !== null">
<el-option v-for="(item, index) in areaData[addressIndex[0]][addressIndex[1]]" :key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="12">
<el-input v-model="addressDetail" placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[1]" placeholder="请选择市"
:disabled="addressIndex.length === 0">
<template v-if="addressIndex[0] !== null">
<el-option v-for="(item, index) in cityData[addressIndex[0]]" :key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[2]" placeholder="请选择区"
:disabled="addressIndex.length === 1">
<template v-if="addressIndex[0] !== null && addressIndex[1] !== null">
<el-option v-for="(item, index) in areaData[addressIndex[0]][addressIndex[1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="12">
<el-input v-model="addressDetail" placeholder="请输入详细地址"/>
</el-col>
</el-row>
</template>
<view class="mt-20 w-50p flex flex-col justify-center items-center m-a">
<text class="text-main font-bold text-40 mb-20">订单金额:¥{{ info.amount }}</text>
<el-button type="primary" round :disabled="!phone || !name || addressIndex.length < 3" @click="onPay">
<text class="text-main font-bold text-40 mb-20" v-if="info">订单金额:¥{{ info.amount }}</text>
<el-button type="primary" round
:disabled="(info.type === 0 && (!phone || !name || addressIndex.length < 3))" @click="onPay">
立即支付
</el-button>
</view>
@@ -106,7 +112,9 @@ export default {
data() {
return {
id: null,
info: null,
info: {
type: null
},
provinceData: provinces,
cityData: citys,
areaData: areas,
@@ -128,7 +136,7 @@ export default {
})
if (this.info.orderStatus === 1) {
this.$message({
type:'success',
type: 'success',
message: '订单已支付成功'
})
setTimeout(() => {
@@ -138,7 +146,21 @@ export default {
}, 1000)
}
},
onPay() {
async onPay() {
if (this.info.type === 0) {
if (this.addressIndex.length > 2 && this.addressIndex[2] === null) {
await vk.callFunction({
url: 'client/order/kh/updateAddress',
data: {
id: this.id,
address: [provinces[this.addressIndex[0]], citys[this.addressIndex[0]][this.addressIndex[1]], areas[this.addressIndex[0]][this.addressIndex[1]][this.addressIndex[2]]],
addressDetail: this.addressDetail,
phone: this.phone,
name: this.name,
}
})
}
}
const requestTimestamp = dayjs().format('YYYY-MM-DD HH:mm:ss')
const timestamp = dayjs().format('YYYYMMDDHHmmss')
const goods = []
@@ -183,6 +205,9 @@ export default {
this.id = options.id
this.getInfo()
}
},
onUnload() {
if (this.checkPayInterval) clearInterval(this.checkPayInterval)
}
}
</script>
+40 -9
View File
@@ -8,7 +8,8 @@
<view class="tool-bar">
<view class="search">
<text>地区:</text>
<el-cascader :options="options" :props="{label: 'name', value: 'code'}" v-model="address"/>
<el-cascader :options="options" :props="{label: 'name', value: 'code'}" v-model="address"
@change="getGoodsList()" clearable/>
</view>
<view class="buy-btn">
<image src="https://oss.wsdns.cn/20231204/bcc976f4396e437abf19deb11c1f06b4.png" mode="widthFix"/>
@@ -16,8 +17,11 @@
</view>
<view class="tool-bar">
<view class="item">分类:</view>
<view class="item">全部</view>
<view class="item" v-for="(item, index) in categoryList" :key="index">{{ item.name }}</view>
<view class="item" @click="selectCate(null)">全部</view>
<view class="item" v-for="(item, index) in categoryList" :key="index"
@click="selectCate(item._id)"
:class="[categoryId === item._id? 'active' : '']">{{ item.name }}
</view>
</view>
</view>
@@ -42,7 +46,10 @@
<el-pagination
background
layout="prev, pager, next"
:total="1000">
:total="total"
:page-size="pageSize"
@click="getGoodsList"
>
</el-pagination>
</div>
</view>
@@ -79,7 +86,11 @@ export default {
}
],
options: [],
address: []
address: [],
pageIndex: 1,
pageSize: 20,
total: 0,
categoryId: null
};
},
onLoad(options) {
@@ -112,14 +123,24 @@ export default {
this.categoryList = res.rows
})
},
getGoodsList() {
getGoodsList(pageIndex = 1) {
vk.callFunction({
url: 'client/goods/list/pub/getList'
url: 'client/goods/list/pub/getList',
data: {
pageIndex,
pageSize: this.pageSize,
city: this.address.length > 1 ? this.address[1] : null,
parentId: this.categoryId
}
}).then(res => {
this.goodsList = res.rows
})
},
selectCate(cateId) {
if (this.categoryId === cateId) this.categoryId = null
else this.categoryId = cateId
this.getGoodsList()
}
}
}
</script>
@@ -146,7 +167,7 @@ export default {
.tool-bar {
display: flex;
justify-content: space-between;
justify-content: flex-start;
align-items: center;
padding: 20px;
font-size: 16px;
@@ -155,6 +176,16 @@ export default {
display: flex;
align-items: center;
}
.item {
margin-right: 10px;
cursor: pointer;
}
.item:hover, .active {
color: #bf2b28;
}
}
}