This commit is contained in:
2026-10-08 18:20:51 +08:00
parent dec4ebc773
commit 6f1b2dc03a
621 changed files with 47117 additions and 43176 deletions
+50 -75
View File
@@ -1,81 +1,56 @@
<script> <script>
import config from '@/app.config.js' import config from '@/app.config.js'
import { version } from './package.json' import {version} from './package.json'
export default {
methods: {
}, export default {
// 监听 - 页面404 methods: {},
onPageNotFound:function(e) { // 监听 - 页面404
uni.redirectTo({ onPageNotFound: function (e) {
url: config.error.url uni.redirectTo({
}) url: config.error.url
}, })
onLaunch: function(options) { },
// 注意:config.debug 在正式环境时,值为false,故此{}内的代码只有开发环境才会执行 onLaunch: function (options) {
if (config.debug) { // 注意:config.debug 在正式环境时,值为false,故此{}内的代码只有开发环境才会执行
// #ifndef APP-PLUS if (config.debug) {
console.log( // #ifndef APP-PLUS
`%c vk-client %c v${version} `, console.log(
'background:#35495e ; padding: 1px; border-radius: 3px 0 0 3px; color: #fff', `%c vk-client %c v${version} `,
'background:#007aff ;padding: 1px; border-radius: 0 3px 3px 0; color: #fff; font-weight: bold;' 'background:#35495e ; padding: 1px; border-radius: 3px 0 0 3px; color: #fff',
); 'background:#007aff ;padding: 1px; border-radius: 0 3px 3px 0; color: #fff; font-weight: bold;'
// #endif );
console.log('App Launch'); // #endif
} console.log('App Launch');
// 注意:以下代码正式和开发环境都会执行 }
// #ifdef MP // 注意:以下代码正式和开发环境都会执行
uni.vk.updateManager.updateReady(); // 此代码可以让小程序自动检测最新版本 // #ifdef MP
// #endif uni.vk.updateManager.updateReady(); // 此代码可以让小程序自动检测最新版本
// #endif
},
onShow: function () {
if (config.debug) console.log("App Show");
// #ifdef MP-WEIXIN
// 加载商品分类数据 // 检测如果当前是体验版,但没有点HBX的【发行】菜单发布,则提示开发者请点【发行】按钮
vk.callFunction({ try {
url: 'client/spot/category/pub/getTree', console.log('当前运行模式: ', process.env.NODE_ENV);
loading: false, const info = uni.getAccountInfoSync();
data: { if (info.miniProgram.envVersion === "trial" && process.env.NODE_ENV !== 'production') {
// 如果不想要alert弹窗提示,可以将vk.alert改成console.log
}, uni.vk.alert('检测到您当前发布的【体验版】是通过【运行】按钮打包发布的,请重新点击HBX上方菜单的【发行】按钮进行打包发布小程序(如果确定是【发行】按钮打包的,请删除手机上的体验版小程序并重新扫码进入)', '重要提示', '好的');
success: (data) => { }
vk.setVuex('$app.siteData.categoryData', data.rows) } catch (err) {
} }
}); // #endif
},
onHide: function () {
if (config.debug) console.log('App Hide');
}
}
},
onShow: function() {
if (config.debug) console.log("App Show");
// #ifdef MP-WEIXIN
// 检测如果当前是体验版,但没有点HBX的【发行】菜单发布,则提示开发者请点【发行】按钮
try {
console.log('当前运行模式: ', process.env.NODE_ENV);
const info = uni.getAccountInfoSync();
if (info.miniProgram.envVersion === "trial" && process.env.NODE_ENV !== 'production') {
// 如果不想要alert弹窗提示,可以将vk.alert改成console.log
uni.vk.alert('检测到您当前发布的【体验版】是通过【运行】按钮打包发布的,请重新点击HBX上方菜单的【发行】按钮进行打包发布小程序(如果确定是【发行】按钮打包的,请删除手机上的体验版小程序并重新扫码进入)', '重要提示', '好的');
}
} catch(err){}
// #endif
},
onHide: function() {
if(config.debug) console.log('App Hide');
}
}
</script> </script>
<style lang="scss"> <style lang="scss">
/*每个页面公共css */ /*每个页面公共css */
// @import "./uni_modules/vk-uview-ui/index.scss"; // @import "./uni_modules/vk-uview-ui/index.scss";
@import "./common/css/app.scss"; @import "./common/css/app.scss";
</style> </style>
+28 -5
View File
@@ -529,6 +529,7 @@ h1, h2, h3, h4, h5 {
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
font-size: 0; font-size: 0;
height: 44px;
} }
.mod-mini-search .mod-hot-query li { .mod-mini-search .mod-hot-query li {
@@ -748,7 +749,7 @@ button, input, select, textarea {
float: left; float: left;
width: 220px; width: 220px;
height: 40px; height: 40px;
cursor: pointer; /*cursor: pointer;*/
position: relative; position: relative;
} }
@@ -892,7 +893,7 @@ button, input, select, textarea {
.cate-menu { .cate-menu {
height: 500px; height: 500px;
overflow: hidden; overflow-y: auto;
width: 100%; width: 100%;
} }
@@ -2170,6 +2171,10 @@ input:disabled {
color: #333; color: #333;
} }
.text-blue {
color: #316ccb;
}
.color-6C { .color-6C {
color: #6C6C6C; color: #6C6C6C;
} }
@@ -2322,6 +2327,10 @@ input:disabled {
width: 33%; width: 33%;
} }
.w-35p {
width: 35%;
}
.w-40p { .w-40p {
width: 40%; width: 40%;
} }
@@ -2701,11 +2710,11 @@ input:disabled {
border-right: 1rpx solid #F1F5F9; border-right: 1rpx solid #F1F5F9;
} }
.bg-gray{ .bg-gray {
background-color: #DDD; background-color: #DDD;
} }
.bg-gray-light{ .bg-gray-light {
background-color: #F9F9F9; background-color: #F9F9F9;
} }
@@ -2741,9 +2750,23 @@ input:disabled {
border: 1px solid #a92924; border: 1px solid #a92924;
} }
.line-1{ .line-1 {
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
word-break: break-all; word-break: break-all;
white-space: nowrap; white-space: nowrap;
}
.line-2 {
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
}
.text-line-through {
text-decoration: line-through;
} }
+10 -6
View File
@@ -37,7 +37,7 @@ body, html {
.group-inner1 .mod-tab ul li{ .group-inner1 .mod-tab ul li{
float: left; float: left;
border: 1px solid #ddd; border: 1px solid #ddd;
margin:0px 10px 10px 0px; margin:0 10px 10px 0;
} }
.group-inner1 .mod-tab ul li a{ .group-inner1 .mod-tab ul li a{
display: block; display: block;
@@ -213,7 +213,7 @@ body, html {
} }
.mod-inner2Listcenter .inli-mask{ .mod-inner2Listcenter .inli-mask{
width: 266px; width: 220px;
position: relative; position: relative;
float: left; float: left;
padding: 13px 5px; padding: 13px 5px;
@@ -221,12 +221,12 @@ body, html {
-webkit-transition: all .2s linear; -webkit-transition: all .2s linear;
-o-transition: all .2s linear; -o-transition: all .2s linear;
transition: all .2s linear; transition: all .2s linear;
margin-right: 45px; margin-right: 10px;
background-color: #FFFFFF; background-color: #FFFFFF;
margin-bottom: 45rpx; margin-bottom: 30rpx;
} }
.mod-inner2Listcenter .inli-mask:nth-child(4n){ .mod-inner2Listcenter .inli-mask:nth-child(5n){
margin-right: 0; margin-right: 0;
} }
.mod-inner2Listcenter{ .mod-inner2Listcenter{
@@ -2632,9 +2632,13 @@ letter-spacing: 3px;
font-size: 18px; font-size: 18px;
} }
#footer{ #footer{
margin-top: 0px; margin-top: 0;
} }
.ddddd .shop_check{ .ddddd .shop_check{
color: #a92924; color: #a92924;
}
.currentDatePickerClass .el-picker-panel__footer .el-button--text.el-picker-panel__link-btn {
display: none;
} }
+459 -339
View File
@@ -1,374 +1,494 @@
<template> <template>
<view> <view>
<div class="group-nav"> <div class="group-nav">
<div class="mod-nav clearfix"> <div class="mod-nav clearfix">
<div class="first-level-nav "> <div class="first-level-nav ">
<div class="clearfix navigation-bottom"> <div class="clearfix navigation-bottom">
<div class="classification" id="bannerAllPro"> <div class="classification" id="bannerAllPro">
<div class="classification-text"> <div class="classification-text">
<i class="el-icon-menu"></i> 全部商品分类 <i class="el-icon-menu"></i> 全部商品分类
</div> </div>
<!--全部商品分类开始--> <!--全部商品分类开始-->
<div v-show="alwaysShowCategory || showCategory" class="banner-left" style=""> <div v-show="alwaysShowCategory || showCategory" class="banner-left" style="">
<div class="mod-category"> <div class="mod-category">
<div class="part-category"> <div class="part-category">
<div class="cate-menu" psa="a156"> <div class="cate-menu" psa="a156">
<ul id="nav-sub" class=""> <ul id="nav-sub" class="">
<li v-for="(item,index) in vk.getVuex('$app.siteData.categoryData')" <li v-for="(item,index) in categoryData"
class="clearfix menuliselected" :key="index"> @mouseenter="showShowChild(index)"
<i class="cate-menu-icon cate-icon-1"></i> @mouseleave="hideShowChild(index)"
<h2> class="clearfix menuliselected" :key="index">
<a href="">{{ item.name }}</a> <i class="cate-menu-icon cate-icon-1"></i>
</h2> <h2>
<div class="cate-item clearfix"> <a @click="jumpToIndex(item)" class="pointer cate-name">{{
<a v-for="(citem,cindex) in item.children" href="" item.name
:key="cindex">{{ citem.name }}</a> }}</a>
</div> </h2>
</li> <div class="cate-item clearfix" v-if="item.showChild">
<a v-for="(citem,cindex) in item.children" href="javascript:;"
v-show="cindex < 9"
@click="jump(item, citem)"
:key="cindex">{{ citem.name }}</a>
</div>
</li>
</ul>
</div>
<!-- <div class="cate-cont" psa="a157" style="">-->
<!-- <div class="item-main" style="">-->
<!-- <div class="part-hot-word">-->
<!-- <div class="item">-->
<!-- <div class="title">-->
<!-- <h2>-->
<!-- <a href="/market/index.html?name2=螺纹钢、高线">螺纹钢</a>-->
<!-- </h2>-->
<!-- <a href="/market/index.html" class="more">更多-->
<!-- <i>&gt;</i></a>-->
<!-- </div>-->
<!-- <div class="cont">-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="part-logo-cont">-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
</div>
</div>
</div>
</ul> <!--全部商品分类结束-->
</div>
<div class="linkNav">
<ul>
<li class="nav ">
<a href="/">首页</a>
</li>
<li class="nav" @click="navTo('/pages/index/self-support/self-support')"
:class="[currentPage.includes('self-support') ? 'active' : '']">
<a href="javascript:;">金久信自营</a>
</li>
<li @click="navTo('/pages/spot/goods/goods')" class="nav"
:class="[currentPage.includes('spot') ? 'active' : '']">
<a href="javascript:;" class="navigator">
现货市场
</a>
</li>
<li @click="navTo('/pages/enquiry/list')" class="nav "
:class="[currentPage.includes('enquiry') ? 'active' : '']">
<a href="javascript:;" class="navigator">
找供应
</a>
</li>
<li @click="navTo('/pages/process/list')" class="nav "
:class="[currentPage.includes('process') ? 'active' : '']">
<a href="javascript:;">找加工</a>
</li>
<li class="nav " @click="navTo('/pages/index/old/old')"
:class="[currentPage.includes('old') ? 'active' : '']">
<a href="javascript:;">旧货交易</a>
</li>
<li @click="navTo('/pages/yellowPage/list')" class="nav "
:class="[currentPage.includes('yellowPage') ? 'active' : '']">
<a href="javascript:;">金久信黄页</a>
</li>
<li class="nav " @click="navTo('/pages/article/list')"
:class="[currentPage.includes('article') ? 'active' : '']">
<a href="javascript:;">金久信学堂</a>
</li>
<li class="nav " @click="navTo('/pages/index/shop/shop')"
:class="[(currentPage.includes('shop') && !currentPage.includes('pay')) ? 'active' : '']">
<a href="javascript:;">特产商城</a>
</li>
</ul>
</div>
<div class="classification">
<div class="entry">
<div class="entry-link " @click="navTo('/pages/index/self-support/self-support')">
<img src="@/static/images/logo-left2.png">
</div>
</div>
<!--全部商品分类开始-->
<div v-show="alwaysShowCategory" class="zghome-nav-display">
</div> <div v-show="alwaysShowCategory" class="mod-manage" style="height: 500px;">
<div class="cate-cont" psa="a157" style="">
<div class="item-main" style="">
<div class="part-hot-word">
<div class="item">
<div class="title">
<h2>
<a href="/market/index.html?name2=螺纹钢、高线">螺纹钢</a>
</h2>
<a href="/market/index.html" class="more">更多
<i>&gt;</i></a>
</div>
<div class="cont">
</div>
</div>
</div>
<div class="part-logo-cont">
</div>
</div>
</div>
</div>
</div>
</div>
<!--全部商品分类结束--> <div class="me-login">
<div class="login-not">
<div class="login-head">
<img src="@/static/images/logo-small.png" alt="">
</div>
<div class="login-action">
<el-button v-if="!vk.getVuex('$user.userInfo.nickname')" type="primary"
class="empty-bg-plain-btn w-full" plain icon="el-icon-user"
@click.native="navTo('/pages/auth/login/login')">登录
</el-button>
<el-button v-else type="primary"
class="empty-bg-plain-btn w-full" plain icon="el-icon-user"
@click.native="navTo('/pages/user/user')">个人中心
</el-button>
</div>
<div class="login-action">
<el-button type="primary" class="auth-btn"
@click.native="navTo('/pages/user/user')">
<text class="company-name" style="max-width: 320rpx">{{
JSON.stringify(vk.getVuex('$user.userInfo')) === '{}' ? '实名认证' :
([2, '2'].includes(vk.getVuex('$user.userInfo.accountType')) ? vk.getVuex('$user.userInfo.company.companyName') : vk.getVuex('$user.userInfo.person.personName'))
}}
</text>
</el-button>
</div>
</div>
</div>
<div class="me-tab">
<div class="me-tab-text">
<ul>
<li @click="canShareType = 0;"
class="tab-left"
:class="[canShareType === 0 ? 'active' : '']">
<a href="javascript:void(0)">买家可享</a>
</li>
<li @click="canShareType = 1;" class=""
:class="[canShareType === 1 ? 'active' : '']">
<a href="javascript:void(0)">卖家可享</a>
</li>
</ul>
</div>
<div class="me-tab-content">
<div class="tab-inner">
<div class="me-step clearfix" v-if="canShareType === 0">
<dl>
<dt>
<i class="iconNew"><img
src="/static/images/lg1.png"></i>
<i class="iconNew iconNew-step-arrow"><img
src="/static/images/lg13.png"></i>
</dt>
<dd>免费注册</dd>
</dl>
<dl>
<dt>
<i class="iconNew"><img
src="/static/images/lg2.png"></i>
<i class="iconNew iconNew-step-arrow"><img
src="/static/images/lg13.png"></i>
</dt>
<dd>发布需求</dd>
</dl>
<dl>
<dt>
<i class="iconNew"><img
src="/static/images/lg3.png"></i>
</dt>
<dd>管理采购</dd>
</dl>
<dl class="dowslf3">
<dt class="clearfix">
<i class="iconNew iconNew-step-arrow2"><img
src="/static/images/lg14.png"></i>
</dt>
</dl>
<dl>
<dt>
<i class="iconNew"><img
src="/static/images/lg6.png"></i>
<i class="iconNew iconNew-step-arrow"><img
src="/static/images/lg15.png"></i>
</dt>
<dd>达成交易</dd>
</dl>
<dl>
<dt>
<i class="iconNew"><img
src="/static/images/lg5.png"></i>
<i class="iconNew iconNew-step-arrow"><img
src="/static/images/lg15.png"></i>
</dt>
<dd>验收</dd>
</dl>
<dl>
<dt>
<i class="iconNew"><img
src="/static/images/lg4.png"></i>
</dt>
<dd>我的订单</dd>
</dl>
</div> </div>
<div class="linkNav"> <div class="me-step clearfix" v-else-if="canShareType === 1">
<ul> <dl>
<li class="nav "> <dt>
<a href="/">首页</a> <i class="iconNew"><img
</li> src="/static/images/lg1.png"></i>
<li class="nav" @click="navTo('/pages/index/self-support/self-support')" :class="[currentPage.includes('self-support') ? 'active' : '']"> <i class="iconNew iconNew-step-arrow"><img
<a href="javascript:;">金久信自营</a> src="/static/images/lg13.png"></i>
</li> </dt>
<li @click="navTo('/pages/spot/goods/goods')" class="nav" <dd>免费注册</dd>
:class="[currentPage.includes('spot') ? 'active' : '']"> </dl>
<a href="javascript:;" class="navigator"> <dl>
现货市场 <dt>
</a> <i class="iconNew"><img
</li> src="/static/images/lg2.png"></i>
<li @click="navTo('/pages/enquiry/list')" class="nav " <i class="iconNew iconNew-step-arrow"><img
:class="[currentPage.includes('enquiry') ? 'active' : '']"> src="/static/images/lg13.png"></i>
<a href="javascript:;" class="navigator"> </dt>
找买家 <dd>优势报价</dd>
</a> </dl>
</li> <dl>
<li @click="navTo('/pages/process/list')" class="nav " <dt>
:class="[currentPage.includes('process') ? 'active' : '']"> <i class="iconNew"><img
<a href="javascript:;">找加工</a> src="/static/images/lg3.png"></i>
</li> </dt>
<li class="nav " @click="navTo('/pages/index/old/old')" <dd>管理销售</dd>
:class="[currentPage.includes('old') ? 'active' : '']"> </dl>
<a href="javascript:;">旧货交易</a> <dl class="dowslf3">
</li> <dt class="clearfix">
<li @click="navTo('/pages/yellowPage/list')" class="nav " <i class="iconNew iconNew-step-arrow2"><img
:class="[currentPage.includes('yellowPage') ? 'active' : '']"> src="/static/images/lg14.png"></i>
<a href="javascript:;">金久信黄页</a> </dt>
</li> </dl>
<li class="nav " @click="navTo('/pages/article/list')" <dl>
:class="[currentPage.includes('article') ? 'active' : '']"> <dt>
<a href="javascript:;">金久信学堂</a> <i class="iconNew"><img
</li> src="/static/images/lg6.png"></i>
<li class="nav " @click="navTo('/pages/index/shop/shop')" :class="[currentPage.includes('shop') ? 'active' : '']"> <i class="iconNew iconNew-step-arrow"><img
<a href="javascript:;">特产商城</a> src="/static/images/lg15.png"></i>
</li> </dt>
</ul> <dd>完成交易</dd>
</dl>
<dl>
<dt>
<i class="iconNew"><img
src="/static/images/lg5.png"></i>
<i class="iconNew iconNew-step-arrow"><img
src="/static/images/lg15.png"></i>
</dt>
<dd>组织发货</dd>
</dl>
<dl>
<dt>
<i class="iconNew"><img
src="/static/images/lg4.png"></i>
</dt>
<dd>我的订单</dd>
</dl>
</div> </div>
<div class="classification"> <p style="width: 100%;margin:10px 0;">
<div class="entry"> <a v-if="canShareType === 0" href="javascript:;" @click="navTo('/pages/store/buyer')"
<div class="entry-link"> style="text-align: center;color: #a92924;font-size: 13px;line-height: 2">进入买家中心
<img src="@/static/images/logo-left2.png"> &gt;</a>
</div> <a v-else-if="canShareType === 1" href="javascript:;" @click="navTo('/pages/store/store')"
</div> style="text-align: center;color: #a92924;font-size: 13px;line-height: 2">进入卖家中心
<!--全部商品分类开始--> &gt;</a>
<div v-show="alwaysShowCategory" class="zghome-nav-display"> </p>
</div>
<div class="tab-inner" style="display: none;">
<div class="me-step clearfix">
<dl>
<dt>
<i class="iconNew"><img
src="/static/images/lg7.png"></i>
<i class="iconNew iconNew-step-arrow"><img
src="/static/images/lg13.png"></i>
</dt>
<dd>企业注册</dd>
</dl>
<dl>
<dt>
<i class="iconNew"><img
src="/static/images/lg8.png"></i>
<i class="iconNew iconNew-step-arrow"><img
src="/static/images/lg13.png"></i>
</dt>
<dd>商品管理</dd>
</dl>
<dl>
<dt>
<i class="iconNew"><img
src="/static/images/lg9.png"></i>
</dt>
<dd>匹配需求</dd>
</dl>
<dl class="dowslf3">
<dt class="clearfix">
<i class="iconNew iconNew-step-arrow2"><img
src="/static/images/lg14.png"></i>
</dt>
</dl>
<dl>
<dt>
<i class="iconNew"><img
src="/static/images/lg12.png"></i>
<i class="iconNew iconNew-step-arrow"><img
src="/static/images/lg15.png"></i>
</dt>
<dd>完成订单</dd>
</dl>
<dl>
<dt>
<i class="iconNew"><img
src="/static/images/lg11.png"></i>
<i class="iconNew iconNew-step-arrow"><img
src="/static/images/lg15.png"></i>
</dt>
<dd>卖出货品</dd>
</dl>
<dl>
<dt>
<i class="iconNew"><img
src="/static/images/lg10.png"></i>
</dt>
<dd> 报价</dd>
</dl>
<div v-show="alwaysShowCategory" class="mod-manage" style="height: 500px;">
<div class="me-login">
<div class="login-not">
<div class="login-head">
<img src="/static/images/logo-small.png" alt="">
</div>
<div class="login-action">
<el-button v-if="!vk.getVuex('$user.userInfo.nickname')" type="primary"
class="empty-bg-plain-btn w-full" plain icon="el-icon-user"
@click.native="navTo('/pages/auth/login/login')">登录
</el-button>
<el-button v-else type="primary"
class="empty-bg-plain-btn w-full" plain icon="el-icon-user"
@click.native="navTo('/pages/user/user')">个人中心
</el-button>
</div>
<div class="login-action">
<el-button type="primary" class="auth-btn">
<img src="@/static/images/id-card.png">
<text>实名认证</text>
</el-button>
</div>
</div>
</div>
<div class="me-tab">
<div class="me-tab-text">
<ul>
<li @click="canShareType = 0" class="tab-left"
:class="[canShareType === 0 ? 'active' : '']">
<a href="javascript:void(0)">买家可享</a>
</li>
<li @click="canShareType = 1" class=""
:class="[canShareType === 1 ? 'active' : '']">
<a href="javascript:void(0)">卖家可享</a>
</li>
</ul>
</div>
<div class="me-tab-content">
<div class="tab-inner">
<div class="me-step clearfix">
<dl>
<dt>
<i class="iconNew"><img
src="/static/images/lg1.png"></i>
<i class="iconNew iconNew-step-arrow"><img
src="/static/images/lg13.png"></i>
</dt>
<dd>免费注册</dd>
</dl>
<dl>
<dt>
<i class="iconNew"><img
src="/static/images/lg2.png"></i>
<i class="iconNew iconNew-step-arrow"><img
src="/static/images/lg13.png"></i>
</dt>
<dd>发布需求</dd>
</dl>
<dl>
<dt>
<i class="iconNew"><img
src="/static/images/lg3.png"></i>
</dt>
<dd>管理采购</dd>
</dl>
<dl class="dowslf3">
<dt class="clearfix">
<i class="iconNew iconNew-step-arrow2"><img
src="/static/images/lg14.png"></i>
</dt>
</dl>
<dl>
<dt>
<i class="iconNew"><img
src="/static/images/lg6.png"></i>
<i class="iconNew iconNew-step-arrow"><img
src="/static/images/lg15.png"></i>
</dt>
<dd>达成交易</dd>
</dl>
<dl>
<dt>
<i class="iconNew"><img
src="/static/images/lg5.png"></i>
<i class="iconNew iconNew-step-arrow"><img
src="/static/images/lg15.png"></i>
</dt>
<dd>验收</dd>
</dl>
<dl>
<dt>
<i class="iconNew"><img
src="/static/images/lg4.png"></i>
</dt>
<dd> 我的订单</dd>
</dl>
</div>
<p style="width: 100%;margin:10px 0px;">
<a href="/buyer/index.html"
style="text-align: center;color: #a92924;font-size: 13px;line-height: 2">进入买家中心
&gt;</a>
</p>
</div>
<div class="tab-inner" style="display: none;">
<div class="me-step clearfix">
<dl>
<dt>
<i class="iconNew"><img
src="/static/images/lg7.png"></i>
<i class="iconNew iconNew-step-arrow"><img
src="/static/images/lg13.png"></i>
</dt>
<dd>企业注册</dd>
</dl>
<dl>
<dt>
<i class="iconNew"><img
src="/static/images/lg8.png"></i>
<i class="iconNew iconNew-step-arrow"><img
src="/static/images/lg13.png"></i>
</dt>
<dd>商品管理</dd>
</dl>
<dl>
<dt>
<i class="iconNew"><img
src="/static/images/lg9.png"></i>
</dt>
<dd>匹配需求</dd>
</dl>
<dl class="dowslf3">
<dt class="clearfix">
<i class="iconNew iconNew-step-arrow2"><img
src="/static/images/lg14.png"></i>
</dt>
</dl>
<dl>
<dt>
<i class="iconNew"><img
src="/static/images/lg12.png"></i>
<i class="iconNew iconNew-step-arrow"><img
src="/static/images/lg15.png"></i>
</dt>
<dd>完成订单</dd>
</dl>
<dl>
<dt>
<i class="iconNew"><img
src="/static/images/lg11.png"></i>
<i class="iconNew iconNew-step-arrow"><img
src="/static/images/lg15.png"></i>
</dt>
<dd>卖出货品</dd>
</dl>
<dl>
<dt>
<i class="iconNew"><img
src="/static/images/lg10.png"></i>
</dt>
<dd> 报价</dd>
</dl>
</div>
<p style="width: 100%;margin:10px 0px;">
<a href="/seller/index.html"
style="text-align: center;color: #a92924;font-size: 13px;line-height: 2">进入卖家中心
&gt;</a>
</p>
</div>
</div>
</div>
<div class="clearfix wartchar">
<div class="wartcharlist"><img src="/static/images/wx.png"
style="height: 38px;margin-top: 5px;">
<p style="padding-top: 5px;line-height: 2">金久信</p>
<p>微信公众号</p>
</div>
<div class="wartcharlist">
<img src="/static/images/80705c8b12d05d0ff67a2758749ef09c.jpg"
style="height: 100px;width: 100px;">
</div>
</div>
</div>
</div>
</div> </div>
<!----> <p style="width: 100%;margin:10px 0;">
<a href="javascript:;" @click="navTo('/pages/store/store')"
style="text-align: center;color: #a92924;font-size: 13px;line-height: 2">进入卖家中心
&gt;</a>
</p>
</div>
</div> </div>
</div>
<div class="clearfix wartchar">
<div class="wartcharlist"><img src="/static/images/wx.png"
style="height: 38px;margin-top: 5px;">
<p style="padding-top: 5px;line-height: 2">金久信</p>
<p>微信公众号</p>
</div>
<div class="wartcharlist">
<img src="/static/images/80705c8b12d05d0ff67a2758749ef09c.jpg"
style="height: 100px;width: 100px;">
</div>
</div>
</div> </div>
</div>
</div> </div>
<!---->
</div>
</div> </div>
</view> </div>
</div>
</view>
</template> </template>
<script> <script>
export default { export default {
props: { props: {
alwaysShowCategory: { alwaysShowCategory: {
type: Boolean, type: Boolean,
default: false default: false
}
},
name: "category-bar",
data() {
return {
showCategory: false,
canShareType: 0,
currentPage: ''
};
},
mounted() {
let that = this
const bannerAllPro = document.getElementById("bannerAllPro")
bannerAllPro.addEventListener("mouseover", () => {
that.showCategory = true
})
bannerAllPro.addEventListener("mouseleave", () => {
that.showCategory = false
})
const routes = getCurrentPages()
this.currentPage = getCurrentPages()[routes.length - 1].route
},
methods: {
navTo(url) {
vk.navigateTo(url);
}
},
watch: {
$route({meta: {pagePath}}) {
this.currentPage = pagePath
}
} }
},
name: "category-bar",
data() {
return {
showCategory: false,
canShareType: 0,
currentPage: '',
categoryData: []
};
},
mounted() {
let that = this
this.getCateList()
const bannerAllPro = document.getElementById("bannerAllPro")
bannerAllPro.addEventListener("mouseover", () => {
that.showCategory = true
})
bannerAllPro.addEventListener("mouseleave", () => {
that.showCategory = false
})
const routes = getCurrentPages()
this.currentPage = getCurrentPages()[routes.length - 1].route
},
methods: {
navTo(url) {
if (JSON.stringify(vk.getVuex('$user.userInfo')) === '{}') {
if (url === '/pages/user/user') url = '/pages/auth/register/register'
}
vk.navigateTo(url);
},
showShowChild(index) {
this.$set(this.categoryData[index], 'showChild', true)
},
hideShowChild(index) {
this.$set(this.categoryData[index], 'showChild', false)
},
getCateList() {
vk.callFunction({
url: 'client/spot/category/pub/getTree',
loading: false,
data: {},
success: (data) => {
data.rows.map(item => {
item.showChild = false
return item
})
this.categoryData = data.rows
}
});
},
jump(item, citem) {
if (item._id === '657609c48b0da41d31e5f901') this.navTo(`/pages/index/old/list/list`)
else this.navTo(`/pages/spot/goods/goods?keyword=${citem.name}`)
},
jumpToIndex(item) {
if (item._id === '657609c48b0da41d31e5f901') this.navTo(`/pages/index/old/list/list`)
else this.navTo(`/pages/spot/goods/goods?keyword=${item.name}`)
}
},
watch: {
$route({meta: {pagePath}}) {
this.currentPage = pagePath
}
}
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.navigator { .navigator {
cursor: pointer; cursor: pointer;
} }
.login-action { .login-action {
display: flex;
align-items: center;
justify-content: center;
.auth-btn {
margin-top: .5rem;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 100%;
.auth-btn { img {
margin-top: .5rem; width: 14px;
display: flex; margin-right: 5px;
align-items: center;
justify-content: center;
width: 100%;
img {
width: 14px;
margin-right: 5px;
}
} }
}
} }
.el-icon-menu{
.el-icon-menu {
padding: 0 4px; padding: 0 4px;
} }
.company-name {
display: inline-block;
max-width: 100px;
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;
white-space: nowrap;
}
.cate-name:hover {
color: #a92924
}
</style> </style>
+150 -181
View File
@@ -1,195 +1,164 @@
<template> <template>
<view id="footer"> <view id="footer">
<div class="group-foot"> <div class="group-foot">
<div class="group-foot-inner"> <div class="group-foot-inner">
<div class="mod-contact"> <div class="mod-contact">
<dl> <dl>
<dt>平台服务</dt> <dt>关于金久信</dt>
<dd> <dd>
<ul> <ul>
<li><a rel="nofollow" href="javascript:;" <li v-for="(item, index) in aboutList" :key="index"><a rel="nofollow" href="javascript:;"
@click="navTo('/pages/index/self-support/self-support')">金久信自营</a></li> @click="navTo(`/pages/otherArticle/detail?id=${item._id}`)">{{
<li><a rel="nofollow" href="javascript:;" item.name
@click="navTo('/pages/otherArticle/list?id=657457acf082105ea4d467f0')">常见问题</a> }}</a>
</li> </li>
<li><a rel="nofollow" href="javascript:;" </ul>
@click="navTo('/pages/otherArticle/list?id=657457b621821b5c0fca456a')">帮助中心</a> </dd>
</li> </dl>
<li><a rel="nofollow" href="javascript:;" @click="navTo('/')">实力商家入驻</a></li> </div>
</ul> <div class="mod-contact">
</dd> <dl>
</dl> <dt>常见问题</dt>
</div> <dd>
<div class="mod-contact"> <ul>
<dl> <li v-for="(item, index) in oldList" :key="index"><a rel="nofollow" href="javascript:;"
<dt>交易流程</dt> @click="navTo(`/pages/otherArticle/detail?id=${item._id}`)">{{
<dd> item.name
<ul> }}</a>
<li><a rel="nofollow" href="javascript:;" </li>
@click="navTo('/pages/otherArticle/detail?id=657458e821821b5c0fca7dff')">信誉采购</a> </ul>
</li> </dd>
<li><a rel="nofollow" href="javascript:;" </dl>
@click="navTo('/pages/otherArticle/detail?id=6574591f7ad52d34471bd558')">金久信公正</a> </div>
</li> <div class="mod-contact">
<li><a rel="nofollow" href="javascript:;" <dl>
@click="navTo('/pages/otherArticle/list?id=6574592b09664c4f4af2e686')">自主交易</a> <dt>帮助中心</dt>
</li> <dd>
<li><a rel="nofollow" href="javascript:;" <ul>
@click="navTo('/pages/index/self-support/self-support')">金久信自营</a></li> <li v-for="(item, index) in processList" :key="index"><a rel="nofollow" href="javascript:;"
<li><a rel="nofollow" href="javascript:;" @click="navTo(`/pages/otherArticle/detail?id=${item._id}`)">{{
@click="navTo('/pages/enquiry/list')">发布询价单</a> item.name
</li> }}</a>
</ul> </li>
</dd> </ul>
</dl> </dd>
</div> </dl>
<div class="mod-contact"> </div>
<dl>
<dt>关于金久信</dt>
<dd>
<ul>
<li><a rel="nofollow" href="javascript:;"
@click="navTo('/pages/otherArticle/list?id=657457b621821b5c0fca456a')">金久信动态</a>
</li>
<li><a rel="nofollow" href="javascript:;"
@click="navTo('/pages/otherArticle/list?id=657457b621821b5c0fca456a')">知识产权声明</a>
</li>
<li><a rel="nofollow" href="javascript:;"
@click="navTo('/pages/otherArticle/list?id=657457b621821b5c0fca456a')">隐私声明</a>
</li>
<li><a rel="nofollow" href="javascript:;"
@click="navTo('/pages/otherArticle/list?id=657457b621821b5c0fca456a')">免责声明</a>
</li>
<li><a rel="nofollow" href="javascript:;"
@click="navTo('/pages/otherArticle/list?id=657457b621821b5c0fca456a')">平台交易规则</a>
</li>
<li><a rel="nofollow" href="javascript:;"
@click="navTo('/pages/otherArticle/list?id=657457b621821b5c0fca456a')">关于我们</a>
</li>
</ul>
</dd>
</dl>
</div>
<div class="mod-contact">
<dl>
<dt> 旧货交易</dt>
<dd>
<ul>
<li><a rel="nofollow" href="/article/detail/id/19.html">旧货交易流程</a>
</li>
<li><a rel="nofollow" href="/article/detail/id/18.html">如何下单</a>
</li>
</ul>
</dd>
</dl>
</div>
<div class="mod-contact">
<dl>
<dt>找加工</dt>
<dd>
<ul>
<li><a rel="nofollow" href="/article/detail/id/21.html">加工交易流程</a>
</li>
<li><a rel="nofollow" href="/article/detail/id/20.html">如何下加工单</a>
</li>
</ul>
</dd>
</dl>
</div>
<div class="mod-contact">
<dl>
<dt>找合作</dt>
<dd>
<ul>
<li><a rel="nofollow" href="/article/detail/id/23.html">合作施工</a>
</li>
<li><a rel="nofollow" href="/article/detail/id/22.html">合作供货</a>
</li>
</ul>
</dd>
</dl>
</div>
<div class="mod-contact"> </div>
<dl> </div>
<dt> 金久信学堂</dt> <div class="group-copyright active">
<dd> <div class="group-copyright-inner">
<ul> <div class="mod-inner">
<li><a rel="nofollow" href="/article/detail/id/27.html">行业动态</a> <div class="wuage-other-link">
</li> <!-- <div class="wuage-link">-->
<li><a rel="nofollow" href="/article/detail/id/26.html">技术论坛</a> <!-- <p class="out-link">-->
</li> <!-- <a rel="nofollow" target="_self"-->
<li><a rel="nofollow" href="/article/detail/id/25.html">执行标准</a> <!-- href="https://baike.baidu.com/item/%E5%8D%97%E5%AE%81%E4%BA%BF%E5%88%A9%E9%80%9A%E9%92%A2%E7%AE%A1%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8/23408974?fr=ge_ala">亿利通官网</a>-->
</li> <!-- |<a rel="nofollow" target="_self"-->
<li><a rel="nofollow" href="/article/detail/id/24.html">基础知识</a> <!-- href="https://baike.baidu.com/item/%E5%8D%97%E5%AE%81%E4%BA%BF%E5%88%A9%E9%80%9A%E9%92%A2%E7%AE%A1%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8/23408974?fr=ge_ala">亿利通</a>-->
</li> <!-- </p>-->
</ul> <!-- </div>-->
</dd> <p class="wuage-copyright">
</dl> Copyright © 2020-2021&nbsp;&nbsp; jinjiuxinzg.cn &nbsp;&nbsp;All Rights Reserved &nbsp;&nbsp;版权所有:&nbsp;&nbsp;南宁亿利通钢管有限公司
</div> <a href="https://beian.miit.gov.cn" rel="nofollow" target="_blank">桂ICP备19008827号-1</a>
<div class="mod-contact"> <a class="wuage-copyright"
<dl> href="https://beian.mps.gov.cn/#/query/webSearch?code=45010702002145" rel="noreferrer"
<dt>金久信金融</dt> target="blank">桂公网安备45010702002145</a>
<dd> </p>
<ul> </div>
<li><a rel="nofollow" href="/article/detail/id/31.html">如何还款</a> <div class="certs-group">
</li> <a class="cert-1" rel="nofollow">
<li><a rel="nofollow" href="/article/detail/id/30.html">如何使用额度</a>
</li>
<li><a rel="nofollow" href="/article/detail/id/29.html">申请流程</a>
</li>
<li><a rel="nofollow" href="/article/detail/id/28.html"
>金久信金融简介</a></li>
</ul>
</dd>
</dl>
</div>
</div>
</div>
<div class="group-copyright active">
<div class="group-copyright-inner">
<div class="mod-inner">
<div class="wuage-other-link">
<div class="wuage-link">
<p class="out-link">
<a rel="nofollow" target="_self" href="http:/yilitong.com">亿利通官网</a>
|<a rel="nofollow" target="_self" href="baidu.com">亿利通</a>
</p>
</div>
<p class="wuage-copyright">
Copyright © 2020-2021&nbsp;&nbsp; jinjiuxinzg.cn &nbsp;&nbsp;All Rights Reserved &nbsp;&nbsp;版权所有:&nbsp;&nbsp;南宁亿利通钢管有限公司
<a href="https:/beian.miit.gov.cn" rel="nofollow">桂ICP备19008827号-1</a>
</p>
</div>
<div class="certs-group">
<a class="cert-1" rel="nofollow">
<span class="clearfix"><img <span class="clearfix"><img
src="http:/jyx.gxwebsoft.com/public/upload/image/20210220/80705c8b12d05d0ff67a2758749ef09c.jpg"><p>公众号</p></span> :src="gzhQr"><p>公众号</p></span>
</a> </a>
<a class="cert-2" rel="nofollow"> <a class="cert-2" rel="nofollow">
<span class="clearfix"><img <span class="clearfix"><img
src="http:/jyx.gxwebsoft.com/public/upload/image/20210220/80705c8b12d05d0ff67a2758749ef09c.jpg"><p>手机站</p></span> :src="mobileQr"><p>手机站</p></span>
</a> </a>
</div> </div>
</div>
</div>
</div> </div>
</view> </div>
</div>
</view>
</template> </template>
<script> <script>
export default { export default {
name: "common-footer", name: "common-footer",
data() { data() {
return {}; return {
jinRongList: [],
tradeList: [],
aboutList: [],
coopList: [],
processList: [],
oldList: [],
serviceList: [],
gzhQr: '',
mobileQr: '',
};
},
mounted() {
this.getAboutList()
this.getProcessList()
this.getOldList()
this.getGzhQr()
this.getMobileQr()
},
methods: {
navTo(url) {
vk.navigateTo({
url: url
});
}, },
methods: { async getGzhQr() {
navTo(url) { const res = await vk.callFunction({
vk.navigateTo({ url: 'client/dict/pub/getDetail',
url: url data: {
}); id: '8656c02468f88b03002dbcd84f57dd2d'
},
})
this.gzhQr = res.content
},
async getMobileQr() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '7f4b671368f88b39002cf006447af059'
},
})
this.mobileQr = res.content
},
async getAboutList() {
const res = await vk.callFunction({
url: 'client/otherArticle/list/pub/getList',
data: {
parentId: "c0a2d8e46870f2ed0513ba3239037c48"
} }
} })
this.aboutList = res.rows
},
async getProcessList() {
const res = await vk.callFunction({
url: 'client/otherArticle/list/pub/getList',
data: {
parentId: "c0a2d8e46870f3090513bb2a71c44b74"
}
})
this.processList = res.rows
},
async getOldList() {
const res = await vk.callFunction({
url: 'client/otherArticle/list/pub/getList',
data: {
parentId: "29dca3d56870f2fe050cfa37206db15c"
}
})
this.oldList = res.rows
},
}
} }
</script> </script>
+237 -107
View File
@@ -1,115 +1,245 @@
<template> <template>
<view> <view>
<div class="group-head clearfix"> <div class="group-head clearfix">
<div class="group-inner clearfix"> <div class="group-inner clearfix">
<div class="mod-logo"> <div class="mod-logo">
<a href="/" class="logo"><img src="@/static/images/logo.png"></a> <a href="/" class="logo"><img src="@/static/images/logo.png"></a>
</div> </div>
<div class="mod-mini-search"> <div class="mod-mini-search">
<div class="navigation-top clearfix"> <div class="navigation-top clearfix">
<div class="searchBar"> <div class="searchBar">
<ul class="searchBar-tab clearfix"> <ul class="searchBar-tab clearfix">
<li @click="searchTypeChange(0)" :class="{'active': searchType == 0}" class="_goods" >商品</li> <li @click="searchTypeChange(1)" :class="{'active': searchType === 1}" class="_shop">
<li @click="searchTypeChange(1)" :class="{'active': searchType == 1}" class="_shop">商户</li> 现货
</ul> </li>
<div class="clearfix"> <li @click="searchTypeChange(2)" :class="{'active': searchType === 2}" class="_shop">
<div class="searchBar-input"> 找供应
<div class="searchBar-input-inner"> </li>
<input type="text" :placeholder="searchList[searchType].placeholder" <li @click="searchTypeChange(3)" :class="{'active': searchType === 3}" class="_shop">
maxlength="100" autocomplete="off"> 找加工
</div> </li>
<div class="searchBar-input-list" style="display: none;"></div> <li @click="searchTypeChange(4)" :class="{'active': searchType === 4}" class="_shop">
</div> 旧货
<div class="preventButton button" desc=""></div> </li>
<div class="button" @click="search">搜索</div> <li @click="searchTypeChange(0)" :class="{'active': searchType === 0}" class="_goods">
</div> 特产商品
</div> </li>
</ul>
<div class="clearfix">
<div class="searchBar-input">
<div class="searchBar-input-inner">
<input type="text" :placeholder="searchList[searchType].placeholder"
maxlength="100" autocomplete="off" v-model="keyword">
</div>
<div class="searchBar-input-list" style="display: none;"></div>
</div>
<div class="preventButton button" desc=""></div>
<div class="button" @click="search">搜索</div>
</div>
</div>
<div class="mod-hot-query"> <div class="mod-hot-query">
<ul class="clearfix"> <ul style="width: 480px; overflow-x: auto;">
<li> <li v-for="(item, index) in allChildCate" :key="index">
<a href="/market/index.html?product_name=直缝焊管">直缝焊管</a> <a href="javascript:;" @click="navTo(item.name)">{{ item.name }}</a>
</li> </li>
<li> </ul>
<a href="/market/index.html?product_name=架子管">架子管</a> </div>
</li> </div>
<li> </div>
<a href="/market/index.html?product_name=无缝管">无缝管</a> <div class="mod-menu">
</li> <div class="hrd">
<li> <a href="javascript:;" class="hrd-landing"
<a href="/market/index.html?product_name=方矩管">方矩管</a> @click="jump('/pages/index/self-support/self-support')">
</li> <img src="@/static/images/logo-left.png">
<li> </a>
<a href="/market/index.html?product_name=钢板">钢板</a> </div>
</li> </div>
<li> <!-- <div class="mod-download-icon js-download">-->
<a href="/market/index.html?product_name=螺纹钢">螺纹钢</a> <!-- <a class="download clearfix" href="" target="_blank">-->
</li> <!-- <span style="float: left;font-size: 13px;padding-top: 27px;padding-right: 10px;">金久信<br>-->
<li> <!-- 手机站</span>-->
<a href="/market/index.html?product_name=H型钢">H型钢</a> <!-- <img src="/public/upload/image/20210220/80705c8b12d05d0ff67a2758749ef09c.jpg"-->
</li> <!-- style="height: 90px;width: 90px;float: left;">-->
<li> <!-- </a>-->
<a href="/market/index.html?product_name=工字钢">工字钢</a> <!-- </div>-->
</li> </div>
<li> </div>
<a href="/market/index.html?product_name=槽钢">槽钢</a> </view>
</li>
<li>
<a href="/market/index.html?product_name=镀锌钢管">镀锌钢管</a>
</li>
</ul>
</div>
</div>
</div>
<div class="mod-menu">
<div class="hrd">
<a href="/support/index.html" class="hrd-landing">
<img src="@/static/images/logo-left.png">
</a>
</div>
</div>
<div class="mod-download-icon js-download">
<a class="download clearfix" href="" target="_blank">
<span style="float: left;font-size: 13px;padding-top: 27px;padding-right: 10px;">金久信<br>
手机站</span>
<img src="/public/upload/image/20210220/80705c8b12d05d0ff67a2758749ef09c.jpg"
style="height: 90px;width: 90px;float: left;">
</a>
</div>
</div>
</div>
</view>
</template> </template>
<script> <script>
export default { export default {
name: "common-header", name: "common-header",
data() { data() {
return { return {
searchType: 0, searchType: 1,
searchList: [ allChildCate: [],
{ searchList: [
type: 0, {
name: '商品', type: 0,
placeholder:'请输入品名 材质 规格 钢厂等搜索' name: '商品',
}, placeholder: '请输入商品名称等搜索',
{ page: '/pages/index/shop/shop'
type: 1, },
name: '商户', {
placeholder:'请输入商户名或公司名进行搜索' type: 1,
} name: '现货',
] placeholder: '请输入品名 材质 规格 钢厂等搜索',
}; page: '/pages/spot/goods/goods'
}, },
methods: { {
searchTypeChange(e) { type: 2,
this.searchType = e name: '找供应',
}, placeholder: '请输入品名 材质 规格 钢厂等搜索',
search() { page: '/pages/enquiry/list'
this.$message('这是一条消息提示'); },
} {
} type: 3,
} name: '找加工',
placeholder: '请输入品名 材质 规格 钢厂等搜索',
page: '/pages/process/list'
},
{
type: 4,
name: '旧货',
placeholder: '请输入品名 材质 规格 钢厂等搜索',
page: '/pages/index/old/old'
},
],
keyword: null,
currentPage: '',
spotCateList: [],
enquiryCateList: [],
processCateList: [],
oldCateList: [],
goodsCateList: [],
};
},
methods: {
searchTypeChange(e) {
this.searchType = e
switch (e) {
case 0 : {
this.allChildCate = this.goodsCateList
}
break;
case 1 : {
this.allChildCate = this.spotCateList
}
break;
case 2 : {
this.allChildCate = this.enquiryCateList
}
break;
case 3 : {
this.allChildCate = this.processCateList
}
break;
case 4 : {
this.allChildCate = this.oldCateList
}
break;
}
},
search() {
this.navTo(this.keyword)
},
getCateList() {
vk.callFunction({
url: 'client/spot/category/pub/getTree',
title: '请求中...',
data: {},
success: (data) => {
this.spotCateList = []
data.rows.forEach(item => {
item.children.forEach(child => {
this.spotCateList.push(child)
})
})
this.allChildCate = this.spotCateList
}
});
},
async getEnquiryCateList() {
vk.callFunction({
url: 'client/enquiry/template/pub/getList',
title: '请求中...',
data: {},
success: (data) => {
this.enquiryCateList = data.rows
}
});
},
async getProcessCateList() {
vk.callFunction({
url: 'client/process/category/pub/getTree',
title: '请求中...',
data: {},
success: (data) => {
this.processCateList = data.rows
}
});
},
async getOldCateList() {
vk.callFunction({
url: 'client/old/pub/getTree',
title: '请求中...',
data: {type: 1},
success: (data) => {
this.oldCateList = data.rows.map(item => {
item.children.forEach(child => {
delete child.children
})
return item
})
}
});
},
getGoodsCate() {
vk.callFunction({
url: 'client/goods/category/pub/getList'
}).then(res => {
this.goodsCateList = res.rows
})
},
navTo(keyword) {
if (this.searchType === 0) {
vk.navigateTo({
url: this.searchList[this.searchType].page + '?cateName=' + keyword
})
} else {
vk.navigateTo({
url: this.searchList[this.searchType].page + '?keyword=' + keyword
})
}
},
jump(url) {
vk.navigateTo({
url: url
})
}
},
mounted() {
this.getCateList()
this.getEnquiryCateList()
this.getProcessCateList()
this.getOldCateList()
this.getGoodsCate()
},
watch: {
$route({meta: {pagePath}}) {
this.currentPage = pagePath
if (this.currentPage.includes('shop')) this.searchType = 0
if (this.currentPage.includes('spot')) this.searchType = 1
if (this.currentPage.includes('enquiry')) this.searchType = 2
if (this.currentPage.includes('process')) this.searchType = 3
if (this.currentPage.includes('old')) this.searchType = 4
// console.log(this.currentPage.includes('process'), this.searchType)
}
}
}
</script> </script>
<style lang="scss"> <style lang="scss">
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,61 @@
<template>
<el-carousel :height="`${height}px`" :style="{width: width}" class="m-a">
<el-carousel-item v-for="(item, index) in list.swiper" :key="item" :style="{width: width}">
<image class="carousel-img" :src="item" mode="scaleToFill" :style="{width: width}" @click="onClick(index)"/>
</el-carousel-item>
</el-carousel>
</template>
<script>
export default {
name: "CommonSwiper",
props: {
page: {
type: String,
default: "index"
},
height: {
type: String | Number,
default: "500"
},
width: {
type: String,
default: "100%"
},
},
data() {
return {
list: []
}
},
methods: {
getList() {
vk.callFunction({
url: 'client/album/pub/list',
data: {
page: this.page
},
success: res => {
this.list = res
console.log(this.list)
}
})
},
onClick(index) {
// if (this.list.companyId) vk.navigateTo(`/pages/yellowPage/info?id=${this.list.companyId}`)
}
},
mounted() {
this.getList()
}
}
</script>
<style lang="scss" scoped>
.carousel-img {
width: 100%;
height: 100%;
margin: 0 auto;
}
</style>
+38
View File
@@ -0,0 +1,38 @@
<template>
<view>
<template v-if="['doc', 'docx'].includes(item.split('.').pop())">
<file-word theme="outline" class="pointer" size="40" fill="#4a90e2" strokeLinecap="square"/>
</template>
<template v-else-if="['xls', 'xlsx'].includes(item.split('.').pop())">
<file-excel theme="outline" class="pointer" size="40" fill="#417505" strokeLinecap="square"/>
</template>
<template v-else-if="['pdf'].includes(item.split('.').pop())">
<file-pdf-one theme="outline" class="pointer" size="40" fill="#f5a623"
strokeLinecap="square"/>
</template>
<template v-else>
<el-image :src="item" style="width: 100px; height: 100px" fit="cover"
:preview-src-list="[item]"/>
</template>
</view>
</template>
<script>
import {FileExcel, FilePdfOne, FileWord} from "@icon-park/vue";
export default {
name: "file-type",
components: {FilePdfOne, FileExcel, FileWord},
props: {
item: {
type: String,
default: ''
}
},
data() {
return {}
},
methods: {
},
}
</script>
@@ -0,0 +1,170 @@
<template>
<view>
<template v-if="vk.getVuex('$user.userInfo.userLevel') < 3">
<div class="mt-20 text-main font-bold" v-if="!quoteExpiredAt || monthExpired">剩余报价次数:{{
remainQuoteNum
}}次
</div>
<div class="mt-20 text-main font-bold" v-else-if="quoteExpiredAt && !monthExpired">
报价包月过期时间:{{ dayjs(quoteExpiredAt).format('YYYY-MM-DD HH:mm:ss') }}
</div>
</template>
<el-dialog title="报价次数" :visible.sync="dialogVisible" width="50%">
<p>请选择购买模式</p>
<div class="flex justify-center items-center">
<div class="p-20 rounded m-20 shadow flex flex-col justify-center items-center flex-1 pointer"
:class="[buyQuoteMode === 'single' ? 'buy-quote-mode-active' : '']"
@click="buyQuoteMode = 'single'">
<p>单次购买</p>
<p>{{ amount ? amount : singleQuoteAmount }}元/次</p>
</div>
<div class="p-20 rounded m-20 shadow flex flex-col justify-center items-center flex-1 pointer"
:class="[buyQuoteMode === item._id ? 'buy-quote-mode-active' : '']"
:style="{cursor: 'not-allowed'}"
@click="buyQuoteMode = item._id" v-for="(item, index) in monthlyQuoteAmountList" :key="index">
<p>{{ item.name }}</p>
<p>{{ item.amount }}元</p>
</div>
</div>
<div class="mt-20 flex justify-start items-center"
v-if="vk.getVuex('$user.userInfo.userLevel') === 0 && buyQuoteMode !== 'single'">
<span>您还未成为会员,仅能单次购买。请</span>
<span class="text-main font-bold pointer mx-15 text-35" style="text-decoration: underline"
@click="toUpgrade">升级会员</span>
<span> ,可享受优惠报价套餐。</span>
</div>
<div class="mt-20 " v-if="!vk.getVuex('$user.userInfo.quoteExpiredAt')">
<span>剩余报价次数:</span>
<span class="text-main font-bold text-35">{{ remainQuoteNum }}</span>
<span>次</span>
</div>
<div class="mt-20 text-main font-bold" v-else>
报价包月过期时间:{{ dayjs(quoteExpiredAt).format('YYYY-MM-DD') }}
</div>
<div class="mt-20 flex justify-center items-center">
<el-button type="primary" :disabled="!buyQuoteMode || disabled" @click.native="doBuyQuote">确定
</el-button>
<el-button plain @click.native="cancel">取消</el-button>
</div>
</el-dialog>
</view>
</template>
<script>
import dayjs from "dayjs";
export default {
name: "quote-remain-num",
props: {
amount: Number,
type: String,
id: String,
},
data() {
return {
remainQuoteNum: '',
quoteExpiredAt: null,
dialogVisible: false,
monthExpired: false,
buyQuoteMode: null,
disabled: false,
singleQuoteAmount: 1,
monthlyQuoteAmount: 10,
monthlyQuoteAmountList: []
}
},
methods: {
dayjs,
async getSingleQuoteAmount() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '6587b034466d41a591df881c'
},
})
this.singleQuoteAmount = res.content
},
async getMonthlyAmount() {
const {rows} = await vk.callFunction({
url: 'client/quoteNumConfig/list/pub/list',
})
this.monthlyQuoteAmountList = rows
},
async doBuyQuote() {
const {data} = await vk.callFunction({
url: 'client/enquiry/quoteNum/kh/add',
data: {
buyQuoteMode: this.buyQuoteMode,
type: this.type,
id: this.id,
},
})
this.dialogVisible = false
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
},
cancel() {
this.dialogVisible = false
vk.navigateBack()
},
toUpgrade() {
this.dialogVisible = false
vk.navigateTo({
url: `/pages/user/user?menu=equity`
})
}
},
async mounted() {
await this.getSingleQuoteAmount()
await this.getMonthlyAmount()
vk.userCenter.getCurrentUserInfo({
success: async (data) => {
if (this.amount) {
const res = await vk.callFunction({
url: 'client/user/kh/getUserQuoteNumList',
data: {
type: this.type,
sheetId: this.id,
},
})
// if (!res.data) this.remainQuoteNum = 0
// else this.remainQuoteNum = res.data.num
}
this.remainQuoteNum = data.userInfo.remainQuoteNum ? parseInt(data.userInfo.remainQuoteNum) : 0
this.quoteExpiredAt = data.userInfo.quoteExpiredAt ? dayjs(data.userInfo.quoteExpiredAt).format('YYYY-MM-DD HH:mm:ss') : null
this.monthExpired = dayjs(data.userInfo.quoteExpiredAt).isBefore(dayjs())
if (this.remainQuoteNum === 0 && (!this.quoteExpiredAt || dayjs(this.quoteExpiredAt).isBefore(dayjs())) && parseInt(vk.getVuex('$user.userInfo.userLevel')) < 3) {
this.$confirm('您的报价次数已用完/已过期,是否立即购买?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
closeOnClickModal: false,
closeOnPressEscape: false,
}).then(async () => {
this.dialogVisible = true
}).catch(() => {
vk.navigateBack()
})
}
}
});
},
watch: {
buyQuoteMode(val) {
if (vk.getVuex('$user.userInfo.userLevel') === 0) {
if (val === 'single') this.disabled = false
else this.disabled = true
}
}
}
}
</script>
<style scoped lang="scss">
.buy-quote-mode-active {
border: 1px solid #a92924;
background-color: #f1c7c7;
}
</style>
+135 -135
View File
@@ -1,186 +1,186 @@
<template> <template>
<view> <view>
<div class="layout layout-fix-tab-narrow" style="right: 0px;"> <div class="layout layout-fix-tab-narrow" style="right: 0px;">
<div class="mod-fix-tab-narrow" style="display: block; "> <div class="mod-fix-tab-narrow" style="display: block; ">
<div class="fix-tab-main"> <div class="fix-tab-main">
<ul> <ul>
<li class="side-hrd"> <!-- <li class="side-hrd">-->
<a rel="nofollow" href="javascript:;" class="DeliveryMyCard" <!-- <a rel="nofollow" href="javascript:;" class="DeliveryMyCard"-->
@click="navTo('/pages/enquiry/list')"> <!-- @click="navTo('/pages/enquiry/list')">-->
<div class="item"> <!-- <div class="item">-->
<i class="wag-icon"><img src="@/static/images/cl1.png"></i> <!-- <i class="wag-icon"><img src="@/static/images/cl1.png"></i>-->
</div> <!-- </div>-->
<span>找买家</span> <!-- <span>下询价单</span>-->
</a> <!-- </a>-->
</li> <!-- </li>-->
<li class="side-add-cart"><a rel="nofollow" href="javascript:;" <!-- <li class="side-add-cart"><a rel="nofollow" href="javascript:;"-->
@click="navTo('/pages/index/shop/cart')"> <!-- @click="navTo('/pages/index/shop/cart')">-->
<div class="item"> <!-- <div class="item">-->
<i class="wag-icon"><img src="@/static/images/cl3.png"></i> <!-- <i class="wag-icon"><img src="@/static/images/cl3.png"></i>-->
</div> <!-- </div>-->
<span class="txt"> 进货单 </span> <!-- <span class="txt"> 购物车 </span>-->
</a> <!-- </a>-->
</li> <!-- </li>-->
<li class="side-steel-kefu"> <li class="side-steel-kefu">
<a rel="nofollow" <a rel="nofollow"
href="http://wpa.qq.com/msgrd?v=3&amp;uin=949419497&amp;site=qq&amp;menu=yes" href="http://wpa.qq.com/msgrd?v=3&amp;uin=949419497&amp;site=qq&amp;menu=yes"
target="_blank"> target="_blank">
<div class="item"> <div class="item">
<i class="wag-icon"><img src="@/static/images/cl4.png"></i> <i class="wag-icon"><img src="@/static/images/cl4.png"></i>
</div>
<span>在线客服</span>
</a>
</li>
<li class="side-steel-counter">
<a rel="nofollow" href="/counter/index.html">
<div class="item">
<i class="wag-icon"><img src="@/static/images/cl5.png"></i>
</div>
<span>钢材计算器</span>
</a>
</li>
<li class="side-steel-search">
<a rel="nofollow" href="javascript:;" @click="navTo('/pages/yellowPage/list')">
<div class="item">
<i class="wag-icon"><img src="@/static/images/cl6.png"></i>
</div>
<span>金久信黄页</span>
</a>
</li>
<li class="side-steel-search">
<a rel="nofollow" href="javascript:;" @click="navTo('/pages/contract/index?tab=sign')">
<div class="item">
<agreement theme="outline" size="16" fill="#666" strokeLinecap="square"/>
</div>
<span>签约宝</span>
</a>
</li>
<li class="actGotop" style="display: none;">
<div class="item">
<i class="wag-icon"><img src="@/static/images/cc-top.png"></i>
</div>
<span>返回顶部</span>
</li>
</ul>
</div> </div>
</div> <span>在线客服</span>
</a>
</li>
<!-- <li class="side-steel-counter">-->
<!-- <a rel="nofollow" href="javascript:;" @click="navTo('/pages/stealCal/stealCal')">-->
<!-- <div class="item">-->
<!-- <i class="wag-icon"><img src="@/static/images/cl5.png"></i>-->
<!-- </div>-->
<!-- <span>钢材计算器</span>-->
<!-- </a>-->
<!-- </li>-->
<!-- <li class="side-steel-search">-->
<!-- <a rel="nofollow" href="javascript:;" @click="navTo('/pages/yellowPage/list')">-->
<!-- <div class="item">-->
<!-- <i class="wag-icon"><img src="@/static/images/cl6.png"></i>-->
<!-- </div>-->
<!-- <span>金久信黄页</span>-->
<!-- </a>-->
<!-- </li>-->
<li class="side-steel-search">
<a rel="nofollow" href="javascript:;" @click="navTo('/pages/contract/index?tab=sign')">
<div class="item">
<agreement theme="outline" size="16" fill="#666" strokeLinecap="square"/>
</div>
<span>金久信签约宝</span>
</a>
</li>
<li class="actGotop" style="display: none;">
<div class="item">
<i class="wag-icon"><img src="@/static/images/cc-top.png"></i>
</div>
<span>返回顶部</span>
</li>
</ul>
</div> </div>
</view> </div>
</div>
</view>
</template> </template>
<script> <script>
import {Agreement} from '@icon-park/vue' import {Agreement} from '@icon-park/vue'
export default { export default {
components: {Agreement}, components: {Agreement},
name: "right-bar", name: "right-bar",
data() { data() {
return {}; return {};
}, },
methods: { methods: {
navTo(url) { navTo(url) {
vk.navigateTo(url); vk.navigateTo(url);
}
} }
}
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.layout-fix-tab-narrow { .layout-fix-tab-narrow {
border-left: 1px solid #f1f1f1; border-left: 1px solid #f1f1f1;
position: fixed; position: fixed;
right: -40px; right: -40px;
top: 0; top: 0;
width: 40px; width: 40px;
height: 100%; height: 100%;
background: #fff; background: #fff;
z-index: 9999999; z-index: 9999999;
-webkit-transition: right .5s ease; -webkit-transition: right .5s ease;
-moz-transition: right .5s ease; -moz-transition: right .5s ease;
-ms-transition: right .5s ease; -ms-transition: right .5s ease;
-o-transition: right .5s ease; -o-transition: right .5s ease;
transition: right .5s ease; transition: right .5s ease;
line-height: 1.5; line-height: 1.5;
color: #656565; color: #656565;
font-size: 12px; font-size: 12px;
font-family: -apple-system, BlinkMacSystemFont, Hiragino Sans GB, Microsoft YaHei, sans-serif; font-family: -apple-system, BlinkMacSystemFont, Hiragino Sans GB, Microsoft YaHei, sans-serif;
} }
.mod-fix-tab-narrow li { .mod-fix-tab-narrow li {
width: 40px; width: 40px;
position: relative; position: relative;
margin: 3px 0; margin: 3px 0;
} }
.mod-fix-tab-narrow li { .mod-fix-tab-narrow li {
padding: 4px 0; padding: 4px 0;
cursor: pointer; cursor: pointer;
line-height: 16px; line-height: 16px;
} }
.layout-fix-tab-narrow a { .layout-fix-tab-narrow a {
color: #656565; color: #656565;
text-decoration: none; text-decoration: none;
padding: 5px 0px; padding: 5px 0px;
} }
.mod-fix-tab-narrow li .item { .mod-fix-tab-narrow li .item {
display: block; display: block;
position: relative; position: relative;
z-index: 99; z-index: 99;
text-align: center; text-align: center;
height: 23px; height: 23px;
} }
.mod-fix-tab-narrow li span { .mod-fix-tab-narrow li span {
display: block; display: block;
right: 0; right: 0;
width: 16px; width: 16px;
white-space: inherit; white-space: inherit;
text-align: center; text-align: center;
word-wrap: break-word; word-wrap: break-word;
word-break: break-all; word-break: break-all;
padding: 0 12px; padding: 0 12px;
line-height: 14px; line-height: 14px;
z-index: 10; z-index: 10;
top: 32px; top: 32px;
transition: inherit; transition: inherit;
} }
.wag-icon { .wag-icon {
font-size: 16px; font-size: 16px;
height: 30px; height: 30px;
width: 30px; width: 30px;
font-style: normal; font-style: normal;
color: #353535; color: #353535;
} }
.mod-fix-tab-narrow li:hover { .mod-fix-tab-narrow li:hover {
box-shadow: 0 0; box-shadow: 0 0;
color: #a92924 color: #a92924
} }
.mod-fix-tab-narrow li:hover { .mod-fix-tab-narrow li:hover {
box-shadow: 0 0 16px 0 hsla(0, 0%, 77%, .5) box-shadow: 0 0 16px 0 hsla(0, 0%, 77%, .5)
} }
.mod-fix-tab-narrow li:hover span { .mod-fix-tab-narrow li:hover span {
box-shadow: 0 0; box-shadow: 0 0;
color: #a92924 color: #a92924
} }
.mod-fix-tab-narrow { .mod-fix-tab-narrow {
margin-top: 50px; margin-top: 50px;
} }
.a-fadeinL { .a-fadeinL {
margin-top: 50px; margin-top: 50px;
-webkit-transition: right .5s ease; -webkit-transition: right .5s ease;
-moz-transition: right .5s ease; -moz-transition: right .5s ease;
-ms-transition: right .5s ease; -ms-transition: right .5s ease;
-o-transition: right .5s ease; -o-transition: right .5s ease;
transition: right .5s ease; transition: right .5s ease;
} }
</style> </style>
+182 -148
View File
@@ -1,170 +1,204 @@
<template> <template>
<view> <view>
<view class="group-wagbar"> <view class=" text-center py-15" style="background-color: red; color: yellow">
<div class="group-inner"> 本站测试中,仅对 特约用户 开放部分功能测试,谢谢您的关注,敬请期待!
<div class="mod-welcome"> </view>
<h5 class="welcome-item slogan js-slogan">欢迎来到金久信钢城首页!</h5> <view class="group-wagbar">
<div class="welcome-item login-register"> <div class="group-inner">
<div class="mod-welcome">
<h5 class="welcome-item slogan js-slogan">欢迎来到金久信签约宝!</h5>
<div class="welcome-item login-register">
<navigator v-if="!vk.getVuex('$user.userInfo.nickname')" class="login js-top-bar-login" <navigator v-if="!vk.getVuex('$user.userInfo.nickname')" class="login js-top-bar-login"
url="/pages/auth/login/login" rel="nofollow" target="_self" url="/pages/auth/login/login" rel="nofollow" target="_self"
style="display: inline-block;"> style="display: inline-block;">
请登录 请登录
</navigator> </navigator>
<navigator v-if="!vk.getVuex('$user.userInfo.nickname')" class="register " <navigator v-if="!vk.getVuex('$user.userInfo.nickname')" class="register "
url="/pages/auth/register/register" rel="nofollow" target="_blank" url="/pages/auth/register/register" rel="nofollow" target="_blank"
style="display: inline-block;">免费注册 style="display: inline-block;">免费注册
</navigator> </navigator>
<el-dropdown @command="handleCommand" size="mini" v-if="vk.getVuex('$user.userInfo.nickname')"> <el-dropdown @command="handleCommand" size="mini" v-if="vk.getVuex('$user.userInfo.nickname')">
<span class="register"> <span class="register">
{{ vk.getVuex('$user.userInfo.nickname') }}<i {{ vk.getVuex('$user.userInfo.nickname') }}<i
class="el-icon-arrow-down el-icon--right"></i> class="el-icon-arrow-down el-icon--right"></i>
</span> </span>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item> <el-dropdown-item>
<navigator url="/pages/user/user">个人中心</navigator> <navigator url="/pages/contract/index?tab=sign">金久信签约宝</navigator>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item> <!-- <el-dropdown-item>-->
<navigator url="/pages/store/buyer">买家中心</navigator> <!-- <navigator url="/pages/user/user">个人中心</navigator>-->
</el-dropdown-item> <!-- </el-dropdown-item>-->
<el-dropdown-item> <!-- <el-dropdown-item>-->
<navigator url="/pages/store/store">卖家中心</navigator> <!-- <navigator url="/pages/store/buyer">买家中心</navigator>-->
</el-dropdown-item> <!-- </el-dropdown-item>-->
<el-dropdown-item> <!-- <el-dropdown-item>-->
<navigator url="/pages/process/my">我的加工</navigator> <!-- <navigator url="/pages/store/store">卖家中心</navigator>-->
</el-dropdown-item> <!-- </el-dropdown-item>-->
<el-dropdown-item> <!-- <el-dropdown-item>-->
<navigator url="/pages/user/school">金久信学堂</navigator> <!-- <navigator url="/pages/order/order">订单管理</navigator>-->
</el-dropdown-item> <!-- </el-dropdown-item>-->
<el-dropdown-item> <el-dropdown-item>
<navigator url="/pages/contract/index">合同管理</navigator> <navigator url="/pages/contract/index">合同管理</navigator>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item> <!-- <el-dropdown-item>-->
<navigator url="/pages/contract/index?tab=sign">签约宝</navigator> <!-- <navigator url="/pages/process/my">我的加工</navigator>-->
</el-dropdown-item> <!-- </el-dropdown-item>-->
<el-dropdown-item> <!-- <el-dropdown-item>-->
<navigator url="/pages/user/order">订单管理</navigator> <!-- <navigator url="/pages/user/school">金久信学堂</navigator>-->
</el-dropdown-item> <!-- </el-dropdown-item>-->
<el-dropdown-item command="logout">退出登录</el-dropdown-item> <el-dropdown-item command="logout">退出登录</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</div> </div>
</div> </div>
<div class="mod-tools"> <!-- <div class="mod-tools">-->
<ul> <!-- <ul>-->
<li class="tool-item buyer-item"> <!-- <li class="tool-item buyer-item">-->
<a rel="nofollow" href="javascript:;" class="bar-title"> <!-- <a rel="nofollow" href="javascript:;" class="bar-title">-->
<navigator url="/pages/store/buyer">买家中心<i></i></navigator> <!-- <navigator url="/pages/store/buyer">买家中心<i></i></navigator>-->
</a> <!-- </a>-->
<div class="bar-content"> <!-- <div class="bar-content">-->
<dl> <!-- <dl>-->
<dd> <!-- <dd>-->
<a rel="nofollow" href="javascript:;"> <!-- <a rel="nofollow" href="javascript:;">-->
<navigator url="/pages/store/buyer?menuIndex=1">询价管理</navigator> <!-- <navigator url="/pages/store/buyer?menuIndex=1">询价管理</navigator>-->
</a> <!-- </a>-->
</dd> <!-- </dd>-->
<dd> <!-- <dd>-->
<a rel="nofollow" href="javascript:;"> <!-- <a rel="nofollow" href="javascript:;">-->
<navigator url="/pages/order/order">订单管理</navigator> <!-- <navigator url="/pages/order/order">订单管理</navigator>-->
</a> <!-- </a>-->
</dd> <!-- </dd>-->
<!-- <dd>--> <!-- &lt;!&ndash; <dd>&ndash;&gt;-->
<!-- <a rel="nofollow" href="javascript:;">--> <!-- &lt;!&ndash; <a rel="nofollow" href="javascript:;">&ndash;&gt;-->
<!-- <navigator url="/pages/order/order">订单管理</navigator>--> <!-- &lt;!&ndash; <navigator url="/pages/order/order">订单管理</navigator>&ndash;&gt;-->
<!-- </a>--> <!-- &lt;!&ndash; </a>&ndash;&gt;-->
<!-- </dd>--> <!-- &lt;!&ndash; </dd>&ndash;&gt;-->
</dl> <!-- </dl>-->
</div> <!-- </div>-->
</li> <!-- </li>-->
<li class="tool-item service-item"> <!-- <li class="tool-item service-item">-->
<a rel="nofollow" href="" class="bar-title" target="_blank">客户服务<i></i></a> <!-- <a rel="nofollow" href="" class="bar-title" target="_blank">客户服务<i></i></a>-->
<div class="bar-content"> <!-- <div class="bar-content">-->
<dl> <!-- <dl>-->
<dd> <!-- <dd>-->
<a rel="nofollow" href="javascript:;" <!-- <a rel="nofollow" href="javascript:;"-->
@click="navTo('/pages/otherArticle/list?id=657457acf082105ea4d467f0')">常见问题</a> <!-- @click="navTo('/pages/otherArticle/list?id=657457acf082105ea4d467f0')">常见问题</a>-->
</dd> <!-- </dd>-->
<dd> <!-- <dd>-->
<a rel="nofollow" href="javascript:;" <!-- <a rel="nofollow" href="javascript:;"-->
@click="navTo('/pages/otherArticle/list?id=6573d7c3e0ec19b5047ffa8c')">买家指南</a> <!-- @click="navTo('/pages/otherArticle/list?id=6573d7c3e0ec19b5047ffa8c')">买家指南</a>-->
</dd> <!-- </dd>-->
<dd> <!-- <dd>-->
<a rel="nofollow" href="javascript:;" <!-- <a rel="nofollow" href="javascript:;"-->
@click="navTo('/pages/otherArticle/list?id=6573d7bde0ec19b5047ff941')">卖家指南</a> <!-- @click="navTo('/pages/otherArticle/list?id=6573d7bde0ec19b5047ff941')">卖家指南</a>-->
</dd> <!-- </dd>-->
<!-- <dd>--> <!-- &lt;!&ndash; <dd>&ndash;&gt;-->
<!-- <a rel="nofollow" target="_self" id="wagbar-im"--> <!-- &lt;!&ndash; <a rel="nofollow" target="_self" id="wagbar-im"&ndash;&gt;-->
<!-- class="im data-tracelog">在线咨询</a>--> <!-- &lt;!&ndash; class="im data-tracelog">在线咨询</a>&ndash;&gt;-->
<!-- </dd>--> <!-- &lt;!&ndash; </dd>&ndash;&gt;-->
</dl> <!-- </dl>-->
</div> <!-- </div>-->
</li> <!-- </li>-->
<li class="tool-item"> <!-- <li class="tool-item pos-r">-->
<a rel="nofollow" href="javascript:;" class="bar-title" <!-- <a rel="nofollow" href="javascript:;" class="bar-title"-->
@click="navTo('/pages/user/user?menu=notice')" <!-- @click="navTo('/pages/user/user?menu=notice')"-->
>我的消息</a> <!-- >我的消息({{ messageUnreadNum }})</a>-->
</li> <!-- <div class="dot" v-if="messageUnreadNum > 0"></div>-->
<li class="tool-item2"> <!-- </li>-->
<a rel="nofollow" href="" class="bar-title" target="_blank"><span>客服服务热线:+86 <!-- <li class="tool-item2">-->
0771-3923001</span></a> <!-- <a rel="nofollow" href="javascript:;" class="bar-title"><span>客服服务热线:-->
<!-- {{ serviceContract }}</span></a>-->
</li> <!-- </li>-->
</ul> <!-- </ul>-->
</div> <!-- </div>-->
</div> </div>
</view>
</view> </view>
</view>
</template> </template>
<script> <script>
export default { export default {
name: "top-bar", name: "top-bar",
data() { data() {
return {}; return {
}, messageUnreadNum: 0,
created() { serviceContract: '',
};
}, },
methods: { created() {
handleCommand(e) { if (vk.getVuex('$user.userInfo._id')) {
if (e == 'logout') { this.getUnreadNum()
this.logout() this.getServicePhone()
}
},
navTo(url) {
vk.navigateTo({
url
})
},
logout() {
this.$confirm('确认退出登录?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.userCenter.logout({
success: (data) => {
// 退出登录成功后的逻辑
uni.reLaunch({
url: '/'
})
}
});
})
}
} }
},
methods: {
async getUnreadNum() {
const {data} = await vk.callFunction({
url: 'client/message/kh/getUnreadCount',
});
this.messageUnreadNum = data
},
handleCommand(e) {
if (e == 'logout') {
this.logout()
}
},
navTo(url) {
vk.navigateTo({
url
})
},
logout() {
this.$confirm('确认退出登录?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.userCenter.logout({
success: (data) => {
// 退出登录成功后的逻辑
uni.reLaunch({
url: '/'
})
}
});
})
},
async getServicePhone() {
const {content} = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '657d8fca55b337cfadbe1063'
}
})
this.serviceContract = content
},
}
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.register { .register {
cursor: pointer; cursor: pointer;
&:hover { &:hover {
color: #a92924; color: #a92924;
} }
}
.dot {
position: absolute;
right: 0;
top: 5px;
width: 10px;
height: 10px;
border-radius: 999px;
background-color: #a92924;
} }
</style> </style>
+26 -19
View File
@@ -1,22 +1,29 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="zh-CN"> <html lang="zh-CN">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8"/>
<script> <script>
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
CSS.supports('top: constant(a)')) CSS.supports('top: constant(a)'))
document.write( document.write(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + '<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
(coverSupport ? ', viewport-fit=cover' : '') + '" />') (coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script> document.write('<meta name="keywords" content="金久信签约宝,金久信签约宝会员"/>')
<title></title> document.write('<meta name="description" content="金久信签约宝专注线上电子签约,金久信签约宝会员服务.致力于为您提供一站式金久信签约宝会员服务."/>')
<!--preload-links-->
<!--app-context--> </script>
<!-- 配置H5的 web图标static/logo.png --> <title></title>
<link rel="icon" href="./static/logo.png"/> <!--preload-links-->
</head> <!--app-context-->
<body> <!-- 配置H5的 web图标static/logo.png -->
<div id="app"><!--app-html--></div> <link rel="icon" href="./static/logo.png"/>
<script type="module" src="/main.js"></script> <script type="text/javascript" src="http://qzonestyle.gtimg.cn/qzone/openapi/qc_loader.js" data-appid="101415280"
</body> data-redirecturi="http://127.0.0.1:8080/"
charset="utf-8"></script>
</head>
<body>
<div id="app"><!--app-html--></div>
<script type="module" src="/main.js"></script>
</body>
</html> </html>
+11 -1
View File
@@ -2,7 +2,7 @@
import Vue from 'vue' import Vue from 'vue'
import App from './App' import App from './App'
import store from './store' import store from './store'
import config from '@/app.config.js' import config from './app.config.js'
// 引入 elementUI // 引入 elementUI
import elementUI from "element-ui"; import elementUI from "element-ui";
@@ -29,6 +29,16 @@ import vkAdminUI from 'vk-unicloud-admin-ui';
import 'vk-unicloud-admin-ui/theme/index.css'; import 'vk-unicloud-admin-ui/theme/index.css';
Vue.use(vkAdminUI); Vue.use(vkAdminUI);
// 滑块
import dragVerify from 'vue-drag-verify2'
Vue.use(dragVerify);
import VueTianditu from "vue-tianditu";
Vue.use(VueTianditu, {
v: "4.0",
tk: "bfbc6bd9e85fcda67b62788705aa6427"
});
// 自动注册全局组件(必须加在Vue.use(vkAdminUI);的后面) // 自动注册全局组件(必须加在Vue.use(vkAdminUI);的后面)
const modulesFiles = require.context('./components', true, /\.vue$/); const modulesFiles = require.context('./components', true, /\.vue$/);
modulesFiles.keys().map((modulePath, index) => { modulesFiles.keys().map((modulePath, index) => {
+6 -1
View File
@@ -1,10 +1,11 @@
{ {
"name" : "jinjiuxin-mobile", "name" : "jinjiuxin-mobile",
"appid" : "__UNI__8BFD66E", "appid" : "__UNI__0F0703D",
"description" : "", "description" : "",
"versionName" : "1.0.0", "versionName" : "1.0.0",
"versionCode" : "100", "versionCode" : "100",
"transformPx" : false, "transformPx" : false,
"sassImplementationName": "node-sass",
"app-plus" : { "app-plus" : {
"usingComponents" : true, "usingComponents" : true,
"nvueCompiler" : "uni-app", "nvueCompiler" : "uni-app",
@@ -91,6 +92,10 @@
"template" : "template.h5.html", "template" : "template.h5.html",
"devServer" : { "devServer" : {
"disableHostCheck" : true "disableHostCheck" : true
},
"router" : {
"base" : "/signOnly/",
"mode" : "hash"
} }
}, },
"vueVersion" : "2", "vueVersion" : "2",
+1069
View File
File diff suppressed because it is too large Load Diff
+5
View File
@@ -21,12 +21,15 @@
"dependencies": { "dependencies": {
"@icon-park/vue": "^1.4.2", "@icon-park/vue": "^1.4.2",
"@vant/area-data": "^1.5.1", "@vant/area-data": "^1.5.1",
"@wangeditor/editor": "^5.1.23",
"@wangeditor/editor-for-vue": "^1.0.2",
"async-validator": "^4.2.5", "async-validator": "^4.2.5",
"babel-helper-vue-jsx-merge-props": "^2.0.3", "babel-helper-vue-jsx-merge-props": "^2.0.3",
"crypto-js": "^4.2.0", "crypto-js": "^4.2.0",
"dayjs": "^1.11.10", "dayjs": "^1.11.10",
"element-ui": "2.15.13", "element-ui": "2.15.13",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"md5": "^2.3.0",
"normalize-wheel": "^1.0.1", "normalize-wheel": "^1.0.1",
"request": "^2.88.2", "request": "^2.88.2",
"resize-observer-polyfill": "^1.5.1", "resize-observer-polyfill": "^1.5.1",
@@ -39,6 +42,8 @@
"vue": "^2.7.15", "vue": "^2.7.15",
"vue-clipboard2": "^0.3.3", "vue-clipboard2": "^0.3.3",
"vue-cropper": "^0.6.4", "vue-cropper": "^0.6.4",
"vue-drag-verify2": "^1.2.0",
"vue-tianditu": "^1.2.11",
"vuedraggable": "^2.24.3", "vuedraggable": "^2.24.3",
"xe-utils": "^3.5.14" "xe-utils": "^3.5.14"
}, },
+436 -388
View File
@@ -1,390 +1,438 @@
{ {
"pages": [ "pages": [
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
"navigationBarTitleText": "金久信钢城" "navigationBarTitleText": "金久信钢城"
} }
}, },
{ {
"path": "pages/error/404/404", "path": "pages/error/404/404",
"style": { "style": {
"navigationBarTitleText": "404" "navigationBarTitleText": "404"
} }
} },
,{ {
"path" : "pages/auth/register/register", "path": "pages/auth/register/register",
"style" : "style": {
{ "navigationBarTitleText": "注册",
"navigationBarTitleText": "注册", "enablePullDownRefresh": false
"enablePullDownRefresh": false }
} },
{
} "path": "pages/auth/login/login",
,{ "style": {
"path" : "pages/auth/login/login", "navigationBarTitleText": "金久信签约宝_金久信签约宝会员登录",
"style" : "enablePullDownRefresh": false
{ }
"navigationBarTitleText": "登录", },
"enablePullDownRefresh": false {
} "path": "pages/auth/login/wechat",
"style": {
} "navigationBarTitleText": "微信登录",
,{ "enablePullDownRefresh": false
"path" : "pages/spot/release/release", }
"style" : },
{ {
"navigationBarTitleText": "发布现货", "path": "pages/auth/login/wechat_test",
"enablePullDownRefresh": false "style": {
} "navigationBarTitleText": "微信登录",
"enablePullDownRefresh": false
} }
,{ },
"path" : "pages/spot/goods/goods", {
"style" : "path": "pages/auth/login/qq",
{ "style": {
"navigationBarTitleText": "现货市场", "navigationBarTitleText": "QQ登录",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},
} {
,{ "path": "pages/auth/login/find",
"path" : "pages/user/user", "style": {
"style" : "navigationBarTitleText": "找回密码",
{ "enablePullDownRefresh": false
"navigationBarTitleText": "个人中心", }
"enablePullDownRefresh": false },
} {
"path": "pages/spot/release/release",
}, "style": {
{ "navigationBarTitleText": "发布现货",
"path" : "pages/spot/goods/detail", "enablePullDownRefresh": false
"style" : }
{ },
"navigationBarTitleText" : "", {
"enablePullDownRefresh" : false "path": "pages/spot/goods/goods",
} "style": {
}, "navigationBarTitleText": "现货市场",
{ "enablePullDownRefresh": false
"path" : "pages/company/company", }
"style" : },
{ {
"navigationBarTitleText" : "黄页", "path": "pages/user/user",
"enablePullDownRefresh" : false "style": {
} "navigationBarTitleText": "个人中心",
}, "enablePullDownRefresh": false
{ }
"path" : "pages/enquiry/release", },
"style" : {
{ "path": "pages/spot/goods/detail",
"navigationBarTitleText" : "发布询价", "style": {
"enablePullDownRefresh" : false "navigationBarTitleText": "现货详情",
} "enablePullDownRefresh": false
}, }
{ },
"path" : "pages/enquiry/list", {
"style" : "path": "pages/company/company",
{ "style": {
"navigationBarTitleText" : "询价", "navigationBarTitleText": "黄页",
"enablePullDownRefresh" : false "enablePullDownRefresh": false
} }
}, },
{ {
"path" : "pages/enquiry/my", "path": "pages/enquiry/release",
"style" : "style": {
{ "navigationBarTitleText": "发布询价",
"navigationBarTitleText" : "我发布的询价单", "enablePullDownRefresh": false
"enablePullDownRefresh" : false }
} },
}, {
{ "path": "pages/enquiry/list",
"path" : "pages/enquiry/detail", "style": {
"style" : "navigationBarTitleText": "找买家",
{ "enablePullDownRefresh": false
"navigationBarTitleText" : "报价单详情", }
"enablePullDownRefresh" : false },
} {
}, "path": "pages/enquiry/my",
{ "style": {
"path" : "pages/enquiry/quote", "navigationBarTitleText": "我发布的询价单",
"style" : "enablePullDownRefresh": false
{ }
"navigationBarTitleText" : "填写报价单", },
"enablePullDownRefresh" : false {
} "path": "pages/enquiry/quote/my",
}, "style": {
{ "navigationBarTitleText": "我的报价",
"path" : "pages/contract/index", "enablePullDownRefresh": false
"style" : }
{ },
"navigationBarTitleText" : "合同管理", {
"enablePullDownRefresh" : false "path": "pages/enquiry/detail",
} "style": {
}, "navigationBarTitleText": "报价单详情",
{ "enablePullDownRefresh": false
"path" : "pages/process/list", }
"style" : },
{ {
"navigationBarTitleText" : "找加工", "path": "pages/enquiry/quote",
"enablePullDownRefresh" : false "style": {
} "navigationBarTitleText": "填写报价单",
}, "enablePullDownRefresh": false
{ }
"path" : "pages/process/release", },
"style" : {
{ "path": "pages/contract/index",
"navigationBarTitleText" : "发布找加工", "style": {
"enablePullDownRefresh" : false "navigationBarTitleText": "合同管理",
} "enablePullDownRefresh": false
}, }
{ },
"path" : "pages/process/quote", {
"style" : "path": "pages/contract/certificate",
{ "style": {
"navigationBarTitleText" : "加工报价", "navigationBarTitleText": "司法调证",
"enablePullDownRefresh" : false "enablePullDownRefresh": false
} }
}, },
{ {
"path" : "pages/process/detail", "path": "pages/process/list",
"style" : "style": {
{ "navigationBarTitleText": "找加工",
"navigationBarTitleText" : "加工单详情", "enablePullDownRefresh": false
"enablePullDownRefresh" : false }
} },
}, {
{ "path": "pages/process/release",
"path" : "pages/process/my", "style": {
"style" : "navigationBarTitleText": "发布找加工",
{ "enablePullDownRefresh": false
"navigationBarTitleText" : "我的加工单", }
"enablePullDownRefresh" : false },
} {
}, "path": "pages/process/quote",
{ "style": {
"path" : "pages/checkout/checkout", "navigationBarTitleText": "加工报价",
"style" : "enablePullDownRefresh": false
{ }
"navigationBarTitleText" : "", },
"enablePullDownRefresh" : false {
} "path": "pages/process/quote/my",
}, "style": {
{ "navigationBarTitleText": "我的报价",
"path" : "pages/article/list", "enablePullDownRefresh": false
"style" : }
{ },
"navigationBarTitleText" : "金久信学堂", {
"enablePullDownRefresh" : false "path": "pages/process/detail",
} "style": {
}, "navigationBarTitleText": "加工单详情",
{ "enablePullDownRefresh": false
"path" : "pages/index/self-support/self-support", }
"style" : },
{ {
"navigationBarTitleText" : "金久信自营", "path": "pages/process/my",
"enablePullDownRefresh" : false "style": {
} "navigationBarTitleText": "我的加工单",
}, "enablePullDownRefresh": false
{ }
"path" : "pages/index/self-support/companyQuote", },
"style" : {
{ "path": "pages/process/factoryList",
"navigationBarTitleText" : "金久信自营", "style": {
"enablePullDownRefresh" : false "navigationBarTitleText": "加工厂列表",
} "enablePullDownRefresh": false
}, }
{ },
"path" : "pages/index/self-support/selectType", {
"style" : "path": "pages/checkout/checkout",
{ "style": {
"navigationBarTitleText" : "金久信自营", "navigationBarTitleText": "",
"enablePullDownRefresh" : false "enablePullDownRefresh": false
} }
}, },
{ {
"path" : "pages/index/self-support/productQuote", "path": "pages/article/list",
"style" : "style": {
{ "navigationBarTitleText": "金久信学堂",
"navigationBarTitleText" : "金久信自营", "enablePullDownRefresh": false
"enablePullDownRefresh" : false }
} },
}, {
{ "path": "pages/article/detail",
"path" : "pages/index/server/server", "style": {
"style" : "navigationBarTitleText": "金久信学堂",
{ "enablePullDownRefresh": false
"navigationBarTitleText" : "平台服务", }
"enablePullDownRefresh" : false },
} {
}, "path": "pages/index/self-support/self-support",
{ "style": {
"path" : "pages/index/shop/shop", "navigationBarTitleText": "金久信自营",
"style" : "enablePullDownRefresh": false
{ }
"navigationBarTitleText" : "", },
"enablePullDownRefresh" : false {
} "path": "pages/index/self-support/companyQuote",
}, "style": {
{ "navigationBarTitleText": "金久信自营",
"path" : "pages/index/old/old", "enablePullDownRefresh": false
"style" : }
{ },
"navigationBarTitleText" : "旧货交易", {
"enablePullDownRefresh" : false "path": "pages/index/self-support/selectType",
} "style": {
}, "navigationBarTitleText": "金久信自营",
{ "enablePullDownRefresh": false
"path" : "pages/index/old/list/list", }
"style" : },
{ {
"navigationBarTitleText" : "旧货交易列表", "path": "pages/index/self-support/productQuote",
"enablePullDownRefresh" : false "style": {
} "navigationBarTitleText": "金久信自营",
}, "enablePullDownRefresh": false
{ }
"path" : "pages/index/shop/detail", },
"style" : {
{ "path": "pages/index/self-support/costQuote",
"navigationBarTitleText" : "", "style": {
"enablePullDownRefresh" : false "navigationBarTitleText": "金久信自营",
} "enablePullDownRefresh": false
}, }
{ },
"path" : "pages/index/shop/cart", {
"style" : "path": "pages/index/self-support/quote",
{ "style": {
"navigationBarTitleText" : "购物车", "navigationBarTitleText": "金久信自营报价",
"enablePullDownRefresh" : false "enablePullDownRefresh": false
} }
}, },
{ {
"path" : "pages/yellowPage/list", "path": "pages/index/server/server",
"style" : "style": {
{ "navigationBarTitleText": "平台服务",
"navigationBarTitleText" : "", "enablePullDownRefresh": false
"enablePullDownRefresh" : false }
} },
}, {
{ "path": "pages/index/shop/shop",
"path" : "pages/yellowPage/info", "style": {
"style" : "navigationBarTitleText": "特产商城",
{ "enablePullDownRefresh": false
"navigationBarTitleText" : "", }
"enablePullDownRefresh" : false },
} {
}, "path": "pages/index/old/old",
{ "style": {
"path" : "pages/user/school", "navigationBarTitleText": "旧货交易",
"style" : "enablePullDownRefresh": false
{ }
"navigationBarTitleText" : "金久信学堂", },
"enablePullDownRefresh" : false {
} "path": "pages/index/old/quote",
}, "style": {
{ "navigationBarTitleText": "旧货交易报价",
"path" : "pages/index/shop/pay", "enablePullDownRefresh": false
"style" : }
{ },
"navigationBarTitleText" : "订单支付", {
"enablePullDownRefresh" : false "path": "pages/index/old/quote/my",
} "style": {
}, "navigationBarTitleText": "我的报价",
{ "enablePullDownRefresh": false
"path" : "pages/user/order", }
"style" : },
{ {
"navigationBarTitleText" : "订单列表", "path": "pages/index/old/list/list",
"enablePullDownRefresh" : false "style": {
} "navigationBarTitleText": "旧货交易列表",
}, "enablePullDownRefresh": false
{ }
"path" : "pages/index/old/release", },
"style" : {
{ "path": "pages/index/shop/detail",
"navigationBarTitleText" : "旧货交易", "style": {
"enablePullDownRefresh" : false "navigationBarTitleText": "",
} "enablePullDownRefresh": false
}, }
{ },
"path" : "pages/store/store", {
"style" : "path": "pages/index/shop/cart",
{ "style": {
"navigationBarTitleText" : "卖家中心", "navigationBarTitleText": "购物车",
"enablePullDownRefresh" : false "enablePullDownRefresh": false
} }
}, },
{ {
"path" : "pages/store/buyer", "path": "pages/yellowPage/list",
"style" : "style": {
{ "navigationBarTitleText": "黄页列表",
"navigationBarTitleText" : "买家中心", "enablePullDownRefresh": false
"enablePullDownRefresh" : false }
} },
}, {
{ "path": "pages/yellowPage/info",
"path" : "pages/spot/goods/my", "style": {
"style" : "navigationBarTitleText": "黄页详情",
{ "enablePullDownRefresh": false
"navigationBarTitleText" : "", }
"enablePullDownRefresh" : false },
} {
}, "path": "pages/user/school",
{ "style": {
"path" : "pages/order/order", "navigationBarTitleText": "金久信学堂",
"style" : "enablePullDownRefresh": false
{ }
"navigationBarTitleText" : "", },
"enablePullDownRefresh" : false {
} "path": "pages/index/shop/pay",
}, "style": {
{ "navigationBarTitleText": "订单支付",
"path" : "pages/index/old/detail", "enablePullDownRefresh": false
"style" : }
{ },
"navigationBarTitleText" : "", {
"enablePullDownRefresh" : false "path": "pages/index/old/release",
} "style": {
}, "navigationBarTitleText": "旧货交易",
{ "enablePullDownRefresh": false
"path" : "pages/otherArticle/list", }
"style" : },
{ {
"navigationBarTitleText" : "", "path": "pages/store/store",
"enablePullDownRefresh" : false "style": {
} "navigationBarTitleText": "卖家中心",
}, "enablePullDownRefresh": false
{ }
"path" : "pages/otherArticle/detail", },
"style" : {
{ "path": "pages/store/buyer",
"navigationBarTitleText" : "详情", "style": {
"enablePullDownRefresh" : false "navigationBarTitleText": "买家中心",
} "enablePullDownRefresh": false
}, }
{ },
"path" : "pages/otherArticle/noticeDetail", {
"style" : "path": "pages/spot/goods/my",
{ "style": {
"navigationBarTitleText" : "详情", "navigationBarTitleText": "我的现货",
"enablePullDownRefresh" : false "enablePullDownRefresh": false
} }
}, },
{ {
"path" : "pages/index/old/my", "path": "pages/order/order",
"style" : "style": {
{ "navigationBarTitleText": "订单管理",
"navigationBarTitleText" : "我发布的旧货信息", "enablePullDownRefresh": false
"enablePullDownRefresh" : false }
} },
} {
], "path": "pages/index/old/detail",
"globalStyle": { "style": {
"navigationBarTextStyle": "black", "navigationBarTitleText": "旧货详情",
"navigationBarTitleText": "金久信钢城", "enablePullDownRefresh": false
"navigationStyle": "custom", }
// #ifndef MP-ALIPAY },
"navigationBarBackgroundColor": "#F8F8F8", {
// #endif "path": "pages/otherArticle/list",
"backgroundColor": "#F8F8F8" "style": {
} "navigationBarTitleText": "文章列表",
"enablePullDownRefresh": false
}
},
{
"path": "pages/otherArticle/detail",
"style": {
"navigationBarTitleText": "详情",
"enablePullDownRefresh": false
}
},
{
"path": "pages/otherArticle/noticeDetail",
"style": {
"navigationBarTitleText": "详情",
"enablePullDownRefresh": false
}
},
{
"path": "pages/index/old/my",
"style": {
"navigationBarTitleText": "我发布的旧货信息",
"enablePullDownRefresh": false
}
},
{
"path": "pages/stealCal/stealCal",
"style": {
"navigationBarTitleText": "钢材计算器",
"enablePullDownRefresh": false
}
},
{
"path": "pages/yellowPage/factory",
"style": {
"navigationBarTitleText": "加工商信息",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "金久信钢城",
"navigationStyle": "custom",
// #ifndef MP-ALIPAY
"navigationBarBackgroundColor": "#F8F8F8",
// #endif
"backgroundColor": "#F8F8F8"
}
} }
+222
View File
@@ -0,0 +1,222 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="page-nav">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item>
<navigator style="display: inline-block;" url="/pages/article/list">金久信学堂</navigator>
</el-breadcrumb-item>
<el-breadcrumb-item>金久信学堂详情</el-breadcrumb-item>
</el-breadcrumb>
</view>
<view class="w-1200 m-a bg-white p-40">
<view class=" flex justify-between items-center">
<text class="text-50 font-bold">{{ info.name }}</text>
<view class="flex flex-col justify-center items-center">
<star @click.native="changeCollect" theme="outline" size="30" fill="#4a4a4a" strokeLinecap="square"
v-if="!hasCollect" class="pointer"/>
<star @click.native="changeCollect" theme="filled" size="30" fill="#d00243" strokeLinecap="square"
v-else class="pointer"/>
<text>{{ hasCollect ? '已收藏' : '收藏' }}</text>
</view>
</view>
<view class="mt-20 text-gray text-28 pb-20 border-bottom">{{ info._add_time_str }}</view>
<view class="mt-20 text-gray text-28 pb-20 border-bottom" v-if="userInfo">
<span>剩余</span>
<span class="mx-15 text-main font-bold">{{ userInfo.remainArticleDownloadNum }}</span>
<span>次下载次数</span>
</view>
<view class="py-20 border-bottom flex justify-start flex-col items-start " v-if="info.files">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
附件
</view>
</view>
</view>
<view class="flex justify-start items-start flex-wrap my-25">
<view class="mt-15 mr-15" v-for="(item, index) in info.files" :key="index">
<template v-if="['doc', 'docx'].includes(item.split('.').pop())">
<file-word theme="outline" class="pointer" size="100" fill="#4a90e2" strokeLinecap="square"
@click.native="openDownload(item)"/>
</template>
<template v-else-if="['xls', 'xlsx'].includes(item.split('.').pop())">
<file-excel theme="outline" class="pointer" size="100" fill="#417505" strokeLinecap="square"
@click.native="openDownload(item)"/>
</template>
<template v-else-if="['pdf'].includes(item.split('.').pop())">
<file-pdf-one theme="outline" class="pointer" size="100" fill="#f5a623"
strokeLinecap="square"
@click.native="openDownload(item)"/>
</template>
<template v-else>
<el-image :src="item" style="width: 100px; height: 100px" fit="cover"
:preview-src-list="[item]"/>
</template>
</view>
</view>
</view>
<view v-html="info.content" class="mt-20"></view>
</view>
<gap height="50"/>
<common-footer></common-footer>
</view>
</template>
<script>
import {FileExcel, FilePdfOne, FileWord, Star} from "@icon-park/vue";
export default {
name: "detail",
components: {FileWord, FilePdfOne, FileExcel, Star},
data() {
return {
info: {
name: '',
content: ''
},
hasCollect: false,
userInfo: null,
}
},
onLoad(option) {
if (option.id) {
this.getInfo(option.id);
this.addView(option.id)
this.getUserInfo()
}
},
onShow() {
this.getUserInfo()
},
methods: {
async getInfo(id) {
this.info = await vk.callFunction({
url: `client/article/list/pub/getDetail`,
data: {id}
});
await this.checkCollect()
},
async getUserInfo() {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
this.userInfo = userInfo
},
addView(id) {
vk.callFunction({
url: `client/article/list/pub/addView`,
data: {id}
});
},
async openDownload(url) {
await this.getUserInfo()
if (this.userInfo.userLevel < 0) return this.$message.error('非会员,无法下载');
// else if (this.userInfo.userLevel === 0) {
const {data} = await vk.callFunction({
url: 'client/article/list/kh/check',
data: {
id: this.info._id,
}
})
if (!data) {
if (this.userInfo.remainArticleDownloadNum === 0) {
return this.$confirm(`下载次数不足,是否购买次数?`, '提示', {
cancelButtonText: '关闭',
}).then(async () => {
const {data} = await vk.callFunction({
url: 'client/order/kh/addDownloadOrder',
title: '请求中...',
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
})
} else {
this.$confirm(`将消耗1次下载次数,是否继续?`, '提示', {
cancelButtonText: '关闭',
}).then(async () => {
this.userInfo.remainArticleDownloadNum -= 1
// await this.getUserInfo()
vk.callFunction({
url: 'client/article/list/pub/addDownload',
data: {
id: this.info._id,
}
})
vk.callFunction({
url: 'client/user/kh/reduceDownloadNum',
})
vk.callFunction({
url: 'client/article/list/kh/addDownload',
data: {
id: this.info._id,
}
})
window.open(url)
})
}
} else {
window.open(url)
}
// } else {
// vk.callFunction({
// url: 'client/article/list/pub/addDownload',
// data: {
// id: this.info._id
// }
// })
// window.open(url)
// }
},
async checkCollect() {
const {data} = await vk.callFunction({
url: 'client/article/collect/kh/check',
data: {
articleId: this.info._id
},
});
this.hasCollect = data
},
changeCollect() {
this.hasCollect = !this.hasCollect
vk.callFunction({
url: 'client/article/collect/kh/changeCollect',
data: {
articleId: this.info._id
},
});
}
}
}
</script>
<style scoped lang="scss">
@import "@/common/css/app.scss";
.form-title-wrap {
display: flex;
align-items: center;
justify-content: space-between;
.goods-info-title {
display: flex;
align-items: center;
justify-content: flex-start;
}
.form-title {
padding-left: 10px;
color: $--color-primary;
font-size: 18px;
line-height: 18px;
border-left: 4px solid $--color-primary;
}
}
</style>
+212 -205
View File
@@ -1,241 +1,248 @@
<template> <template>
<view> <view>
<top-bar></top-bar> <top-bar></top-bar>
<common-header></common-header> <common-header></common-header>
<category-bar></category-bar> <category-bar></category-bar>
<view class="carousel"> <view class="carousel">
<el-carousel height="170px"> <common-swiper page="article"/>
<el-carousel-item v-for="item in 4" :key="item">
<image class="carousel-img"
src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"
mode="aspectFill"></image>
</el-carousel-item>
</el-carousel>
</view>
<view class="filter-outer">
<view class="cate">
<view class="item" :class="[activeCateIndex === 0 ? 'active' : '']"
@click="selectCate(0)">
<text class="title">{{ cateList[0].name }}</text>
<text class="remark mt-10">{{ cateList[0].remark }}</text>
</view>
<view class="item" :class="[activeCateIndex === 1 ? 'active' : '']"
@click="selectCate(1)">
<text class="title">{{ cateList[1].name }}</text>
<text class="remark mt-10">{{ cateList[1].remark }}</text>
</view>
<view class="item" :class="[activeCateIndex === -1 ? 'active' : '']"
@click="selectCate(-1)">
<text class="title">乐邦团</text>
<text class="remark mt-10">可提问一些与钢材有关的专业知识问答</text>
</view>
<view class="item" :class="[activeCateIndex === 2 ? 'active' : '']"
@click="selectCate(2)">
<text class="title">{{ cateList[2].name }}</text>
<text class="remark mt-10">{{ cateList[2].remark }}</text>
</view>
<view class="item" :class="[activeCateIndex === -2 ? 'active' : '']"
@click="selectCate(-2)">
<text class="title">金久信风向标</text>
<text class="remark mt-10">平台客户可将宝贵意见和平台需要改进的意见在此发表</text>
</view>
<view class="item mt-20" @click="toMySchool">
<text class="title text-main">我的学堂</text>
<text class="remark mt-10">我上传和下载的文档</text>
</view>
</view>
<view class="content-wrap">
<el-input @keyup.enter.native="getContentList" clearable placeholder="关键字搜索" v-model="keyword">
<i slot="prefix" class="el-input__icon el-icon-search"></i>
<el-button @click="getContentList" type="primary" slot="append" style="border-radius: 0">搜索
</el-button>
</el-input>
<view class="flex flex-col justify-start items-start pointer w-100p">
<view v-for="(item, index) in list" :key="index" class="content-item-wrap"
@click="openDownload(item._id, item.files[0])">
<file-word theme="outline" size="80" fill="#4a90e2" strokeLinecap="square"/>
<view class="content">
<text class="title">{{ item.name }}</text>
<view class="desc">
<text class="item">{{ item._add_time_str }}</text>
<text class="item">{{ item.viewNum }}人浏览</text>
<text class="item">{{ item.downloadNum }}次下载</text>
<text class="item">{{ item.amount === 0 ? '免费下载' : `${item.amount}元下载` }}</text>
<!-- <text class="item">{{ item._add_time_str }}</text>-->
</view>
</view>
</view>
</view>
</view>
</view>
<right-bar></right-bar>
<common-footer></common-footer>
</view> </view>
<view class="filter-outer">
<view class="cate">
<view class="item" :class="[activeCateIndex === 0 ? 'active' : '']"
@click="selectCate(0)">
<text class="title">{{ cateList[0].name }}</text>
<text class="remark mt-10">{{ cateList[0].remark }}</text>
</view>
<!-- <view class="item" :class="[activeCateIndex === 1 ? 'active' : '']"-->
<!-- @click="selectCate(1)">-->
<!-- <text class="title">{{ cateList[1].name }}</text>-->
<!-- <text class="remark mt-10">{{ cateList[1].remark }}</text>-->
<!-- </view>-->
<!-- <view class="item" :class="[activeCateIndex === -1 ? 'active' : '']"-->
<!-- @click="selectCate(-1)">-->
<!-- <text class="title">乐邦团</text>-->
<!-- <text class="remark mt-10">可提问一些与钢材有关的专业知识问答</text>-->
<!-- </view>-->
<view class="item" :class="[activeCateIndex === 1 ? 'active' : '']"
@click="selectCate(1)">
<text class="title">{{ cateList[1].name }}</text>
<text class="remark mt-10">{{ cateList[1].remark }}</text>
</view>
<!-- <view class="item" :class="[activeCateIndex === -2 ? 'active' : '']"-->
<!-- @click="selectCate(-2)">-->
<!-- <text class="title">金久信风向标</text>-->
<!-- <text class="remark mt-10">平台客户可将宝贵意见和平台需要改进的意见在此发表</text>-->
<!-- </view>-->
<view class="item mt-20" @click="navTo('/pages/user/school')">
<text class="title text-main">我的学堂</text>
<text class="remark mt-10">我上传和下载的文档</text>
</view>
</view>
<view class="content-wrap">
<el-input @keyup.enter.native="getContentList()" clearable placeholder="关键字搜索" v-model="keyword">
<i slot="prefix" class="el-input__icon el-icon-search"></i>
<el-button @click="getContentList()" type="primary" slot="append" style="border-radius: 0">搜索
</el-button>
</el-input>
<view class="flex flex-col justify-start items-start pointer w-100p">
<view v-for="(item, index) in list" :key="index" class="content-item-wrap"
@click="navTo(`/pages/article/detail?id=${item._id}`)">
<template v-if="item.files && item.files.length > 0">
<template v-if="['doc', 'docx'].includes(item.files[0].split('.').pop())">
<file-word theme="outline" class="pointer" size="80" fill="#4a90e2" strokeLinecap="square"/>
</template>
<template v-else-if="['xls', 'xlsx'].includes(item.files[0].split('.').pop())">
<file-excel theme="outline" class="pointer" size="80" fill="#417505" strokeLinecap="square"/>
</template>
<template v-else-if="['pdf'].includes(item.files[0].split('.').pop())">
<file-pdf-one theme="outline" class="pointer" size="80" fill="#f5a623" strokeLinecap="square"/>
</template>
<template v-else>
<el-image :src="item.files[0]" style="width: 100px; height: 100px" fit="cover"
:preview-src-list="[item.files]"/>
</template>
</template>
<view class="content">
<text class="title">{{ item.name }}</text>
<view class="desc">
<text class="item">{{ item._add_time_str }}</text>
<text class="item">{{ item.viewNum }}人浏览</text>
<text class="item">{{ item.downloadNum }}次下载</text>
<!-- <text class="item">{{ item.amount === 0 ? '免费下载' : `${item.amount}元下载` }}</text>-->
<!-- <text class="item">{{ item._add_time_str }}</text>-->
</view>
</view>
</view>
<el-pagination @current-change="getContentList" background layout="prev, pager, next"
:total="total"></el-pagination>
</view>
</view>
</view>
<right-bar></right-bar>
<common-footer></common-footer>
</view>
</template> </template>
<script> <script>
import {FileWord} from '@icon-park/vue' import {FilePdfOne, FileExcel, FileWord} from '@icon-park/vue'
export default { export default {
name: "list", name: "list",
components: {FileWord}, components: {FilePdfOne, FileExcel, FileWord},
data() { data() {
return { return {
cateList: [], cateList: [],
activeCateIndex: 0, activeCateIndex: 0,
list: [], list: [],
keyword: null total: 0,
} pageSize: 10,
}, keyword: null
methods: {
async getCateList() {
const {rows} = await vk.callFunction({
url: 'client/article/category/pub/getList'
})
this.cateList = rows
await this.getContentList()
},
selectCate(index) {
this.activeCateIndex = index
this.getContentList()
},
async getContentList() {
const {rows} = await vk.callFunction({
url: 'client/article/list/pub/getList',
data: {
parentId: this.cateList[this.activeCateIndex]._id,
keyword: this.keyword
}
})
this.list = rows
},
toMySchool() {
vk.navigateTo({
url: '/pages/user/school'
})
},
async openDownload(id, url) {
await vk.callFunction({
url: 'client/article/list/pub/addDownload',
data: {
id
}
})
window.open(url)
}
},
onLoad() {
this.getCateList()
} }
},
methods: {
async getCateList() {
const {rows} = await vk.callFunction({
url: 'client/article/category/pub/getList'
})
this.cateList = rows
await this.getContentList()
},
selectCate(index) {
this.activeCateIndex = index
this.getContentList()
},
async getContentList(pageIndex = 1) {
const {rows, total} = await vk.callFunction({
url: 'client/article/list/pub/getList',
data: {
pageIndex,
pageSize: this.pageSize,
parentId: this.cateList[this.activeCateIndex]._id,
keyword: this.keyword
}
})
this.list = rows
this.total = total
window.scrollTo({top: 0})
},
navTo(url) {
vk.navigateTo({
url
})
},
},
onLoad() {
this.getCateList()
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.carousel { .carousel {
width: 1200px; width: 1200px;
margin: 20px auto; margin: 20px auto;
} }
.carousel-img { .carousel-img {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.filter-outer { .filter-outer {
width: 1200px; width: 1200px;
margin: 20px auto; margin: 20px auto;
//padding: 20px; //padding: 20px;
display: flex;
align-items: flex-start;
justify-content: flex-start;
.cate {
width: 250px;
margin-right: 30px;
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
justify-content: flex-start; justify-content: flex-start;
flex-direction: column;
.cate { .item {
width: 250px; width: 100%;
margin-right: 30px; padding: 25px 10px;
display: flex;
align-items: flex-start;
justify-content: flex-start;
flex-direction: column;
cursor: pointer;
background-color: #FFFFFF;
.title {
font-size: 18px;
}
.remark {
color: #bbb;
}
}
.active {
background-color: #CB5050;
color: white;
.remark {
color: #F2CFCE;
}
}
}
.content-wrap {
padding: 20px;
background-color: #FFFFFF;
flex: 1;
display: flex;
align-items: flex-start;
justify-content: flex-start;
flex-direction: column;
.content-item-wrap {
display: flex;
align-items: flex-start;
justify-content: flex-start;
margin: 30px 0;
.content {
margin-left: 25px;
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
justify-content: flex-start; justify-content: flex-start;
flex-direction: column; flex-direction: column;
.item { .title {
width: 100%; font-size: 20px;
padding: 25px 10px;
display: flex;
align-items: flex-start;
justify-content: flex-start;
flex-direction: column;
cursor: pointer;
background-color: #FFFFFF;
.title {
font-size: 18px;
}
.remark {
color: #bbb;
}
} }
.active { .desc {
background-color: #CB5050; font-size: 14px;
color: white; color: #bbb;
display: flex;
align-items: flex-start;
justify-content: flex-start;
margin-top: 10px;
.remark { .item {
color: #F2CFCE; padding: 0 10px;
} border-right: 2px solid #bbb;
} }
}
:first-child {
.content-wrap { padding-left: 0;
padding: 20px; }
background-color: #FFFFFF;
flex: 1; :last-child {
display: flex; border-right: none
align-items: flex-start; }
justify-content: flex-start;
flex-direction: column;
.content-item-wrap {
display: flex;
align-items: flex-start;
justify-content: flex-start;
margin: 30px 0;
.content {
margin-left: 25px;
display: flex;
align-items: flex-start;
justify-content: flex-start;
flex-direction: column;
.title {
font-size: 20px;
}
.desc {
font-size: 14px;
color: #bbb;
display: flex;
align-items: flex-start;
justify-content: flex-start;
margin-top: 10px;
.item {
padding: 0 10px;
border-right: 2px solid #bbb;
}
:first-child {
padding-left: 0;
}
:last-child {
border-right: none
}
}
}
} }
}
} }
}
} }
</style> </style>
+633
View File
@@ -0,0 +1,633 @@
<template>
<view>
<div class="outter-wrapper">
<div class="login-page">
<div class="header w-1180 flex-h-ac">
<a href="" class="zg-logo fl nuxt-link-active">
<img src="@/static/images/logo-small.png" alt="买卖钢材,上金久信">
</a>
</div>
<div class="main-container">
<div class="w-1180 flex-h-e">
<div class="login-container">
<h2 style="margin-bottom: 15px;">找回密码</h2>
<div id="from" action="">
<div class="tabContent">
<!--企业用户登录-->
<div class="login-con active" id="rc">
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_user"></i>
</div>
<input type="text" class="form-control" v-model="form1.mobile"
placeholder="请输入手机号" autocomplete="off">
</div>
<div class="input-group clear">
<input type="text" class="form-control" v-model="form1.code"
placeholder="请输入短信验证码" autocomplete="off"/>
<div @click="sendSmsCode" id="btnSendCode1" type="button"
class="btn-default" value="">{{ smsTips }}
</div>
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_password"></i>
</div>
<input type="password" class="form-control" v-model="form1.password"
placeholder="请输入新密码" autocomplete="off">
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_password"></i>
</div>
<input type="password" class="form-control" v-model="form1.repassword"
placeholder="请再次输入新密码" autocomplete="off">
</div>
</div>
</div>
<div class="input-groupp clear">
<button @click="handleSubmit" type="submit" id="login" class="btnMarymt"
style="width: 100%;">确认密码
</button>
</div>
</div>
<div class="input-groupwp clear">
<navigator url="/pages/auth/register/register" style="float: left;text-align: left;">
免费注册新账号
</navigator>
<a href="javascript:;" style="float: right;text-align: right;">
<navigator url="/pages/auth/login/login" style="float: left;text-align: left;">
登录
</navigator>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</view>
</template>
<script>
var vk = uni.vk
let timer = null
let timeS = 60
export default {
data() {
return {
memberType: 'business', // business 企业 、、personal个人
loginMethod: 'username', // username 用户名 + 密码 、、mobile 手机号 + 验证码
smsTips: '获取验证码',
form1: {
mobile: '',
password: '',
repassword: '',
code: '',
username: ''
},
};
},
methods: {
handleSubmit() {
if (this.testForm()) {
const {
password,
mobile,
code
} = this.form1
vk.userCenter.resetPasswordByMobile({
data: {
password,
mobile,
code
},
success: (data) => {
// 成功后的逻辑
this.$message({
message: "密码重置成功",
type:'success'
})
vk.redirectTo({
url: '/pages/auth/login/login'
})
}
});
}
},
sendSmsCode() {
if (timer != null) {
return
}
vk.userCenter.sendSmsCode({
loading: false,
data: {
mobile: this.form1.mobile,
type: 'reset-pwd',
},
success: (data) => {
this.$message({
message: "验证码已发送",
type: 'success'
})
timeS = 60
timer = setInterval(() => {
timeS--
if (timeS <= 0) {
this.smsTips = "重新发送"
this.stopTimer()
} else {
this.smsTips = timeS + "秒"
}
}, 1000)
}
});
},
stopTimer() {
if (timer != null) {
clearInterval(timer)
timer = null
}
},
loginSuccess() {
uni.reLaunch({
url: '/'
})
},
testForm() {
const {
mobile, // 手机号
code, // 短信验证码4-8位
password, // 密码 6-20位
repassword, // 重复输入密码
} = this.form1;
// 手机号验证
if (!mobile || !/^1[3456789]\d{9}$/.test(mobile)) {
this.$message({
message: '手机号为空或格式不正确',
type: 'error'
})
return false
}
// 短信验证码验证
if (!code || !/^\d{4,8}$/.test(code)) {
// 短信验证码为空或格式不正确
// 处理错误逻辑
this.$message({
message: '短信验证码为空或格式不正确',
type: 'error'
})
return false
}
// 密码验证
if (!password || password.length < 6 || password.length > 20) {
// 密码为空或长度不符合要求
this.$message({
message: '密码长度不符合要求',
type: 'error'
})
return false
// 处理错误逻辑
}
// 重复输入密码验证
if (password !== repassword) {
// 两次输入的密码不一致
this.$message({
message: '两次输入的密码不一致',
type: 'error'
})
return false
// 处理错误逻辑
}
return true
},
},
onUnload() {
if (timer != null) {
clearInterval(timer)
timer = null
}
}
}
</script>
<style lang="scss" scoped>
@charset "utf-8";
.login-method {
display: flex;
justify-content: space-between;
font-size: 14px;
margin-bottom: 2px;
&-item {
color: #d0111a;
cursor: pointer;
}
}
.outter-wrapper {
background-color: #fff;
}
.zg-logo img {
width: 230px;
border: none;
}
.layout-common-footer {
text-align: center;
margin: 15px 0px 10px;
}
.layout-common-footer .copyright .link > a {
color: #666;
padding: 0 10px;
display: inline-block;
line-height: 2
}
.w-1180 {
width: 1200px;
margin: 0px auto;
box-sizing: border-box;
}
.flex-h-ac {
display: flex;
align-items: center;
}
.header {
height: 90px;
}
.main-container {
min-width: 1200px;
padding: 60px 0;
background: #e8f5fd url(/static/images/login-bg.jpg) 50% no-repeat;
}
.flex-h-e,
.flex-h-e-ac {
display: flex;
flex-direction: row;
justify-content: flex-end;
}
.main-container .login-container {
width: 350px;
box-sizing: border-box;
padding: 30px 35px 30px;
background-color: #fff;
}
.login-container h2 {
text-align: center;
line-height: 2;
color: #000;
font-size: 25px;
margin-bottom: 25px;
}
.btnMarymt {
height: 48px;
line-height: 48px;
background: #a92924;
color: #fff !important;
text-align: center;
width: 100%;
background: linear-gradient(90deg, #f0242e, #d0111a);
font-size: 16px;
cursor: pointer;
text-align: center;
}
.btnMarymt:hover {
background: #f12d36
}
.input-group {
width: 100%;
height: 46px;
}
.input-group-addon {
}
.input-group .form-control {
flex: 1;
height: 100%;
border: none;
background: none;
margin-left: 12px;
outline: none;
font-size: 13px;
color: #333;
}
.input-group {
display: flex;
align-items: center;
border: 1px solid #d4d4d4;
margin-bottom: 15px;
position: relative;
}
.input-group-addon i {
background: url(/static/images/iconsmall.png) no-repeat center center;
width: 38px;
border-right: 1px solid #d4d4d4;
height: 26px;
overflow: hidden;
display: inline-block
}
.input-group-addon .icon_user {
background-position: -212px -35px;
}
.input-group-addon .icon_phone {
background-position: -212px -67px;
}
.input-group-addon .icon_password {
background-position: -212px -100px;
}
.input-group-addon .icon_yaoqingma {
background-position: -209px -318px;
}
.input-groupp {
width: 100%;
}
#btnSendCode1 {
position: absolute;
right: 1px;
top: 8px;
line-height: 31px;
color: #d0111a;
width: 79px;
text-align: center;
cursor: pointer;
border-left: 1px solid;
background: none;
font-size: 14px;
}
.input-group.focus {
background-color: #fff;
box-shadow: 0 2px 11px 0 rgba(0, 0, 0, .04)
}
.input-groupwp {
width: 100%;
text-align: center;
height: 60px;
line-height: 60px;
font-size: 14px;
margin-bottom: 10px;
}
.input-groupwpg a {
display: inline-block;
}
.input-groupwpg .dsf-wetChat i {
background: url(/static/images/iconsmall.png) no-repeat;
width: 50px;
height: 40px;
display: block;
background-position: -218px -132px;
}
.input-groupwpg .dsf-qq i {
background: url(/static/images/iconsmall.png) no-repeat;
width: 50px;
height: 40px;
display: block;
background-position: -216px -178px;
margin: 0px 24px;
}
.input-groupwpg .dsf-dx i {
background: url(/static/images/iconsmall.png) no-repeat;
width: 50px;
height: 40px;
display: block;
background-position: -215px -224px;
}
.threeBorder {
position: relative;
text-align: center;
}
.threeBorder:after {
content: '';
position: absolute;
z-index: 0;
bottom: 10px;
left: 10px;
width: 95%;
height: 1px;
border-bottom: 1px solid #CCCCCC;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
-webkit-transform-origin: 0 100%;
transform-origin: 0 100%;
}
.threeBorder span {
color: #888888;
background: #fff;
width: 90px;
margin: 0 auto;
z-index: 1002;
position: relative;
display: block;
}
.input-groupwpg {
width: 100%;
text-align: center;
height: 48px;
font-size: 14px;
margin-top: 22px;
}
.login-con {
display: none;
}
.input-grouptabs span {
color: #666;
cursor: pointer;
font-size: 16px;
line-height: 23px;
font-weight: normal;
display: inline-block;
padding: 0px 18px;
text-align: center;
margin: 0px auto;
}
.input-grouptabs {
text-align: center;
margin: 0px auto 30px;
width: 100%;
}
.input-grouptabs i {
background: url(/static/images/iconsmall.png) no-repeat;
width: 25px;
height: 25px;
float: left;
margin-right: 5px;
}
.input-grouptabs .tab-active#normal i {
background-position: -218px -269px;
}
.input-grouptabs .tab-active#nopw i {
background-position: -218px -269px;
}
.input-grouptabs #normal i {
background-position: -218px -293px;
}
.input-grouptabs #nopw i {
background-position: -218px -293px;
}
.input-grouptabs span.tab-active {
color: #a92924
}
.active {
display: block;
}
.input-groupread {
height: 40px;
line-height: 30px;
width: 100%;
text-align: left;
}
.agreement_dialogs {
position: fixed;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
width: 100%;
height: 100%;
z-index: 99999;
text-align: center;
display: none;
background-color: rgba(35, 35, 35, 0.4);
-webkit-transition: all 0.5s linear;
transition: all 0.5s linear;
}
.agreement_dialogs .dialog_lay_1syd {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
display: inline-block;
width: 750px;
color: #656565;
font-size: 12px;
line-height: 20px;
background-color: #fff;
text-align: left;
vertical-align: middle;
-webkit-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.agreement_dialogs .dialog_foot_1hHfr {
height: 80px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
border-top: 1px solid #d5d5d5;
margin: 0;
text-align: center;
}
.agreement_dialogs .dialog_minorBtn_1u8nf {
display: inline-block;
-webkit-box-sizing: border-box;
box-sizing: border-box;
border: 1px #316ccb solid;
padding: 0 30px;
height: 40px;
background: #a92924;
background: linear-gradient(90deg, #f0242e, #d0111a);
line-height: 40px;
cursor: pointer;
font-size: 16px;
vertical-align: top;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
color: #fff;
border-color: #fff;
}
.agreement_titley {
height: 55px;
line-height: 55px;
font-size: 16px;
color: #666;
text-align: center;
border-bottom: 1px solid #d5d5d5;
font-weight: 400;
}
.agreement_content {
margin: 23px 32px;
}
.con-subhead {
font-size: 14px;
font-weight: 500;
color: #333;
margin-bottom: 16px;
}
.con-content {
height: 240px;
overflow-y: scroll;
line-height: 2;
font-size: 13px;
}
</style>
+576 -538
View File
File diff suppressed because it is too large Load Diff
+642
View File
@@ -0,0 +1,642 @@
<template>
<view>
<div class="outter-wrapper">
<div class="login-page">
<div class="header w-1180 flex-h-ac">
<a href="" class="zg-logo fl nuxt-link-active">
<img src="@/static/images/logo-small.png" alt="买卖钢材,上金久信">
</a>
</div>
<div class="main-container">
<div class="w-1180 flex-h-e">
<div class="login-container">
<h2 style="margin-bottom: 15px;">QQ登录</h2>
<template v-if="showBind">
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_user"></i>
</div>
<input v-model="form1.mobile" type="text" class="form-control" name="mobile"
placeholder="请输入手机号" autocomplete="off">
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_phone"></i>
</div>
<input type="text" class="form-control" v-model="form1.smsCode" name="smsCode"
placeholder="请输入短信验证码" autocomplete="off"/>
<view @click="sendSmsCode" id="btnSendCode1" type="button"
class="btn-default" value="">{{ smsTips }}
</view>
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_password"></i>
</div>
<input type="password" class="form-control" v-model="form1.password" name="password"
placeholder="设置登录密码" autocomplete="off">
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_password"></i>
</div>
<input type="password" class="form-control" v-model="form1.repassword"
placeholder="确认登录密码" autocomplete="off">
</div>
<div class="input-groupp clear">
<button @click="handleSubmit" type="submit" id="login" class="btnMarymt"
style="width: 100%;">绑定并登录
</button>
</div>
</template>
</div>
</div>
</div>
</div>
</div>
</view>
</template>
<script>
import {Loading} from "element-ui";
var vk = uni.vk
let timer = null
let timeS = 60
export default {
data() {
return {
showBind: false,
smsTips: '获取验证码',
form1: {
mobile: '',
password: '',
repassword: '',
smsCode: '',
username: ''
},
accountType: null
};
},
methods: {
handleSubmit() {
if (this.testForm()) {
vk.userCenter.bindMobile({
data: {
mobile: this.form1.mobile,
code: this.form1.smsCode,
},
success: () => {
vk.userCenter.resetPwd({
data: {
password: this.form1.password,
},
success: () => {
vk.redirectTo({url: '/pages/auth/login/login'})
}
})
}
})
}
},
sendSmsCode() {
if (timer != null) {
return
}
vk.userCenter.sendSmsCode({
loading: false,
data: {
mobile: this.form1.mobile,
type: 'bind',
},
success: (data) => {
this.$message({
message: "验证码已发送",
type: 'success'
})
timeS = 60
timer = setInterval(() => {
timeS--
if (timeS <= 0) {
this.smsTips = "重新发送"
this.stopTimer()
} else {
this.smsTips = timeS + "秒"
}
}, 1000)
}
});
},
stopTimer() {
if (timer != null) {
clearInterval(timer)
timer = null
}
},
loginSuccess() {
uni.reLaunch({
url: '/'
})
},
async loginByQQ(code, accountType) {
let loadingInstance1 = Loading.service({fullscreen: true, text: '登录中...'});
const res = await vk.callFunction({
url: 'user/pub/loginByQQ',
data: {code, accountType}
})
loadingInstance1.close()
if (res.code === 0) {
this.loading = false
if (!res.mobileConfirmed) {
this.showBind = !res.mobileConfirmed
this.accountType = parseInt(accountType)
} else this.loginSuccess()
}
},
testForm() {
const {
mobile, // 手机号
smsCode, // 短信验证码4-8位
password, // 密码 6-20位
repassword, // 重复输入密码
} = this.form1;
// 手机号验证
if (!mobile || !/^1[3456789]\d{9}$/.test(mobile)) {
this.$message({
message: '手机号为空或格式不正确',
type: 'error'
})
return false
}
// 短信验证码验证
if (!smsCode || !/^\d{4,8}$/.test(smsCode)) {
// 短信验证码为空或格式不正确
// 处理错误逻辑
this.$message({
message: '短信验证码为空或格式不正确',
type: 'error'
})
return false
}
// 密码验证
if (!password || password.length < 6 || password.length > 20) {
// 密码为空或长度不符合要求
this.$message({
message: '密码长度不符合要求',
type: 'error'
})
return false
// 处理错误逻辑
}
// 重复输入密码验证
if (password !== repassword) {
// 两次输入的密码不一致
this.$message({
message: '两次输入的密码不一致',
type: 'error'
})
return false
// 处理错误逻辑
}
return true
},
},
onLoad(options) {
if (options.state && options.state.includes('jjx')) {
this.loginByQQ(options.code, options.state.split('_')[1])
} else vk.redirectTo({url: '/pages/index/index'})
},
onUnload() {
if (timer != null) {
clearInterval(timer)
timer = null
}
}
}
</script>
<style lang="scss" scoped>
@charset "utf-8";
.login-method {
display: flex;
justify-content: space-between;
font-size: 14px;
margin-bottom: 2px;
&-item {
color: #d0111a;
cursor: pointer;
}
}
.outter-wrapper {
background-color: #fff;
}
.zg-logo img {
width: 230px;
border: none;
}
.layout-common-footer {
text-align: center;
margin: 15px 0px 10px;
}
.layout-common-footer .copyright .link > a {
color: #666;
padding: 0 10px;
display: inline-block;
line-height: 2
}
.w-1180 {
width: 1200px;
margin: 0px auto;
box-sizing: border-box;
}
.flex-h-ac {
display: flex;
align-items: center;
}
.header {
height: 90px;
}
.main-container {
min-width: 1200px;
padding: 60px 0;
background: #e8f5fd url(/static/images/login-bg.jpg) 50% no-repeat;
}
.flex-h-e,
.flex-h-e-ac {
display: flex;
flex-direction: row;
justify-content: flex-end;
}
.main-container .login-container {
height: 530px;
width: 350px;
box-sizing: border-box;
padding: 30px 35px 30px;
background-color: #fff;
}
.login-container h2 {
text-align: center;
line-height: 2;
color: #000;
font-size: 25px;
margin-bottom: 25px;
}
.btnMarymt {
height: 48px;
line-height: 48px;
background: #a92924;
color: #fff !important;
text-align: center;
width: 100%;
background: linear-gradient(90deg, #f0242e, #d0111a);
font-size: 16px;
cursor: pointer;
text-align: center;
}
.btnMarymt:hover {
background: #f12d36
}
.input-group {
width: 100%;
height: 46px;
}
.input-group-addon {
}
.input-group .form-control {
flex: 1;
height: 100%;
border: none;
background: none;
margin-left: 12px;
outline: none;
font-size: 13px;
color: #333;
}
.input-group {
display: flex;
align-items: center;
border: 1px solid #d4d4d4;
margin-bottom: 15px;
position: relative;
}
.input-group-addon i {
background: url(/static/images/iconsmall.png) no-repeat center center;
width: 38px;
border-right: 1px solid #d4d4d4;
height: 26px;
overflow: hidden;
display: inline-block
}
.input-group-addon .icon_user {
background-position: -212px -35px;
}
.input-group-addon .icon_phone {
background-position: -212px -67px;
}
.input-group-addon .icon_password {
background-position: -212px -100px;
}
.input-group-addon .icon_yaoqingma {
background-position: -209px -318px;
}
.input-groupp {
width: 100%;
}
#btnSendCode1 {
position: absolute;
right: 1px;
top: 8px;
line-height: 31px;
color: #d0111a;
width: 79px;
text-align: center;
cursor: pointer;
border-left: 1px solid;
background: none;
font-size: 14px;
}
.input-group.focus {
background-color: #fff;
box-shadow: 0 2px 11px 0 rgba(0, 0, 0, .04)
}
.input-groupwp {
width: 100%;
text-align: center;
height: 60px;
line-height: 60px;
font-size: 14px;
margin-bottom: 10px;
}
.input-groupwpg a {
display: inline-block;
}
.input-groupwpg .dsf-wetChat i {
background: url(/static/images/iconsmall.png) no-repeat;
width: 50px;
height: 40px;
display: block;
background-position: -218px -132px;
}
.input-groupwpg .dsf-qq i {
background: url(/static/images/iconsmall.png) no-repeat;
width: 50px;
height: 40px;
display: block;
background-position: -216px -178px;
margin: 0px 24px;
}
.input-groupwpg .dsf-dx i {
background: url(/static/images/iconsmall.png) no-repeat;
width: 50px;
height: 40px;
display: block;
background-position: -215px -224px;
}
.threeBorder {
position: relative;
text-align: center;
}
.threeBorder:after {
content: '';
position: absolute;
z-index: 0;
bottom: 10px;
left: 10px;
width: 95%;
height: 1px;
border-bottom: 1px solid #CCCCCC;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
-webkit-transform-origin: 0 100%;
transform-origin: 0 100%;
}
.threeBorder span {
color: #888888;
background: #fff;
width: 90px;
margin: 0 auto;
z-index: 1002;
position: relative;
display: block;
}
.input-groupwpg {
width: 100%;
text-align: center;
height: 48px;
font-size: 14px;
margin-top: 22px;
}
.login-con {
display: none;
}
.input-grouptabs span {
color: #666;
cursor: pointer;
font-size: 16px;
line-height: 23px;
font-weight: normal;
display: inline-block;
padding: 0px 18px;
text-align: center;
margin: 0px auto;
}
.input-grouptabs {
text-align: center;
margin: 0px auto 30px;
width: 100%;
}
.input-grouptabs i {
background: url(/static/images/iconsmall.png) no-repeat;
width: 25px;
height: 25px;
float: left;
margin-right: 5px;
}
.input-grouptabs .tab-active#normal i {
background-position: -218px -269px;
}
.input-grouptabs .tab-active#nopw i {
background-position: -218px -269px;
}
.input-grouptabs #normal i {
background-position: -218px -293px;
}
.input-grouptabs #nopw i {
background-position: -218px -293px;
}
.input-grouptabs span.tab-active {
color: #a92924
}
.active {
display: block;
}
.input-groupread {
height: 40px;
line-height: 30px;
width: 100%;
text-align: left;
}
.agreement_dialogs {
position: fixed;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
width: 100%;
height: 100%;
z-index: 99999;
text-align: center;
display: none;
background-color: rgba(35, 35, 35, 0.4);
-webkit-transition: all 0.5s linear;
transition: all 0.5s linear;
}
.agreement_dialogs .dialog_lay_1syd {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
display: inline-block;
width: 750px;
color: #656565;
font-size: 12px;
line-height: 20px;
background-color: #fff;
text-align: left;
vertical-align: middle;
-webkit-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.agreement_dialogs .dialog_foot_1hHfr {
height: 80px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
border-top: 1px solid #d5d5d5;
margin: 0;
text-align: center;
}
.agreement_dialogs .dialog_minorBtn_1u8nf {
display: inline-block;
-webkit-box-sizing: border-box;
box-sizing: border-box;
border: 1px #316ccb solid;
padding: 0 30px;
height: 40px;
background: #a92924;
background: linear-gradient(90deg, #f0242e, #d0111a);
line-height: 40px;
cursor: pointer;
font-size: 16px;
vertical-align: top;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
color: #fff;
border-color: #fff;
}
.agreement_titley {
height: 55px;
line-height: 55px;
font-size: 16px;
color: #666;
text-align: center;
border-bottom: 1px solid #d5d5d5;
font-weight: 400;
}
.agreement_content {
margin: 23px 32px;
}
.con-subhead {
font-size: 14px;
font-weight: 500;
color: #333;
margin-bottom: 16px;
}
.con-content {
height: 240px;
overflow-y: scroll;
line-height: 2;
font-size: 13px;
}
</style>
+728
View File
@@ -0,0 +1,728 @@
<template>
<view>
<div class="outter-wrapper">
<div class="login-page">
<div class="header w-1180 flex-h-ac">
<a href="" class="zg-logo fl nuxt-link-active">
<img src="@/static/images/logo-small.png" alt="买卖钢材,上金久信">
</a>
</div>
<div class="main-container">
<div class="w-1180 flex-h-e">
<div class="login-container">
<h2 style="margin-bottom: 15px;">手机号绑定</h2>
<template v-if="showBind">
<div class="input-grouptabs clear">
<span @click="form1.accountType = 2"
:class="{'tab-active': form1.accountType === 2}" class="nopassword"
data-id="1"
id="nopw"><i></i>企业用户</span>
<span @click="form1.accountType = 1"
:class="{'tab-active': form1.accountType === 1}" class="normal" data-id="0"
id="normal"><i></i>个人用户</span>
</div>
<div v-show="form1.accountType === 1" class="input-group clear">
<div class="input-group-addon">
<i class="icon_yaoqingma"></i>
</div>
<input type="text" class="form-control" v-model="form1.nickname"
placeholder="请输入姓名" autocomplete="off">
</div>
<div v-show="form1.accountType === 2" class="input-group clear">
<div class="input-group-addon">
<i class="icon_yaoqingma"></i>
</div>
<input type="text" class="form-control" v-model="form1.nickname"
placeholder="请输入公司名称" autocomplete="off">
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_user"></i>
</div>
<input v-model="form1.mobile" type="text" class="form-control" name="mobile"
placeholder="请输入手机号" autocomplete="off">
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_phone"></i>
</div>
<input type="text" class="form-control" v-model="form1.smsCode" name="smsCode"
placeholder="请输入短信验证码" autocomplete="off"/>
<view @click="sendSmsCode" id="btnSendCode1" type="button"
class="btn-default" value="">{{ smsTips }}
</view>
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_password"></i>
</div>
<input type="password" class="form-control" v-model="form1.password" name="password"
placeholder="设置登录密码" autocomplete="off">
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_password"></i>
</div>
<input type="password" class="form-control" v-model="form1.repassword"
placeholder="确认登录密码" autocomplete="off">
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_yaoqingma"></i>
</div>
<input type="text" class="form-control" v-model="form1.inviteCode"
placeholder="请输入邀请码,选填" autocomplete="off">
</div>
<div class="input-groupread clear">
<el-checkbox v-model="agree"></el-checkbox>
<label class="ml-20">阅读并同意<a href="javascript:;" style="display: inline-block;"
@click="getInfo">
<span style="color: #3288b2">《金久信注册协议》</span></a></label>
</div>
<div class="input-groupp clear">
<button @click="handleSubmit" type="submit" id="login" class="btnMarymt"
style="width: 100%;">绑定
</button>
</div>
</template>
</div>
</div>
</div>
</div>
</div>
<el-dialog title="" :visible.sync="dialogVisible" width="40%">
<div v-html="info"></div>
</el-dialog>
</view>
</template>
<script>
import {Loading} from "element-ui";
var vk = uni.vk
let timer = null
let timeS = 60
export default {
data() {
return {
dialogVisible: false,
agree: false,
info: null,
showBind: false,
smsTips: '获取验证码',
form1: {
mobile: '',
password: '',
repassword: '',
smsCode: '',
username: '',
inviteCode: '',
accountType: 2,
nickname: '',
},
accountType: null,
code: null,
loginType: null,
uid: null
};
},
methods: {
async handleSubmit() {
if (!this.agree) {
this.$message({
message: '请先阅读并同意《金久信注册协议》',
type: 'warning'
})
return
}
if (this.testForm()) {
await vk.callFunction({
url: '/client/user/kh/updateLoginInfo',
data: {
uid: this.uid,
accountType: this.form1.accountType,
nickname: this.form1.nickname,
inviteCode: this.form1.inviteCode,
}
})
vk.userCenter.bindMobile({
data: {
mobile: this.form1.mobile,
code: this.form1.smsCode,
},
success: () => {
vk.userCenter.resetPwd({
data: {
password: this.form1.password,
},
success: async () => {
vk.redirectTo({url: '/pages/auth/login/login'})
}
})
}
})
}
},
sendSmsCode() {
if (timer != null) {
return
}
vk.userCenter.sendSmsCode({
loading: false,
data: {
mobile: this.form1.mobile,
type: 'bind',
},
success: (data) => {
this.$message({
message: "验证码已发送",
type: 'success'
})
timeS = 60
timer = setInterval(() => {
timeS--
if (timeS <= 0) {
this.smsTips = "重新发送"
this.stopTimer()
} else {
this.smsTips = timeS + "秒"
}
}, 1000)
}
});
},
stopTimer() {
if (timer != null) {
clearInterval(timer)
timer = null
}
},
loginSuccess() {
uni.reLaunch({url: '/'})
},
testForm() {
const {
mobile, // 手机号
smsCode, // 短信验证码4-8位
password, // 密码 6-20位
repassword, // 重复输入密码
nickname
} = this.form1;
// 手机号验证
if (!mobile || !/^1[3456789]\d{9}$/.test(mobile)) {
this.$message({
message: '手机号为空或格式不正确',
type: 'error'
})
return false
}
// 短信验证码验证
if (!smsCode || !/^\d{4,8}$/.test(smsCode)) {
// 短信验证码为空或格式不正确
// 处理错误逻辑
this.$message({
message: '短信验证码为空或格式不正确',
type: 'error'
})
return false
}
// 密码验证
if (!password || password.length < 6 || password.length > 20) {
// 密码为空或长度不符合要求
this.$message({
message: '密码长度不符合要求',
type: 'error'
})
return false
// 处理错误逻辑
}
const reg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]+$/
if (!reg.test(password)) {
this.$message({
message: '密码必须由数字和字母组成',
type: 'error'
})
return false
}
// 重复输入密码验证
if (password !== repassword) {
// 两次输入的密码不一致
this.$message({
message: '两次输入的密码不一致',
type: 'error'
})
return false
// 处理错误逻辑
}
if (!nickname) {
return this.$message({
message: '请输入' + (this.form1.accountType === 2 ? '公司名称' : '您的姓名'),
type: 'error'
})
}
return true
},
async getInfo() {
const {content} = await vk.callFunction({
url: `client/otherArticle/list/pub/getDetail`,
data: {id: 'adea4666684a336402937a2c5dcc448e'}
});
this.info = content
this.dialogVisible = true
}
},
async onLoad(options) {
if (options.state && options.state.includes('jjx')) {
this.form1.accountType = parseInt(options.state.split('_')[1])
if (options.code) {
this.code = options.code
const {uid, type, mobileConfirmed} = await vk.callFunction({
url: 'user/pub/loginByWeixin',
data: {
code: this.code,
accountType: this.form1.accountType,
},
})
this.uid = uid
this.showBind = type === "register"
if (mobileConfirmed) this.loginSuccess()
else this.showBind = true
} else {
this.showBind = !vk.getVuex('$user.userInfo.mobile')
}
} else this.loginSuccess()
},
onUnload() {
if (timer != null) {
clearInterval(timer)
timer = null
}
}
}
</script>
<style lang="scss" scoped>
@charset "utf-8";
.login-method {
display: flex;
justify-content: space-between;
font-size: 14px;
margin-bottom: 2px;
&-item {
color: #d0111a;
cursor: pointer;
}
}
.outter-wrapper {
background-color: #fff;
}
.zg-logo img {
width: 230px;
border: none;
}
.layout-common-footer {
text-align: center;
margin: 15px 0px 10px;
}
.layout-common-footer .copyright .link > a {
color: #666;
padding: 0 10px;
display: inline-block;
line-height: 2
}
.w-1180 {
width: 1200px;
margin: 0px auto;
box-sizing: border-box;
}
.flex-h-ac {
display: flex;
align-items: center;
}
.header {
height: 90px;
}
.main-container {
min-width: 1200px;
padding: 60px 0;
background: #e8f5fd url(/static/images/login-bg.jpg) 50% no-repeat;
}
.flex-h-e,
.flex-h-e-ac {
display: flex;
flex-direction: row;
justify-content: flex-end;
}
.main-container .login-container {
height: 640px;
width: 350px;
box-sizing: border-box;
padding: 30px 35px 30px;
background-color: #fff;
}
.login-container h2 {
text-align: center;
line-height: 2;
color: #000;
font-size: 25px;
margin-bottom: 25px;
}
.btnMarymt {
height: 48px;
line-height: 48px;
background: #a92924;
color: #fff !important;
text-align: center;
width: 100%;
background: linear-gradient(90deg, #f0242e, #d0111a);
font-size: 16px;
cursor: pointer;
text-align: center;
}
.btnMarymt:hover {
background: #f12d36
}
.input-group {
width: 100%;
height: 46px;
}
.input-group-addon {
}
.input-group .form-control {
flex: 1;
height: 100%;
border: none;
background: none;
margin-left: 12px;
outline: none;
font-size: 13px;
color: #333;
}
.input-group {
display: flex;
align-items: center;
border: 1px solid #d4d4d4;
margin-bottom: 15px;
position: relative;
}
.input-group-addon i {
background: url(/static/images/iconsmall.png) no-repeat center center;
width: 38px;
border-right: 1px solid #d4d4d4;
height: 26px;
overflow: hidden;
display: inline-block
}
.input-group-addon .icon_user {
background-position: -212px -35px;
}
.input-group-addon .icon_phone {
background-position: -212px -67px;
}
.input-group-addon .icon_password {
background-position: -212px -100px;
}
.input-group-addon .icon_yaoqingma {
background-position: -209px -318px;
}
.input-groupp {
width: 100%;
}
#btnSendCode1 {
position: absolute;
right: 1px;
top: 8px;
line-height: 31px;
color: #d0111a;
width: 79px;
text-align: center;
cursor: pointer;
border-left: 1px solid;
background: none;
font-size: 14px;
}
.input-group.focus {
background-color: #fff;
box-shadow: 0 2px 11px 0 rgba(0, 0, 0, .04)
}
.input-groupwp {
width: 100%;
text-align: center;
height: 60px;
line-height: 60px;
font-size: 14px;
margin-bottom: 10px;
}
.input-groupwpg a {
display: inline-block;
}
.input-groupwpg .dsf-wetChat i {
background: url(/static/images/iconsmall.png) no-repeat;
width: 50px;
height: 40px;
display: block;
background-position: -218px -132px;
}
.input-groupwpg .dsf-qq i {
background: url(/static/images/iconsmall.png) no-repeat;
width: 50px;
height: 40px;
display: block;
background-position: -216px -178px;
margin: 0px 24px;
}
.input-groupwpg .dsf-dx i {
background: url(/static/images/iconsmall.png) no-repeat;
width: 50px;
height: 40px;
display: block;
background-position: -215px -224px;
}
.threeBorder {
position: relative;
text-align: center;
}
.threeBorder:after {
content: '';
position: absolute;
z-index: 0;
bottom: 10px;
left: 10px;
width: 95%;
height: 1px;
border-bottom: 1px solid #CCCCCC;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
-webkit-transform-origin: 0 100%;
transform-origin: 0 100%;
}
.threeBorder span {
color: #888888;
background: #fff;
width: 90px;
margin: 0 auto;
z-index: 1002;
position: relative;
display: block;
}
.input-groupwpg {
width: 100%;
text-align: center;
height: 48px;
font-size: 14px;
margin-top: 22px;
}
.login-con {
display: none;
}
.input-grouptabs span {
color: #666;
cursor: pointer;
font-size: 16px;
line-height: 23px;
font-weight: normal;
display: inline-block;
padding: 0px 18px;
text-align: center;
margin: 0px auto;
}
.input-grouptabs {
text-align: center;
margin: 0px auto 30px;
width: 100%;
}
.input-grouptabs i {
background: url(/static/images/iconsmall.png) no-repeat;
width: 25px;
height: 25px;
float: left;
margin-right: 5px;
}
.input-grouptabs .tab-active#normal i {
background-position: -218px -269px;
}
.input-grouptabs .tab-active#nopw i {
background-position: -218px -269px;
}
.input-grouptabs #normal i {
background-position: -218px -293px;
}
.input-grouptabs #nopw i {
background-position: -218px -293px;
}
.input-grouptabs span.tab-active {
color: #a92924
}
.active {
display: block;
}
.input-groupread {
height: 40px;
line-height: 30px;
width: 100%;
text-align: left;
}
.agreement_dialogs {
position: fixed;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
width: 100%;
height: 100%;
z-index: 99999;
text-align: center;
display: none;
background-color: rgba(35, 35, 35, 0.4);
-webkit-transition: all 0.5s linear;
transition: all 0.5s linear;
}
.agreement_dialogs .dialog_lay_1syd {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
display: inline-block;
width: 750px;
color: #656565;
font-size: 12px;
line-height: 20px;
background-color: #fff;
text-align: left;
vertical-align: middle;
-webkit-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.agreement_dialogs .dialog_foot_1hHfr {
height: 80px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
border-top: 1px solid #d5d5d5;
margin: 0;
text-align: center;
}
.agreement_dialogs .dialog_minorBtn_1u8nf {
display: inline-block;
-webkit-box-sizing: border-box;
box-sizing: border-box;
border: 1px #316ccb solid;
padding: 0 30px;
height: 40px;
background: #a92924;
background: linear-gradient(90deg, #f0242e, #d0111a);
line-height: 40px;
cursor: pointer;
font-size: 16px;
vertical-align: top;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
color: #fff;
border-color: #fff;
}
.agreement_titley {
height: 55px;
line-height: 55px;
font-size: 16px;
color: #666;
text-align: center;
border-bottom: 1px solid #d5d5d5;
font-weight: 400;
}
.agreement_content {
margin: 23px 32px;
}
.con-subhead {
font-size: 14px;
font-weight: 500;
color: #333;
margin-bottom: 16px;
}
.con-content {
height: 240px;
overflow-y: scroll;
line-height: 2;
font-size: 13px;
}
</style>
+717
View File
@@ -0,0 +1,717 @@
<template>
<view>
<div class="outter-wrapper">
<div class="login-page">
<div class="header w-1180 flex-h-ac">
<a href="" class="zg-logo fl nuxt-link-active">
<img src="@/static/images/logo-small.png" alt="买卖钢材,上金久信">
</a>
</div>
<div class="main-container">
<div class="w-1180 flex-h-e">
<div class="login-container">
<h2 style="margin-bottom: 15px;">手机号绑定</h2>
<template v-if="showBind">
<div class="input-grouptabs clear">
<span @click="form1.accountType = 2"
:class="{'tab-active': form1.accountType === 2}" class="nopassword"
data-id="1"
id="nopw"><i></i>企业用户</span>
<span @click="form1.accountType = 1"
:class="{'tab-active': form1.accountType === 1}" class="normal" data-id="0"
id="normal"><i></i>个人用户</span>
</div>
<div v-show="form1.accountType === 1" class="input-group clear">
<div class="input-group-addon">
<i class="icon_yaoqingma"></i>
</div>
<input type="text" class="form-control" v-model="form1.nickname"
placeholder="请输入姓名" autocomplete="off">
</div>
<div v-show="form1.accountType === 2" class="input-group clear">
<div class="input-group-addon">
<i class="icon_yaoqingma"></i>
</div>
<input type="text" class="form-control" v-model="form1.nickname"
placeholder="请输入公司名称" autocomplete="off">
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_user"></i>
</div>
<input v-model="form1.mobile" type="text" class="form-control" name="mobile"
placeholder="请输入手机号" autocomplete="off">
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_phone"></i>
</div>
<input type="text" class="form-control" v-model="form1.smsCode" name="smsCode"
placeholder="请输入短信验证码" autocomplete="off"/>
<view @click="sendSmsCode" id="btnSendCode1" type="button"
class="btn-default" value="">{{ smsTips }}
</view>
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_password"></i>
</div>
<input type="password" class="form-control" v-model="form1.password" name="password"
placeholder="设置登录密码" autocomplete="off">
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_password"></i>
</div>
<input type="password" class="form-control" v-model="form1.repassword"
placeholder="确认登录密码" autocomplete="off">
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_yaoqingma"></i>
</div>
<input type="text" class="form-control" v-model="form1.inviteCode"
placeholder="请输入邀请码,选填" autocomplete="off">
</div>
<div class="input-groupread clear">
<el-checkbox v-model="agree"></el-checkbox>
<label class="ml-20">阅读并同意<a href="javascript:;" style="display: inline-block;"
@click="getInfo">
<span style="color: #3288b2">《金久信注册协议》</span></a></label>
</div>
<div class="input-groupp clear">
<button @click="handleSubmit" type="submit" id="login" class="btnMarymt"
style="width: 100%;">绑定
</button>
</div>
</template>
</div>
</div>
</div>
</div>
</div>
<el-dialog title="" :visible.sync="dialogVisible" width="40%">
<div v-html="info"></div>
</el-dialog>
</view>
</template>
<script>
import {Loading} from "element-ui";
var vk = uni.vk
let timer = null
let timeS = 60
export default {
data() {
return {
dialogVisible: false,
agree: false,
info: null,
showBind: false,
smsTips: '获取验证码',
form1: {
mobile: '',
password: '',
repassword: '',
smsCode: '',
username: '',
inviteCode: '',
accountType: 2,
nickname: '',
},
accountType: null,
code: null,
loginType: null,
uid: null
};
},
methods: {
async handleSubmit() {
if (!this.agree) {
this.$message({
message: '请先阅读并同意《金久信注册协议》',
type: 'warning'
})
return
}
if (this.testForm()) {
await vk.callFunction({
url: '/client/user/kh/updateLoginInfo',
data: {
uid: this.uid,
accountType: this.form1.accountType,
nickname: this.form1.nickname,
}
})
vk.userCenter.bindMobile({
data: {
mobile: this.form1.mobile,
code: this.form1.smsCode,
},
success: () => {
vk.userCenter.resetPwd({
data: {
password: this.form1.password,
},
success: async () => {
vk.redirectTo({url: '/pages/auth/login/login'})
}
})
}
})
}
},
sendSmsCode() {
if (timer != null) {
return
}
vk.userCenter.sendSmsCode({
loading: false,
data: {
mobile: this.form1.mobile,
type: 'bind',
},
success: (data) => {
this.$message({
message: "验证码已发送",
type: 'success'
})
timeS = 60
timer = setInterval(() => {
timeS--
if (timeS <= 0) {
this.smsTips = "重新发送"
this.stopTimer()
} else {
this.smsTips = timeS + "秒"
}
}, 1000)
}
});
},
stopTimer() {
if (timer != null) {
clearInterval(timer)
timer = null
}
},
loginSuccess() {
uni.reLaunch({url: '/'})
},
testForm() {
const {
mobile, // 手机号
smsCode, // 短信验证码4-8位
password, // 密码 6-20位
repassword, // 重复输入密码
nickname
} = this.form1;
// 手机号验证
if (!mobile || !/^1[3456789]\d{9}$/.test(mobile)) {
this.$message({
message: '手机号为空或格式不正确',
type: 'error'
})
return false
}
// 短信验证码验证
if (!smsCode || !/^\d{4,8}$/.test(smsCode)) {
// 短信验证码为空或格式不正确
// 处理错误逻辑
this.$message({
message: '短信验证码为空或格式不正确',
type: 'error'
})
return false
}
// 密码验证
if (!password || password.length < 6 || password.length > 20) {
// 密码为空或长度不符合要求
this.$message({
message: '密码长度不符合要求',
type: 'error'
})
return false
// 处理错误逻辑
}
// 重复输入密码验证
if (password !== repassword) {
// 两次输入的密码不一致
this.$message({
message: '两次输入的密码不一致',
type: 'error'
})
return false
// 处理错误逻辑
}
if (!nickname) {
return this.$message({
message: '请输入' + (this.form1.accountType === 2 ? '公司名称' : '您的姓名'),
type: 'error'
})
}
return true
},
async getInfo() {
const {content} = await vk.callFunction({
url: `client/otherArticle/list/pub/getDetail`,
data: {id: '65792dc8652341901b34a0bc'}
});
this.info = content
this.dialogVisible = true
}
},
async onLoad(options) {
// if (options.state && options.state.includes('jjx')) {
// this.form1.accountType = parseInt(options.state.split('_')[1])
// if (options.code) {
// this.code = options.code
// const {uid, type, mobileConfirmed} = await vk.callFunction({
// url: 'user/pub/loginByWeixin',
// data: {
// code: this.code,
// accountType: this.form1.accountType,
// },
// })
// this.uid = uid
// this.showBind = type === "register"
// if (mobileConfirmed) this.loginSuccess()
//
// } else {
// this.showBind = !vk.getVuex('$user.userInfo.mobile')
// }
// } else this.loginSuccess()
},
onUnload() {
if (timer != null) {
clearInterval(timer)
timer = null
}
}
}
</script>
<style lang="scss" scoped>
@charset "utf-8";
.login-method {
display: flex;
justify-content: space-between;
font-size: 14px;
margin-bottom: 2px;
&-item {
color: #d0111a;
cursor: pointer;
}
}
.outter-wrapper {
background-color: #fff;
}
.zg-logo img {
width: 230px;
border: none;
}
.layout-common-footer {
text-align: center;
margin: 15px 0px 10px;
}
.layout-common-footer .copyright .link > a {
color: #666;
padding: 0 10px;
display: inline-block;
line-height: 2
}
.w-1180 {
width: 1200px;
margin: 0px auto;
box-sizing: border-box;
}
.flex-h-ac {
display: flex;
align-items: center;
}
.header {
height: 90px;
}
.main-container {
min-width: 1200px;
padding: 60px 0;
background: #e8f5fd url(/static/images/login-bg.jpg) 50% no-repeat;
}
.flex-h-e,
.flex-h-e-ac {
display: flex;
flex-direction: row;
justify-content: flex-end;
}
.main-container .login-container {
height: 640px;
width: 350px;
box-sizing: border-box;
padding: 30px 35px 30px;
background-color: #fff;
}
.login-container h2 {
text-align: center;
line-height: 2;
color: #000;
font-size: 25px;
margin-bottom: 25px;
}
.btnMarymt {
height: 48px;
line-height: 48px;
background: #a92924;
color: #fff !important;
text-align: center;
width: 100%;
background: linear-gradient(90deg, #f0242e, #d0111a);
font-size: 16px;
cursor: pointer;
text-align: center;
}
.btnMarymt:hover {
background: #f12d36
}
.input-group {
width: 100%;
height: 46px;
}
.input-group-addon {
}
.input-group .form-control {
flex: 1;
height: 100%;
border: none;
background: none;
margin-left: 12px;
outline: none;
font-size: 13px;
color: #333;
}
.input-group {
display: flex;
align-items: center;
border: 1px solid #d4d4d4;
margin-bottom: 15px;
position: relative;
}
.input-group-addon i {
background: url(/static/images/iconsmall.png) no-repeat center center;
width: 38px;
border-right: 1px solid #d4d4d4;
height: 26px;
overflow: hidden;
display: inline-block
}
.input-group-addon .icon_user {
background-position: -212px -35px;
}
.input-group-addon .icon_phone {
background-position: -212px -67px;
}
.input-group-addon .icon_password {
background-position: -212px -100px;
}
.input-group-addon .icon_yaoqingma {
background-position: -209px -318px;
}
.input-groupp {
width: 100%;
}
#btnSendCode1 {
position: absolute;
right: 1px;
top: 8px;
line-height: 31px;
color: #d0111a;
width: 79px;
text-align: center;
cursor: pointer;
border-left: 1px solid;
background: none;
font-size: 14px;
}
.input-group.focus {
background-color: #fff;
box-shadow: 0 2px 11px 0 rgba(0, 0, 0, .04)
}
.input-groupwp {
width: 100%;
text-align: center;
height: 60px;
line-height: 60px;
font-size: 14px;
margin-bottom: 10px;
}
.input-groupwpg a {
display: inline-block;
}
.input-groupwpg .dsf-wetChat i {
background: url(/static/images/iconsmall.png) no-repeat;
width: 50px;
height: 40px;
display: block;
background-position: -218px -132px;
}
.input-groupwpg .dsf-qq i {
background: url(/static/images/iconsmall.png) no-repeat;
width: 50px;
height: 40px;
display: block;
background-position: -216px -178px;
margin: 0px 24px;
}
.input-groupwpg .dsf-dx i {
background: url(/static/images/iconsmall.png) no-repeat;
width: 50px;
height: 40px;
display: block;
background-position: -215px -224px;
}
.threeBorder {
position: relative;
text-align: center;
}
.threeBorder:after {
content: '';
position: absolute;
z-index: 0;
bottom: 10px;
left: 10px;
width: 95%;
height: 1px;
border-bottom: 1px solid #CCCCCC;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
-webkit-transform-origin: 0 100%;
transform-origin: 0 100%;
}
.threeBorder span {
color: #888888;
background: #fff;
width: 90px;
margin: 0 auto;
z-index: 1002;
position: relative;
display: block;
}
.input-groupwpg {
width: 100%;
text-align: center;
height: 48px;
font-size: 14px;
margin-top: 22px;
}
.login-con {
display: none;
}
.input-grouptabs span {
color: #666;
cursor: pointer;
font-size: 16px;
line-height: 23px;
font-weight: normal;
display: inline-block;
padding: 0px 18px;
text-align: center;
margin: 0px auto;
}
.input-grouptabs {
text-align: center;
margin: 0px auto 30px;
width: 100%;
}
.input-grouptabs i {
background: url(/static/images/iconsmall.png) no-repeat;
width: 25px;
height: 25px;
float: left;
margin-right: 5px;
}
.input-grouptabs .tab-active#normal i {
background-position: -218px -269px;
}
.input-grouptabs .tab-active#nopw i {
background-position: -218px -269px;
}
.input-grouptabs #normal i {
background-position: -218px -293px;
}
.input-grouptabs #nopw i {
background-position: -218px -293px;
}
.input-grouptabs span.tab-active {
color: #a92924
}
.active {
display: block;
}
.input-groupread {
height: 40px;
line-height: 30px;
width: 100%;
text-align: left;
}
.agreement_dialogs {
position: fixed;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
width: 100%;
height: 100%;
z-index: 99999;
text-align: center;
display: none;
background-color: rgba(35, 35, 35, 0.4);
-webkit-transition: all 0.5s linear;
transition: all 0.5s linear;
}
.agreement_dialogs .dialog_lay_1syd {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
display: inline-block;
width: 750px;
color: #656565;
font-size: 12px;
line-height: 20px;
background-color: #fff;
text-align: left;
vertical-align: middle;
-webkit-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.agreement_dialogs .dialog_foot_1hHfr {
height: 80px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
border-top: 1px solid #d5d5d5;
margin: 0;
text-align: center;
}
.agreement_dialogs .dialog_minorBtn_1u8nf {
display: inline-block;
-webkit-box-sizing: border-box;
box-sizing: border-box;
border: 1px #316ccb solid;
padding: 0 30px;
height: 40px;
background: #a92924;
background: linear-gradient(90deg, #f0242e, #d0111a);
line-height: 40px;
cursor: pointer;
font-size: 16px;
vertical-align: top;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
color: #fff;
border-color: #fff;
}
.agreement_titley {
height: 55px;
line-height: 55px;
font-size: 16px;
color: #666;
text-align: center;
border-bottom: 1px solid #d5d5d5;
font-weight: 400;
}
.agreement_content {
margin: 23px 32px;
}
.con-subhead {
font-size: 14px;
font-weight: 500;
color: #333;
margin-bottom: 16px;
}
.con-content {
height: 240px;
overflow-y: scroll;
line-height: 2;
font-size: 13px;
}
</style>
File diff suppressed because it is too large Load Diff
+439
View File
@@ -0,0 +1,439 @@
<template>
<view class="">
<top-bar></top-bar>
<common-nav></common-nav>
<view class="w-1200">
<view class="certificate-container bg-white p-20">
<!-- 申请表格 -->
<div v-html="content"></div>
<!-- 出证样板选择 -->
<view class="form-item mb-20">
<view class="form-label">出证样板查看</view>
</view>
<!-- 出证方式 -->
<view class="form-item mb-20">
<view class="form-label">出证方式</view>
<view class="form-content">
<el-radio v-model="form.certificateType" label="normal">(正常)出证时效({{ amount }}元/份)</el-radio>
<el-radio v-model="form.certificateType" label="urgent">(加急)出证时效({{
urgentAmount
}}元/份)
</el-radio>
</view>
</view>
<!-- 发票类型 -->
<view class="form-item mb-20">
<view class="form-label">发票类型</view>
<view class="form-content">
<el-radio v-model="form.invoiceTypes" label="none">无需开具发票</el-radio>
<el-radio v-model="form.invoiceTypes" label="electronic">增值税专用发票(电子发票)</el-radio>
<el-radio v-model="form.invoiceTypes" label="normal">普票(电子发票)</el-radio>
</view>
</view>
<!-- 发票抬头 -->
<template v-if="form.invoiceTypes !== 'none'">
<view class="form-item mb-20">
<view class="form-label">发票抬头</view>
<view class="form-content">
<el-form :model="form.invoice" label-width="100px">
<el-form-item label="名称:" required>
<el-input v-model="form.invoice.companyName" placeholder="请输入企业名称或个人姓名"></el-input>
</el-form-item>
<el-form-item label="税号/证号:" required>
<el-input v-model="form.invoice.taxNumber" placeholder="请输入税号或身份证号"></el-input>
</el-form-item>
<el-form-item label="开户行:">
<el-input v-model="form.invoice.bankName"></el-input>
</el-form-item>
<el-form-item label="开户账号:">
<el-input v-model="form.invoice.bankAccount"></el-input>
</el-form-item>
<el-form-item label="联系电话:" required>
<el-input v-model="form.invoice.phone"></el-input>
</el-form-item>
</el-form>
</view>
</view>
<!-- 电子发票接收信息 -->
<!-- <view class="form-item mb-20">-->
<!-- <view class="form-label">电子发票接收信息</view>-->
<!-- <view class="form-content">-->
<!-- <el-form :model="form.electronicInvoice" label-width="100px">-->
<!-- <el-form-item label="收票人:" required>-->
<!-- <el-input v-model="form.electronicInvoice.receiver"></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="手机号码:" required>-->
<!-- <el-input v-model="form.electronicInvoice.phone"></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="邮箱:" required>-->
<!-- <el-input v-model="form.electronicInvoice.email"></el-input>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<!-- </view>-->
<!-- </view>-->
</template>
<!-- 出证交付方式 -->
<view class="form-item mb-20">
<view class="form-label">出证交付方式</view>
<view class="form-content">
<el-checkbox v-model="form.deliveryMethods.electronic" @change="selectEle">电子</el-checkbox>
<!-- <el-form v-if="form.deliveryMethods.electronic" :model="form.electronicDelivery" label-width="100px">-->
<!-- <el-form-item label="收件人姓名:" class="required">-->
<!-- <el-input v-model="form.electronicDelivery.receiver"></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="手机号码:" class="required">-->
<!-- <el-input v-model="form.electronicDelivery.phone"></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="收件邮箱:" class="required">-->
<!-- <el-input v-model="form.electronicDelivery.email"></el-input>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<el-checkbox v-model="form.deliveryMethods.paper" @change="selectPaper">纸质邮寄</el-checkbox>
<el-form v-if="form.deliveryMethods.paper" :model="form.paperDelivery" label-width="100px">
<el-form-item label="收件人姓名:" class="required">
<el-input v-model="form.paperDelivery.receiver"></el-input>
</el-form-item>
<el-form-item label="手机号码:" class="required">
<el-input v-model="form.paperDelivery.phone"></el-input>
</el-form-item>
<el-form-item label="收件地址:" class="required">
<el-input v-model="form.paperDelivery.address" placeholder="请输入详细地址"></el-input>
</el-form-item>
</el-form>
</view>
</view>
<!-- 支付方式 -->
<view class="form-item mb-20">
<view class="form-label">支付方式</view>
<view class="form-content">
<el-radio v-model="form.paymentMethod" label="online">在线支付</el-radio>
<el-radio v-model="form.paymentMethod" label="advance">公对公支付</el-radio>
</view>
</view>
<view v-if="form.paymentMethod === 'advance'" v-html="bankAccount"></view>
<!-- 提交按钮 -->
<view class="text-center mb-20">
<el-button type="primary" @click="submitForm" v-if="form.paymentMethod === 'online'">提交支付</el-button>
<vk-data-upload v-else v-model="form.payVoucher" :cloudPathRemoveChinese="false" list-type="text"
:limit="1" button-text="上传付款记录"
accept=".jpg,.jpeg,.png" :on-success="uploadSuccess" ref="uploader"
:show-file-list="false">
</vk-data-upload>
</view>
<!-- 客服电话 -->
<view class="text-center">
<view class="service-phone">客服电话:400 686 5559</view>
</view>
</view>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
data() {
return {
form: {
sampleSelected: false,
paidConfirm: false,
hasReport: false,
certificateType: 'normal',
lawPrice: '100',
agreementPrice: '150',
invoiceTypes: 'none',
invoice: {
companyName: '',
taxNumber: '',
bankName: '',
bankAccount: '',
phone: ''
},
electronicInvoice: {
receiver: '',
phone: '',
email: ''
},
deliveryMethods: {
electronic: true,
paper: false
},
electronicDelivery: {
receiver: '',
phone: '',
email: ''
},
paperDelivery: {
receiver: '',
phone: '',
address: ''
},
paymentMethod: 'online',
payVoucher: ''
},
contractId: null,
transactionId: null,
amount: null,
urgentAmount: null,
content: null,
bankAccount: null,
}
},
onLoad({contractId, transactionId,}) {
this.contractId = contractId;
this.transactionId = transactionId;
this.getContent()
this.getAmount()
this.getUrgentAmount()
this.getUserInfo()
this.getBankAccount()
},
methods: {
async getUserInfo() {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
this.form.invoice.companyName = userInfo.accountType === 2 ? userInfo.company.companyName : userInfo.person.personName
this.form.invoice.taxNumber = userInfo.accountType === 2 ? userInfo.company.organization : userInfo.person.idCard
this.form.invoice.phone = userInfo.accountType === 2 ? userInfo.company.mobile : userInfo.person.mobile
},
async getContent() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: 'e647148e684a458a0295b0a239c3d539'
},
})
this.content = res.content
},
async getAmount() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: 'd77d384f684a47b6029a135220ecf4c9'
},
})
this.amount = res.content
},
async getUrgentAmount() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '8524406c684a47c402985cb55941b3cb'
},
})
this.urgentAmount = res.content
},
uploadSuccess(response, file, fileList) {
this.form.payVoucher = response.url;
this.submitForm()
},
submitForm() {
// 表单验证
if (!this.validateForm()) {
return;
}
if (this.form.certificateType === 'normal') {
this.form.amount = this.amount;
} else {
this.form.amount = this.urgentAmount;
}
this.$confirm(`司法调证服务需向数据中心付费(${this.form.amount}元/次),是否继续?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
// 提交表单
this.form.contractId = this.contractId;
this.form.contractNo = this.transactionId;
vk.callFunction({
url: 'client/contract/kh/certificateAdd',
title: '提交中...',
data: this.form,
success: async (res) => {
this.$message({
message: '申请提交成功',
type: 'success'
});
if (this.form.paymentMethod === 'online') {
const {data} = await vk.callFunction({
url: 'client/contract/kh/buy',
title: '请求中...',
data: {
contractId: this.contractId,
contractNo: this.transactionId,
amount: this.form.amount
},
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
} else {
this.$message({
message: '请等待后台审核',
type: 'success'
});
setTimeout(() => {
vk.navigateTo({
url: `/pages/contract/index?tab=2`
})
}, 1500)
}
}
});
})
},
validateForm() {
// 验证必填项
// if (this.form.deliveryMethods.electronic) {
// if (!this.form.electronicDelivery.receiver) {
// this.$message.error('请填写电子发送邮箱的收件人姓名');
// return false;
// }
// if (!this.form.electronicDelivery.phone) {
// this.$message.error('请填写电子发送邮箱的手机号码');
// return false;
// }
// if (!this.form.electronicDelivery.email) {
// this.$message.error('请填写电子发送邮箱的收件邮箱');
// return false;
// }
// }
if (this.form.deliveryMethods.paper) {
if (!this.form.paperDelivery.receiver) {
this.$message.error('请填写纸质邮寄的收件人姓名');
return false;
}
if (!this.form.paperDelivery.phone) {
this.$message.error('请填写纸质邮寄的手机号码');
return false;
}
if (!this.form.paperDelivery.address) {
this.$message.error('请填写纸质邮寄的收件地址');
return false;
}
}
return true;
},
selectEle(e) {
if (e) {
this.form.deliveryMethods.electronic = true;
this.form.deliveryMethods.paper = false;
} else {
this.form.deliveryMethods.electronic = false;
this.form.deliveryMethods.paper = true;
}
},
selectPaper(e) {
if (!e) {
this.form.deliveryMethods.electronic = true;
this.form.deliveryMethods.paper = false;
} else {
this.form.deliveryMethods.electronic = false;
this.form.deliveryMethods.paper = true;
}
},
async getBankAccount() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: 'b5ad93e068f343230344c7b63cb1aac5'
},
})
this.bankAccount = res.content
},
}
}
</script>
<style scoped lang="scss">
.w-1200 {
width: 1200px;
margin: 20px auto;
}
.certificate-container {
border-radius: 4px;
}
.title {
font-size: 24px;
font-weight: bold;
}
.certificate-table {
width: 100%;
table {
border-collapse: collapse;
width: 100%;
th, td {
border: 1px solid #dcdfe6;
padding: 8px;
text-align: center;
}
th {
background-color: #f5f7fa;
}
}
}
.notice {
border: 1px solid #dcdfe6;
padding: 10px;
border-radius: 4px;
.notice-title {
font-weight: bold;
margin-bottom: 5px;
}
.notice-item {
font-size: 14px;
line-height: 1.5;
color: #606266;
}
}
.form-item {
margin-bottom: 20px;
.form-label {
font-weight: bold;
margin-bottom: 10px;
}
.form-content {
padding: 0 20px;
}
}
.w-100 {
width: 100px;
}
.required /deep/ .el-form-item__label:before {
content: '*';
color: #f56c6c;
margin-right: 4px;
}
.service-phone {
font-size: 16px;
font-weight: bold;
color: #333;
}
</style>
+1833 -507
View File
File diff suppressed because it is too large Load Diff
+96 -109
View File
@@ -1,6 +1,6 @@
<template> <template>
<view class="border-bottom pt-20"> <view class="border-bottom pt-20">
<el-form ref="form" :model="form1" label-width="80px" :rules="form1.props.rules"> <el-form ref="form" :model="form1" label-width="140px" :rules="form1.props.rules">
<view class="flex flex-wrap justify-start items-start"> <view class="flex flex-wrap justify-start items-start">
<view class="w-25p"> <view class="w-25p">
<el-form-item label="商品名称"> <el-form-item label="商品名称">
@@ -15,49 +15,51 @@
</el-form-item> </el-form-item>
</view> </view>
<view class="w-25p" v-for="(item, index) in goodsAttributes" :key="index"> <view class="w-25p" v-for="(item, index) in goodsAttributes" :key="index">
<el-form-item :label="item.label"> <template v-if="goodsAttributes && goodsAttributes.length > 0">
<el-select v-model="form1.data.model[item.label]" placeholder="请选择"> <el-form-item :label="item.label" v-if="item.label">
<el-option <el-select v-model="form1.data.model[index].value" placeholder="请选择">
v-for="(item, index) in item.values" <el-option
:key="index" v-for="(value, valueIndex) in item.values" :key="valueIndex" :label="value"
:label="item" :value="value">
:value="item"> </el-option>
</el-option> </el-select>
</el-select> </el-form-item>
</el-form-item> </template>
</view> </view>
</view> </view>
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="10"> <!-- <el-col :span="10">-->
<el-form-item label="单件长度"> <!-- <el-form-item label="单件长度">-->
<el-input placeholder="请输入内容" v-model="form1.data.singleLength" class="input-with-select"> <!-- <el-input placeholder="请输入内容" v-model="form1.data.singleLength" class="input-with-select"-->
<el-select v-model="form1.data.singleLengthUnit" slot="append" placeholder="请选择"> <!-- type="number">-->
<template v-if=" attributes.find(attr => attr.label === '单件长度')"> <!-- <template slot="append">米</template>-->
<el-option <!--&lt;!&ndash; <el-select v-model="form1.data.singleLengthUnit" slot="append" placeholder="请选择">&ndash;&gt;-->
v-for="(item, index) in attributes.find(attr => attr.label === '单件长度').options" <!--&lt;!&ndash; <template v-if=" attributes.find(attr => attr.label === '单件长度')">&ndash;&gt;-->
:key="index" <!--&lt;!&ndash; <el-option&ndash;&gt;-->
:label="item.label" <!--&lt;!&ndash; v-for="(item, index) in attributes.find(attr => attr.label === '单件长度').options"&ndash;&gt;-->
:value="item.value"> <!--&lt;!&ndash; :key="index"&ndash;&gt;-->
</el-option> <!--&lt;!&ndash; :label="item.label"&ndash;&gt;-->
</template> <!--&lt;!&ndash; :value="item.value">&ndash;&gt;-->
</el-select> <!--&lt;!&ndash; </el-option>&ndash;&gt;-->
</el-input> <!--&lt;!&ndash; </template>&ndash;&gt;-->
</el-form-item> <!--&lt;!&ndash; </el-select>&ndash;&gt;-->
</el-col> <!-- </el-input>-->
<el-col :span="6"> <!-- </el-form-item>-->
<el-form-item label="材质"> <!-- </el-col>-->
<el-select v-model="form1.data.materialQuality" placeholder="请选择"> <!-- <el-col :span="6">-->
<template v-if=" attributes.find(attr => attr.label === '材质')"> <!-- <el-form-item label="尺寸">-->
<el-option <!-- <el-select v-model="form1.data.materialQuality" placeholder="请选择">-->
v-for="(item, index) in attributes.find(attr => attr.label === '材质').options" <!-- <template v-if=" attributes.find(attr => attr.label === '尺寸')">-->
:key="index" <!-- <el-option-->
:label="item.label" <!-- v-for="(item, index) in attributes.find(attr => attr.label === '尺寸').options"-->
:value="item.value"> <!-- :key="index"-->
</el-option> <!-- :label="item.label"-->
</template> <!-- :value="item.value">-->
</el-select> <!-- </el-option>-->
</el-form-item> <!-- </template>-->
</el-col> <!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="6"> <el-col :span="6">
<el-form-item label="交货服务"> <el-form-item label="交货服务">
<el-select v-model="form1.data.deliverService" placeholder="请选择"> <el-select v-model="form1.data.deliverService" placeholder="请选择">
@@ -72,24 +74,6 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="采购数量">
<el-input v-model="form1.data.procureNumber" class="input-with-select">
<el-select v-model="form1.data.procureUnit" slot="append" placeholder="请选择">
<template v-if=" attributes.find(attr => attr.label === '单位')">
<el-option
v-for="(item, index) in attributes.find(attr => attr.label === '单位').options"
:key="index"
:label="item.label"
:value="item.value">
</el-option>
</template>
</el-select>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="计价形式"> <el-form-item label="计价形式">
<el-select v-model="form1.data.pricingForm" placeholder="请选择"> <el-select v-model="form1.data.pricingForm" placeholder="请选择">
@@ -106,53 +90,38 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="6"> <el-col :span="12">
<el-form-item label="交货时限"> <el-form-item label="采购数量">
<el-date-picker <el-input v-model="form1.data.procureNumber" class="input-with-select" type="number">
v-model="form1.data.deliveryTime" <el-select v-model="form1.data.procureUnit" slot="append" placeholder="请选择">
type="date" <template v-if=" attributes.find(attr => attr.label === '单位')">
placeholder="选择日期"> <el-option
</el-date-picker> 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-form-item>
</el-col> </el-col>
<el-col :span="18"> <el-col :span="12">
<el-form-item label="交货地点" class="ml-10"> <el-form-item label="装货、卸货费用承担">
<el-row :gutter="10"> <el-select v-model="form1.data.loadPaidBy" placeholder="请选择" style="width: 100%">
<el-col :span="5"> <template v-if="attributes.find(attr => attr.label === '装货、卸货费用承担')">
<el-select v-model="provinceIndex" placeholder="省" @change="selectProvince"> <el-option
<el-option v-for="(item, index) in provinceData" :key="index" :value="index" v-for="(item, index) in attributes.find(attr => attr.label === '装货、卸货费用承担').options"
:label="item.name"/> :key="index"
<!-- <span slot="prefix">省</span>--> :label="item.label"
</el-select> :value="item.label">
</el-col> </el-option>
<el-col :span="5"> </template>
<el-select v-model="cityIndex" placeholder="市" @change="selectCity"> </el-select>
<template v-if="provinceIndex !== null">
<el-option v-for="(item, index) in cityData[provinceIndex]" :key="index"
:value="index"
:label="item.name"/>
</template>
<!-- <span slot="prefix">市</span>-->
</el-select>
</el-col>
<el-col :span="5">
<el-select v-model="areaIndex" placeholder="区/县" @change="selectArea">
<template v-if="provinceIndex !== null && cityIndex !== null">
<el-option v-for="(item, index) in areaData[provinceIndex][cityIndex]"
:key="index" :value="index"
:label="item.name"/>
</template>
<!-- <span slot="prefix">区/县</span>-->
</el-select>
</el-col>
<el-col :span="8">
<el-input v-model="form1.data.addressDetail"
placeholder="详细地址或几公里范围内"></el-input>
</el-col>
</el-row>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
</view> </view>
</template> </template>
@@ -183,6 +152,11 @@ export default {
}, },
data() { data() {
return { return {
pickerOptions: {
disabledDate(time) {
return time.getTime() < Date.now();
},
},
provinceData: provinces, provinceData: provinces,
cityData: citys, cityData: citys,
areaData: areas, areaData: areas,
@@ -211,6 +185,7 @@ export default {
deliverService: null, deliverService: null,
standard: null, standard: null,
pricingForm: null, pricingForm: null,
loadPaidBy: '供货方承担装车费用,采购方承担卸货费用',
deliveryTime: null, deliveryTime: null,
len: null, len: null,
extraAttributes: {}, extraAttributes: {},
@@ -277,8 +252,6 @@ export default {
} else { } else {
this.form1.props.columns[2].columns = [] this.form1.props.columns[2].columns = []
} }
} }
}, },
{ {
@@ -499,6 +472,7 @@ export default {
getGoodsList() { getGoodsList() {
vk.callFunction({ vk.callFunction({
url: 'client/enquiry/template/pub/getList', url: 'client/enquiry/template/pub/getList',
pageSize: 500,
title: '请求中', title: '请求中',
success: ({rows}) => { success: ({rows}) => {
this.goodsList = rows this.goodsList = rows
@@ -506,10 +480,17 @@ export default {
}) })
}, },
selectGoods(val) { selectGoods(val) {
this.form1.data.model = []
this.goodsList.forEach(({_id, name, extraAttributes}) => { this.goodsList.forEach(({_id, name, extraAttributes}) => {
if (_id === val) { if (_id === val) {
this.form1.data.goodsName = name this.form1.data.goodsName = name
this.goodsAttributes = extraAttributes this.goodsAttributes = extraAttributes
this.goodsAttributes.forEach(attr => {
if (attr.label) this.form1.data.model.push({
label: attr.label,
value: null
})
})
} }
}) })
}, },
@@ -525,13 +506,19 @@ export default {
}, },
watch: { watch: {
"form1.data"(val) { "form1.data": {
this.$emit('input', val) immediate: true,
console.log("this.$emit('input', val.data)"); handler(val) {
this.$emit('input', val)
console.log("this.$emit('input', val.data)");
}
}, },
value(val) { value: {
this.form1.data = val immediate: true,
console.log("this.form1.data = val", val); handler(val) {
this.form1.data = val
console.log("this.form1.data = val", val);
}
} }
} }
+334 -130
View File
@@ -16,12 +16,13 @@
<view class="page-main" v-if="sheet"> <view class="page-main" v-if="sheet">
<view class="flex justify-between items-center"> <view class="flex justify-between items-center">
<text class="text-gray">加工询价单编号:{{ sheet.orderNo }}</text> <text class="text-gray">询价单编号:{{ sheet.enquiryNo }}</text>
<text class="text-gray">发布时间:{{ sheet._add_time_str }}</text> <text class="text-gray">发布时间:{{ sheet._add_time_str }}</text>
</view> </view>
<view class="my-25 flex justify-between items-center"> <view class="my-25 flex justify-between items-center">
<view class="flex justify-start items-center"> <view class="flex justify-start items-center">
<text class="text-40 font-bold">{{ sheet.title }}</text> <text class="text-40 font-bold">{{ sheet.title }}</text>
<el-tag type="success" v-if="sheet.tradeMethod === 0" size="small" class="ml-20">自主交易</el-tag>
<view class="ml-20 flex justify-start items-center"> <view class="ml-20 flex justify-start items-center">
<building-one theme="outline" size="24" fill="#a92924" strokeLinecap="square"/> <building-one theme="outline" size="24" fill="#a92924" strokeLinecap="square"/>
<view class="text-main "> <view class="text-main ">
@@ -34,15 +35,15 @@
</view> </view>
</view> </view>
<view class="flex justify-end items-end" <view class="flex justify-end items-end"
v-if="sheet.answerEndTime && dayjs().diff(dayjs(sheet.answerEndTime), 'second') > 0"> v-if="sheet.answerEndTime && dayjs(sheet.answerEndTime).diff(dayjs(), 'second') > 0">
<text>距离报价结束还有:</text> <text>距离报价结束还有:</text>
<view class="border-main countdown text-main">{{ <view class="border-main countdown text-main">{{
dayjs().diff(dayjs(sheet.answerEndTime), 'day') dayjs(sheet.answerEndTime).diff(dayjs(), 'day')
}} }}
</view> </view>
<text>天</text> <text>天</text>
<view class="border-main countdown text-main"> <view class="border-main countdown text-main">
{{ (dayjs().diff(dayjs(sheet.answerEndTime), 'hour')) % 24 }} {{ (dayjs(sheet.answerEndTime).diff(dayjs(), 'hour')) % 24 }}
</view> </view>
<text>时</text> <text>时</text>
</view> </view>
@@ -50,19 +51,71 @@
<view class="my-25 flex justify-between items-center pb-20 border-bottom"> <view class="my-25 flex justify-between items-center pb-20 border-bottom">
<view class="flex justify-start items-center"> <view class="flex justify-start items-center">
<id-card theme="outline" size="24" fill="#a92924" strokeLinecap="square"/> <id-card theme="outline" size="24" fill="#a92924" strokeLinecap="square"/>
<text class="ml-15 text-gray"> <text class="ml-15 text-gray" v-if="sheet.user">
{{ {{
sheet.user.accountType === 1 ? sheet.user.person.personName : sheet.user.company.companyName sheet.user.accountType === 1 ? sheet.user.person.personName.replace(/^(.).*$/,"$1**") : sheet.user.company.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/,"$1$2***$3$4$5$6")
}} }}
</text> </text>
</view> </view>
<el-button type="primary" @click.native="toQuote" <el-button type="primary" @click.native="toQuote" :disabled="sheet.disabled"
v-if="vk.getVuex('$user.userInfo._id') !== sheet.userId && sheet.status === 0">我要报价 v-if="vk.getVuex('$user.userInfo._id') !== sheet.userId && sheet.status === 0">{{
sheet.disabled ? '已超时无法报价' : '我要报价'
}}
</el-button> </el-button>
<el-button type="primary" @click.native="showDialog = true" <el-button type="primary" @click.native="showDialog = true"
v-else-if="vk.getVuex('$user.userInfo._id') === sheet.userId">查看收到的申请报价 v-else-if="vk.getVuex('$user.userInfo._id') === sheet.userId">查看收到的申请报价
</el-button> </el-button>
</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-20" v-if="sheet.fillType === 1">{{-->
<!-- sheet.productList.map(item => item.goodsName + `${item.materialQuality ? `(${item.materialQuality})` : ''}`).join(',')-->
<!-- }}-->
<!-- </view>-->
<!-- <view v-else class="mt-20">-->
<!-- <el-descriptions :title="item.goodsName" v-for="(item, index) in sheet.productList" :key="index"-->
<!-- class="pb-20 border-bottom">-->
<!-- <el-descriptions-item :label="model.label" v-for="(model, modelIndex) in item.model"-->
<!-- :key="modelIndex">{{ model.value }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item label="单价长度">{{-->
<!-- item.singleLength ? item.singleLength : ''-->
<!-- }}{{ item.singleLengthUnit ? item.singleLengthUnit : '' }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item label="交货服务">{{-->
<!-- item.deliverService ? item.deliverService : '无'-->
<!-- }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item label="采购数量">{{-->
<!-- item.procureNumber ? item.procureNumber : ''-->
<!-- }}{{ item.procureUnit ? item.procureUnit : '' }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item label="计价形式">{{-->
<!-- item.pricingForm ? item.pricingForm : '无'-->
<!-- }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item label="交货时限">{{-->
<!-- sheet.deliveryTime ? sheet.deliveryTime : '无'-->
<!-- }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item label="交货地点">{{-->
<!-- sheet.fullAddress-->
<!-- }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item label="装货、卸货费用承担">{{-->
<!-- item.loadPaidBy ? item.loadPaidBy : '无'-->
<!-- }}-->
<!-- </el-descriptions-item>-->
<!-- </el-descriptions>-->
<!-- </view>-->
<!-- </view>-->
<view class="item-wrap"> <view class="item-wrap">
<view class="form-title-wrap"> <view class="form-title-wrap">
<view class="goods-sheet-title"> <view class="goods-sheet-title">
@@ -71,13 +124,35 @@
</view> </view>
</view> </view>
</view> </view>
<view class="mt-15 mr-15" v-for="(item, index) in sheet.files" :key="index"> <template v-if="sheet.files">
<el-image :src="item" style="width: 100px; height: 100px" fit="cover" <view class="mt-15 mr-15" v-for="(item, index) in sheet.files" :key="index">
:preview-src-list="sheet.files"/> <file-type :item="item" @click.native="openDownload(item)"/>
</view> </view>
</template>
<template v-if="sheet.multiFiles">
<view class="mt-15 mr-15" v-for="(item, index) in sheet.multiFiles" :key="index">
<template v-if="['doc', 'docx'].includes(item.split('.').pop())">
<file-word theme="outline" class="pointer" size="40" fill="#4a90e2" strokeLinecap="square"
@click.native="openDownload(item)"/>
</template>
<template v-else-if="['xls', 'xlsx'].includes(item.split('.').pop())">
<file-excel theme="outline" class="pointer" size="40" fill="#417505" strokeLinecap="square"
@click.native="openDownload(item)"/>
</template>
<template v-else-if="['pdf'].includes(item.split('.').pop())">
<file-pdf-one theme="outline" class="pointer" size="40" fill="#f5a623"
strokeLinecap="square"
@click.native="openDownload(item)"/>
</template>
<template v-else>
<el-image :src="item" style="width: 100px; height: 100px" fit="cover"
:preview-src-list="[item]"/>
</template>
</view>
</template>
</view> </view>
<view class="item-wrap"> <view class="item-wrap" v-if="sheet.remark">
<view class="form-title-wrap"> <view class="form-title-wrap">
<view class="goods-sheet-title"> <view class="goods-sheet-title">
<view class="form-title"> <view class="form-title">
@@ -98,8 +173,13 @@
</view> </view>
<view class="mt-15">是否含税:{{ sheet.invoice ? '含税' : '不含税' }}</view> <view class="mt-15">是否含税:{{ sheet.invoice ? '含税' : '不含税' }}</view>
<view class="mt-15">开票时间:{{ WRITE_INVOICE_TIME[sheet.writeInvoiceTime] }}</view> <view class="mt-15">开票时间:{{ WRITE_INVOICE_TIME[sheet.writeInvoiceTime] }}</view>
<view class="mt-15">发票种类:{{ INVOICE_TYPE[sheet.invoiceType] }}</view>
<view class="mt-15">其他要求:{{ sheet.invoiceOther }}</view> <view class="mt-15" v-if="sheet.invoiceOther">税票要求:{{ sheet.invoiceOther }}</view>
<template v-else>
<view class="mt-15">纳税人身份:{{ sheet.taxType ? sheet.taxType : '无' }}</view>
<view class="mt-15">发票种类:{{ sheet.invoiceType ? sheet.invoiceType : '无' }}</view>
<view class="mt-15">税率:{{ sheet.taxRate ? sheet.taxRate : '无' }}</view>
</template>
</view> </view>
<view class="item-wrap"> <view class="item-wrap">
@@ -110,9 +190,28 @@
</view> </view>
</view> </view>
</view> </view>
<view class="mt-15">随货资料:{{ sheet.transportDocuments.join() }}</view> <view class="mt-15" v-if="sheet.transportDocuments && sheet.transportDocuments.length > 0">
<view class="mt-15">其他要求:{{ sheet.otherTransportDocuments }}</view> 随货资料:{{ sheet.transportDocuments.join() }}
</view>
<view class="mt-15" v-if="sheet.otherTransportDocuments">其他要求:{{
sheet.otherTransportDocuments
}}
</view>
<view class="mt-15">运输限制要求:{{ sheet.transportLimit ? '有' : '无' }}</view> <view class="mt-15">运输限制要求:{{ sheet.transportLimit ? '有' : '无' }}</view>
<view class="mt-15" v-if="sheet.transportLimit && sheet.otherTransportRequest">
运输限制说明:{{ sheet.otherTransportRequest }}
</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
交易模式
</view>
</view>
</view>
<view class="mt-15">{{ sheet.tradeMethod === 0 ? '自主交易' : '金久信公证' }}</view>
</view> </view>
<view class="item-wrap"> <view class="item-wrap">
@@ -123,7 +222,13 @@
</view> </view>
</view> </view>
</view> </view>
<view class="mt-15">付款方式:{{ PROCESS_PAY_METHOD[sheet.payMethod] }}</view> <view class="mt-15">付款方式:{{ PROCESS_PAY_METHOD[sheet.payMethod] }}{{
sheet.payMethod === 0 ? `${sheet.advancePayRate}%货到付全款` : ''
}}{{
sheet.payMethod === 3 ? `${sheet.reputationPayDay}天` :
(sheet.payMethod === 4 ? `:${sheet.otherPayMethod}` : '')
}}
</view>
<view class="mt-15">报价形式:{{ sheet.offerType === 0 ? '整单报价' : '可分项报价' }}</view> <view class="mt-15">报价形式:{{ sheet.offerType === 0 ? '整单报价' : '可分项报价' }}</view>
<view class="mt-15">报价期限: <view class="mt-15">报价期限:
<text v-if="sheet.answerStartTime && sheet.answerEndTime">{{ <text v-if="sheet.answerStartTime && sheet.answerEndTime">{{
@@ -134,6 +239,79 @@
</view> </view>
<view class="item-wrap"> <view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
采购商信息
</view>
</view>
</view>
<view class="mt-15">项目名称:{{ sheet.projectName ? sheet.projectName : '' }}</view>
<view class="mt-15">项目地址:{{ sheet.fullAddress }}</view>
<template v-if="sheet.isMine || sheet.hasQuote || userInfo.userLevel > 0">
<view class="mt-15" v-if="sheet.companyName">公司信息:{{
sheet.companyName ? sheet.companyName : ''
}}
</view>
<view class="mt-15" v-if="sheet.companyMobile">公司联系方式:{{
sheet.companyMobile ? sheet.companyMobile : ''
}}
</view>
<view class="mt-15">授权业务咨询人:{{
sheet.businessName ? sheet.businessName : ''
}}
</view>
<view class="mt-15">业务咨询联系方式:{{
sheet.businessMobile ? sheet.businessMobile : ''
}}
</view>
</template>
<template v-else>
<view class="mt-15" v-if="sheet.companyName">公司信息:{{
sheet.companyName ? sheet.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6") : ''
}}
</view>
<view class="mt-15" v-if="sheet.companyMobile">公司联系方式:{{
sheet.companyMobile ? sheet.companyMobile.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : ''
}}
</view>
<view class="mt-15">授权业务咨询人:{{
sheet.businessName ? sheet.businessName.replace(/^(.).*(.)$/, "$1***$2") : ''
}}
</view>
<view class="mt-15">业务咨询联系方式:{{
sheet.businessMobile ? sheet.businessMobile.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : ''
}}
</view>
</template>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
交易保证金要求
</view>
</view>
</view>
<view class="mt-15">{{ sheet.earnestMoney ? sheet.earnestMoney.toFixed(2) : '无' }}</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
签约模式
</view>
</view>
</view>
<view class="mt-15">{{
sheet.signMethod === 0 ? '线上签约-标准合同' : (sheet.signMethod !== 1 ? '线上签约-双方协商合同' : '线下签约')
}}
</view>
</view>
<view class="item-wrap" v-if="sheet.signMethod === 0">
<view class="form-title-wrap"> <view class="form-title-wrap">
<view class="goods-sheet-title"> <view class="goods-sheet-title">
<view class="form-title"> <view class="form-title">
@@ -157,21 +335,36 @@
<view class="mt-15"> <view class="mt-15">
本合同的全部内容由双方平等共同协商一致,共同起草制定,非一方事先拟定,不属于格式条款。本合同自双方签字盖章后生效(包括电子签字、盖章),按本合同内容地址、联系方式寄送的一切文书、函件送达与否,均为视为送达有法律效力,通知途径和本合同内联系方式或地址送达文件双方均予以验证。 本合同的全部内容由双方平等共同协商一致,共同起草制定,非一方事先拟定,不属于格式条款。本合同自双方签字盖章后生效(包括电子签字、盖章),按本合同内容地址、联系方式寄送的一切文书、函件送达与否,均为视为送达有法律效力,通知途径和本合同内联系方式或地址送达文件双方均予以验证。
</view> </view>
<view class="mt-15">采购方补充条款: 供货方逾期供货承担采购方一切损失</view> <view class="mt-15">采购方补充条款: {{ sheet.supplementary }}</view>
<view class="mt-15"> 供应方补充条款:</view> <!-- <view class="mt-15">供应方补充条款:</view>-->
</view> </view>
<template v-else-if="sheet.signMethod === 2">
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
合同附件
</view>
</view>
</view>
</view>
<view v-for="(item, index) in sheet.contractAttachment" :key="index" class="mr-25 my-25">
<file-type :item="item" @click.native="openDownload(item)"/>
</view>
</template>
<view class="item-wrap"> <view class="item-wrap">
<view class="form-title-wrap"> <view class="form-title-wrap">
<view class="goods-info-title"> <view class="goods-info-title">
<view class="form-title"> <view class="form-title">
已收到的加工申请 {{ sheet.quoteList.length }}家已报价
</view> </view>
</view> </view>
</view> </view>
<!-- 报价列表 --> <!-- 报价列表 -->
<vk-data-table :data="sheet.quoteList" :columns="table1.columns" title="adasda " <!-- <vk-data-table :data="sheet.quoteList" :columns="table1.columns"-->
:customRightBtns="table1.customRightBtns"></vk-data-table> <!-- :customRightBtns="table1.customRightBtns"></vk-data-table>-->
</view> </view>
</view> </view>
@@ -185,16 +378,26 @@
<view class="mt-15"> <view class="mt-15">
<view class="request-header"> <view class="request-header">
<text class="flex-1">供应商</text> <text class="flex-1">供应商</text>
<text class="flex-1">报价时间</text> <text class="flex-1">{{ sheet.type === 2 && sheet.rentType === 1 ? '询价' : '报价' }}时间</text>
<text class="flex-1">联系方式</text> <text class="flex-1">联系方式</text>
<text class="flex-1">报价</text> <text class="flex-1">{{ sheet.type === 2 && sheet.rentType === 1 ? '询价内容' : '报价' }}</text>
<text class="flex-1">附件</text>
<text class="flex-1">详情</text>
<text class="flex-1">供应商合同补充条款</text>
<text class="flex-1">操作</text> <text class="flex-1">操作</text>
</view> </view>
<view class="quote" v-for="(item, index) in sheet.quoteList" :key="index"> <view class="quote" v-for="(item, index) in sheet.quoteList" :key="index">
<text class="flex-1">{{ item.subjectName }}</text> <text class="flex-1">{{ item.subjectName }}</text>
<text class="flex-1">{{ item._add_time_str }}</text> <text class="flex-1">{{ item._add_time_str }}</text>
<text class="flex-1">{{ item.subjectMobile }}</text> <text class="flex-1">{{ item.subjectMobile }}</text>
<text class="flex-1">{{ item.totalPrice }}元</text> <text class="flex-1">{{ item.totalPrice }}{{ sheet.type === 2 && sheet.rentType === 1 ? '' : '元' }}</text>
<view class="flex-1">
<view class="mt-15 mr-15" v-for="(file, fileIndex) in item.files" :key="fileIndex">
<file-type :item="file" @click.native="openDownload(file)"/>
</view>
</view>
<text class="flex-1">{{ item.remark }}</text>
<text class="flex-1">{{ item.supplierExt ? item.supplierExt : '无' }}</text>
<text class="flex-1"> <text class="flex-1">
<el-button type="primary" v-if="sheet.status === 0" @click.native="confirm(item)">选择 <el-button type="primary" v-if="sheet.status === 0" @click.native="confirm(item)">选择
</el-button> </el-button>
@@ -206,19 +409,31 @@
</template> </template>
<script> <script>
import {BuildingOne, IdCard} from "@icon-park/vue"; import {BuildingOne, IdCard, FileWord, FileExcel, FilePdfOne} from "@icon-park/vue";
import dayjs from "dayjs"; import dayjs from "dayjs";
import {WRITE_INVOICE_TIME, INVOICE_TYPE, PROCESS_PAY_METHOD} from '@/util' import {WRITE_INVOICE_TIME, INVOICE_TYPE, PROCESS_PAY_METHOD} from '@/util'
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
import FileType from "../../components/file-type/file-type.vue";
export default { export default {
components: {BuildingOne, IdCard}, components: {FileType, BuildingOne, IdCard, FileWord, FileExcel, FilePdfOne},
data() { data() {
return { return {
userInfo: {
userLevel: 0
},
accountNum: 0,
provinceData: provinces,
cityData: citys,
areaData: areas,
WRITE_INVOICE_TIME, WRITE_INVOICE_TIME,
INVOICE_TYPE, INVOICE_TYPE,
PROCESS_PAY_METHOD, PROCESS_PAY_METHOD,
enquiryId: undefined, enquiryId: undefined,
showDialog: false, showDialog: false,
hasQuote: false,
productList: [], productList: [],
sheetTitle: '', sheetTitle: '',
sheet: { sheet: {
@@ -234,18 +449,7 @@ export default {
key: "subjectName", key: "subjectName",
title: "供应商", title: "供应商",
type: "text", type: "text",
width: 300, 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", key: "_add_time_str",
@@ -263,7 +467,7 @@ export default {
if (row.managerMobile) { if (row.managerMobile) {
str = row.managerMobile str = row.managerMobile
} }
if (vk.getVuex('$user.userInfo._id') == this.sheet.userId) { if (vk.getVuex('$user.userInfo._id') == this.sheet.userId || row.userId == vk.getVuex('$user.userInfo._id')) {
return str return str
} }
return vk.pubfn.hidden(str, 3, 4); return vk.pubfn.hidden(str, 3, 4);
@@ -279,103 +483,100 @@ export default {
if (row.managerMobile) { if (row.managerMobile) {
str = row.managerMobile str = row.managerMobile
} }
if (vk.getVuex('$user.userInfo._id') == this.sheet.userId) { if (vk.getVuex('$user.userInfo._id') == this.sheet.userId || row.userId == vk.getVuex('$user.userInfo._id')) {
return val return `${val}元`
} }
return "******"; return "******";
} }
}, },
{
key: "remark",
title: "详情",
type: "text",
formatter: (val, row, column, index) => {
let str = val
if (row.managerMobile) {
str = row.managerMobile
}
if (vk.getVuex('$user.userInfo._id') == this.sheet.userId || row.userId == vk.getVuex('$user.userInfo._id')) {
return val
}
return "******";
}
}
], ],
customRightBtns: [
{
title: '合同',
type: 'primary',
icon: 'el-icon-search',
show: (row) => {
return vk.getVuex('$user.userInfo._id') == this.sheet.userId && row.status == 1
},
onClick: (item) => {
vk.navigateTo('/pages/contract/index');
},
},
{
title: '选择',
type: 'primary',
icon: 'el-icon-search',
show: (row) => {
return vk.getVuex('$user.userInfo._id') == this.sheet.userId && row.status == 0
},
onClick: (item) => {
vk.callFunction({
url: 'client/enquiry/quote/kh/confirmQuote',
title: '请求中...',
data: {
quoteId: item._id,
},
success: (data) => {
vk.navigateTo('/pages/contract/index');
}
});
},
},
{
title: '查看报价详情',
type: 'primary',
icon: 'el-icon-search',
disabled: (item) => {
return vk.getVuex('$user.userInfo._id') != this.sheet.userId
},
onClick: (item) => {
this.showDialog = true
}
},
]
}, },
}; };
}, },
onLoad(options = {}) { onLoad(options = {}) {
const { const {id} = options
id
} = options
if (!id) { if (!id) {
vk.navigateTo('/pages/enquiry/list'); vk.navigateTo('/pages/enquiry/list');
return return
} }
this.enquiryId = id this.enquiryId = id
this.getEnquiryDetail() this.getEnquiryDetail()
this.getUserInfo()
}, },
methods: { methods: {
dayjs, dayjs,
async getUserInfo(){
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
this.userInfo = userInfo
this.accountNum = accountNum
},
/** /**
* 打开报价窗口 * 打开报价窗口
*/ */
toQuote() { async toQuote() {
// 获取用户信息 if (!this.userInfo.fadadaConfirm || [-1, 2].includes(this.userInfo.authStatus)) {
vk.userCenter.getCurrentUserInfo({ this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
success: (data) => { confirmButtonText: '确定',
const { cancelButtonText: '取消',
userInfo type: 'warning'
} = data }).then(() => {
if (userInfo.quoteTimes > 3) { vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} } else if (vk.pubfn.isNull(this.userInfo.businessCard)) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
this.$confirm(`今日报价次数${userInfo.quoteTimes || 0}, 是否继续?`, '提示', { confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (this.accountNum === 0) {
this.$confirm('请先到个人中心添加收款账户', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=account'});
})
} else {
if (this.userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning'
center: true
}).then(res => {
vk.navigateTo('/pages/enquiry/quote?enquiryId=' + this.enquiryId);
}) })
return
} }
}); if (this.sheet.earnestMoney && this.sheet.earnestMoney > 0 && this.userInfo.paidEnsure < this.sheet.earnestMoney) {
this.$confirm('保证金不足,是否去充值保证金?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=grade'});
})
return
}
vk.navigateTo('/pages/enquiry/quote?enquiryId=' + this.enquiryId);
}
}, },
/** /**
* 获取询价单详情 * 获取询价单详情
@@ -388,23 +589,12 @@ export default {
_id: this.enquiryId _id: this.enquiryId
}, },
success: (res) => { success: (res) => {
const { this.sheet = res.data
productList this.sheet.disabled = (!this.sheet.answerEndTime || dayjs(this.sheet.answerEndTime).isBefore(dayjs()))
} = res.data this.sheet.fullAddress = ''
let title = [] if (this.sheet.deliveryTime) this.sheet.deliveryTime = dayjs(this.sheet.deliveryTime).format('YYYY-MM-DD HH:mm:ss')
productList.forEach(item => { 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}` : ''
const keys = Object.keys(item.extraAttributes) if (this.sheet.addressRegion.addressDetail) this.list.rows[index].fullAddress += this.sheet.addressRegion.addressDetail
keys.forEach(citem => {
item.extraAttributes[citem] = JSON.parse(item.extraAttributes[
citem])
})
title.push(item.goodsName)
})
this.productList = productList
delete res.data.productList
this.sheet = {...res.data, ...{title: title.join()}}
} }
}); });
}, },
@@ -416,13 +606,27 @@ export default {
quoteId: item._id, quoteId: item._id,
}, },
success: (data) => { success: (data) => {
vk.navigateTo('/pages/contract/index'); this.showDialog = false
if (this.sheet.signMethod === 0) vk.navigateTo('/pages/contract/index?tab=1')
else {
if (this.sheet.signMethod === 1) vk.navigateTo('/pages/store/buyer')
else vk.navigateTo('/pages/contract/index?tab=0')
}
this.$message({ this.$message({
type: 'success', type: 'success',
message: '报价确认成功' message: '报价确认成功'
}) })
} }
}); });
},
openDownload(url) {
if (this.sheet.isMine || this.sheet.hasQuote || this.userInfo.userLevel > 0)
window.open(url)
else{
this.$message({
message: '请先完成报价/升级会员'
})
}
} }
} }
} }
+513 -493
View File
File diff suppressed because it is too large Load Diff
+219 -236
View File
@@ -1,42 +1,43 @@
<template> <template>
<view> <view>
<top-bar></top-bar> <top-bar></top-bar>
<common-header></common-header> <common-header></common-header>
<category-bar></category-bar> <category-bar></category-bar>
<!-- <view class="page-nav"> <!-- <view class="page-nav">
<el-breadcrumb separator="/"> <el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item> <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item><navigator url="/pages/spot/goods/goods">现货市场</navigator></el-breadcrumb-item> <el-breadcrumb-item><navigator url="/pages/spot/goods/goods">现货市场</navigator></el-breadcrumb-item>
</el-breadcrumb> </el-breadcrumb>
</view> --> </view> -->
<view class="carousel"> <view class="carousel">
<el-carousel height="170px"> <!-- <el-carousel height="170px">-->
<el-carousel-item v-for="item in 4" :key="item"> <!-- <el-carousel-item v-for="item in 4" :key="item">-->
<image class="carousel-img" <!-- <image class="carousel-img"-->
src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg" <!-- src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"-->
mode="aspectFill"></image> <!-- mode="aspectFill"></image>-->
</el-carousel-item> <!-- </el-carousel-item>-->
</el-carousel> <!-- </el-carousel>-->
<view class="goods-options"> <common-swiper page="enquiry-mine" :height="200"/>
<el-row class=""> <view class="goods-options">
<el-button @click="toRelease" type="primary" round>发布询价单</el-button> <el-row class="">
<!-- <el-button type="primary" round plain>我发布的询价单</el-button> --> <el-button @click="toRelease" type="primary" round>发布询价单</el-button>
</el-row> <!-- <el-button type="primary" round plain>我发布的询价单</el-button> -->
</view> </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> </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> </template>
<script> <script>
@@ -45,237 +46,219 @@ import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json"; import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
export default { export default {
data() { data() {
return { return {
provinceData: provinces, provinceData: provinces,
cityData: citys, cityData: citys,
areaData: areas, areaData: areas,
keyword: '', keyword: '',
// 表格相关开始 ----------------------------------------------------------- // 表格相关开始 -----------------------------------------------------------
queryForm1: { queryForm1: {
formData: { formData: {
userId: vk.getVuex('$user.userInfo._id') userId: vk.getVuex('$user.userInfo._id')
},
columns: [
{key: "userId", title: "发布人ID", type: "text", width: 160, mode: "="},
]
},
table1: {
// 表格数据请求地址
action: "client/enquiry/sheet/pub/getList",
customRightBtns: [
{
title: '详情',
icon: 'el-icon-search',
type: 'primary',
onClick: (item) => {
vk.navigateTo('/pages/enquiry/detail?id=' + item._id);
}
},
{
title: '删除',
icon: 'el-icon-delete',
type: 'primary',
onClick: (item) => {
this.$confirm('').then(() => {
}).then(() => {
vk.callFunction({
url: 'client/enquiry/sheet/kh/delete',
title: '请求中...',
data: {
_id: item._id
},
}).then(res => {
this.$refs.table1.refresh()
})
})
}
},
],
// 表格字段显示规则
columns: [
{
key: "productList",
title: "品名/材质",
type: "text",
width: 280,
formatter: (val, row, column, index) => {
return val.map(item => `${item.goodsName}(${item.materialQuality})`).join("/")
}
},
{
key: "productList",
title: "采购量",
type: "text",
width: 100,
formatter: (val, row, column, index) => {
return val.map(item => item.procureNumber + item.procureUnit).join("/")
}
},
{
key: "productList",
title: "收货地",
type: "text",
minWidth: 200,
formatter: (val, row, column, index) => {
let fullAddress = ""
try {
let provinceIndex = 0, cityIndex = 0, areaIndex = 0
this.provinceData.forEach((item, index) => {
if (row.productList[0].addressRegion !== undefined && parseInt(row.productList[0].addressRegion[0]) === parseInt(item.code)) {
provinceIndex = index
fullAddress = item.name
}
})
this.cityData[provinceIndex].forEach((item, index) => {
if (row.productList[0].addressRegion !== undefined && parseInt(row.productList[0].addressRegion[1]) === parseInt(item.code)) {
cityIndex = index
fullAddress += item.name
}
})
this.areaData[provinceIndex][cityIndex].forEach((item, index) => {
if (row.productList[0].addressRegion !== undefined && parseInt(row.productList[0].addressRegion[2]) === parseInt(item.code)) {
areaIndex = index
fullAddress += item.name
}
})
fullAddress += row.productList[0].addressDetail
} catch (err) {
fullAddress = ""
}
return fullAddress
}
},
{
key: "user",
title: "采购单位",
type: "text",
width: 280,
formatter: (val, row, column, index) => {
if (val.accountType == 1) {
return val.person.personName
} else {
return val.company.companyName
}
}
},
// {
// key: "_add_time_srt",
// title: "添加时间",
// type: "time",
// width: 160
// },
],
// 多选框选中的值
multipleSelection: [],
// 当前高亮的记录
selectItem: "",
},
// 表格相关结束 -----------------------------------------------------------
};
},
onLoad() {
},
methods: {
toRelease() {
if (!vk.getVuex('$user.userInfo.fadadaConfirm')) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.getCertUrl()
})
} else if (vk.pubfn.isNull(vk.getVuex('$user.userInfo.businessCard'))) {
this.$confirm('请完善名片信息', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=business-card');
})
} else {
uni.navigateTo({
url: '/pages/enquiry/release'
})
}
}, },
}, columns: [
computed: { {key: "userId", title: "发布人ID", type: "text", width: 160, mode: "="},
checkCategoryArr() { ]
let arr = [] },
this.checkCategoryList.forEach(item => { table1: {
arr.push(...item) // 表格数据请求地址
}) action: "client/enquiry/sheet/kh/getList",
customRightBtns: [
this.checkProvinceList.forEach(item => { {
arr.push({ title: '详情',
...item icon: 'el-icon-search',
type: 'primary',
onClick: (item) => {
vk.navigateTo('/pages/enquiry/detail?id=' + item._id);
}
},
{
title: '删除',
icon: 'el-icon-delete',
type: 'primary',
onClick: (item) => {
this.$confirm('如果你要删除此条信息,之前其他客户填写的留言将无法查看', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.callFunction({
url: 'client/enquiry/sheet/kh/delete',
title: '请求中...',
data: {
_id: item._id
},
}).then(res => {
this.$refs.table1.refresh()
}) })
}) })
return arr }
} },
],
// 表格字段显示规则
columns: [
{
key: "enquiryNo",
title: "单号",
type: "text",
},
{
key: "title",
title: "品名/材质",
type: "text"
},
{
key: "productList",
title: "采购量",
type: "text",
formatter: (val, row, column, index) => {
if (row.fillType === 0) return val.map(item => (item.procureNumber ? item.procureNumber : '') + (item.procureUnit ? item.procureUnit : '')).join("/")
else return row.procureUnit ? `${row.procureNumber}${row.procureUnit}` : ''
}
},
{
key: "addressRegion",
title: "收货地",
type: "text",
formatter: (val, row, column, index) => {
let fullAddress = (val && val.province) ? `${val.province.name}${val.city.name}${val.area.name}` : ''
if (row.addressDetail) fullAddress += ` ${row.addressDetail}`
return fullAddress
}
},
{
key: "user",
title: "采购单位",
type: "text",
formatter: (val, row, column, index) => {
if (!val) return ''
if (val.accountType == 1) {
return val.person.personName
} else {
return val.company.companyName
}
}
},
{
key: "quoteNum",
title: "报价数",
type: "text",
formatter: (val, row, column, index) => {
return `${val}家已报价`
}
},
{
key: "_add_time_str",
title: "发布时间",
type: "time",
width: 160
},
],
// 多选框选中的值
multipleSelection: [],
// 当前高亮的记录
selectItem: "",
},
// 表格相关结束 -----------------------------------------------------------
};
},
onLoad() {
},
methods: {
toRelease() {
if (!vk.getVuex('$user.userInfo.fadadaConfirm')) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(vk.getVuex('$user.userInfo.businessCard'))) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=fadada');
})
} else {
uni.navigateTo({
url: '/pages/enquiry/release'
})
}
},
},
computed: {
checkCategoryArr() {
let arr = []
this.checkCategoryList.forEach(item => {
arr.push(...item)
})
this.checkProvinceList.forEach(item => {
arr.push({
...item
})
})
return arr
} }
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.carousel { .carousel {
width: 1200px; width: 1200px;
margin: 20px auto; margin: 20px auto;
} }
.carousel-img { .carousel-img {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.goods-options { .goods-options {
background-color: #FFFFFF; background-color: #FFFFFF;
padding: 20px; padding: 20px;
} }
.filter-outer { .filter-outer {
width: 1200px; width: 1200px;
margin: 20px auto; margin: 20px auto;
background-color: #FFFFFF; background-color: #FFFFFF;
padding: 20px; padding: 20px;
} }
.tags { .tags {
display: flex; display: flex;
.el-tag { .el-tag {
margin-right: 10px; margin-right: 10px;
} }
} }
.sheet-list { .sheet-list {
width: 1200px; width: 1200px;
margin: 20px auto; margin: 20px auto;
// display: flex; // display: flex;
} }
.paginatio { .paginatio {
float: none; float: none;
width: 1200px; width: 1200px;
margin: 20px auto; margin: 20px auto;
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
</style> </style>
+217 -167
View File
@@ -1,196 +1,246 @@
<template> <template>
<view> <view>
<top-bar></top-bar> <top-bar></top-bar>
<common-header></common-header> <common-header></common-header>
<category-bar></category-bar> <category-bar></category-bar>
<view class="page-nav"> <view class="page-nav">
<el-breadcrumb separator="/"> <el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item> <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item> <el-breadcrumb-item>
<navigator style="display: inline-block;" url="/pages/enquiry/list">询价单</navigator> <navigator style="display: inline-block;" url="/pages/enquiry/list">询价单</navigator>
</el-breadcrumb-item> </el-breadcrumb-item>
<el-breadcrumb-item>填写报价信息</el-breadcrumb-item> <el-breadcrumb-item>填写报价信息</el-breadcrumb-item>
</el-breadcrumb> </el-breadcrumb>
</view>
<view class="page-main">
<vk-data-form
ref="form1"
v-model="form1.data"
:action="form1.props.action"
:columns="form1.props.columns"
:rules="form1.props.rules"
:form-type="form1.props.formType"
:loading.sync="form1.props.loading"
:auto-close="true"
label-width="140px"
@success="onFormSuccess"
></vk-data-form>
</view>
<common-footer></common-footer>
</view> </view>
<view class="page-main">
<quote-remain-num v-if="reloaded" :amount="sheet.quoteAmount" type="enquiry" :id="enquiryId"/>
<vk-data-form
ref="form1"
v-model="form1.data"
:action="form1.props.action"
:columns="form1.props.columns"
:rules="form1.props.rules"
:form-type="form1.props.formType"
:loading.sync="form1.props.loading"
:auto-close="false"
:need-alert="false"
:show-cancel="false"
label-width="160px"
@success="onFormSuccess"
@fail="onFormFail"
>
<template v-slot:totalPrice>
<el-input v-model="form1.data.totalPrice" placeholder="请输入货款总价"
@change="formatNumber"></el-input>
</template>
</vk-data-form>
</view>
<common-footer></common-footer>
</view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
// 表单相关开始----------------------------------------------------------- sheet: null,
form1: { enquiryId: null,
// 表单请求数据,此处可以设置默认值 reloaded: false,
data: { // 表单相关开始-----------------------------------------------------------
// radio: 1, form1: {
// checkbox : [1,2] // 表单请求数据,此处可以设置默认值
sheetId: null data: {
}, // radio: 1,
// 表单属性 // checkbox : [1,2]
props: { sheetId: null,
// 表单请求地址 totalPrice: null,
action: "client/enquiry/quote/kh/addQuote", },
// 表单字段显示规则 // 表单属性
columns: [ props: {
{key: "totalPrice", title: "货款总价", type: "number"}, // 表单请求地址
{key: "totalPriceStr", title: "人民币大写", type: "text"}, action: "client/enquiry/quote/kh/addQuote",
{key: "remark", title: "报价单详情", type: "editor"}, // 表单字段显示规则
], columns: [
// 表单验证规则 {
rules: { key: "totalPrice",
text: [ title: "货款总价(人民币:元)",
{required: true, message: "text不能为空", trigger: "change"}, type: "html"
]
},
// add 代表添加 update 代表修改
formType: "",
// 表单是否在请求中
loading: false,
// 是否显示表单1 的弹窗
show: false
}
}, },
// 表单相关结束----------------------------------------------------------- // {key: "totalPrice", title: "货款总价(人民币:元)", type: "number", precision: 2},
}; {
}, key: "files",
onLoad(options = {}) { title: "附件",
console.log(options) type: "file",
const { accept: '.pdf',
enquiryId tips: '仅支持PDF文档,报价附件将生成标准合同附件,请认真审阅。'
} = options },
if (!enquiryId) { {key: "remark", title: "报价单详情", type: "textarea"},
vk.navigateTo('/pages/process/sheet/list'); {key: "supplierExt", title: "供应商合同补充条款", type: "textarea", autosize: {minRows: 4, maxRows: 10},},
return ],
} // 表单验证规则
rules: {
this.enquiryId = enquiryId totalPrice: [
this.form1.data.sheetId = enquiryId {required: true, message: "货款总价不能为空", trigger: "change,blur"},
this.getEnquiryDetail() ]
}, },
computed: { // add 代表添加 update 代表修改
formType: "",
totalPriceStr() { // 表单是否在请求中
if (this.totalPrice == 0) { loading: false,
return "零元" // 是否显示表单1 的弹窗
} show: false
return vk.myfn.convertCurrency(this.totalPrice / 100)
}
},
methods: {
onFormSuccess() {
vk.navigateBack()
},
// 提交报价单
async submit() {
const data = await vk.userCenter.getCurrentUserInfo();
const {userInfo} = data
if (userInfo.quoteTimes > 3) {
}
this.$confirm(`今日报价次数${userInfo.quoteTimes || 0}, 是否继续?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
center: true
}).then(res => {
vk.callFunction({
url: 'client/enquiry/quote/kh/addQuote',
title: '请求中...',
// data: {
// sheet: this.sheet,
// totalPrice: this.totalPrice
// },
success: (data) => {
this.$message({
message: "报价成功",
type: 'success'
})
}
});
})
},
/**
* 获取询价单详情
*/
getEnquiryDetail() {
vk.callFunction({
url: 'client/enquiry/sheet/pub/getDetail',
title: '请求中...',
data: {
_id: this.enquiryId
},
success: (res) => {
res.data.productList.forEach(item => {
item.unitPrice = 0
const keys = Object.keys(item.extraAttributes)
keys.forEach(citem => {
item.extraAttributes[citem] = JSON.parse(item.extraAttributes[
citem])
})
})
this.sheet = res.data
}
});
} }
},
// 表单相关结束-----------------------------------------------------------
};
},
onLoad(options = {}) {
console.log(options)
const {
enquiryId
} = options
if (!enquiryId) {
vk.navigateTo('/pages/process/sheet/list');
return
} }
this.enquiryId = enquiryId
this.form1.data.sheetId = enquiryId
this.getEnquiryDetail()
},
computed: {
totalPriceStr() {
if (this.totalPrice == 0) {
return "零元"
}
return vk.myfn.convertCurrency(this.totalPrice / 100)
}
},
methods: {
onFormSuccess() {
vk.redirectTo({url: `/pages/enquiry/detail?id=${this.enquiryId}`})
},
onFormFail(data) {
if (data.data.code === 12) {
this.$confirm(data.data.msg, '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(() => {
vk.redirectTo({url: `/pages/user/user?menu=grade`})
})
} else {
this.$confirm(data.data.msg, '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(() => {
vk.navigateBack()
})
}
},
// 提交报价单
async submit() {
const data = await vk.userCenter.getCurrentUserInfo();
const {userInfo} = data
if (userInfo.remainQuoteNum === 0 || !userInfo.remainQuoteNum) {
}
// this.$confirm(`今日报价次数${userInfo.quoteTimes || 0}, 是否继续?`, '提示', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning',
// center: true
// }).then(res => {
//
// })
vk.callFunction({
url: 'client/enquiry/quote/kh/addQuote',
title: '请求中...',
// data: {
// sheet: this.sheet,
// totalPrice: this.totalPrice
// },
success: (data) => {
this.$message({
message: "报价成功",
type: 'success'
})
},
fail: err => {
console.log(err)
}
})
},
/**
* 获取询价单详情
*/
getEnquiryDetail() {
vk.callFunction({
url: 'client/enquiry/sheet/pub/getDetail',
title: '请求中...',
data: {
_id: this.enquiryId
},
success: (res) => {
this.sheet = res.data
}
});
},
formatNumber(e) {
this.form1.data.totalPrice = parseFloat(this.form1.data.totalPrice).toFixed(2)
}
},
onShow() {
this.reloaded = false
setTimeout(() => {
this.reloaded = true
}, 500)
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.page-main { .page-main {
width: 1200px; width: 1200px;
margin: 20px auto; margin: 20px auto;
background-color: #FFFFFF; background-color: #FFFFFF;
padding: 20px; padding: 20px;
} }
.description { .description {
margin-bottom: 40px; margin-bottom: 40px;
width: 800px; width: 800px;
} }
.quote { .quote {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
} }
.quote-form { .quote-form {
width: 260px; width: 260px;
} }
.form-footer { .form-footer {
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
background: #fff; background: #fff;
padding-top: 0; padding-top: 0;
text-align: center; text-align: center;
display: block; display: block;
} }
</style> </style>
+184
View File
@@ -0,0 +1,184 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<!-- <view class="page-nav">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item><navigator url="/pages/spot/goods/goods">现货市场</navigator></el-breadcrumb-item>
</el-breadcrumb>
</view> -->
<view class="carousel">
<el-carousel height="170px">
<el-carousel-item v-for="item in 4" :key="item">
<image class="carousel-img"
src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"
mode="aspectFill"></image>
</el-carousel-item>
</el-carousel>
<view class="goods-options">
<el-row class="">
<el-button @click="toRelease" type="primary" round>发布询价单</el-button>
<!-- <el-button type="primary" round plain>我发布的询价单</el-button> -->
</el-row>
</view>
</view>
<!-- 商品列表 -->
<view class="sheet-list">
<vk-data-table ref="table1" :action="table1.action" :columns="table1.columns"
:customRightBtns="table1.customRightBtns"
:pagination="true"></vk-data-table>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
data() {
return {
keyword: '',
// 表格相关开始 -----------------------------------------------------------
table1: {
// 表格数据请求地址
action: "client/enquiry/quote/kh/getList",
customRightBtns: [
{
title: '详情',
icon: 'el-icon-search',
type: 'primary',
onClick: (item) => {
vk.navigateTo('/pages/enquiry/detail?id=' + item.sheetId);
}
},
],
// 表格字段显示规则
columns: [
{
key: "sheet.title",
title: "供应标题",
type: "text",
},
{
key: "totalPrice",
title: "金额",
type: "text",
formatter: (val, row, column, index) => {
return `${val}元`
}
},
{
key: "status",
title: "状态",
type: "select",
data: [
{value: 0, label: '待选商'},
{value: 1, label: '已被选商'},
]
},
{
key: "remark",
title: "备注",
type: "text",
},
{
key: "_add_time_str",
title: "发布时间",
type: "time",
width: 160
},
],
// 多选框选中的值
multipleSelection: [],
// 当前高亮的记录
selectItem: "",
},
// 表格相关结束 -----------------------------------------------------------
};
},
onLoad() {
},
methods: {
toRelease() {
if (!vk.getVuex('$user.userInfo.fadadaConfirm')) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(vk.getVuex('$user.userInfo.businessCard'))) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=fadada');
})
} else {
uni.navigateTo({
url: '/pages/enquiry/release'
})
}
},
}
}
</script>
<style lang="scss" scoped>
.carousel {
width: 1200px;
margin: 20px auto;
}
.carousel-img {
width: 100%;
height: 100%;
}
.goods-options {
background-color: #FFFFFF;
padding: 20px;
}
.filter-outer {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
}
.tags {
display: flex;
.el-tag {
margin-right: 10px;
}
}
.sheet-list {
width: 1200px;
margin: 20px auto;
// display: flex;
}
.paginatio {
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
}
</style>
+1089 -886
View File
File diff suppressed because it is too large Load Diff
+1385 -1044
View File
File diff suppressed because it is too large Load Diff
+587 -384
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+260 -206
View File
@@ -1,236 +1,290 @@
<template> <template>
<view> <view>
<top-bar></top-bar> <top-bar></top-bar>
<common-header></common-header> <common-header></common-header>
<category-bar></category-bar> <category-bar></category-bar>
<!-- <view class="page-nav"> <!-- <view class="page-nav">
<el-breadcrumb separator="/"> <el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item> <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item><navigator url="/pages/spot/goods/goods">现货市场</navigator></el-breadcrumb-item> <el-breadcrumb-item><navigator url="/pages/spot/goods/goods">现货市场</navigator></el-breadcrumb-item>
</el-breadcrumb> </el-breadcrumb>
</view> --> </view> -->
<view class="carousel"> <view class="carousel">
<el-carousel height="170px"> <!-- <el-carousel height="170px">-->
<el-carousel-item v-for="item in 4" :key="item"> <!-- <el-carousel-item v-for="item in 4" :key="item">-->
<image class="carousel-img" <!-- <image class="carousel-img"-->
src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg" <!-- src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"-->
mode="aspectFill"></image> <!-- mode="aspectFill"></image>-->
</el-carousel-item> <!-- </el-carousel-item>-->
</el-carousel> <!-- </el-carousel>-->
<view class="goods-options"> <common-swiper page="old-mine" :height="200"/>
<el-row class=""> <view class="goods-options">
<el-button @click="toRelease" type="primary" round>发布旧货交易</el-button> <el-row class="">
<!-- <el-button type="primary" round plain>我发布的询价单</el-button> --> <el-button @click="toRelease" type="primary" round>发布旧货交易</el-button>
</el-row> <!-- <el-button type="primary" round plain>我发布的询价单</el-button> -->
</view> </el-row>
</view> </view>
</view>
<!-- 商品列表 --> <!-- 商品列表 -->
<view class="sheet-list"> <view class="sheet-list">
<vk-data-table ref="table1" :action="table1.action" :columns="table1.columns" :customRightBtns="table1.customRightBtns" <vk-data-table ref="table1" :action="table1.action" :columns="table1.columns"
:pagination="true" :query-form-param="queryForm1"></vk-data-table> :customRightBtns="table1.customRightBtns"
</view> :pagination="true" :query-form-param="queryForm1"></vk-data-table>
</view>
<common-footer></common-footer> <common-footer></common-footer>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
keyword: '', keyword: '',
// 表格相关开始 ----------------------------------------------------------- // 表格相关开始 -----------------------------------------------------------
queryForm1: { queryForm1: {
formData: { formData: {
userId: vk.getVuex('$user.userInfo._id') userId: vk.getVuex('$user.userInfo._id')
}, },
columns: [ columns: [
{ key:"userId", title:"发布人ID", type:"text", width:160, mode:"=" }, {key: "userId", title: "发布人ID", type: "text", width: 160, mode: "="},
] ]
}, },
table1: { table1: {
// 表格数据请求地址 // 表格数据请求地址
action: "client/old/kh/getList", action: "client/old/kh/getList",
customRightBtns: [ customRightBtns: [
{ {
title: '详情', title: '详情',
icon: 'el-icon-search', icon: 'el-icon-search',
type: 'primary', type: 'primary',
onClick: (item) => { onClick: (item) => {
vk.navigateTo('/pages/index/old/detail?id=' + item._id); vk.navigateTo('/pages/index/old/detail?id=' + item._id);
} }
}, },
{ {
title: '删除', title: '删除',
icon: 'el-icon-delete', icon: 'el-icon-delete',
type: 'primary', type: 'primary',
onClick: (item) => { onClick: (item) => {
this.$confirm('').then(()=> { this.$confirm('如果你要删除此条信息,之前其他客户填写的留言将无法查看', '提示', {
confirmButtonText: '确定',
}).then(() => { cancelButtonText: '取消',
vk.callFunction({ type: 'warning'
url: 'client/old/kh/delete', }).then(() => {
title: '请求中...', vk.callFunction({
data: { url: 'client/old/kh/delete',
id: item._id title: '请求中...',
}, data: {
}).then(res => { id: item._id
this.$refs.table1.refresh() },
}) }).then(res => {
}) this.$refs.table1.refresh()
} })
}, })
], },
// 表格字段显示规则 show: (item) => {
columns: [ console.log(item.status)
{ return item.status === 0
key: "标题", }
title: "title", },
type: "text", ],
width: 280 // 表格字段显示规则
}, columns: [
{ {
key: "productList", key: "title",
title: "所在地", title: "标题",
type: "text", type: "text",
minWidth: 200, width: 280
formatter: (val, row, column, index) => { },
let str = "" {
try { key: "addressRegion",
str = val.map(item=>{ title: "所在地",
return item.addressRegion[0].name + "-" + item.addressRegion[1].name type: "text",
}).join("/") minWidth: 200,
} catch(err){ formatter: (val, row, column, index) => {
str = "" let str = ""
} try {
if (row.type === 1) str = (row.deliverAddressRegion && row.deliverAddressRegion.city) ? (row.deliverAddressRegion.province.name + "-" + row.deliverAddressRegion.city.name) : ''
return str else str = (row.addressRegion && row.addressRegion.city) ? (row.addressRegion.province.name + "-" + row.addressRegion.city.name) : ''
}
},
{
key: "supplier.companyName",
title: "供应商",
type: "text",
},
{
key: "_add_time_srt",
title: "添加时间",
type: "time",
width: 160
},
],
// 多选框选中的值
multipleSelection: [],
// 当前高亮的记录
selectItem: "",
}, // if (row.type === 2) {
// 表格相关结束 ----------------------------------------------------------- // str = row.offerAddressRegion.province.name + row.offerAddressRegion.city.name + row.offerAddressRegion.area.name
}; // } else if (row.type === 1) {
}, // str = row.deliverAddressRegion.province.name + row.deliverAddressRegion.city.name + row.deliverAddressRegion.area.name
onLoad() { // } else {
// str = val.province.name + val.city.name + val.area.name
// }
} catch (err) {
str = ""
}
}, return str
methods: { }
toRelease() { },
{
key: "quoteNum",
title: "报价数",
type: "text",
formatter: (val, row, column, index) => {
return `${val}家已报价`
}
},
{
key: "type",
title: "类型",
type: "select",
data: [
{value: 0, label: '拍卖'},
{value: 1, label: '采购'},
{value: 2, label: '租赁'},
{value: 3, label: '物资回收'},
]
},
// {
// key: "supplier",
// title: "供应商",
// type: "text",
// formatter: (val, row, column, index) => {
// console.log(val.companyName, val.companyName === '')
// if (val.companyName && val.companyName !== '') return val.companyName
// else return val.personName
// // console.log((val.companyName && val.companyName !== ''), val.companyName)
// // return ((val.companyName && val.companyName !== '') ? val.companyName : val.personName)
// }
// },
{
key: "_add_time_str",
title: "添加时间",
type: "time",
width: 160
},
if (!vk.getVuex('$user.userInfo.fadadaConfirm')) { ],
this.$confirm('您尚未认证, 是否前往认证?', '提示', { // 多选框选中的值
confirmButtonText: '确定', multipleSelection: [],
cancelButtonText: '取消', // 当前高亮的记录
type: 'warning' selectItem: "",
}).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'
})
}
},
// 表格相关结束 -----------------------------------------------------------
};
},
onLoad() {
},
methods: {
async toRelease() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (accountNum === 0) {
this.$confirm('请先到个人中心添加收款账户', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=account'});
})
} else {
if (userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
vk.navigateTo({
url: '/pages/index/old/release'
})
}
},
},
computed: {
checkCategoryArr() {
let arr = []
this.checkCategoryList.forEach(item => {
arr.push(...item)
})
this.checkProvinceList.forEach(item => {
arr.push({
...item
})
})
return arr
}
}, }
}, }
computed: {
checkCategoryArr() {
let arr = []
this.checkCategoryList.forEach(item => {
arr.push(...item)
})
this.checkProvinceList.forEach(item => {
arr.push({
...item
})
})
return arr
}
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.carousel { .carousel {
width: 1200px; width: 1200px;
margin: 20px auto; margin: 20px auto;
} }
.carousel-img { .carousel-img {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.goods-options { .goods-options {
background-color: #FFFFFF; background-color: #FFFFFF;
padding: 20px; padding: 20px;
} }
.filter-outer { .filter-outer {
width: 1200px; width: 1200px;
margin: 20px auto; margin: 20px auto;
background-color: #FFFFFF; background-color: #FFFFFF;
padding: 20px; padding: 20px;
} }
.tags { .tags {
display: flex; display: flex;
.el-tag { .el-tag {
margin-right: 10px; margin-right: 10px;
} }
} }
.sheet-list { .sheet-list {
width: 1200px; width: 1200px;
margin: 20px auto; margin: 20px auto;
// display: flex; // display: flex;
} }
.paginatio {
.paginatio { float: none;
float: none; width: 1200px;
width: 1200px; margin: 20px auto;
margin: 20px auto; display: flex;
display: flex; justify-content: center;
justify-content: center; }
}
</style> </style>
+581 -490
View File
File diff suppressed because it is too large Load Diff
+235
View File
@@ -0,0 +1,235 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="page-nav">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item>
<navigator style="display: inline-block;" url="/pages/index/old/old">旧货交易</navigator>
</el-breadcrumb-item>
<el-breadcrumb-item>填写报价信息</el-breadcrumb-item>
</el-breadcrumb>
</view>
<view class="page-main">
<quote-remain-num v-if="reloaded" :amount="sheet.quoteAmount" type="old" :id="id"/>
<vk-data-form
ref="form1"
v-model="form1.data"
:action="form1.props.action"
:columns="form1.props.columns"
:rules="form1.props.rules"
:form-type="form1.props.formType"
:loading.sync="form1.props.loading"
:auto-close="false"
label-width="140px"
:show-cancel="false"
@success="onFormSuccess"
>
<template v-slot:totalPrice>
<el-input v-if="sheet.type === 2 && sheet.rentType === 1" v-model="form1.data.totalPrice"
placeholder="请输入询价内容"/>
<el-input v-else v-model="form1.data.totalPrice" placeholder="请输入总价"
@change="formatNumber"></el-input>
</template>
</vk-data-form>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
import dayjs from "dayjs";
export default {
data() {
return {
id: null,
sheet: null,
reloaded: false,
// 表单相关开始-----------------------------------------------------------
form1: {
// 表单请求数据,此处可以设置默认值
data: {
// radio: 1,
// checkbox : [1,2]
sheetId: null
},
// 表单属性
props: {
// 表单请求地址
action: "client/old/kh/addQuote",
// 表单字段显示规则
columns: [
{
key: "totalPrice", title: "总价(人民币:元)", type: "number", showRule: () => {
return this.sheet.type !== 2 || (this.sheet.type === 2 && this.sheet.rentType === 0)
}
},
{
key: "totalPrice", title: '简述询价内容', type: "number", showRule: () => {
return this.sheet.type === 2 && this.sheet.rentType === 1
}
},
{key: "files", title: "附件", type: "file", accept: '.pdf'},
{
key: "remark", title: "报价单详情", type: "textarea", showRule: () => {
return this.sheet.type !== 2 || (this.sheet.type === 2 && this.sheet.rentType === 0)
}
},
{
key: "remark", title: "询价详情", type: "textarea", showRule: () => {
return this.sheet.type === 2 && this.sheet.rentType === 1
}
},
{
key: "supplierExt", title: "报价补充条款", type: "textarea", showRule: () => {
return this.sheet.type !== 2 || (this.sheet.type === 2 && this.sheet.rentType === 0)
}
},
],
// 表单验证规则
rules: {
totalPrice: [
{required: true, message: "总价不能为空", trigger: "change,blur"},
]
},
// add 代表添加 update 代表修改
formType: "",
// 表单是否在请求中
loading: false,
// 是否显示表单1 的弹窗
show: false
}
},
// 表单相关结束-----------------------------------------------------------
};
},
onLoad(options = {}) {
console.log(options)
const {
id
} = options
if (!id) {
vk.navigateTo('/pages/index/old/old');
return
}
this.id = id
this.form1.data.sheetId = id
this.getDetail()
},
computed: {
totalPriceStr() {
if (this.totalPrice === 0) {
return "零元"
}
return vk.myfn.convertCurrency(this.totalPrice / 100)
}
},
methods: {
getDetail() {
this.reloaded = false
vk.callFunction({
url: 'client/old/pub/getDetail',
title: '请求中...',
data: {
id: this.id
},
success: (res) => {
this.sheet = res
this.reloaded = true
}
}).catch(err => {
if (err.code === -1) {
setTimeout(() => {
vk.navigateBack()
}, 1500)
}
})
},
formatNumber(e) {
this.form1.data.totalPrice = parseFloat(this.form1.data.totalPrice).toFixed(2)
},
onFormSuccess() {
vk.redirectTo({url: `/pages/index/old/detail?id=${this.id}`})
},
// 提交报价单
async submit() {
const data = await vk.userCenter.getCurrentUserInfo();
const {userInfo} = data
if (userInfo.quoteTimes > 3) {
}
// this.$confirm(`今日报价次数${userInfo.quoteTimes || 0}, 是否继续?`, '提示', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning',
// center: true
// }).then(res => {
vk.callFunction({
url: 'client/enquiry/quote/kh/addQuote',
title: '请求中...',
// data: {
// sheet: this.sheet,
// totalPrice: this.totalPrice
// },
success: (data) => {
this.$message({
message: "报价成功",
type: 'success'
})
}
});
// })
},
},
onShow() {
this.reloaded = false
setTimeout(() => {
this.reloaded = true
}, 500)
}
}
</script>
<style lang="scss" scoped>
.page-main {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
}
.description {
margin-bottom: 40px;
width: 800px;
}
.quote {
display: flex;
align-items: center;
justify-content: space-between;
}
.quote-form {
width: 260px;
}
.form-footer {
height: 40px;
line-height: 40px;
background: #fff;
padding-top: 0;
text-align: center;
display: block;
}
</style>
+195
View File
@@ -0,0 +1,195 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<!-- <view class="page-nav">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item><navigator url="/pages/spot/goods/goods">现货市场</navigator></el-breadcrumb-item>
</el-breadcrumb>
</view> -->
<view class="carousel">
<el-carousel height="170px">
<el-carousel-item v-for="item in 4" :key="item">
<image class="carousel-img"
src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"
mode="aspectFill"></image>
</el-carousel-item>
</el-carousel>
<view class="goods-options">
<el-row class="">
<el-button @click="toRelease" type="primary" round>发布旧货交易</el-button>
<!-- <el-button type="primary" round plain>我发布的询价单</el-button> -->
</el-row>
</view>
</view>
<!-- 商品列表 -->
<view class="sheet-list">
<vk-data-table ref="table1" :action="table1.action" :columns="table1.columns"
:customRightBtns="table1.customRightBtns"
:pagination="true"></vk-data-table>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
data() {
return {
keyword: '',
// 表格相关开始 -----------------------------------------------------------
table1: {
// 表格数据请求地址
action: "client/old/kh/getMyQuoteList",
customRightBtns: [
{
title: '详情',
icon: 'el-icon-search',
type: 'primary',
onClick: (item) => {
vk.navigateTo('/pages/index/old/detail?id=' + item.sheetId);
}
},
],
// 表格字段显示规则
columns: [
{
key: "sheet.title",
title: "旧货标题",
type: "text",
},
{
key: "sheet.type",
title: "旧货类型",
type: "select",
data: [
{value: 0, label: '拍卖'},
{value: 1, label: '采购'},
{value: 2, label: '租赁'},
{value: 3, label: '物资回收'},
]
},
{
key: "totalPrice",
title: "金额",
type: "text",
formatter: (val, row, column, index) => {
return `${val}元`
}
},
{
key: "status",
title: "状态",
type: "select",
data: [
{value: 0, label: '待选商'},
{value: 1, label: '已被选商'},
]
},
{
key: "remark",
title: "备注",
type: "text",
},
{
key: "_add_time_str",
title: "发布时间",
type: "time",
width: 160
},
],
// 多选框选中的值
multipleSelection: [],
// 当前高亮的记录
selectItem: "",
},
// 表格相关结束 -----------------------------------------------------------
};
},
onLoad() {
},
methods: {
toRelease() {
if (!vk.getVuex('$user.userInfo.fadadaConfirm')) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(vk.getVuex('$user.userInfo.businessCard'))) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=fadada');
})
} else {
uni.navigateTo({
url: '/pages/index/old/release'
})
}
},
}
}
</script>
<style lang="scss" scoped>
.carousel {
width: 1200px;
margin: 20px auto;
}
.carousel-img {
width: 100%;
height: 100%;
}
.goods-options {
background-color: #FFFFFF;
padding: 20px;
}
.filter-outer {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
}
.tags {
display: flex;
.el-tag {
margin-right: 10px;
}
}
.sheet-list {
width: 1200px;
margin: 20px auto;
// display: flex;
}
.paginatio {
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
}
</style>
+136 -33
View File
@@ -1,30 +1,37 @@
<template> <template>
<view> <view>
<top-bar></top-bar> <top-bar></top-bar>
<common-header></common-header> <common-header></common-header>
<category-bar></category-bar> <category-bar></category-bar>
<view class="w-1200 m-a bg-white"> <view class="w-1200 m-a bg-white">
<image src="/static/images/old/liucheng2.png" class="w-full" mode="widthFix"/> <image src="/static/images/old/liucheng2.png" class="w-full" mode="widthFix"/>
<view class="p-20"> <view class="p-20">
<el-tabs v-model="activeName" stretch> <el-tabs v-model="activeName" stretch>
<el-tab-pane label="拍卖信息发布" name="0"> <el-tab-pane label="拍卖信息发布" name="0">
<type_0/> <type_0 v-if="parseInt(activeName) === 0" :urgentAmount="urgentAmount" :remainOldNum="remainOldNum" :unitList="unitList"
</el-tab-pane> :buyOldNumAmount="buyOldNumAmount" :agreement="agreement"
<el-tab-pane label="采购信息发布" name="1"> :commonContractUrl="commonContractUrl" :contactList="contactList"/>
<type_1/> </el-tab-pane>
</el-tab-pane> <el-tab-pane label="采购信息发布" name="1">
<el-tab-pane label="承租信息发布" name="2"> <type_1 v-if="parseInt(activeName) === 1" :urgentAmount="urgentAmount" :remainOldNum="remainOldNum"
<type_2/> :buyOldNumAmount="buyOldNumAmount" :agreement="agreement"
</el-tab-pane> :commonContractUrl="commonContractUrl" :contactList="contactList"/>
<el-tab-pane label="物资回收信息发布" name="3"> </el-tab-pane>
<type_3/> <el-tab-pane label="承租、租赁信息发布" name="2">
</el-tab-pane> <type_2 v-if="parseInt(activeName) === 2" :urgentAmount="urgentAmount" :remainOldNum="remainOldNum"
</el-tabs> :buyOldNumAmount="buyOldNumAmount" :agreement="agreement"
</view> :commonContractUrl="commonContractUrl" :contactList="contactList"/>
</view> </el-tab-pane>
<gap height="50"/> <el-tab-pane label="物资回收信息发布" name="3">
<common-footer></common-footer> <type_3 v-if="parseInt(activeName) === 3" :urgentAmount="urgentAmount" :remainOldNum="remainOldNum"
:buyOldNumAmount="buyOldNumAmount" :agreement="agreement" :contactList="contactList"/>
</el-tab-pane>
</el-tabs>
</view>
</view> </view>
<gap height="50"/>
<common-footer></common-footer>
</view>
</template> </template>
<script> <script>
@@ -34,13 +41,109 @@ import Type_2 from "./release/type_2.vue";
import Type_3 from "./release/type_3.vue"; import Type_3 from "./release/type_3.vue";
export default { export default {
name: "list", name: "list",
components: {Type_3, Type_2, Type_1, Type_0}, components: {Type_3, Type_2, Type_1, Type_0},
data() { data() {
return { return {
activeName: '0' activeName: '0',
} urgentAmount: 1,
remainOldNum: vk.getVuex('$user.userInfo.remainOldNum') ? parseInt(vk.getVuex('$user.userInfo.remainOldNum')) : 0,
buyOldNumAmount: 5,
agreement: '',
commonContractUrl: '',
contactList: [],
unitList: [],
}
},
methods: {
async getUrgentAmount() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '6587dd2fe0ec19027452c5b5'
},
})
this.urgentAmount = res.content
}, },
methods: {} async getBuyOldAmount() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '6587dd54189f86d49b3d5ff5'
},
})
this.buyOldNumAmount = res.content
},
async getUnitList() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: 'a45325976635f10600341a7f2f472cd1'
},
})
this.unitList = res.content.split(',')
},
async getAgreement() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '65885d5b862066f18a4e4a36'
},
})
this.agreement = res.content
},
async getCommonContractUrl() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '657d36befe975f63af1f24e7'
},
})
this.commonContractUrl = res.content
},
async getContactList() {
const {rows} = await vk.callFunction({
url: 'client/businessContact/kh/getList',
})
this.contactList = rows
},
},
onLoad() {
this.getUnitList()
this.getUrgentAmount()
this.getBuyOldAmount()
this.getAgreement()
this.getCommonContractUrl()
this.getContactList()
},
onShow() {
vk.userCenter.getCurrentUserInfo({
success: (data) => {
this.remainOldNum = data.userInfo.remainOldNum ? parseInt(data.userInfo.remainOldNum) : 0
if (this.remainOldNum === 0) {
this.$confirm('您的旧货发布次数已用完,是否立即购买?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const {data} = await vk.callFunction({
url: 'client/old/kh/buyNum',
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
}).catch(() => {
vk.navigateBack()
})
}
}
});
}
} }
</script> </script>
<style>
/deep/ .el-tabs__item.is-active{
font-size: 1.2rem!important;
}
</style>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+371 -197
View File
@@ -1,135 +1,158 @@
<template> <template>
<view class="flex flex-col justify-start items-start"> <view class="flex flex-col justify-start items-start">
<text class="text-50">发布我的回收信息</text> <text class="text-50">发布我的回收信息</text>
<text class="text-gray">回收信息越完整,成功交易越容易</text> <text class="text-gray">回收信息越完整,成功交易越容易</text>
<el-form ref="form" :model="form" label-width="140px" class="mt-20"> <el-form ref="form" :model="form" label-width="140px" class="mt-20">
<el-form-item label="信息失效时间:"> <el-form-item label="信息失效时间:" required>
<el-date-picker <el-date-picker
v-model="form.expiredTime" :picker-options="pickerOptions"
type="datetime" v-model="form.expiredTime"
placeholder="选择日期时间"> type="datetime"
</el-date-picker> placeholder="选择日期时间">
</el-form-item> </el-date-picker>
<el-form-item label="物资分类:"> </el-form-item>
<el-radio-group v-model="form.category" size="small"> <el-form-item label="物资分类:" required>
<el-radio label="机械设备"> <div class="flex justify-start items-center">
<text>机械设备</text> <el-cascader :options="cateData" v-model="form.category" :disabled="form.otherCate"
</el-radio> :props="{'label': 'name', 'value': 'name'}"/>
<el-radio label="成品钢材"> <el-checkbox v-model="form.otherCate" class="mx-20">其他分类</el-checkbox>
<text>成品钢材</text> <el-input v-model="form.otherCateName" :disabled="!form.otherCate" placeholder="如物资分类选项中不能描述您的信息物资主要内容,请在此用专业或通用术语填写"
</el-radio> class="ml-20"/>
<el-radio label="废旧钢材"> </div>
<text>废旧钢材</text> </el-form-item>
</el-radio> <el-form-item label="信息标题:" required>
<el-radio label="旧架子管"> <el-input v-model="form.title" placeholder="一句话简介回收内容,如 常年回收 二手、废旧螺纹钢、型材等"/>
<text>旧架子管</text> </el-form-item>
</el-radio> <el-form-item label="回收方简述:">
<el-radio label="旧扣件"> <el-input v-model="form.desc" placeholder="请详细描述物资信息,描述内容:材料名称、材质......(限300字以内)"
<text>旧扣件</text> type="textarea" show-word-limit maxlength="300"/>
</el-radio> </el-form-item>
</el-radio-group> <el-form-item label="回收物实景照片:">
</el-form-item> <vk-data-upload v-model="form.files" list-type="text"
<el-form-item label="信息标题:"> accept="image/*">
<el-input v-model="form.title" placeholder="一句话简介物资,如拍卖直缝钢管200吨等"/> </vk-data-upload>
</el-form-item> </el-form-item>
<el-form-item label="回收方简述:"> <el-form-item label="回收单位地址" class="ml-10" required>
<el-input v-model="form.desc" placeholder="请详细描述物资信息,描述内容:材料名称、材质......(限300字以内)" <el-row :gutter="10">
type="textarea" show-word-limit maxlength="300"/> <el-col :span="5">
</el-form-item> <el-select v-model="provinceIndex" placeholder="省" @change="selectProvince">
<el-form-item label="回收物实景照片:"> <el-option v-for="(item, index) in provinceData" :key="index" :value="index"
<vk-data-upload v-model="form.files" :label="item.name"/>
accept="image/*"> </el-select>
</vk-data-upload> </el-col>
</el-form-item> <el-col :span="5">
<el-form-item label="回收单位地址" class="ml-10"> <el-select v-model="cityIndex" placeholder="市" @change="selectCity">
<el-row :gutter="10"> <template v-if="provinceIndex !== null">
<el-col :span="5"> <el-option v-for="(item, index) in cityData[provinceIndex]" :key="index"
<el-select v-model="provinceIndex" placeholder="省" @change="selectProvince"> :value="index"
<el-option v-for="(item, index) in provinceData" :key="index" :value="index" :label="item.name"/>
:label="item.name"/> </template>
</el-select> </el-select>
</el-col> </el-col>
<el-col :span="5"> <el-col :span="5">
<el-select v-model="cityIndex" placeholder="市" @change="selectCity"> <el-select v-model="areaIndex" placeholder="区/县" @change="selectArea">
<template v-if="provinceIndex !== null"> <template v-if="provinceIndex !== null && cityIndex !== null">
<el-option v-for="(item, index) in cityData[provinceIndex]" :key="index" <el-option v-for="(item, index) in areaData[provinceIndex][cityIndex]"
:value="index" :key="index" :value="index"
:label="item.name"/> :label="item.name"/>
</template> </template>
</el-select> </el-select>
</el-col> </el-col>
<el-col :span="5"> <el-col :span="8">
<el-select v-model="areaIndex" placeholder="区/县" @change="selectArea"> <el-input v-model="form.addressDetail"
<template v-if="provinceIndex !== null && cityIndex !== null"> placeholder="详细地址或几公里范围内"></el-input>
<el-option v-for="(item, index) in areaData[provinceIndex][cityIndex]" </el-col>
:key="index" :value="index" </el-row>
:label="item.name"/> </el-form-item>
</template> <view class="form-title-wrap">
</el-select> <view class="goods-info-title">
</el-col> <view class="form-title">
<el-col :span="8"> 回收单位信息
<el-input v-model="form.addressDetail" </view>
placeholder="详细地址或几公里范围内"></el-input>
</el-col>
</el-row>
</el-form-item>
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
回收单位信息
</view>
</view>
</view>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="公司信息">
<el-input v-model="form.supplier.companyName"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="公司联系方式">
<el-input v-model="form.supplier.contract"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="个人信息">
<el-input v-model="form.supplier.personalName"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="个人联系方式">
<el-input v-model="form.supplier.personalContract"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="授权人姓名">
<el-input v-model="form.supplier.managerName"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="授权联系方式">
<el-input v-model="form.supplier.managerContract"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<view class="mt-20 flex justify-start items-center">
<text class="mr-25">您是否对以上信息进行了详细核实:</text>
<el-radio label="是" v-model="checked">
<text>是</text>
</el-radio>
<el-radio label="否" v-model="checked">
<text>否</text>
</el-radio>
</view>
<view class="flex justify-center items-center mt-30 m-a">
<el-button type="primary" :disabled="checked === '否'" @click="publish">立即发布</el-button>
</view> </view>
</view>
<el-row :gutter="10" v-if="vk.getVuex('$user.userInfo.accountType') === 2">
<el-col :span="12">
<el-form-item label="公司信息">
<el-input v-model="form.supplier.companyName"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="公司联系方式">
<el-input v-model="form.supplier.contract"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10" v-if="vk.getVuex('$user.userInfo.accountType') === 1">
<el-col :span="12">
<el-form-item label="个人信息">
<el-input v-model="form.supplier.personalName"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="个人联系方式">
<el-input v-model="form.supplier.personalContract"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="12" class="flex justify-start items-center">
<el-form-item label="授权业务咨询人">
<el-select v-model="form.supplier.managerName" placeholder="点击选择业务联系人"
class="w-100p" @change="selectContact">
<el-option
v-for="(item, index) in contactList"
:key="index"
:label="item.name"
:value="item.name">
</el-option>
<view slot="empty" class="text-gray pointer p-20">
<text>无业务联系人,请到</text>
<text class="text-main mx-15" @click="navTo">个人中心</text>
<text>添加</text>
</view>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" class="flex justify-start items-center">
<el-form-item label="业务咨询联系方式">
<el-input v-model="form.supplier.managerContract" type="number" disabled/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<view class="mt-20 flex justify-start items-center">
<text class="mr-25">您是否对以上信息进行了详细核实:</text>
<el-radio label="是" v-model="checked">
<text>是</text>
</el-radio>
<el-radio label="否" v-model="checked">
<text>否</text>
</el-radio>
</view> </view>
<view class="mt-20 flex justify-start items-center">
<text class="mr-25">是否加急({{ urgentAmount }}元/次,将在旧货交易页面加急展示区展示):</text>
<el-radio :label="true" v-model="form.isUrgent">
<text>是</text>
</el-radio>
<el-radio :label="false" v-model="form.isUrgent">
<text>否</text>
</el-radio>
</view>
<view class="my-25 text-main font-bold">本月剩余旧货发布次数:{{ remainOldNum }}</view>
<view class="flex justify-start items-center">
<el-checkbox v-model="agree">我已阅读并同意</el-checkbox>
<span class="text-main pointer font-bold" @click="showAgreement">《金久信旧货交易协议》</span>
</view>
<view class="flex justify-center items-center mt-30 m-a">
<el-button type="primary" :disabled="checked === '否' || !agree" @click="publish">立即发布</el-button>
</view>
<el-dialog title="金久信旧货交易协议" :visible.sync="dialogVisible" width="70%" close-on-press-escape
close-on-click-modal show-close
>
<div v-html="agreement"></div>
</el-dialog>
</view>
</template> </template>
<script> <script>
@@ -138,59 +161,206 @@ import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json"; import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
export default { export default {
name: "type_3", name: "type_3",
data() { props: {
return { urgentAmount: {
provinceData: provinces, type: Number,
cityData: citys, default: 10
areaData: areas,
form: {
type: 3,
category: 0,
files: [],
title: '',
desc: '',
addressRegion: [],
addressDetail: '',
expiredTime: '',
supplier: {
companyName: '',
contract: '',
personalName: '',
personalContract: '',
managerName: '',
managerContract: '',
},
},
provinceIndex: null,
cityIndex: null,
areaIndex: null,
checked: '否'
}
}, },
methods: { remainOldNum: {
selectProvince(index) { type: Number,
this.form.addressRegion[0] = this.provinceData[index] default: 0
},
agreement: {
type: String,
default: ''
},
contactList: {
type: Array,
default: ''
},
},
data() {
return {
pickerOptions: {
disabledDate(time) {
return time.getTime() < Date.now();
}, },
selectCity(index) { },
this.form.addressRegion[1] = this.cityData[this.provinceIndex][index] agree: false,
provinceData: provinces,
cityData: citys,
areaData: areas,
allChildCate: [],
cateData: [],
form: {
otherCate: false,
otherCateName: '',
type: 3,
category: 0,
files: [],
title: '',
desc: '',
addressRegion: {},
addressDetail: '',
expiredTime: '',
supplier: {
companyName: '',
contract: '',
personalName: '',
personalContract: '',
managerName: '',
managerContract: '',
}, },
selectArea(index) { isUrgent: false
this.form.addressRegion[2] = this.areaData[this.provinceIndex][this.cityIndex][index] },
}, provinceIndex: null,
async publish() { cityIndex: null,
await vk.callFunction({ areaIndex: null,
url: 'client/old/kh/add', checked: '否',
data: this.form dialogVisible: false
})
this.$message({
message: "提交成功",
type: 'success'
})
vk.navigateBack()
}
} }
},
methods: {
selectProvince(index) {
this.form.addressRegion.province = this.provinceData[index]
},
selectCity(index) {
this.form.addressRegion.city = this.cityData[this.provinceIndex][index]
},
selectArea(index) {
this.form.addressRegion.area = this.areaData[this.provinceIndex][this.cityIndex][index]
},
async publish() {
if (this.remainOldNum === 0) {
this.$confirm('您的旧货发布次数已用完,是否立即购买?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async ({confirm}) => {
if (confirm) {
const {data} = await vk.callFunction({
url: 'client/old/kh/buyNum',
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
}
})
return
}
if (this.provinceIndex === null || this.cityIndex === null || this.areaIndex === null) return this.$message({
message: "请选择完整的地址",
type: 'warning'
})
if (!this.form.addressDetail) return this.$message({
message: "请填写详细地址",
type: 'warning'
})
if (!this.form.title) return this.$message({
message: "请填写标题",
type: 'warning'
})
if (!this.form.otherCate) {
if (!this.form.category) return this.$message({
message: "请选择分类",
type: 'warning'
})
} else {
if (!this.form.otherCateName) return this.$message({
message: "请输入其他分类",
type: 'warning'
})
this.form.category = ['', this.form.otherCateName]
}
if (!this.form.expiredTime) return this.$message({
message: "请选择失效时间",
type: 'warning'
})
const res = await vk.callFunction({
url: 'client/old/kh/add',
data: this.form
})
localStorage.removeItem("old_3")
this.$message({
message: "您的信息已经提交,等待管理员审核,请您耐心等待!",
type: 'success'
})
if (this.form.isUrgent) {
vk.navigateTo({
url: `/pages/index/shop/pay?id=${res.data}`
})
} else {
vk.redirectTo({url: '/pages/index/old/old'});
}
},
showAgreement() {
// this.$confirm(this.agreement, '金久信旧货交易协议', {
// cancelButtonText: '关闭',
// showConfirmButton: false,
// dangerouslyUseHTMLString: true,
// customClass: 'confirm-box'
// })
this.dialogVisible = true
},
navTo() {
vk.navigateTo({url: '/pages/user/user?menu=business-contact'})
},
selectContact(name) {
const contact = this.contactList.find(item => item.name === name)
this.form.supplier.managerContract = contact.phone
},
save() {
localStorage.setItem("old_3", JSON.stringify({
form: this.form,
provinceIndex: this.provinceIndex,
cityIndex: this.cityIndex,
areaIndex: this.areaIndex,
}))
this.$message({
message: "已保存",
type: 'success'
})
}
},
mounted() {
vk.callFunction({
url: 'client/old/pub/getTree',
title: '请求中...',
data: {type: 3},
success: (data) => {
this.cateData = data.rows.map(item => {
item.children.forEach(child => {
delete child.children
})
return item
})
}
});
if (vk.getVuex('$user.userInfo.accountType') === 2) {
this.form.supplier.companyName = vk.getVuex('$user.userInfo.company.companyName')
this.form.supplier.contract = vk.getVuex('$user.userInfo.company.mobile')
} else {
this.form.supplier.personalName = vk.getVuex('$user.userInfo.person.personName')
this.form.supplier.personalContract = vk.getVuex('$user.userInfo.person.mobile')
}
if (!!localStorage.getItem("old_3")) {
this.$confirm('您有一份暂存数据,是否恢复?', '提示', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
const savedData = JSON.parse(localStorage.getItem("old_3"))
this.form = savedData.form
this.provinceIndex = savedData.provinceIndex
this.cityIndex = savedData.cityIndex
this.areaIndex = savedData.areaIndex
})
}
}
} }
</script> </script>
@@ -198,38 +368,42 @@ export default {
@import "@/common/css/app.scss"; @import "@/common/css/app.scss";
.form-title-wrap { .form-title-wrap {
display: flex;
align-items: center;
justify-content: space-between;
.goods-info-title {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: flex-start;
}
.goods-info-title { .form-title {
display: flex; padding-left: 10px;
align-items: center; color: $--color-primary;
justify-content: flex-start; font-size: 18px;
} line-height: 18px;
border-left: 4px solid $--color-primary;
.form-title { }
padding-left: 10px;
color: $--color-primary;
font-size: 18px;
line-height: 18px;
border-left: 4px solid $--color-primary;
}
} }
.sign-method-header { .sign-method-header {
width: 120px; width: 120px;
} }
</style> </style>
<style> <style>
/deep/ .input-with-select{ /deep/ .input-with-select {
width: 200px; width: 200px;
} }
/deep/ .input-with-select .el-input-group__append { /deep/ .input-with-select .el-input-group__append {
background-color: #fff !important; background-color: #fff !important;
width: 80px !important; width: 80px !important;
}
.confirm-box .el-dialog {
width: 70%;
} }
</style> </style>
+560 -342
View File
@@ -1,191 +1,247 @@
<template> <template>
<view> <view>
<top-bar></top-bar> <top-bar></top-bar>
<common-header></common-header> <common-header></common-header>
<category-bar></category-bar> <category-bar></category-bar>
<view class="w-1200 m-a"> <view class="w-1200 m-a">
<u-swiper :list="list" :height="380" borderRadius="0"></u-swiper> <common-swiper page="self-support-company-swiper"/>
<view class="bg-white p-40"> <view class="flex justify-end items-center text-main pointer my-20 " @click="demoDownload">示例下载</view>
<view v-for="(item, index) in configList" :key="index" <view class="bg-white p-40">
class="my-20 flex flex-col justify-start items-start"> <view v-for="(item, index) in configList" :key="index"
<view class="flex flex-col justify-start items-start"> class="server-item my-20 flex flex-col justify-start items-start">
<view class="flex justify-start items-center text-35 mb-20"> <el-checkbox @change="changeCheck(index, item.name)">
<text>服务内容:{{ item.name }}</text> <view class="flex flex-col justify-start items-start">
<view class="flex flex-col justify-start items-start"> <view class="flex justify-start items-center text-35 mb-20">
<view v-for="(content, contentIndex) in item.contents" :key="contentIndex" <view class="name">{{ item.name }}</view>
class="mb-40 flex justify-start items-center"> <view class="ml-15">
<view class="ml-35"> <text>业务编号:</text>
<text>业务编号:</text> <text v-if="item.contentIndex !== null">{{
<text>{{ content.code }}</text> item.contents[item.contentIndex].code
</view> }}
<view class="flex justify-start items-center"> </text>
<text class="ml-35">服务服务项目:</text>
<el-checkbox v-model="configList[index].contents[contentIndex].checked"
:disabled="!content.amountList || content.amountList.length === 0">
{{ content.title }}
</el-checkbox>
</view>
<view class="flex justify-start items-center ml-35">
<el-select v-model="configList[index].contents[contentIndex].amountIndex"
clearable @change="selectAmount(index, contentIndex, $event)"
:disabled="!content.amountList || content.amountList.length === 0">
<el-option v-for="(amount, amountIndex) in content.amountList"
:key="amountIndex"
:label="amount.title" :value="amountIndex"/>
</el-select>
<text class="ml-35" v-if="content.amountIndex !== null">
{{ content.amountList[content.amountIndex].amount }}元/次
</text>
</view>
</view>
</view>
</view>
<view>备注: {{ item.remark }}</view>
</view>
</view> </view>
<el-form ref="form" :model="form" label-width="200px"> <view class="server-item-content">
<view v-for="(item, companyIndex) in companyList" :key="companyIndex"> <text class="ml-15">服务项目:</text>
<el-form-item label="考察对象(个人/企业全称):" required> <el-select v-model="configList[index].contentIndex" clearable
<el-input v-model="companyList[companyIndex].name"/> :disabled="!contentList.includes(index)">
</el-form-item> <el-option v-for="(content, contentIndex) in item.contents" :key="contentIndex"
<el-form-item label="考察对象(个人身份证/企业信用代码):"> :label="content.title" :value="contentIndex"/>
<el-input v-model="companyList[companyIndex].code"/> </el-select>
</el-form-item> <template v-if="item.contentIndex !== null">
<el-form-item label="考察对象(个人/单位)所在地:"> <el-select v-model="configList[index].amountIndex"
<el-row :gutter="10"> clearable class="ml-15">
<el-col :span="4"> <el-option
<el-select v-model="addressIndex[companyIndex][0]" placeholder="请选择省"> v-for="(amount, amountIndex) in item.contents[item.contentIndex].amountList"
<el-option v-for="(item, index) in provinceData" :key="index" :key="amountIndex"
:label="item.name" :label="amount.title" :value="amountIndex"/>
:value="index"> </el-select>
</el-option> </template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[companyIndex][1]" placeholder="请选择市"
:disabled="addressIndex[companyIndex].length === 0">
<template v-if="addressIndex[companyIndex][0] !== null">
<el-option v-for="(item, index) in cityData[addressIndex[companyIndex][0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[companyIndex][2]" placeholder="请选择区"
:disabled="addressIndex[companyIndex].length === 1">
<template
v-if="addressIndex[companyIndex][0] !== null && addressIndex[companyIndex][1] !== null">
<el-option
v-for="(item, index) in areaData[addressIndex[companyIndex][0]][addressIndex[companyIndex][1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="11">
<el-input v-model="companyList[companyIndex].address" placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="接收文件电子邮箱:">
<el-input v-model="companyList[companyIndex].email"/>
</el-form-item>
<el-form-item label="接收文件微信:">
<el-input v-model="companyList[companyIndex].wechat"/>
</el-form-item>
<el-form-item label="接收文件寄件地址">
<el-row :gutter="10">
<el-col :span="4">
<el-select v-model="receiveAddressIndex[companyIndex][0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[companyIndex][1]" placeholder="请选择市"
:disabled="receiveAddressIndex[companyIndex].length === 0">
<template v-if="receiveAddressIndex[companyIndex][0] !== null">
<el-option
v-for="(item, index) in cityData[receiveAddressIndex[companyIndex][0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[companyIndex][2]" placeholder="请选择区"
:disabled="receiveAddressIndex[companyIndex].length === 1">
<template
v-if="receiveAddressIndex[companyIndex][0] !== null && receiveAddressIndex[companyIndex][1] !== null">
<el-option
v-for="(item, index) in areaData[receiveAddressIndex[companyIndex][0]][receiveAddressIndex[companyIndex][1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="11">
<el-input v-model="companyList[companyIndex].receiveAddress" placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="申请人:">
<el-input v-model="companyList[companyIndex].requestName"/>
</el-form-item>
<el-form-item label="联系人:">
<el-input v-model="companyList[companyIndex].contactName"/>
</el-form-item>
<el-form-item label="联系方式:">
<el-input v-model="companyList[companyIndex].contact"/>
</el-form-item>
<el-form-item label="本次服务费用小计:">
<view class="flex justify-between items-start mb-20 w-100p">
<view class="flex justify-start items-center">
<el-input v-model="amount" disabled/>
<view class="ml-20">
<el-button type="primary" @click.native="addCompany">增加考察对象
</el-button>
</view>
<view class="ml-20">
<el-button type="primary" plain @click.native="removeCompany(companyIndex)"
class="ml-20"
:disabled="companyList.length === 1">删除该对象
</el-button>
</view>
</view>
</view>
</el-form-item>
</view>
</el-form>
<view class="mt-40 flex justify-center items-center">
<view class="flex justify-center items-center">
<text>总价:</text>
<text class="text-main font-bold text-35">{{ totalAmount }}元</text>
</view>
<view class="ml-35">客服联系方式: 0771-3923001</view>
</view> </view>
<view class="mt-40 flex justify-center items-center"> <text>金额:</text>
<el-button type="primary" @click="newOrder" <view class="ml-15" v-if="item.contentIndex !== null && item.amountIndex!== null">
:disabled="companyList.length === 0 || !companyList[0].name"> {{ item.contents[item.contentIndex].amountList[item.amountIndex].amount }}元/次
立即支付
</el-button>
</view> </view>
<view class="ml-15" v-else>
元/次
</view>
</view>
<view class="remark">备注: {{ item.remark }}</view>
</view> </view>
</el-checkbox>
</view> </view>
<gap/> <el-form ref="form" :model="form" label-width="200px">
<common-footer></common-footer> <view v-for="(item, companyIndex) in companyList" :key="companyIndex">
<el-divider>{{ item.name }}</el-divider>
<el-form-item label="考察对象类型:" required>
<el-select v-model="companyList[companyIndex].type" placeholder="请选择考察对象类型">
<el-option label="企业" value="企业"></el-option>
<el-option label="个人" value="个人"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="`考察对象(${item.type}全称):`" required>
<el-input v-model="companyList[companyIndex].name"/>
</el-form-item>
<template v-if="item.type === '个人'">
<el-form-item label="考察对象(个人身份证): " required>
<el-input v-model="companyList[companyIndex].code"/>
</el-form-item>
<el-form-item label="考察对象所在地:" required>
<el-row :gutter="10">
<el-col :span="4">
<el-select v-model="addressIndex[companyIndex][0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[companyIndex][1]" placeholder="请选择市"
:disabled="addressIndex[companyIndex].length === 0">
<template v-if="addressIndex[companyIndex][0] !== null">
<el-option v-for="(item, index) in cityData[addressIndex[companyIndex][0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[companyIndex][2]" placeholder="请选择区"
:disabled="addressIndex[companyIndex].length === 1">
<template
v-if="addressIndex[companyIndex][0] !== null && addressIndex[companyIndex][1] !== null">
<el-option
v-for="(item, index) in areaData[addressIndex[companyIndex][0]][addressIndex[companyIndex][1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="11">
<el-input v-model="companyList[companyIndex].address" placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-form-item>
</template>
<el-form-item label="本次服务费用小计:">
<view class="flex justify-between items-start mb-20 w-100p">
<view class="flex justify-start items-center">
<el-input v-model="amount" disabled/>
<view class="ml-20">
<el-button type="primary" plain @click.native="removeCompany(companyIndex)"
class="ml-20"
:disabled="companyList.length === 1">删除该对象
</el-button>
</view>
</view>
</view>
</el-form-item>
</view>
<el-divider/>
<el-button type="primary" @click.native="addCompany">增加考察对象
</el-button>
<el-form-item label="接收文件电子邮箱:" required>
<el-input v-model="email"/>
</el-form-item>
<el-form-item label="接收文件微信:" required>
<el-input v-model="wechat"/>
</el-form-item>
<el-form-item label="接收文件寄件地址" required>
<el-row :gutter="10">
<el-col :span="4">
<el-select v-model="receiveAddressIndex[0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[1]" placeholder="请选择市"
:disabled="receiveAddressIndex.length === 0">
<template v-if="receiveAddressIndex[0] !== null">
<el-option
v-for="(item, index) in cityData[receiveAddressIndex[0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[2]" placeholder="请选择区"
:disabled="receiveAddressIndex.length === 1">
<template
v-if="receiveAddressIndex[0] !== null && receiveAddressIndex[1] !== null">
<el-option
v-for="(item, index) in areaData[receiveAddressIndex[0]][receiveAddressIndex[1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="11">
<el-input v-model="receiveAddress"
placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-form-item>
<p class="text-main text-25 text-center" style="margin-bottom: 80rpx">接收文件电子邮箱/ 接收文件微信/
接收文件寄件地址,以上三项选填一项即可</p>
<el-row :gutter="10">
<el-col :span="8" class="flex justify-start items-center">
<el-form-item label="申请人:" required>
<el-input v-model="requestName"/>
</el-form-item>
</el-col>
<el-col :span="8" class="flex justify-start items-center">
<el-form-item label="业务联系人:" required>
<el-input v-model="contactName"/>
</el-form-item>
</el-col>
<el-col :span="8" class="flex justify-start items-center">
<el-form-item label="业务咨询联系方式:" required>
<el-input v-model="contact"/>
</el-form-item>
</el-col>
<!-- <el-col :span="8" class="flex justify-start items-center">-->
<!-- <el-form-item label="业务联系人:" required>-->
<!-- <el-select v-model="contactName" placeholder="点击选择业务联系人"-->
<!-- class="w-100p" @change="selectContact">-->
<!-- <el-option-->
<!-- v-for="(item, index) in contactList"-->
<!-- :key="index"-->
<!-- :label="item.name"-->
<!-- :value="item.name">-->
<!-- </el-option>-->
<!-- <view slot="empty" class="text-gray pointer p-20">-->
<!-- <text>无业务联系人,请到</text>-->
<!-- <text class="text-main mx-15" @click="navTo">个人中心</text>-->
<!-- <text>添加</text>-->
<!-- </view>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="8" class="flex justify-start items-center">-->
<!-- <el-form-item label="业务咨询联系方式:" required>-->
<!-- <el-input v-model="contact" type="number" disabled/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
</el-row>
<!-- <el-form-item label="联系方式:" required>-->
<!-- <el-input v-model="contact" disabled/>-->
<!-- </el-form-item>-->
</el-form>
<view class="mt-40 flex justify-center items-center">
<view class="flex justify-center items-center">
<text>总价:</text>
<text class="text-main font-bold text-35">{{ totalAmount }}元</text>
</view>
<view class="ml-35">客服联系方式: 0771-3923001</view>
</view>
<view class="flex justify-start items-center">
<el-checkbox v-model="agree">我已阅读并同意</el-checkbox>
<span class="text-main pointer font-bold" @click="showAgreement">《金久信自营交易协议》</span>
</view>
<view class="mt-40 flex justify-center items-center">
<el-button type="primary" @click="newOrder"
:disabled="companyList.length === 0 || !companyList[0].name || !agree">
立即支付
</el-button>
</view>
</view>
</view> </view>
<gap/>
<common-footer></common-footer>
</view>
</template> </template>
<script> <script>
@@ -195,167 +251,329 @@ import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
import Gap from "../../../components/gap/gap.vue"; import Gap from "../../../components/gap/gap.vue";
export default { export default {
name: "companyQuote", name: "companyQuote",
components: {Gap}, components: {Gap},
data() { data() {
return { return {
provinceData: provinces, provinceData: provinces,
cityData: citys, cityData: citys,
areaData: areas, areaData: areas,
list: [ form: {},
{ configList: [],
image: '/static/images/selfSupport/swiper.jpg', checkList: [],
title: '昨夜星辰昨夜风,画楼西畔桂堂东' contentList: [],
}, contentNameList: [],
], addressIndex: [[null, null, null]],
form: {}, addressDetail: '',
configList: [], receiveAddressIndex: [null, null, null],
checkList: [], receiveAddressDetail: '',
contentList: [], companyList: [
contentNameList: [], {
addressIndex: [[null, null, null]], name: '',
addressDetail: '', code: '',
receiveAddressIndex: [[null, null, null]], type: '企业',
receiveAddressDetail: '', addressRegion: {
companyList: [ province: null,
{ city: null,
name: '', area: null,
code: '', },
addressRegion: { address: '',
province: null,
city: null,
area: null,
},
address: '',
email: '',
wechat: '',
receiveAddressRegion: {
province: null,
city: null,
area: null,
},
receiveAddress: '',
requestName: '',
contactName: '',
contact: '',
}
],
}
},
methods: {
async getConfigList() {
const {rows} = await vk.callFunction({
url: 'client/coop/config/pub/getList',
data: {type: 0}
})
if (rows) {
this.configList = rows.map(item => {
item.contents.map(content => {
content.checked = false
content.amountIndex = null
return content
})
return item
})
}
},
addCompany() {
this.companyList.push({
name: '',
code: '',
addressRegion: {
province: null,
city: null,
area: null,
},
address: '',
email: '',
wechat: '',
receiveAddressRegion: {
province: null,
city: null,
area: null,
},
receiveAddress: '',
requestName: '',
contactName: '',
contact: '',
})
this.addressIndex.push([null, null, null])
this.receiveAddressIndex.push([null, null, null])
},
removeCompany(index) {
this.companyList.splice(index, 1)
this.addressIndex.splice(index, 1)
this.receiveAddressIndex.splice(index, 1)
},
async newOrder() {
const amountList = []
this.configList.forEach(item => {
item.contents.forEach(content => {
if (content.checked && content.amountList.length > 0) {
content.amountList.forEach((amount, amountIndex) => {
if (amountIndex === content.amountIndex) {
amountList.push(amount._index)
}
})
}
})
})
if (amountList.length === 0) return this.$message({
message: '请至少选择一项服务',
type: 'error'
})
this.companyList.forEach((item, index) => {
this.companyList[index].addressRegion = {
province: this.provinceData[this.addressIndex[index][0]],
city: this.cityData[this.addressIndex[index][0]][this.addressIndex[index][1]],
area: this.areaData[this.addressIndex[index][0]][this.addressIndex[index][1]][this.addressIndex[index][2]],
}
this.companyList[index].receiveAddressRegion = {
province: this.provinceData[this.receiveAddressIndex[index][0]],
city: this.cityData[this.receiveAddressIndex[index][0]][this.receiveAddressIndex[index][1]],
area: this.areaData[this.receiveAddressIndex[index][0]][this.receiveAddressIndex[index][1]][this.receiveAddressIndex[index][2]],
}
})
const {data} = await vk.callFunction({
url: 'client/selfSupport/kh/addOrder',
data: {
type: 0,
amountList,
contentList: this.companyList
}
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
},
selectAmount(index, contentIndex, e) {
console.log(index, contentIndex, e)
}
},
onLoad() {
this.getConfigList()
},
computed: {
amount() {
let tmpAmount = 0
this.configList.forEach(item => {
item.contents.forEach(content => {
if (content.checked && content.amountList.length > 0) {
content.amountList.forEach((amount, amountIndex) => {
if (amountIndex === content.amountIndex) {
tmpAmount += parseFloat(amount.amount)
}
})
}
})
})
return tmpAmount
},
totalAmount() {
return this.amount * this.companyList.length
} }
],
email: '',
wechat: '',
receiveAddressRegion: {
province: null,
city: null,
area: null,
},
receiveAddress: '',
requestName: '',
contactName: '',
contact: '',
agreement: '',
agree: false,
contactList: []
} }
},
methods: {
async getConfigList() {
const {rows} = await vk.callFunction({
url: 'client/coop/config/pub/getList',
data: {type: 0}
})
if (rows) {
this.configList = rows.map(item => {
item.contentIndex = null
item.amountIndex = null
return item
})
}
},
changeCheck(itemIndex, name) {
const index = this.contentList.indexOf(itemIndex)
if (index === -1) {
this.contentList.push(itemIndex)
this.contentNameList.push(name)
} else {
this.contentList.splice(index, 1)
this.contentNameList.splice(index, 1)
this.configList[itemIndex].contentIndex = null
this.configList[itemIndex].amountIndex = null
}
},
addCompany() {
this.companyList.push({
name: '',
code: '',
type: '企业',
addressRegion: {
province: null,
city: null,
area: null,
},
})
this.addressIndex.push([null, null, null])
this.receiveAddressIndex.push([null, null, null])
},
removeCompany(index) {
this.companyList.splice(index, 1)
this.addressIndex.splice(index, 1)
this.receiveAddressIndex.splice(index, 1)
},
async newOrder() {
const amountList = []
this.configList.forEach(item => {
item.contents.forEach((content, contentIndex) => {
if (contentIndex === item.contentIndex && content.amountList.length > 0) {
content.amountList.forEach((amount, amountIndex) => {
if (amountIndex === item.amountIndex) {
amountList.push(`${content._index},${amount._index}`)
}
})
}
})
})
if (amountList.length === 0) return this.$message({
message: '请至少选择一项服务',
type: 'error'
})
// if (this.addressIndex[0][2] === null) return this.$message({
// message: '请选择地址',
// type: 'error'
// })
if (!this.email && !this.wechat && this.receiveAddressIndex[0][2] === null) return this.$message({
message: '请选择接收文件地址/微信/邮箱',
type: 'error'
})
this.companyList.forEach((item, index) => {
if (this.addressIndex[index][2]) {
const companyProvince = this.provinceData[this.addressIndex[index][0]]
const companyCity = this.cityData[this.addressIndex[index][0]][this.addressIndex[index][1]]
const companyArea = this.areaData[this.addressIndex[index][0]][this.addressIndex[index][1]][this.addressIndex[index][2]]
this.companyList[index].addressRegion = {
province: {code: companyProvince.code, name: companyProvince.name},
city: {code: companyCity.code, name: companyCity.name},
area: {code: companyArea.code, name: companyArea.name},
}
}
})
for (let i = 0; i < this.companyList.length; i++) {
if (!this.companyList[i].name) return this.$message({
message: '请填写考察对象名称',
type: 'error'
})
if (this.companyList[i].type === '个人') {
if (!this.companyList[i].code) return this.$message({
type: 'error',
message: '请填写考察个人身份证号',
})
if (!this.companyList[i].address) return this.$message({
type: 'error',
message: '请填写个人地址',
})
if (this.addressIndex[i][2] === null) return this.$message({
type: 'error',
message: '请填写个人地址',
})
}
}
if (!this.requestName) return this.$message({
type: 'error',
message: '请填写申请人',
})
if (!this.contactName) return this.$message({
type: 'error',
message: '请填写业务联系人姓名',
})
if (!this.contact) return this.$message({
type: 'error',
message: '请填写联系人电话',
})
if (this.receiveAddressIndex.length > 0 && this.receiveAddressIndex[2] !== null) {
const province = this.provinceData[this.receiveAddressIndex[0]]
const city = this.cityData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]]
const area = this.areaData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]][this.receiveAddressIndex[2]]
this.receiveAddressRegion = {
province: {code: province.code, name: province.name},
city: {code: city.code, name: city.name},
area: {code: area.code, name: area.name},
}
}
const {data} = await vk.callFunction({
url: 'client/selfSupport/kh/addOrder',
title: '提交中...',
data: {
type: 0,
amountList,
contentList: this.companyList,
receiveAddressRegion: this.receiveAddressRegion,
email: this.email,
wechat: this.wechat,
receiveAddress: this.receiveAddress,
requestName: this.requestName,
contactName: this.contactName,
contact: this.contact,
}
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
},
showAgreement() {
this.$confirm(this.agreement, '金久信自营交易协议', {
cancelButtonText: '关闭',
showConfirmButton: false,
dangerouslyUseHTMLString: true,
})
},
async getAgreement() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '65885d4c09664c1c8d8e8476'
},
})
this.agreement = res.content
},
demoDownload() {
vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '6588642a99c624e89199fbb4'
},
success: res => {
window.open(res.content)
}
})
},
async getContactList() {
const {rows} = await vk.callFunction({
url: 'client/businessContact/kh/getList',
})
this.contactList = rows
},
navTo() {
vk.navigateTo({url: '/pages/user/user?menu=business-contact'})
},
selectContact(name) {
const contact = this.contactList.find(item => item.name === name)
this.contact = contact.phone
}
},
onLoad() {
const userInfo = vk.getVuex('$user.userInfo')
if (parseInt(userInfo.accountType) === 2) {
this.email = userInfo.company.contactEmail
this.requestName = userInfo.manager.personName
this.contactName = userInfo.manager.personName
this.contact = userInfo.company.mobile
if (userInfo.company && userInfo.company.addressRegion) {
this.receiveAddressIndex[0] = this.provinceData.findIndex(item => item.name === userInfo.company.addressRegion.province.name)
this.receiveAddressIndex[1] = this.cityData[this.receiveAddressIndex[0]].findIndex(item => item.name === userInfo.company.addressRegion.city.name)
this.receiveAddressIndex[2] = this.areaData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]].findIndex(item => item.name === userInfo.company.addressRegion.area.name)
}
if (userInfo.company.addressDetail) this.receiveAddress = userInfo.company.addressDetail
} else {
if (userInfo.businessCard && userInfo.businessCard.email) this.email = userInfo.businessCard.email
this.requestName = userInfo.person.personName
this.contactName = userInfo.person.personName
this.contact = userInfo.person.mobile
if (userInfo.person && userInfo.person.addressRegion) {
this.receiveAddressIndex[0] = this.provinceData.findIndex(item => item.name === userInfo.person.addressRegion.province.name)
this.receiveAddressIndex[1] = this.cityData[this.receiveAddressIndex[0]].findIndex(item => item.name === userInfo.person.addressRegion.city.name)
this.receiveAddressIndex[2] = this.areaData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]].findIndex(item => item.name === userInfo.person.addressRegion.area.name)
}
if (userInfo.person.addressDetail) this.receiveAddress = userInfo.person.addressDetail
}
this.getAgreement()
this.getConfigList()
// this.getContactList()
},
computed: {
amount() {
let tmpAmount = 0
this.configList.forEach(item => {
item.contents.forEach((content, contentIndex) => {
if (contentIndex === item.contentIndex && content.amountList.length > 0) {
content.amountList.forEach((amount, amountIndex) => {
if (amountIndex === item.amountIndex) {
tmpAmount += parseFloat(amount.amount)
}
})
}
})
})
return tmpAmount
},
totalAmount() {
return this.amount * this.companyList.length
}
}
} }
</script> </script>
<style lang="scss" scoped>
.server-item {
background-color: #fbf8f8;
border: 2px solid #fbebf1;
padding: 10px;
display: flex;
justify-content: space-between;
margin-bottom: 20px;
.items-center {
width: 1100px;
display: flex;
justify-content: space-between;
align-items: center;
flex: 1;
view {
width: 300px;
}
.ml-35 {
font-weight: normal;
font-size: 13px;
}
}
.server-item-content {
display: flex;
align-items: center;
width: 600px !important;
}
.remark {
color: #999999;
font-weight: normal;
}
}
.divider-title {
font-size: 17px;
font-weight: bold;
}
</style>
+525
View File
@@ -0,0 +1,525 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="w-1200 m-a">
<common-swiper page="self-support-quote-swiper"/>
<view class="flex justify-end items-center text-main pointer my-20 " @click="demoDownload">示例下载</view>
<view class="bg-white p-40">
<view v-for="(item, index) in configList" :key="index"
class="server-item my-20 flex flex-col justify-start items-start">
<el-checkbox @change="changeCheck(index, item.name)">
<view class="flex flex-col justify-start items-start">
<view class="flex justify-start items-center text-35 mb-20">
<view class="name" style="width: 120px;">{{ item.name }}</view>
<view class="ml-15" style="width: 120px;">
<text>业务编号:</text>
<text v-if="item.contentIndex !== null">{{
item.contents[item.contentIndex].code
}}
</text>
</view>
<view class="server-item-content">
<text class="ml-15">服务项目:</text>
<el-select v-model="configList[index].contentIndex" clearable style="width: 200px"
:disabled="!contentList.includes(index)">
<el-option v-for="(content, contentIndex) in item.contents" :key="contentIndex"
:label="content.title" :value="contentIndex"/>
</el-select>
<template v-if="item.contentIndex !== null">
<el-select v-model="configList[index].amountIndex" @change="changeAmountIndex(index)"
clearable class="ml-15" style="width: 300px">
<el-option
v-for="(amount, amountIndex) in item.contents[item.contentIndex].amountList"
:key="amountIndex"
:label="amount.title" :value="amountIndex"/>
</el-select>
<template v-if="configList[index].amountIndex !== null">
<text class="ml-15">清单单品项数:</text>
<el-input v-model="configList[index].num" style="width: 200px"/>
</template>
</template>
</view>
</view>
<view class="remark">备注: {{ item.remark }}</view>
</view>
</el-checkbox>
</view>
<el-form ref="form" :model="form" label-width="200px">
<view v-for="(item, companyIndex) in companyList" :key="companyIndex">
<el-divider>{{ item.name }}</el-divider>
<el-form-item label="产品明细:" required>
<vk-data-upload v-model="companyList[companyIndex].files" list-type="text"
:on-preview="previewUpload"
accept=".jpg,.jpeg,.png,.xlsx,.doc,.docx,.pdf">
</vk-data-upload>
</el-form-item>
<el-form-item label="产品应用地址:" required>
<el-row :gutter="10">
<el-col :span="4">
<el-select v-model="addressIndex[companyIndex][0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[companyIndex][1]" placeholder="请选择市"
:disabled="addressIndex[companyIndex].length === 0">
<template v-if="addressIndex[companyIndex][0] !== null">
<el-option v-for="(item, index) in cityData[addressIndex[companyIndex][0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[companyIndex][2]" placeholder="请选择区"
:disabled="addressIndex[companyIndex].length === 1">
<template
v-if="addressIndex[companyIndex][0] !== null && addressIndex[companyIndex][1] !== null">
<el-option
v-for="(item, index) in areaData[addressIndex[companyIndex][0]][addressIndex[companyIndex][1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="11">
<el-input v-model="companyList[companyIndex].address" placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-form-item>
</view>
<el-divider/>
<el-form-item label="接收文件电子邮箱:" required>
<el-input v-model="email"/>
</el-form-item>
<el-form-item label="接收文件微信:" required>
<el-input v-model="wechat"/>
</el-form-item>
<el-form-item label="接收文件寄件地址" required>
<el-row :gutter="10">
<el-col :span="4">
<el-select v-model="receiveAddressIndex[0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[1]" placeholder="请选择市"
:disabled="receiveAddressIndex.length === 0">
<template v-if="receiveAddressIndex[0] !== null">
<el-option
v-for="(item, index) in cityData[receiveAddressIndex[0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[2]" placeholder="请选择区"
:disabled="receiveAddressIndex.length === 1">
<template
v-if="receiveAddressIndex[0] !== null && receiveAddressIndex[1] !== null">
<el-option
v-for="(item, index) in areaData[receiveAddressIndex[0]][receiveAddressIndex[1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="11">
<el-input v-model="receiveAddress" placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-form-item>
<p class="text-main text-25 text-center" style="margin-bottom: 80rpx">接收文件电子邮箱/ 接收文件微信/
接收文件寄件地址,以上三项选填一项即可</p>
<el-row :gutter="10">
<el-col :span="8" class="flex justify-start items-center">
<el-form-item label="申请人:" required>
<el-input v-model="requestName"/>
</el-form-item>
</el-col>
<el-col :span="8" class="flex justify-start items-center">
<el-form-item label="业务联系人:" required>
<el-input v-model="contactName"/>
</el-form-item>
</el-col>
<el-col :span="8" class="flex justify-start items-center">
<el-form-item label="业务咨询联系方式:" required>
<el-input v-model="contact"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<view class="mt-40 flex justify-center items-center">
<view class="ml-35">客服联系方式: 0771-3923001</view>
</view>
<view class="flex justify-start items-center">
<el-checkbox v-model="agree">我已阅读并同意</el-checkbox>
<span class="text-main pointer font-bold" @click="showAgreement">《金久信自营交易协议》</span>
</view>
<view class="mt-40 flex justify-center items-center">
<el-button type="primary" @click="newOrder"
:disabled="companyList.length === 0 || !agree">
立即提交
</el-button>
</view>
</view>
</view>
<gap/>
<common-footer></common-footer>
</view>
</template>
<script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
import Gap from "../../../components/gap/gap.vue";
export default {
name: "companyQuote",
components: {Gap},
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
form: {},
configList: [],
checkList: [],
contentList: [],
contentNameList: [],
addressIndex: [[null, null, null]],
addressDetail: '',
receiveAddressIndex: [null, null, null],
receiveAddressDetail: '',
companyList: [
{
name: '',
code: '',
addressRegion: {
province: null,
city: null,
area: null,
},
address: '',
}
],
email: '',
wechat: '',
receiveAddressRegion: {
province: null,
city: null,
area: null,
},
receiveAddress: '',
requestName: '',
contactName: '',
contact: '',
agreement: '',
agree: false,
contactList: []
}
},
methods: {
async getConfigList() {
const {rows} = await vk.callFunction({
url: 'client/coop/config/pub/getList',
data: {type: 2}
})
if (rows) {
this.configList = rows.map(item => {
item.contentIndex = null
item.amountIndex = null
item.num = null
return item
})
}
},
changeCheck(itemIndex, name) {
const index = this.contentList.indexOf(itemIndex)
if (index === -1) {
this.contentList.push(itemIndex)
this.contentNameList.push(name)
} else {
this.contentList.splice(index, 1)
this.contentNameList.splice(index, 1)
this.configList[itemIndex].contentIndex = null
this.configList[itemIndex].amountIndex = null
}
},
addCompany() {
this.companyList.push({
name: '',
code: '',
addressRegion: {
province: null,
city: null,
area: null,
},
})
this.addressIndex.push([null, null, null])
this.receiveAddressIndex.push([null, null, null])
},
removeCompany(index) {
this.companyList.splice(index, 1)
this.addressIndex.splice(index, 1)
this.receiveAddressIndex.splice(index, 1)
},
async newOrder() {
const amountList = []
this.configList.forEach(item => {
item.contents.forEach((content, contentIndex) => {
if (contentIndex === item.contentIndex && content.amountList.length > 0) {
content.amountList.forEach((amount, amountIndex) => {
if (amountIndex === item.amountIndex) {
amountList.push(`${content._index},${amount._index},${item.num}`)
}
})
}
})
})
if (amountList.length === 0) return this.$message({
message: '请至少选择一项服务',
type: 'error'
})
if (this.addressIndex[0][2] === null) return this.$message({
message: '请选择地址',
type: 'error'
})
if (!this.email && !this.wechat && this.receiveAddressIndex[0][2] === null) return this.$message({
message: '请选择接收文件地址/微信/邮箱',
type: 'error'
})
this.companyList.forEach((item, index) => {
const companyProvince = this.provinceData[this.addressIndex[index][0]]
const companyCity = this.cityData[this.addressIndex[index][0]][this.addressIndex[index][1]]
const companyArea = this.areaData[this.addressIndex[index][0]][this.addressIndex[index][1]][this.addressIndex[index][2]]
this.companyList[index].addressRegion = {
province: {code: companyProvince.code, name: companyProvince.name},
city: {code: companyCity.code, name: companyCity.name},
area: {code: companyArea.code, name: companyArea.name},
}
})
for (let i = 0; i < this.companyList.length; i++) {
if (!this.companyList[i].files || this.companyList[i].files.length === 0) return this.$message({
message: '请上传产品明细',
type: 'error'
})
if (!this.companyList[i].address) return this.$message({
type: 'error',
message: '请填写产品应用地址',
})
if (this.addressIndex[i][2] === null) return this.$message({
type: 'error',
message: '请填写产品应用地址',
})
}
if (!this.requestName) return this.$message({
type: 'error',
message: '请填写申请人',
})
if (!this.contactName) return this.$message({
type: 'error',
message: '请填写业务联系人姓名',
})
if (!this.contact) return this.$message({
type: 'error',
message: '请填写联系人电话',
})
if (this.receiveAddressIndex.length > 0 && this.receiveAddressIndex[2] !== null) {
const province = this.provinceData[this.receiveAddressIndex[0]]
const city = this.cityData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]]
const area = this.areaData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]][this.receiveAddressIndex[2]]
this.receiveAddressRegion = {
province: {code: province.code, name: province.name},
city: {code: city.code, name: city.name},
area: {code: area.code, name: area.name},
}
}
const {data} = await vk.callFunction({
url: 'client/selfSupport/kh/addOrder',
title: '提交中...',
data: {
type: 2,
amountList,
contentList: this.companyList,
receiveAddressRegion: this.receiveAddressRegion,
email: this.email,
wechat: this.wechat,
receiveAddress: this.receiveAddress,
requestName: this.requestName,
contactName: this.contactName,
contact: this.contact,
}
})
this.$message({
type: 'success',
message: '已提交',
})
vk.navigateBack()
},
showAgreement() {
this.$confirm(this.agreement, '金久信自营交易协议', {
cancelButtonText: '关闭',
showConfirmButton: false,
dangerouslyUseHTMLString: true,
})
},
async getAgreement() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '65885d4c09664c1c8d8e8476'
},
})
this.agreement = res.content
},
demoDownload() {
vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '6588642a99c624e89199fbb4'
},
success: res => {
window.open(res.content)
}
})
},
async getContactList() {
const {rows} = await vk.callFunction({
url: 'client/businessContact/kh/getList',
})
this.contactList = rows
},
navTo() {
vk.navigateTo({url: '/pages/user/user?menu=business-contact'})
},
selectContact(name) {
const contact = this.contactList.find(item => item.name === name)
this.contact = contact.phone
},
changeAmountIndex(configIndex) {
const config = this.configList[configIndex]
if (config.contentIndex !== null && config.amountIndex !== null) {
this.configList[configIndex].num = config.contents[config.contentIndex].amountList[config.amountIndex].defaultNum
}
},
previewUpload({url}) {
window.open(url)
}
},
onLoad() {
const userInfo = vk.getVuex('$user.userInfo')
// console.log('userInfo', userInfo)
if (parseInt(userInfo.accountType) === 2) {
this.email = userInfo.company.contactEmail
this.requestName = userInfo.manager.personName
this.contactName = userInfo.manager.personName
this.contact = userInfo.company.mobile
if (userInfo.company && userInfo.company.addressRegion) {
this.receiveAddressIndex[0] = this.provinceData.findIndex(item => item.name === userInfo.company.addressRegion.province.name)
this.receiveAddressIndex[1] = this.cityData[this.receiveAddressIndex[0]].findIndex(item => item.name === userInfo.company.addressRegion.city.name)
this.receiveAddressIndex[2] = this.areaData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]].findIndex(item => item.name === userInfo.company.addressRegion.area.name)
}
if (userInfo.company.addressDetail) this.receiveAddress = userInfo.company.addressDetail
} else {
if (userInfo.businessCard && userInfo.businessCard.email) this.email = userInfo.businessCard.email
this.requestName = userInfo.person.personName
this.contactName = userInfo.person.personName
this.contact = userInfo.person.mobile
if (userInfo.person && userInfo.person.addressRegion) {
this.receiveAddressIndex[0] = this.provinceData.findIndex(item => item.name === userInfo.person.addressRegion.province.name)
this.receiveAddressIndex[1] = this.cityData[this.receiveAddressIndex[0]].findIndex(item => item.name === userInfo.person.addressRegion.city.name)
this.receiveAddressIndex[2] = this.areaData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]].findIndex(item => item.name === userInfo.person.addressRegion.area.name)
}
if (userInfo.person.addressDetail) this.receiveAddress = userInfo.person.addressDetail
}
this.getAgreement()
this.getConfigList()
// this.getContactList()
},
computed: {
amount() {
let tmpAmount = 0
this.configList.forEach(item => {
item.contents.forEach((content, contentIndex) => {
if (contentIndex === item.contentIndex && content.amountList.length > 0) {
content.amountList.forEach((amount, amountIndex) => {
if (amountIndex === item.amountIndex) {
tmpAmount += parseFloat(amount.amount)
}
})
}
})
})
return tmpAmount
},
totalAmount() {
return this.amount * this.companyList.length
}
}
}
</script>
<style lang="scss" scoped>
.server-item {
background-color: #fbf8f8;
border: 2px solid #fbebf1;
padding: 10px;
display: flex;
justify-content: space-between;
margin-bottom: 20px;
.items-center {
width: 1100px;
display: flex;
justify-content: space-between;
align-items: center;
flex: 1;
view {
width: 300px;
}
.ml-35 {
font-weight: normal;
font-size: 13px;
}
}
.server-item-content {
display: flex;
align-items: center;
flex: 1;
//width: 600px !important;
}
.remark {
color: #999999;
font-weight: normal;
}
}
.divider-title {
font-size: 17px;
font-weight: bold;
}
</style>
+593 -344
View File
@@ -1,193 +1,270 @@
<template> <template>
<view> <view>
<top-bar></top-bar> <top-bar></top-bar>
<common-header></common-header> <common-header></common-header>
<category-bar></category-bar> <category-bar></category-bar>
<view class="w-1200 m-a"> <view class="w-1200 m-a">
<u-swiper :list="list" :height="380" borderRadius="0"></u-swiper> <common-swiper page="self-support-product-swiper"/>
<view class="bg-white p-40"> <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="my-20 flex flex-col justify-start items-start">
<view class="flex flex-col justify-start items-start">
<view class="flex justify-start items-center text-35 mb-20">
<text>服务内容:{{ item.name }}</text>
<view class="flex flex-col justify-start items-start">
<view v-for="(content, contentIndex) in item.contents" :key="contentIndex"
class="mb-40 flex justify-start items-center">
<view class="ml-35">
<text>业务编号:</text>
<text>{{ content.code }}</text>
</view>
<view class="flex justify-start items-center">
<text class="ml-35">服务服务项目:</text>
<el-checkbox v-model="configList[index].contents[contentIndex].checked"
@change="selectContent(content)"
:disabled="!content.amountList || content.amountList.length === 0">
{{ content.title }}
</el-checkbox>
</view>
<view class="flex justify-start items-center ml-35">
<el-select v-model="configList[index].contents[contentIndex].amountIndex"
clearable
:disabled="!content.amountList || content.amountList.length === 0">
<el-option v-for="(amount, amountIndex) in content.amountList"
:key="amountIndex"
:label="amount.title" :value="amountIndex"/>
</el-select>
<text class="ml-35" v-if="content.amountIndex !== null">
{{ content.amountList[content.amountIndex].amount }}元/次
</text>
</view>
</view>
</view>
</view> <view class="bg-white p-40">
<view>备注: {{ item.remark }}</view> <view v-for="(item, index) in configList" :key="index"
</view> class="server-item my-20 flex flex-col justify-start items-start">
<el-checkbox @change="changeCheck(index, item.name)">
<view class="flex flex-col justify-start items-start">
<view class="flex justify-start items-center text-35 mb-20">
<view class="name">{{ item.name }}</view>
<view class="ml-15">
<text>业务编号:</text>
<text v-if="item.contentIndex !== null">{{
item.contents[item.contentIndex].code
}}
</text>
</view> </view>
<el-form ref="form" :model="form" label-width="200px"> <view class="server-item-content">
<view v-for="(item, productIndex) in productList" :key="productIndex"> <text class="ml-15">服务项目:</text>
<el-form-item label="检测产品:" required> <el-select v-model="configList[index].contentIndex" clearable
<el-input v-model="productList[productIndex].name"/> :disabled="!contentList.includes(index)">
</el-form-item> <el-option v-for="(content, contentIndex) in item.contents" :key="contentIndex"
<el-form-item label="检测内容"> :label="content.title" :value="contentIndex"/>
{{ contentNameList.join() }} </el-select>
</el-form-item>
<el-form-item label="取样所在地"> <template v-if="item.contentIndex !== null">
<el-row :gutter="10"> <el-select v-model="configList[index].amountIndex"
<el-col :span="4"> clearable class="ml-15">
<el-select v-model="addressIndex[productIndex][0]" placeholder="请选择省"> <el-option
<el-option v-for="(item, index) in provinceData" :key="index" v-for="(amount, amountIndex) in item.contents[item.contentIndex].amountList"
:label="item.name" :key="amountIndex"
:value="index"> :label="amount.title" :value="amountIndex"/>
</el-option> </el-select>
</el-select> </template>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[productIndex][1]" placeholder="请选择市"
:disabled="addressIndex[productIndex].length === 0">
<template v-if="addressIndex[productIndex][0] !== null">
<el-option v-for="(item, index) in cityData[addressIndex[productIndex][0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[productIndex][2]" placeholder="请选择区"
:disabled="addressIndex[productIndex].length === 1">
<template
v-if="addressIndex[productIndex][0] !== null && addressIndex[productIndex][1] !== null">
<el-option
v-for="(item, index) in areaData[addressIndex[productIndex][0]][addressIndex[productIndex][1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="11">
<el-input v-model="productList[productIndex].address" placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="接收文件电子邮箱:">
<el-input v-model="productList[productIndex].email"/>
</el-form-item>
<el-form-item label="接收文件微信:">
<el-input v-model="productList[productIndex].wechat"/>
</el-form-item>
<el-form-item label="接收文件寄件地址">
<el-row :gutter="10">
<el-col :span="4">
<el-select v-model="receiveAddressIndex[productIndex][0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[productIndex][1]" placeholder="请选择市"
:disabled="receiveAddressIndex[productIndex].length === 0">
<template v-if="receiveAddressIndex[productIndex][0] !== null">
<el-option
v-for="(item, index) in cityData[receiveAddressIndex[productIndex][0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[productIndex][2]" placeholder="请选择区"
:disabled="receiveAddressIndex[productIndex].length === 1">
<template
v-if="receiveAddressIndex[productIndex][0] !== null && receiveAddressIndex[productIndex][1] !== null">
<el-option
v-for="(item, index) in areaData[receiveAddressIndex[productIndex][0]][receiveAddressIndex[productIndex][1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="11">
<el-input v-model="productList[productIndex].receiveAddress" placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="申请人:">
<el-input v-model="productList[productIndex].requestName"/>
</el-form-item>
<el-form-item label="联系人:">
<el-input v-model="productList[productIndex].contactName"/>
</el-form-item>
<el-form-item label="联系方式:">
<el-input v-model="productList[productIndex].contact"/>
</el-form-item>
<el-form-item label="本次服务费用小计:">
<view class="flex justify-between items-start mb-20 w-100p">
<view class="flex justify-start items-center">
<el-input v-model="amount" disabled/>
<view class="ml-20">
<el-button type="primary" @click.native="addProduct">增加考察对象
</el-button>
</view>
<view class="ml-20">
<el-button type="primary" plain @click.native="removeProduct(productIndex)"
class="ml-20"
:disabled="productList.length === 1">删除该对象
</el-button>
</view>
</view>
</view>
</el-form-item>
</view>
</el-form>
<view class="mt-40 flex justify-center items-center">
<view class="flex justify-center items-center">
<text>总价:</text>
<text class="text-main font-bold text-35">{{ totalAmount }}元</text>
</view>
<view class="ml-35">客服联系方式: 0771-3923001</view>
</view> </view>
<view class="mt-40 flex justify-center items-center"> <text>金额:</text>
<el-button type="primary" @click.native="newOrder" <view class="ml-15" v-if="item.contentIndex !== null && item.amountIndex !== null">
:disabled="productList.length === 0 || !productList[0].name"> {{ item.contents[item.contentIndex].amountList[item.amountIndex].amount }}元/次
立即支付
</el-button>
</view> </view>
<view class="ml-15" v-else>
元/次
</view>
<el-button type="primary" size="small"
@click="addToAmountList(index, configList[index].contentIndex, item.amountIndex)"
:disabled="item.amountIndex === null">
添加
</el-button>
</view>
<view class="remark">备注: {{ item.remark }}</view>
</view> </view>
</el-checkbox>
</view> </view>
<gap/> <el-form ref="form" :model="form" label-width="200px">
<common-footer></common-footer> <view v-for="(item, productIndex) in productList" :key="productIndex">
<el-form-item label="检测产品:" required>
<el-input v-model="productList[productIndex].name"/>
</el-form-item>
<el-form-item label="文档上传:">
<vk-data-upload v-model="productList[productIndex].files" list-type="text"
:on-preview="previewUpload"
accept=".jpg,.jpeg,.png,.xlsx,.doc,.docx,.pdf">
</vk-data-upload>
</el-form-item>
<el-form-item label="检测内容">
{{ contentNameList.join() }}
</el-form-item>
<el-form-item label="取样所在地">
<el-row :gutter="10">
<el-col :span="4">
<el-select v-model="addressIndex[productIndex][0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[productIndex][1]" placeholder="请选择市"
:disabled="addressIndex[productIndex].length === 0">
<template v-if="addressIndex[productIndex][0] !== null">
<el-option v-for="(item, index) in cityData[addressIndex[productIndex][0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[productIndex][2]" placeholder="请选择区"
:disabled="addressIndex[productIndex].length === 1">
<template
v-if="addressIndex[productIndex][0] !== null && addressIndex[productIndex][1] !== null">
<el-option
v-for="(item, index) in areaData[addressIndex[productIndex][0]][addressIndex[productIndex][1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="11">
<el-input v-model="productList[productIndex].address" placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="本次服务费用小计:">
<view class="flex justify-between items-start mb-20 w-100p">
<view class="flex justify-start items-center">
<el-input v-model="amount" disabled/>
</view>
<view class="ml-20">
<el-button type="primary" plain @click.native="removeProduct(productIndex)"
class="ml-20"
:disabled="productList.length === 1">删除该对象
</el-button>
</view>
</view>
</el-form-item>
<el-divider/>
</view>
<el-form-item label="接收文件电子邮箱:">
<el-input v-model="email"/>
</el-form-item>
<el-form-item label="接收文件微信:">
<el-input v-model="wechat"/>
</el-form-item>
<el-form-item label="接收文件寄件地址">
<el-row :gutter="10">
<el-col :span="4">
<el-select v-model="receiveAddressIndex[0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[1]" placeholder="请选择市"
:disabled="receiveAddressIndex.length === 0">
<template v-if="receiveAddressIndex[0] !== null">
<el-option
v-for="(item, index) in cityData[receiveAddressIndex[0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[2]" placeholder="请选择区"
:disabled="receiveAddressIndex.length === 1">
<template
v-if="receiveAddressIndex[0] !== null && receiveAddressIndex[1] !== null">
<el-option
v-for="(item, index) in areaData[receiveAddressIndex[0]][receiveAddressIndex[1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="11">
<el-input v-model="receiveAddress"
placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-form-item>
<p class="text-main text-25 text-center" style="margin-bottom: 80rpx">接收文件电子邮箱/ 接收文件微信/
接收文件寄件地址,以上三项选填一项即可</p>
<!-- <el-form-item label="申请人:">-->
<!-- <el-input v-model="requestName"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="联系人:">-->
<!-- <el-input v-model="contactName"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="联系方式:">-->
<!-- <el-input v-model="contact"/>-->
<!-- </el-form-item>-->
<el-row :gutter="10">
<el-col :span="8" class="flex justify-start items-center">
<el-form-item label="申请人:" required>
<el-input v-model="requestName"/>
</el-form-item>
</el-col>
<el-col :span="8" class="flex justify-start items-center">
<el-form-item label="业务联系人:" required>
<el-input v-model="contactName"/>
</el-form-item>
</el-col>
<el-col :span="8" class="flex justify-start items-center">
<el-form-item label="业务咨询联系方式:" required>
<el-input v-model="contact"/>
</el-form-item>
</el-col>
<!-- <el-col :span="8" class="flex justify-start items-center">-->
<!-- <el-form-item label="联系人:" required>-->
<!-- <el-select v-model="contactName" placeholder="点击选择业务联系人"-->
<!-- class="w-100p" @change="selectContact">-->
<!-- <el-option-->
<!-- v-for="(item, index) in contactList"-->
<!-- :key="index"-->
<!-- :label="item.name"-->
<!-- :value="item.name">-->
<!-- </el-option>-->
<!-- <view slot="empty" class="text-gray pointer p-20">-->
<!-- <text>无业务联系人,请到</text>-->
<!-- <text class="text-main mx-15" @click="navTo">个人中心</text>-->
<!-- <text>添加</text>-->
<!-- </view>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="8" class="flex justify-start items-center">-->
<!-- <el-form-item label="业务咨询联系方式:" required>-->
<!-- <el-input v-model="contact" type="number" disabled/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
</el-row>
<el-form-item label="备注:">
<el-input v-model="remark"/>
</el-form-item>
<el-button type="primary" @click.native="addProduct">增加考察对象
</el-button>
</el-form>
<view class="mt-20">
<view>已选项目:</view>
<view v-for="(item, index) in amountList" :key="index" class="mt-20 flex justify-start items-center">
<el-button type="primary" size="small" @click="removeFromAmountList(index)">删除</el-button>
<p class="ml-20">{{ configList[item.index].name }} -- {{ configList[item.index].contents[item.contentIndex].title }} --
{{
configList[item.index].contents[item.contentIndex].amountList[item.amountIndex].title
}},{{ configList[item.index].contents[item.contentIndex].amountList[item.amountIndex].amount }}元</p>
</view>
</view>
<view class="mt-40 flex justify-center items-center">
<view class="flex justify-center items-center">
<text>总价:</text>
<text class="text-main font-bold text-35">{{ totalAmount }}元</text>
</view>
<view class="ml-35">客服联系方式: 0771-3923001</view>
</view>
<view class="flex justify-start items-center">
<el-checkbox v-model="agree">我已阅读并同意</el-checkbox>
<span class="text-main pointer font-bold" @click="showAgreement">《金久信自营交易协议》</span>
</view>
<view class="mt-40 flex justify-center items-center">
<el-button type="primary" @click.native="newOrder"
:disabled="productList.length === 0 || !productList[0].name || !agree">
立即支付
</el-button>
</view>
</view>
</view> </view>
<gap/>
<common-footer></common-footer>
</view>
</template> </template>
<script> <script>
@@ -196,168 +273,340 @@ import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json"; import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
export default { export default {
name: "productQuote", name: "productQuote",
data() { data() {
return { return {
provinceData: provinces, provinceData: provinces,
cityData: citys, cityData: citys,
areaData: areas, areaData: areas,
list: [ form: {},
{ configList: [],
image: '/static/images/selfSupport/swiper.jpg', checkList: [],
title: '昨夜星辰昨夜风,画楼西畔桂堂东' contentList: [],
}, contentNameList: [],
], addressIndex: [[null, null, null]],
form: {}, addressDetail: '',
configList: [], receiveAddressIndex: [null, null, null],
checkList: [], receiveAddressDetail: '',
contentList: [], productList: [
contentNameList: [], {
addressIndex: [[null, null, null]], name: '',
addressDetail: '', code: '',
receiveAddressIndex: [[null, null, null]], addressRegion: {
receiveAddressDetail: '', province: null,
productList: [ city: null,
{ area: null,
name: '', },
code: '', address: '',
addressRegion: {
province: null,
city: null,
area: null,
},
address: '',
email: '',
wechat: '',
receiveAddressRegion: {
province: null,
city: null,
area: null,
},
receiveAddress: '',
requestName: '',
contactName: '',
contact: '',
}
],
}
},
methods: {
async getConfigList() {
const {rows} = await vk.callFunction({
url: 'client/coop/config/pub/getList',
data: {type: 1}
})
if (rows) {
this.configList = rows.map(item => {
item.contents.map(content => {
content.checked = false
content.amountIndex = null
return content
})
return item
})
}
},
addProduct() {
this.productList.push({
name: '',
code: '',
addressRegion: {
province: null,
city: null,
area: null,
},
address: '',
email: '',
wechat: '',
receiveAddressRegion: {
province: null,
city: null,
area: null,
},
receiveAddress: '',
requestName: '',
contactName: '',
contact: '',
})
this.addressIndex.push([null, null, null])
this.receiveAddressIndex.push([null, null, null])
},
removeProduct(index) {
this.productList.splice(index, 1)
this.addressIndex.splice(index, 1)
this.receiveAddressIndex.splice(index, 1)
},
selectContent(content) {
const index = this.contentNameList.indexOf(content.title)
if (index === -1) this.contentNameList.push(content.title)
else this.contentNameList.splice(index, 1)
},
async newOrder() {
const amountList = []
this.configList.forEach(item => {
item.contents.forEach(content => {
if (content.checked && content.amountList.length > 0) {
content.amountList.forEach((amount, amountIndex) => {
if (amountIndex === content.amountIndex) {
amountList.push(amount._index)
}
})
}
})
})
if (amountList.length === 0) return this.$message({
message: '请至少选择一项服务',
type: 'error'
})
this.productList.forEach((item, index) => {
this.productList[index].addressRegion = {
province: this.provinceData[this.addressIndex[index][0]],
city: this.cityData[this.addressIndex[index][0]][this.addressIndex[index][1]],
area: this.areaData[this.addressIndex[index][0]][this.addressIndex[index][1]][this.addressIndex[index][2]],
}
this.productList[index].receiveAddressRegion = {
province: this.provinceData[this.receiveAddressIndex[index][0]],
city: this.cityData[this.receiveAddressIndex[index][0]][this.receiveAddressIndex[index][1]],
area: this.areaData[this.receiveAddressIndex[index][0]][this.receiveAddressIndex[index][1]][this.receiveAddressIndex[index][2]],
}
})
const {data} = await vk.callFunction({
url: 'client/selfSupport/kh/addOrder',
data: {
type: 1,
amountList,
contentList: this.productList
}
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
},
},
onLoad() {
this.getConfigList()
},
computed: {
amount() {
let tmpAmount = 0
this.configList.forEach(item => {
item.contents.forEach(content => {
if (content.checked && content.amountList.length > 0) {
content.amountList.forEach((amount, amountIndex) => {
if (amountIndex === content.amountIndex) {
tmpAmount += parseFloat(amount.amount)
}
})
}
})
})
return tmpAmount
},
totalAmount() {
return this.amount * this.productList.length
} }
],
email: '',
wechat: '',
receiveAddressRegion: {
province: null,
city: null,
area: null,
},
receiveAddress: '',
requestName: '',
contactName: '',
contact: '',
remark: '',
agreement: '',
agree: false,
contactList: [],
files: [],
amountList: []
} }
},
methods: {
async getConfigList() {
const {rows} = await vk.callFunction({
url: 'client/coop/config/pub/getList',
data: {type: 1}
})
if (rows) {
this.configList = rows.map(item => {
item.contentIndex = null
item.amountIndex = null
return item
})
}
},
addProduct() {
this.productList.push({
name: '',
code: '',
addressRegion: {
province: null,
city: null,
area: null,
},
address: '',
})
this.addressIndex.push([null, null, null])
},
removeProduct(index) {
this.productList.splice(index, 1)
this.addressIndex.splice(index, 1)
},
addToAmountList(index, contentIndex, amountIndex) {
this.amountList.push({
index,
contentIndex,
amountIndex,
contentIndexVal: this.configList[index].contents[contentIndex]._index,
amountIndexVal: this.configList[index].contents[contentIndex].amountList[amountIndex]._index,
amount: this.configList[index].contents[contentIndex].amountList[amountIndex].amount
})
this.configList[index].contentIndex = null
this.configList[index].amountIndex = null
},
removeFromAmountList(index) {
this.amountList.splice(index, 1)
},
async newOrder() {
// const amountList = []
// this.configList.forEach(item => {
// item.contents.forEach((content, contentIndex) => {
// if (contentIndex === item.contentIndex && content.amountList.length > 0) {
// content.amountList.forEach((amount, amountIndex) => {
// if (amountIndex === item.amountIndex) {
// amountList.push(`${content._index},${amount._index}`)
// }
// })
// }
// })
// })
if (this.amountList.length === 0) return this.$message({
message: '请至少选择一项服务',
type: 'error'
})
if (!this.email && !this.wechat && this.receiveAddressIndex[0][2] === null) return this.$message({
message: '请选择接收文件地址/微信/邮箱',
type: 'error'
})
if (!this.requestName) return this.$message({
type: 'error',
message: '请填写申请人',
})
if (!this.contactName) return this.$message({
type: 'error',
message: '请填写联系人姓名',
})
if (!this.contact) return this.$message({
type: 'error',
message: '请填写联系人电话',
})
for (let i = 0; i < this.productList.length; i++) {
if (!this.productList[i].name) return this.$message({
message: '请填写考察产品名称',
type: 'error'
})
if (!this.productList[i].address) return this.$message({
type: 'error',
message: '请填写考察产品地址',
})
if (this.addressIndex[i][2] === null) return this.$message({
type: 'error',
message: '请填写考察产品地址',
})
}
if (this.receiveAddressIndex.length > 0 && this.receiveAddressIndex[2] !== null) {
const province = this.provinceData[this.receiveAddressIndex[0]]
const city = this.cityData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]]
const area = this.areaData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]][this.receiveAddressIndex[2]]
this.receiveAddressRegion = {
province: {code: province.code, name: province.name},
city: {code: city.code, name: city.name},
area: {code: area.code, name: area.name},
}
}
this.productList.forEach((item, index) => {
const companyProvince = this.provinceData[this.addressIndex[index][0]]
const companyCity = this.cityData[this.addressIndex[index][0]][this.addressIndex[index][1]]
const companyArea = this.areaData[this.addressIndex[index][0]][this.addressIndex[index][1]][this.addressIndex[index][2]]
this.productList[index].addressRegion = {
province: {code: companyProvince.code, name: companyProvince.name},
city: {code: companyCity.code, name: companyCity.name},
area: {code: companyArea.code, name: companyArea.name},
}
})
const {data} = await vk.callFunction({
url: 'client/selfSupport/kh/addOrder',
title: '请求中...',
data: {
type: 1,
amountList: this.amountList.map(item => `${item.contentIndexVal},${item.amountIndexVal}`),
contentList: this.productList,
receiveAddressRegion: this.receiveAddressRegion,
email: this.email,
wechat: this.wechat,
receiveAddress: this.receiveAddress,
requestName: this.requestName,
contactName: this.contactName,
contact: this.contact,
remark: this.remark,
}
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
},
changeCheck(itemIndex, name) {
const index = this.contentList.indexOf(itemIndex)
if (index === -1) {
this.contentList.push(itemIndex)
this.contentNameList.push(name)
} else {
this.contentList.splice(index, 1)
this.contentNameList.splice(index, 1)
this.configList[itemIndex].contentIndex = null
this.configList[itemIndex].amountIndex = null
}
},
showAgreement() {
this.$confirm(this.agreement, '金久信自营交易协议', {
cancelButtonText: '关闭',
showConfirmButton: false,
dangerouslyUseHTMLString: true,
})
},
async getAgreement() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '65885d4c09664c1c8d8e8476'
},
})
this.agreement = res.content
},
demoDownload() {
vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '6588648da7c432e4a360bb34'
},
success: res => {
window.open(res.content)
}
})
},
async getContactList() {
const {rows} = await vk.callFunction({
url: 'client/businessContact/kh/getList',
})
this.contactList = rows
},
navTo() {
vk.navigateTo({url: '/pages/user/user?menu=business-contact'})
},
selectContact(name) {
const contact = this.contactList.find(item => item.name === name)
this.contact = contact.phone
},
previewUpload({url}) {
window.open(url)
}
},
onLoad() {
const userInfo = vk.getVuex('$user.userInfo')
// console.log('userInfo', userInfo)
if (parseInt(userInfo.accountType) === 2) {
this.email = userInfo.company.contactEmail
this.requestName = userInfo.manager.personName
this.contactName = userInfo.manager.personName
this.contact = userInfo.company.mobile
if (userInfo.company && userInfo.company.addressRegion) {
this.receiveAddressIndex[0] = this.provinceData.findIndex(item => item.name === userInfo.company.addressRegion.province.name)
this.receiveAddressIndex[1] = this.cityData[this.receiveAddressIndex[0]].findIndex(item => item.name === userInfo.company.addressRegion.city.name)
this.receiveAddressIndex[2] = this.areaData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]].findIndex(item => item.name === userInfo.company.addressRegion.area.name)
}
if (userInfo.company.addressDetail) this.receiveAddress = userInfo.company.addressDetail
} else {
if (userInfo.businessCard && userInfo.businessCard.email) this.email = userInfo.businessCard.email
this.requestName = userInfo.person.personName
this.contactName = userInfo.person.personName
this.contact = userInfo.person.mobile
if (userInfo.person && userInfo.person.addressRegion) {
this.receiveAddressIndex[0] = this.provinceData.findIndex(item => item.name === userInfo.person.addressRegion.province.name)
this.receiveAddressIndex[1] = this.cityData[this.receiveAddressIndex[0]].findIndex(item => item.name === userInfo.person.addressRegion.city.name)
this.receiveAddressIndex[2] = this.areaData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]].findIndex(item => item.name === userInfo.person.addressRegion.area.name)
}
if (userInfo.person.addressDetail) this.receiveAddress = userInfo.person.addressDetail
}
this.getConfigList()
this.getAgreement()
// this.getContactList()
},
computed: {
amount() {
let tmpAmount = 0
// this.configList.forEach(item => {
// item.contents.forEach((content, contentIndex) => {
// if (contentIndex === item.contentIndex && content.amountList.length > 0) {
// content.amountList.forEach((amount, amountIndex) => {
// if (amountIndex === item.amountIndex) {
// tmpAmount += parseFloat(amount.amount)
// }
// })
// }
// })
// })
this.amountList.forEach(item => {
tmpAmount += item.amount
})
return tmpAmount
},
totalAmount() {
return this.amount * this.productList.length
}
}
} }
</script> </script>
<style lang="scss" scoped>
.server-item {
background-color: #fbf8f8;
border: 2px solid #fbebf1;
padding: 10px;
display: flex;
justify-content: space-between;
margin-bottom: 20px;
.items-center {
width: 1100px;
display: flex;
justify-content: space-between;
align-items: center;
flex: 1;
view {
width: 300px;
}
.ml-35 {
font-weight: normal;
font-size: 13px;
}
}
.server-item-content {
display: flex;
align-items: center;
width: 600px !important;
}
.remark {
color: #999999;
font-weight: normal;
}
}
.divider-title {
font-size: 17px;
font-weight: bold;
}
</style>
+214
View File
@@ -0,0 +1,214 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="page-nav">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item>
<navigator style="display: inline-block;" url="/pages/self-support/self-support">金久信自营</navigator>
</el-breadcrumb-item>
<el-breadcrumb-item>填写报价信息</el-breadcrumb-item>
</el-breadcrumb>
</view>
<view class="page-main">
<quote-remain-num v-if="reloaded"/>
<vk-data-form
ref="form1"
v-model="form1.data"
:action="form1.props.action"
:columns="form1.props.columns"
:rules="form1.props.rules"
:form-type="form1.props.formType"
:loading.sync="form1.props.loading"
:auto-close="false"
:show-cancel="false"
label-width="160px"
@success="onFormSuccess"
>
<template v-slot:desc>
<span>{{ sheet.desc }}</span>
</template>
<template v-slot:amount>
<el-input v-model="form1.data.amount" placeholder="请输入货款总价" @change="formatNumber"></el-input>
</template>
<template v-slot:sheetFile="{ row, column, index }">
<p v-for="(item, index) in sheet.files" :key="index" class="text-main">
<a :href="item" target="_blank">预览:文件{{index + 1}}</a>
</p>
</template>
</vk-data-form>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
data() {
return {
reloaded: false,
// 表单相关开始-----------------------------------------------------------
form1: {
// 表单请求数据,此处可以设置默认值
data: {
// radio: 1,
// checkbox : [1,2]
sheetId: null,
amount: null,
},
// 表单属性
props: {
// 表单请求地址
action: "client/selfSupport/kh/addQuote",
// 表单字段显示规则
columns: [
{key: "sheetFile", title: "询价文件", type: "html"},
{key: "desc", title: "产品描述", type: "html"},
{key: "amount", title: "货款总价(人民币:元)", type: "html"},
{key: "files", title: "附件", type: "file", accept: '.pdf'},
{key: "remark", title: "报价单详情", type: "textarea"},
],
// 表单验证规则
rules: {
amount: [
{required: true, message: "货款总价不能为空", trigger: "change,blur"},
]
},
// add 代表添加 update 代表修改
formType: "",
// 表单是否在请求中
loading: false,
// 是否显示表单1 的弹窗
show: false
}
},
// 表单相关结束-----------------------------------------------------------
sheet: null
};
},
onLoad(options = {}) {
console.log(options)
const {
id
} = options
if (!id) {
vk.navigateTo('/pages/self-support/self-support');
return
}
this.enquiryId = id
this.form1.data.sheetId = id
this.getEnquiryDetail()
},
computed: {
totalPriceStr() {
if (this.totalPrice == 0) {
return "零元"
}
return vk.myfn.convertCurrency(this.totalPrice / 100)
}
},
methods: {
onFormSuccess() {
vk.redirectTo({url: `/pages/index/index`})
},
// 提交报价单
async submit() {
const data = await vk.userCenter.getCurrentUserInfo();
const {userInfo} = data
if (userInfo.remainQuoteNum === 0 || !userInfo.remainQuoteNum) {
}
// this.$confirm(`今日报价次数${userInfo.quoteTimes || 0}, 是否继续?`, '提示', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning',
// center: true
// }).then(res => {
//
// })
vk.callFunction({
url: 'client/enquiry/quote/kh/addQuote',
title: '请求中...',
// data: {
// sheet: this.sheet,
// totalPrice: this.totalPrice
// },
success: (data) => {
this.$message({
message: "报价成功",
type: 'success'
})
}
});
},
/**
* 获取询价单详情
*/
getEnquiryDetail() {
vk.callFunction({
url: 'client/selfSupport/kh/getDetail',
title: '请求中...',
data: {
_id: this.enquiryId
},
success: (res) => {
this.sheet = res
}
});
},
formatNumber(e){
this.form1.data.amount = parseFloat(this.form1.data.amount).toFixed(2)
}
},
onShow() {
this.reloaded = false
setTimeout(() => {
this.reloaded = true
}, 500)
}
}
</script>
<style lang="scss" scoped>
.page-main {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
}
.description {
margin-bottom: 40px;
width: 800px;
}
.quote {
display: flex;
align-items: center;
justify-content: space-between;
}
.quote-form {
width: 260px;
}
.form-footer {
height: 40px;
line-height: 40px;
background: #fff;
padding-top: 0;
text-align: center;
display: block;
}
</style>
+79 -28
View File
@@ -1,38 +1,89 @@
<template> <template>
<view> <view>
<top-bar></top-bar> <top-bar></top-bar>
<common-header></common-header> <common-header></common-header>
<category-bar></category-bar> <category-bar></category-bar>
<view class="w-1200 m-a"> <view class="w-1200 m-a">
<u-swiper :list="list" :height="380" borderRadius="0"></u-swiper> <!-- <el-carousel :height="`500px`" :style="{width: '1200px'}" class="m-a">-->
<view class="flex flex-col"> <!-- <el-carousel-item v-for="(item, index) in list" :key="index" :style="{width: '1200px'}">-->
<image src="/static/images/selfSupport/company.jpg" class="w-100p pointer" mode="widthFix" <!-- <image :src="item.image" mode="scaleToFill" :style="{width: '1200px', height: '500px'}"/>-->
@click="navTo('/pages/index/self-support/companyQuote')"/> <!-- </el-carousel-item>-->
<image src="/static/images/selfSupport/product.jpg" class="w-100p pointer mt-20" mode="widthFix" <!-- </el-carousel>-->
@click="navTo('/pages/index/self-support/productQuote')"/> <common-swiper page="self-support-main"/>
</view> <view class="flex flex-col">
</view> <image :src="companyImg" class="w-100p pointer"
<common-footer></common-footer> style="height: 150px"
@click="navTo('/pages/index/self-support/companyQuote')"/>
<image :src="productImg" class="w-100p pointer mt-20"
style="height: 150px"
@click="navTo('/pages/index/self-support/productQuote')"/>
<image :src="costImg" class="w-100p pointer mt-20"
style="height: 150px"
@click="navTo('/pages/index/self-support/costQuote')"/>
</view>
</view> </view>
<common-footer></common-footer>
</view>
</template> </template>
<script> <script>
export default { export default {
name: "selectType", name: "selectType",
data() { data() {
return { return {
list: [ list: [
{ {
image: '/static/images/selfSupport/swiper.jpg', image: '/static/images/selfSupport/swiper.jpg',
title: '昨夜星辰昨夜风,画楼西畔桂堂东' title: '昨夜星辰昨夜风,画楼西畔桂堂东'
},
]
}
},
methods: {
navTo(url) {
vk.navigateTo(url);
}, },
],
companyImg: '',
productImg: '',
costImg: '',
} }
},
methods: {
navTo(url) {
vk.navigateTo(url);
},
async getCompanyImg(){
vk.callFunction({
url: 'client/album/pub/list',
data: {
page: 'self-support-company'
},
success: ({swiper}) => {
this.companyImg = swiper[0]
}
})
},
async getProductImg(){
vk.callFunction({
url: 'client/album/pub/list',
data: {
page: 'self-support-product'
},
success: ({swiper}) => {
this.productImg = swiper[0]
}
})
},
async getCostImg(){
vk.callFunction({
url: 'client/album/pub/list',
data: {
page: 'self-support-quote'
},
success: ({swiper}) => {
this.costImg = swiper[0]
}
})
},
},
onLoad(){
this.getCompanyImg()
this.getProductImg()
this.getCostImg()
}
} }
</script> </script>
+344 -186
View File
@@ -1,215 +1,373 @@
<template> <template>
<view> <view>
<top-bar></top-bar> <top-bar></top-bar>
<common-header></common-header> <common-header></common-header>
<category-bar></category-bar> <category-bar></category-bar>
<view class="w-1200"> <view class="w-1200">
<u-swiper :list="list" :height="380" borderRadius="0"></u-swiper> <view class="test">
<view class="test"> <text class="pointer active" @click="navTo('/pages/index/self-support/self-support')">自营钢城</text>
<text class="pointer" @click="navTo('/pages/index/self-support/self-support')">自营钢城</text> <text class="pointer" @click="navTo('/pages/index/self-support/selectType')">平台服务</text>
<text class="pointer" @click="navTo('/pages/index/self-support/selectType')">平台服务</text> <text class="pointer" @click="navTo('/pages/index/shop/shop')">特产商城</text>
<text class="pointer" @click="navTo('/pages/index/shop/shop')">特产商城</text> </view>
</view> <common-swiper page="self-support-index"/>
<view class="tool-bar"> <view class="tool-bar">
<view class="search"> <view class="search">
<text>交易区域:</text> <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/> clearable @change="getCompanyList"/>
</view>
<view class="buy-btn">
<el-button type="primary" plain class="empty-bg-plain-btn" :disabled="address.length === 0"
@click.native="dialogVisible = true">
下单询价>
</el-button>
</view>
</view>
<!-- 合作单位/联营单位-->
<view class="cooperate">
<view class="title">合作单位/联营单位</view>
<u-gap height="5" bg-color="#f3f3f3"/>
<view class="flex justify-start items-start flex-wrap">
<view class="w-25p pointer" v-for="(item, index) in companyList" :key="index">
<view class="border bg-white flex flex-col justify-center items-center p-20">
<image :src="item.businessCard.logo" class="logo"/>
<span class="mt-20 line-1 w-100p text-center">
主营: {{ item.businessCard.mainBusiness }}
</span>
</view>
</view>
</view>
<u-gap height="5" bg-color="#f3f3f3"/>
</view>
</view> </view>
<!-- 现货市场 end --> <view class="flex justify-end items-start">
<gap height="50"/> <view class="flex flex-col justify-center items-center mr-10">
<right-bar></right-bar> <el-button type="primary" plain class="empty-bg-plain-btn" :disabled="address.length === 0"
<common-footer></common-footer> @mouseenter.native="showTips = true"
<el-dialog @mouseleave.native="showTips = false"
title="下询价单" @click.native="dialogVisible = true">
:visible.sync="dialogVisible" 下单询价>
width="60%"> </el-button>
<vk-data-upload v-model="files" accept="*"> <text class="text-main mt-10 text-20" v-if="showTips && address.length === 0">请先选择交易区域</text>
</vk-data-upload> </view>
<el-button @click="dialogVisible = false">取 消</el-button> <el-button type="primary" @click.native="getList">
<el-button type="primary" @click="addFiles">确 定</el-button> 我的询价
</el-dialog> </el-button>
</view>
</view>
<!-- 合作单位/联营单位-->
<view class="cooperate">
<view class="title">合作单位/联营单位</view>
<u-gap height="5" bg-color="#f3f3f3"/>
<view class="flex justify-start items-start flex-wrap">
<view class="w-25p pointer" v-for="(item, index) in companyList" :key="index"
@click="navTo(`/pages/yellowPage/info?id=${item.uid}`)">
<view class="border bg-white flex justify-start items-center p-20">
<image v-if="item.businessCard" :src="item.businessCard.logo" class="logo"/>
<image v-else src="/static/images/no-logo.jpg" class="logo" mode="aspectFill"/>
<div class="flex flex-col justify-start items-start ml-20 w-67p">
<span class="text-30 font-bold mb-25">{{ item.company.companyName }}</span>
<span class="mt-20 line-2 w-100p">
主营: {{
(item.mainSpotCategory && item.mainSpotCategory.length > 0) ? item.mainSpotCategory.join() : ''
}}
</span>
</div>
</view>
</view>
</view>
<u-gap height="5" bg-color="#f3f3f3"/>
</view>
</view> </view>
<!-- 现货市场 end -->
<gap height="50"/>
<right-bar></right-bar>
<common-footer></common-footer>
<el-dialog
title="下询价单"
:visible.sync="dialogVisible"
width="60%">
<el-form ref="form" label-width="140px">
<el-form-item label="联系人" required>
<el-select v-model="name" placeholder="点击选择业务联系人"
class="w-100p" @change="selectContact">
<el-option
v-for="(item, index) in contactList"
:key="index"
:label="item.name"
:value="item.name">
</el-option>
<view slot="empty" class="text-gray pointer p-20">
<text>无业务联系人,请到</text>
<text class="text-main mx-15" @click="navToContact">个人中心</text>
<text>添加</text>
</view>
</el-select>
</el-form-item>
<el-form-item label="联系方式" required>
<el-input v-model="phone" placeholder="请输入联系方式" disabled/>
</el-form-item>
<el-form-item label="用户名称" required>
<el-input v-model="company" placeholder="请输入您的名称"/>
</el-form-item>
<el-form-item label="询价单附件" required>
<vk-data-upload v-model="files" list-type="text" accept="*" :on-preview="previewUpload">
</vk-data-upload>
<!-- <p class="text-main text-25">平台目前仅支持PDF文档上传,请你谅解!</p>-->
</el-form-item>
</el-form>
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="addFiles">确 定</el-button>
</el-dialog>
<el-dialog title="我的询价单" :visible.sync="showList" width="60%">
<el-table :data="list" style="width: 100%">
<el-table-column prop="name" label="联系人"/>
<el-table-column label="询价区域">
<template #default="{row}">
{{ row.province.name }}{{ row.city.name }}
</template>
</el-table-column>
<el-table-column prop="phone" label="联系方式"/>
<el-table-column prop="company" label="企业名称"/>
<el-table-column label="附件">
<template #default="{row}">
<file-type v-for="(item, index) in row.files" :key="index" :item="item"/>
</template>
</el-table-column>
<el-table-column prop="_add_time_str" label="询价日期"/>
</el-table>
<div class="mt-20 text-center">
<el-button @click="showList = false">关 闭</el-button>
</div>
</el-dialog>
</view>
</template> </template>
<script> <script>
import UGap from "@/uni_modules/vk-uview-ui/components/u-gap/u-gap.vue"; import UGap from "@/uni_modules/vk-uview-ui/components/u-gap/u-gap.vue";
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json"; import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json"; import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
import FileType from "../../../components/file-type/file-type.vue";
export default { export default {
components: {UGap}, components: {FileType, UGap},
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
address: [], address: [],
files: [], files: [],
list: [ options: [],
{ companyList: [],
image: 'https://cdn.uviewui.com/uview/swiper/1.jpg', name: null,
title: '昨夜星辰昨夜风,画楼西畔桂堂东' phone: null,
}, company: null,
{ showList: false,
image: 'https://cdn.uviewui.com/uview/swiper/2.jpg', list: [],
title: '身无彩凤双飞翼,心有灵犀一点通' allChildCate: [],
}, contactList: [],
{ showTips: false
image: 'https://cdn.uviewui.com/uview/swiper/3.jpg', };
title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳' },
} onLoad(options) {
], if (options && options.menu) {
options: [], this.currMenu = options.menu
companyList: []
};
},
onLoad(options) {
if (options && options.menu) {
this.currMenu = options.menu
}
this.getCompanyList()
this.options = provinces.map(item => {
item.children = [];
return item
})
this.options.forEach((province, index) => {
citys[index].forEach(city => {
this.options[index].children.push(city)
})
})
},
methods: {
menuSelect(e) {
this.currMenu = e
},
navTo(url) {
vk.navigateTo(url);
},
async getCompanyList() {
const {rows} = await vk.callFunction({
url: 'client/user/pub/getCompany',
data: {
isCoop: 1,
city: this.address.length > 0 ? [this.address[1]] : []
}
})
this.companyList = rows
},
async addFiles() {
await vk.callFunction({
url: 'client/selfSupport/kh/add',
data: {
files: this.files,
city: this.address.length > 0 ? this.address[1] : []
}
})
this.$message({
message: '下单成功',
type: 'success'
})
this.dialogVisible = false
}
} }
this.getCategoryTreeData()
this.options = provinces.map(item => {
item.children = [];
return item
})
this.options.forEach((province, index) => {
citys[index].forEach(city => {
city.children = []
this.options[index].children.push(city)
})
})
this.options.forEach((province, index) => {
citys[index].forEach((city, cityIndex) => {
areas[index][cityIndex].forEach(area => {
this.options[index].children[cityIndex].children.push(area)
})
})
})
this.getContactList()
const user = vk.getVuex('$user.userInfo')
this.company = user.accountType === 2 ? user.company.companyName : user.person.personName
},
methods: {
getCategoryTreeData() {
vk.callFunction({
url: 'client/spot/category/pub/getTree',
title: '请求中...',
data: {},
success: (data) => {
this.allChildCate = []
data.rows.forEach(item => {
item.children.forEach(child => {
this.allChildCate.push(child)
})
})
this.getCompanyList()
}
});
},
menuSelect(e) {
this.currMenu = e
},
navTo(url) {
vk.navigateTo(url);
},
async getCompanyList() {
const {rows} = await vk.callFunction({
url: 'client/user/pub/getCompany',
data: {
isCoop: 1,
province: this.address.length > 0 ? [this.address[0]] : []
}
})
this.companyList = rows.map(item => {
item.name = item.company.companyName
item.mainSpotCategory = []
if (item.company && item.company.mainSpotCategoryIds) {
this.allChildCate.forEach(child => {
if (item.company.mainSpotCategoryIds.includes(child._id)) {
item.mainSpotCategory.push(child.name)
}
})
}
return item
})
},
async addFiles() {
if (!this.name) return this.$message({type: 'error', message: '请输入联系人'})
if (!this.phone) return this.$message({type: 'error', message: '请输入联系方式'})
if (!this.company) return this.$message({type: 'error', message: '请输入您的企业名称'})
if (this.files.length === 0) return this.$message({type: 'error', message: '请上传询价单附件'})
if (!vk.getVuex('$user.userInfo.fadadaConfirm') || [-1, 2].includes(vk.getVuex('$user.userInfo.authStatus'))) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
this.dialogVisible = false
return
}
let city, province
this.options.forEach((provinceItem, index) => {
provinceItem.children.forEach(cityItem => {
if (cityItem.code === this.address[1]) {
city = cityItem
province = {code: provinceItem.code, name: provinceItem.name}
}
})
})
await vk.callFunction({
url: 'client/selfSupport/kh/add',
data: {
files: this.files,
city,
province,
name: this.name,
phone: this.phone,
company: this.company,
}
})
await this.$alert('<p style="text-align: center">您已下单成功,感谢您选择金久信</p><p style="text-align: center">请待平台为您提供竭诚服务!</p><p style="text-align: center; color: red">客服电话:0771-3923001</p>', '', {
dangerouslyUseHTMLString: true,
})
this.dialogVisible = false
},
async getList() {
const {rows} = await vk.callFunction({
url: 'client/selfSupport/kh/getList',
})
this.list = rows
this.showList = true
},
async getContactList() {
const {rows} = await vk.callFunction({
url: 'client/businessContact/kh/getList',
})
this.contactList = rows
},
navToContact() {
this.dialogVisible = false
this.showList = false
vk.navigateTo({url: '/pages/user/user?menu=business-contact'})
},
selectContact(name) {
const contact = this.contactList.find(item => item.name === name)
this.phone = contact.phone
},
previewUpload({url}) {
window.open(url)
}
}
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.w-1200 { .w-1200 {
width: 1200px; width: 1200px;
margin: 20px auto; margin: 20px auto;
background-color: #fff; background-color: #fff;
.test { .test {
height: 50px; height: 50px;
color: #ffffff; color: #ffffff;
font-size: 18px; font-size: 18px;
background-color: #bf2b28; background-color: #bf2b28;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
text { text {
margin: 0 20px; padding: 0 20px;
} height: 100%;
display: flex;
text:hover { align-items: center;
color: #F2CFCE; justify-content: center;
}
} }
.tool-bar { text:hover {
display: flex; background-color: #690503
justify-content: space-between;
align-items: center;
padding: 20px;
font-size: 16px;
.search {
display: flex;
align-items: center;
}
} }
.cooperate { .active {
.title { background-color: #941411
text-align: center;
color: #bf2b28;
font-size: 28px;
line-height: 3em;
}
.wrap {
flex-wrap: wrap;
}
.grid-content {
display: flex;
justify-content: center;
align-items: center;
padding: 10px;
flex-direction: column;
.comments {
line-height: 2em;
}
}
.bg-purple {
border-top: 1px solid #f3f3f3;
border-right: 1px solid #f3f3f3;
.image {
width: 140px;
}
}
} }
}
.tool-bar {
display: flex;
justify-content: space-between;
align-items: flex-start;
padding: 20px;
font-size: 16px;
.search {
display: flex;
align-items: center;
}
}
.cooperate {
.title {
text-align: center;
color: #bf2b28;
font-size: 28px;
line-height: 3em;
}
.wrap {
flex-wrap: wrap;
}
.grid-content {
display: flex;
justify-content: center;
align-items: center;
padding: 10px;
flex-direction: column;
.comments {
line-height: 2em;
}
}
.bg-purple {
border-top: 1px solid #f3f3f3;
border-right: 1px solid #f3f3f3;
.image {
width: 140px;
}
}
}
} }
.logo { .logo {
width: 80px; width: 80px;
height: 80px; height: 80px;
} }
</style> </style>
+3 -3
View File
@@ -244,15 +244,15 @@ export default {
data() { data() {
return { return {
list: [{ list: [{
image: 'https://cdn.uviewui.com/uview/swiper/1.jpg', image: '/static/images/swiper_5.png',
title: '昨夜星辰昨夜风,画楼西畔桂堂东' title: '昨夜星辰昨夜风,画楼西畔桂堂东'
}, },
{ {
image: 'https://cdn.uviewui.com/uview/swiper/2.jpg', image: '/static/images/swiper_5.png',
title: '身无彩凤双飞翼,心有灵犀一点通' title: '身无彩凤双飞翼,心有灵犀一点通'
}, },
{ {
image: 'https://cdn.uviewui.com/uview/swiper/3.jpg', image: '/static/images/swiper_5.png',
title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳' title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
} }
], ],
+50 -18
View File
@@ -9,11 +9,11 @@
<text class="font-bold text-40"> <text class="font-bold text-40">
购物车(全部{{ list.length }}) 购物车(全部{{ list.length }})
</text> </text>
<view class="flex justify-end items-center"> <!-- <view class="flex justify-end items-center">-->
<text>已选商品(不含运费)</text> <!-- <text>已选商品(不含运费)</text>-->
<text class="text-main text-40 font-bold mx-20">¥{{ amount }}</text> <!-- <text class="text-main text-40 font-bold mx-20">¥{{ amount }}</text>-->
<el-button type="primary" round>结算</el-button> <!-- <el-button type="primary" round @click.native="addFromCart">结算</el-button>-->
</view> <!-- </view>-->
</view> </view>
<view class="py-20"> <view class="py-20">
<el-row :gutter="10"> <el-row :gutter="10">
@@ -46,23 +46,24 @@
<view class="flex justify-start items-start"> <view class="flex justify-start items-start">
<el-checkbox v-model="list[index].checked" @change="changeCheck($event, item._id)"> <el-checkbox v-model="list[index].checked" @change="changeCheck($event, item._id)">
</el-checkbox> </el-checkbox>
<el-image :src="item.goods.cover" class="cover ml-20" fit="fit"/> <el-image :src="item.goods.cover" class="cover ml-20" fit="fit"/>
<view class="flex flex-col justify-start items-start ml-20"> <view class="flex flex-col justify-start items-start ml-20">
{{ item.goods.name }} <text class="font-bold mb-15">{{ item.goods.name }}</text>
<text class="text-gray">{{ item.sku.label }}</text>
</view> </view>
</view> </view>
</el-col> </el-col>
<el-col :span="3"> <el-col :span="3">
<text class="text-35 font-bold flex-1">¥{{ item.goods.amount }}</text> <text class="text-35 font-bold flex-1">¥{{ item.sku.values }}</text>
</el-col> </el-col>
<el-col :span="3"> <el-col :span="3">
<text class="text-35 font-bold flex-1"> <text class="text-35 font-bold flex-1">
<el-input-number v-model="list[index].num" @change="changeNum" :min="1" size="small"/> <el-input-number v-model="list[index].num" @change="changeNum(index)" :min="1" size="small"/>
</text> </text>
</el-col> </el-col>
<el-col :span="3"> <el-col :span="3">
<text class="text-35 font-bold flex-1 text-main">¥{{ <text class="text-35 font-bold flex-1 text-main">¥{{
parseFloat(item.goods.amount) * item.num parseFloat(item.sku.values) * item.num
}} }}
</text> </text>
</el-col> </el-col>
@@ -72,7 +73,7 @@
</el-row> </el-row>
</view> </view>
<view class="mt-20 flex justify-between items-center"> <view class="mt-20 flex justify-between items-center">
<el-button type="text">移出购物车</el-button> <el-button type="text" @click.native="removeMulti" :disabled="selectedList.length === 0">移出购物车</el-button>
<view class="flex justify-end items-center"> <view class="flex justify-end items-center">
<view> <view>
<text>已选商品</text> <text>已选商品</text>
@@ -81,7 +82,7 @@
</view> </view>
<text class="ml-35">合计(不含运费):</text> <text class="ml-35">合计(不含运费):</text>
<text class="mx-15 font-bold text-40 text-main">¥{{ amount }}</text> <text class="mx-15 font-bold text-40 text-main">¥{{ amount }}</text>
<el-button type="primary" round :disabled="selectedList.length === 0">结算</el-button> <el-button type="primary" round :disabled="selectedList.length === 0" @click.native="addFromCart">结算</el-button>
</view> </view>
</view> </view>
</view> </view>
@@ -106,18 +107,27 @@ export default {
const {rows} = await vk.callFunction({ const {rows} = await vk.callFunction({
url: "client/cart/kh/getList" url: "client/cart/kh/getList"
}) })
this.selectedAll = false
this.list = rows.map(item => { this.list = rows.map(item => {
item.checked = false item.checked = false
return item return item
}) })
}, },
doSelectAll() { doSelectAll() {
this.selectedList = []
this.list.forEach((item, index) => { this.list.forEach((item, index) => {
this.list[index].checked = this.selectedAll this.list[index].checked = this.selectedAll
if (this.selectedAll) this.selectedList.push(item._id)
}) })
}, },
changeNum(e) { changeNum(index) {
console.log(e) vk.callFunction({
url: "client/cart/kh/changeNum",
data: {
id: this.list[index]._id,
num: this.list[index].num
}
})
}, },
changeCheck(e, id) { changeCheck(e, id) {
const index = this.selectedList.indexOf(id) const index = this.selectedList.indexOf(id)
@@ -126,15 +136,38 @@ export default {
this.selectedAll = this.selectedList.length === this.list.length this.selectedAll = this.selectedList.length === this.list.length
}, },
remove(index) { remove(index) {
this.list.splice(index, 1)
vk.callFunction({ vk.callFunction({
url: "client/cart/kh/delete", url: "client/cart/kh/delete",
data: { data: {
ids: [this.list[index]._id] ids: [this.list[index]._id]
} }
}) })
this.list.splice(index, 1)
},
async removeMulti() {
if (this.selectedList.length === 0) return
await vk.callFunction({
url: "client/cart/kh/delete",
data: {
ids: this.selectedList
}
})
this.selectedList = []
await this.getList()
},
async addFromCart(){
const {data} = await vk.callFunction({
url: "client/order/kh/addFromList",
data: {
type: 0,
ids: this.selectedList
}
})
this.selectedAll = false
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
} }
}, },
onShow() { onShow() {
this.getList() this.getList()
@@ -143,8 +176,7 @@ export default {
amount() { amount() {
let tmpAmount = 0 let tmpAmount = 0
this.list.forEach(item => { this.list.forEach(item => {
console.log(item.checked) if (item.checked) tmpAmount += parseFloat(item.sku.values) * parseInt(item.num)
if (item.checked) tmpAmount += parseFloat(item.goods.amount) * parseInt(item.num)
}) })
return tmpAmount return tmpAmount
} }
+210 -112
View File
@@ -1,142 +1,240 @@
<template> <template>
<view> <view>
<top-bar></top-bar> <top-bar></top-bar>
<common-header></common-header> <common-header></common-header>
<category-bar></category-bar> <category-bar></category-bar>
<view class="w-1200 m-a"> <view class="w-1200 m-a">
<view class="page-nav"> <view class="page-nav">
<el-breadcrumb separator=">"> <el-breadcrumb separator=">">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item> <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item> <el-breadcrumb-item>
<navigator style="display: inline-block;" url="/pages/index/shop/shop">特产商城</navigator> <navigator style="display: inline-block;" url="/pages/index/shop/shop">特产商城</navigator>
</el-breadcrumb-item> </el-breadcrumb-item>
<el-breadcrumb-item class="text-main">{{ info.name }}</el-breadcrumb-item> <el-breadcrumb-item class="text-main">{{ info.name }}</el-breadcrumb-item>
</el-breadcrumb> </el-breadcrumb>
</view> </view>
<view class="bg-white p-40 flex justify-start items-start"> <view class="bg-white p-40 flex justify-start items-start">
<el-carousel height="400px" class="album"> <el-carousel height="500px" class="album">
<el-carousel-item v-for="(item, index) in info.album" :key="index"> <el-carousel-item v-for="(item, index) in info.album" :key="index">
<image :src="item" class="album-item" mode="aspectFill"/> <image :src="item" class="album-item" mode="aspectFill"/>
</el-carousel-item> </el-carousel-item>
</el-carousel> </el-carousel>
<view class="ml-35 flex flex-col justify-start items-start flex-1"> <view class="ml-35 flex flex-col justify-start items-start flex-1">
<view class="font-bold text-40 mb-20">{{ info.name }}</view> <view class="font-bold text-40 mb-20">{{ info.name }}</view>
<view class="flex flex-col justify-start items-start flex-1"> <view class="flex flex-col justify-start items-start flex-1">
<text>产品介绍:</text> <text>产品介绍:</text>
<view class="desc p-20 mt-20">{{ info.desc }}</view> <view class="desc p-20 mt-20">{{ info.desc }}</view>
</view> </view>
<view class="flex justify-between items-center w-100p mt-20"> <view class="flex flex-col items-start justify-start w-100p mt-20">
<view class="flex justify-start items-center"> <view class="flex flex-col justify-start items-start flex-1 mr-25 w-100p">
<text>零售价:</text> <view class="flex justify-start items-center">
<text class="font-bold text-main">¥{{ info.amount }}</text> <text>零售价:</text>
</view> <text class="font-bold text-main">¥{{ info.amount }}</text>
<view class="flex justify-end is-center"> </view>
<el-button type="danger" round class="add-to-cart-btn" @click.native="addToCart">加入购物车</el-button> <view class="flex-1 w-100p" v-if="info.sku">
<el-button type="primary" round class="ml-35" @click.native="newOrder">立即购买</el-button> <view class="w-100p my-25 flex flex-1 justify-center items-center p-15">
</view> <text class="flex-1 text-center">规格/分类/说明</text>
</view> <text class="flex-1 text-center">数量</text>
<text class="flex-1 text-center">价格</text>
</view> </view>
<view class="border my-25 flex justify-center items-center p-15 pointer sku"
v-for="(item, index) in info.sku" :key="index"
:class="[selectedSku === item._index ? 'sku-selected' : '']">
<el-image v-if="item.image" :src="item.image" style="width: 40px; height: 40px"
@click="selectedSku = item._index"/>
<text class="flex-1 text-center" @click="selectedSku = item._index">{{
item.label
}}
</text>
<view class="flex-1 flex justify-center items-center" style="z-index: 999">
<el-input-number v-model="info.sku[index].num" :min="1" size="small"/>
</view>
<text class="flex-1 text-center" @click="selectedSku = item._index">{{
item.values
}}元
</text>
</view>
</view>
</view> </view>
<view class="mt-40"> <view class="flex justify-center items-center w-100p mt-20">
<view class="intro-title">商品介绍</view> <el-button type="danger" round
<view class="intro bg-white" v-html="info.content"></view> :class="selectedSku ? 'add-to-cart-btn' : 'add-to-cart-btn-disabled'"
@click.native="addToCart" :disabled="!selectedSku">
加入购物车
</el-button>
<el-button type="primary" round class="ml-35" @click.native="newOrder"
:disabled="!selectedSku">立即购买
</el-button>
</view> </view>
<view class="mt-20 flex justify-start items-center">
<template v-if="info.express">
<transporter theme="outline" size="16" fill="#9b9b9b" strokeLinecap="square"/>
<text class="ml-10">快递:{{ info.express }}</text>
</template>
<text v-if="info.deliverDate" class="ml-35">{{ info.deliverDate }}</text>
<text v-if="info.expressAmount !== undefined && info.expressAmount !== null" class="ml-35">
运费:{{ info.expressAmount === 0 ? '免运费' : info.expressAmount }}
</text>
</view>
<view class="mt-20 flex justify-start items-center" v-if="info.ensureService">
<like theme="outline" size="16" fill="#9b9b9b" strokeLinecap="square"/>
<text class="ml-10">{{ info.ensureService }}</text>
</view>
</view>
</view> </view>
<!-- 现货市场 end --> </view>
<gap height="50"/> <view class="mt-40" v-if="info.video">
<common-footer></common-footer> <view class="intro-title">视频介绍</view>
<right-bar></right-bar> <video :src="info.video" autoplay controls style="width: 100%; height: 800px"></video>
</view>
<view class="mt-40">
<view class="intro-title">商品介绍</view>
<view class="intro bg-white" v-html="info.content"></view>
</view>
</view> </view>
<!-- 现货市场 end -->
<gap height="50"/>
<common-footer></common-footer>
<right-bar></right-bar>
</view>
</template> </template>
<script> <script>
import UGap from "@/uni_modules/vk-uview-ui/components/u-gap/u-gap.vue"; import UGap from "@/uni_modules/vk-uview-ui/components/u-gap/u-gap.vue";
import {Transporter, Like} from '@icon-park/vue'
export default { export default {
components: {UGap}, components: {UGap, Transporter, Like},
data() { data() {
return { return {
id: null, id: null,
info: { info: {
name: '' name: ''
} },
}; num: 1,
}, selectedSku: null
onLoad(options) { };
if (options && options.id) { },
this.id = options.id; onLoad(options) {
this.getInfo(options.id) if (options && options.id) {
} this.id = options.id;
}, this.getInfo(options.id)
methods: {
navTo(url) {
vk.navigateTo(url);
},
async getInfo(id) {
this.info = await vk.callFunction({
url: 'client/goods/list/pub/getDetail',
data: {id}
})
},
addToCart(){
vk.callFunction({
url: 'client/cart/kh/add',
data: {
goodsId: this.id,
},
success: (res) => {
this.$message({
type:'success',
message: '添加成功'
})
}
})
},
async newOrder(){
const {data} = await vk.callFunction({
url: 'client/order/kh/add',
data: {
goodsId: this.id,
num: 1,
type: 0
}
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
}
} }
},
methods: {
navTo(url) {
vk.navigateTo(url);
},
async getInfo(id) {
this.info = await vk.callFunction({
url: 'client/goods/list/pub/getDetail',
data: {id}
})
if (this.info.sku && this.info.sku.length > 0) {
this.info.sku.map((sku, index) => {
this.$set(this.info.sku[index], 'num', 1)
return sku
})
this.selectedSku = this.info.sku[0]._index
}
},
addToCart() {
if (!vk.getVuex('$user.userInfo.fadadaConfirm') || ([-1, 2].includes(vk.getVuex('$user.userInfo.authStatus')) && !vk.getVuex('$user.userInfo.userType'))) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
return
}
vk.callFunction({
url: 'client/cart/kh/add',
data: {
goodsId: this.id,
skuId: this.selectedSku,
num: this.info.sku.find(item => item._index === this.selectedSku).num,
},
success: (res) => {
this.$message({
type: 'success',
message: '添加成功'
})
}
})
},
async newOrder() {
if (!vk.getVuex('$user.userInfo.fadadaConfirm') || ([-1, 2].includes(vk.getVuex('$user.userInfo.authStatus')) && !vk.getVuex('$user.userInfo.userType'))) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
return
}
const {data} = await vk.callFunction({
url: 'client/order/kh/add',
title: '请求中...',
data: {
goodsId: this.id,
skuId: this.selectedSku,
num: this.info.sku.find(item => item._index === this.selectedSku).num,
type: 0
}
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
},
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.album { .album {
width: 500px; width: 500px;
.album-item { .album-item {
width: 500px; width: 500px;
height: 400px; height: 400px;
} }
} }
.desc { .desc {
background-color: #F5E2E3; background-color: #F5E2E3;
} }
.add-to-cart-btn{ .add-to-cart-btn {
background-color: #FF7300; background-color: #FF7300;
} }
.intro-title{ .add-to-cart-btn-disabled {
background-color: #EF0021; background-color: #f6aa6b;
padding: 10px 20px;
color: white;
width: 120px;
text-align: center;
} }
.intro{ .intro-title {
border-top: 1px solid #F95F6E; background-color: #EF0021;
padding: 10px 20px;
color: white;
width: 120px;
text-align: center;
}
.intro {
border-top: 1px solid #F95F6E;
}
.sku:hover {
background-color: #F5E2E3;
border: 1px solid #EF0021;
}
.sku-selected {
background-color: #F5E2E3;
border: 1px solid #EF0021;
} }
</style> </style>
+519 -198
View File
@@ -1,97 +1,202 @@
<template> <template>
<view> <view>
<top-bar></top-bar> <top-bar></top-bar>
<common-header></common-header> <!-- <common-header></common-header>-->
<category-bar></category-bar> <!-- <category-bar></category-bar>-->
<view class="w-1200 m-a bg-white p-40"> <view class="w-1200 m-a bg-white p-40 mt-20">
<template v-if="info"> <template v-if="info">
<view class="pb-20 border-bottom flex justify-between items-center"> <view class="pb-20 border-bottom flex justify-between items-center">
<text>订单号: {{ info.orderNo }}</text> <text>订单号: {{ info.orderNo }}</text>
<text>下单时间: {{ info._add_time_str }}</text> <text>下单时间: {{ info._add_time_str }}</text>
</view>
<view class="my-20">
<text class="font-bold text-35">商品详情</text>
<view class="flex justify-start items-start my-20">
<text class="w-15p" v-if="info.type === 0">封面</text>
<text class="w-40p">名称</text>
<text class="w-15p">数量</text>
<text class="w-15p">单价</text>
<text class="w-15p">小计</text>
</view>
<view class="flex justify-start items-start my-20" v-for="(item, index) in info.goods" :key="index">
<text class="w-15p" v-if="info.type === 0">
<image :src="item.goodsCover" mode="aspectFit" class="goods-cover"/>
</text>
<text class="w-40p font-bold text-35">{{ item.goodsName }}</text>
<text class="w-15p">x{{ item.num }}</text>
<text class="w-15p text-main">¥{{ item.goodsPrice }}</text>
<text class="w-15p">{{ item.goodsPrice * item.num }}</text>
</view>
</view>
</template>
<template v-if="info.type === 0">
<el-row :gutter="10" class="mb-20">
<el-col :span="4">
<el-input v-model="name" placeholder="请输入收件人姓名"/>
</el-col>
<el-col :span="4">
<el-input v-model="phone" placeholder="请输入收件人手机号"/>
</el-col>
</el-row>
<el-row :gutter="10" class="border-bottom pb-20">
<el-col :span="4">
<el-select v-model="addressIndex[0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[1]" placeholder="请选择市"
:disabled="addressIndex.length === 0">
<template v-if="addressIndex[0] !== null">
<el-option v-for="(item, index) in cityData[addressIndex[0]]" :key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[2]" placeholder="请选择区"
:disabled="addressIndex.length === 1">
<template v-if="addressIndex[0] !== null && addressIndex[1] !== null">
<el-option v-for="(item, index) in areaData[addressIndex[0]][addressIndex[1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="12">
<el-input v-model="addressDetail" placeholder="请输入详细地址"/>
</el-col>
</el-row>
</template>
<view class="mt-20 w-50p flex flex-col justify-center items-center m-a">
<text class="text-main font-bold text-40 mb-20" v-if="info">订单金额:¥{{ info.amount }}</text>
<el-button type="primary" round
:disabled="(info.type === 0 && (!phone || !name || addressIndex.length < 3))" @click="onPay">
立即支付
</el-button>
</view>
<div class="pay-price" v-if="billQRCode">
<uv-qrcode ref="qrcode" size="240px" :value="billQRCode"></uv-qrcode>
<div class="pay-desc">请打开手机微信,扫一扫完成支付</div>
<el-button type="success" @click="onPayStatus">已完成支付</el-button>
</div>
</view> </view>
<gap height="50"/> <view class="my-20">
<common-footer></common-footer> <text class="font-bold text-35">商品详情</text>
<right-bar></right-bar> <view class="flex justify-start items-start my-20">
<text class="w-15p" v-if="info.type === 0">封面</text>
<text class="w-40p">商品详情</text>
<text class="w-15p">数量</text>
<text class="w-15p">单价</text>
<text class="w-15p">小计</text>
</view>
<view class="flex justify-start items-start my-20" v-for="(item, index) in info.goods" :key="index">
<text class="w-15p" v-if="info.type === 0">
<image :src="item.goodsCover" mode="aspectFit" class="goods-cover"/>
</text>
<template v-if="info.type === 0">
<view class="flex flex-col justify-start items-start w-40p">
<text class=" font-bold text-35">{{ item.goodsName }}</text>
<text class="mt-15 text-gray">{{ item.sku.label }}</text>
</view>
<text class="w-15p">x{{ item.num }}</text>
<text class="w-15p text-main">¥{{ item.sku.values }}</text>
<text class="w-15p font-bold">¥{{ item.sku.values * item.num }}</text>
</template>
<template v-else>
<view class="flex flex-col justify-start items-start w-40p">
<text class=" font-bold text-35">{{ item.goodsName }}</text>
</view>
<text class="w-15p">x{{ item.num }}</text>
<text class="w-15p text-main">¥{{ item.goodsPrice }}</text>
<text class="w-15p font-bold">¥{{ item.goodsPrice * item.num }}</text>
</template>
</view>
</view>
</template>
<template v-if="info.type === 0">
<div class="p-20 rounded border m-30 pointer address" v-if="!address" @click="showAddress">
点击选择地址
</div>
<div v-else
class="py-20 flex justify-between items-center">
<div class="flex flex-col justify-start items-start">
<div class="flex justify-start items-center">
<text class="font-bold">{{ address.name }}</text>
</div>
<text>{{ address.phone }}</text>
<text v-if="address.addressRegion && address.addressRegion.province">{{
address.addressRegion.province.name
}}{{
address.addressRegion.city.name
}}{{ address.addressRegion.area.name }}{{ address.addressDetail }}
</text>
<text v-else-if="info.address.province">{{ info.address.province.name }}{{
info.address.city.name
}}{{ info.address.area.name }}{{ info.addressDetail }}
</text>
</div>
<div class="flex justify-center items-center">
<el-button type="primary" @click="showAddress">
变更
</el-button>
</div>
</div>
</template>
<!-- <view class="mt-40 font-bold text-main">您的会员等级:-->
<!-- {{ getUserLevelLabel(vk.getVuex('$user.userInfo.userLevel')) }}-->
<!-- {{ info.offRate !== 100 ? `,享受${info.offRate / 10}折优惠,已为您优惠${info.saveAmount}元` : '' }}-->
<!-- </view>-->
<div v-if="info.type === 0" class="my-20">
<p>备注和要求:</p>
<el-input v-model="remark" type="textarea"/>
</div>
<view class="mt-40 w-50p flex flex-col justify-center items-center m-a">
<text class=" mb-20"
:class="[info.amount !== info.offAmount ? 'text-line-through text-30' : 'text-main font-bold text-40']"
v-if="info">
订单金额:¥{{ info.amount }}
</text>
<text class="text-main font-bold text-40 mb-20" v-if="info && info.amount !== info.offAmount">
优惠后金额:¥{{ parseFloat(info.offAmount).toFixed(2) }}
</text>
<el-button type="primary" round
:disabled="(info.type === 0 && !address)" @click="onPay">
立即支付
</el-button>
</view>
<div class="pay-price" v-if="billQRCode">
<uv-qrcode ref="qrcode" size="240px" :value="billQRCode"></uv-qrcode>
<div class="pay-desc">微信、支付宝、云闪付扫码完成支付</div>
<el-button type="success" @click="onPayStatus">已完成支付</el-button>
</div>
</view> </view>
<gap height="50"/>
<common-footer></common-footer>
<right-bar></right-bar>
<el-dialog :visible.sync="dialogVisible" :title="dialogTitle" width="50%" :close-on-click-modal="false"
@close="dialogVisible = false">
<template v-if="dialogVisible && dialogType === 'address-list'">
<div v-for="(item, index) in addressList" :key="index"
class="py-20 border-bottom flex justify-between items-center">
<div class="flex flex-col justify-start items-start">
<div class="flex justify-start items-center">
<text v-if="item.isDefault" class="default-address">默</text>
<text class="font-bold">{{ item.name }}</text>
</div>
<text>{{ item.phone }}</text>
<text>{{ item.addressRegion.province.name }}{{
item.addressRegion.city.name
}}{{ item.addressRegion.area.name }}{{ item.addressDetail }}
</text>
</div>
<div class="flex justify-center items-center">
<el-button type="primary" @click="address = item; dialogVisible = false" size="small">
选择
</el-button>
<el-button type="warning" @click="addressEdit(item)" plain size="small" class="mt-20">
编辑
</el-button>
</div>
</div>
<div class="text-center">
<el-button plain @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="dialogType = 'address-action'; dialogTitle = '新增地址'">
新增地址
</el-button>
</div>
</template>
<div class="flex flex-col justify-start" v-else-if="dialogVisible && dialogType === 'address-action'">
<el-form ref="form" label-width="100px">
<el-row :gutter="10" class="mb-20">
<el-col :span="12">
<el-form-item label="收件人姓名">
<el-input v-model="name" placeholder="请输入收件人姓名"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="收件人手机号">
<el-input v-model="phone" placeholder="请输入收件人手机号"/>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="收件人地址">
<el-row :gutter="10">
<el-col :span="6">
<el-select v-model="addressIndex[0]" placeholder="请选择省" class="w-100p">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="6">
<el-select v-model="addressIndex[1]" placeholder="请选择市" class="w-100p"
:disabled="addressIndex.length === 0">
<template v-if="addressIndex[0] !== null">
<el-option v-for="(item, index) in cityData[addressIndex[0]]" :key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="6">
<el-select v-model="addressIndex[2]" placeholder="请选择区" class="w-100p"
:disabled="addressIndex.length === 1">
<template v-if="addressIndex[0] !== null && addressIndex[1] !== null">
<el-option v-for="(item, index) in areaData[addressIndex[0]][addressIndex[1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="详细地址">
<el-input v-model="addressDetail" placeholder="请输入详细地址"/>
</el-form-item>
<el-form-item label="默认地址">
<el-switch v-model="isDefault"/>
</el-form-item>
</el-form>
<div class="flex justify-center items-center">
<el-button type="primary" @click="onAddressAction">保存</el-button>
<el-button @click="dialogTitle = '地址列表'; dialogType = 'address-list'">取消</el-button>
</div>
</div>
</el-dialog>
</view>
</template> </template>
<script> <script>
@@ -99,131 +204,347 @@ import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json"; import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json"; import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
import dayjs from "dayjs"; import dayjs from "dayjs";
import {Loading} from "element-ui";
import {getUserLevelLabel} from "../../../util";
const OpenSdk = require('../../user/lib/base').default; const OpenSdk = require('../../user/lib/base').default;
const sdk = new OpenSdk({ const sdk = new OpenSdk({
appId: '10037e6f6823b20801682b6a5e5a0006', // appId: '10037e6f6823b20801682b6a5e5a0006',
appKey: '1c4e3b16066244ae9b236a09e5b312e8' // appKey: '1c4e3b16066244ae9b236a09e5b312e8'
// 正式
appId: '8a81c1db8fc5238d01910b9e312d0692',
appKey: 'a15ceac60f5b464eb758c4fe7800ee9f'
// 测试分账
// appId: 'f0ec96ad2c3848b5b810e7aadf369e2f',
// appKey: '775481e2556e4564985f5439a5e6a277'
}) })
// const mid = '8984501521190CF'
// const tid = '20713432'
const mid = '898450100002303'
const tid = 'G5SBN2XJ'
// const mid = '898310060514001'
// const tid = '00000001'
export default { export default {
name: "order", name: "order",
data() { data() {
return { return {
id: null, id: null,
info: { info: {
type: null type: null,
}, offRate: 100
provinceData: provinces, },
cityData: citys, provinceData: provinces,
areaData: areas, cityData: citys,
addressIndex: [null, null, null], areaData: areas,
addressDetail: '', addressIndex: [null, null, null],
name: '', addressDetail: '',
phone: '', name: '',
billQRCode: null, phone: '',
checkPayInterval: null, billQRCode: null,
} checkPayInterval: null,
}, dialogVisible: false,
methods: { dialogTitle: '',
async getInfo() { dialogType: '',
this.info = await vk.callFunction({ address: null,
url: 'client/order/kh/getInfo', addressList: [],
data: { selectedAddressId: null,
id: this.id isDefault: false,
} remark: ''
})
if (this.info.orderStatus === 1) {
this.$message({
type: 'success',
message: '订单已支付成功'
})
setTimeout(() => {
this.$router.push({
path: '/pages/user/order',
})
}, 1000)
}
},
async onPay() {
if (this.info.type === 0) {
if (this.addressIndex.length > 2 && this.addressIndex[2] === null) {
await vk.callFunction({
url: 'client/order/kh/updateAddress',
data: {
id: this.id,
address: [provinces[this.addressIndex[0]], citys[this.addressIndex[0]][this.addressIndex[1]], areas[this.addressIndex[0]][this.addressIndex[1]][this.addressIndex[2]]],
addressDetail: this.addressDetail,
phone: this.phone,
name: this.name,
}
})
}
}
const requestTimestamp = dayjs().format('YYYY-MM-DD HH:mm:ss')
const timestamp = dayjs().format('YYYYMMDDHHmmss')
const goods = []
let goodsName = this.info.goods[0].goodsName
goods.push({goodsName})
if (this.info.goods.length > 1) goodsName += `等${this.info.goods.length - 1}件商品`
let data = {
queryUrl: 'https://test-api-open.chinaums.com/v1/netpay/bills/get-qrcode',
timestamp,
nonce: 'rp84ufhfn20yneo3tp',
content: {
billNo: this.info.orderNo,
requestTimestamp,
mid: '898201612345678',
tid: '88880001',
instMid: 'QRPAYDEFAULT',
totalAmount: 1,
notifyUrl: 'https://fc-mp-0737e52b-fffa-4223-bcdf-d4ad3d9968a5.next.bspapp.com/pay_notify',
goods
}
}
/**
* 调用函数
*/
sdk.exec(data).then(res => {
const h = this.$createElement;
const result = JSON.parse(res);
if (result.errCode === 'SUCCESS') {
this.showQrcode = true
this.billQRCode = result.billQRCode
setTimeout(() => {
this.checkPayInterval = setInterval(() => {
this.getInfo()
}, 1000)
}, 3000)
}
})
},
},
onLoad(options) {
if (options && options.id) {
this.id = options.id
this.getInfo()
}
},
onUnload() {
if (this.checkPayInterval) clearInterval(this.checkPayInterval)
} }
},
methods: {
getUserLevelLabel,
async getInfo(resetOrderNo = false) {
this.info = await vk.callFunction({
url: 'client/order/kh/getInfo',
data: {
id: this.id,
resetOrderNo
}
})
if (this.info.name) {
this.address = {
name: this.info.name,
phone: this.info.phone,
addressDetail: this.info.addressDetail,
addressRegion: {
province: this.info.address.province,
city: this.info.address.city,
area: this.info.address.area,
},
}
}
if (this.info.orderStatus === -1) {
this.$message.error('订单已取消')
if (this.checkPayInterval) clearInterval(this.checkPayInterval)
vk.redirectTo({
url: '/pages/order/order?menuIndex=1',
})
}
if ([1, 4].includes(this.info.orderStatus)) {
if (this.checkPayInterval) clearInterval(this.checkPayInterval)
this.$message({
type: 'success',
message: '订单已支付成功'
})
setTimeout(() => {
if ([7, 11].includes(this.info.type)) {
vk.navigateBack()
} else if (this.info.type === 13) {
vk.redirectTo({
url: '/pages/contract/index?tab=sign',
})
} else if (this.info.type === 10) {
vk.redirectTo({
url: '/pages/index/old/release',
})
} else {
vk.redirectTo({
url: '/pages/order/order?menuIndex=1',
})
}
}, 1000)
}
},
async onPay() {
if (this.info.type === 0) {
if (!this.address) return this.$message({type: 'error', message: '请选择地址'})
await vk.callFunction({
url: 'client/order/kh/updateAddress',
data: {
id: this.id,
address: {
province: this.address.addressRegion.province,
city: this.address.addressRegion.city,
area: this.address.addressRegion.area,
},
addressDetail: this.address.addressDetail,
phone: this.address.phone,
name: this.address.name,
remark: this.remark,
}
})
}
// await vk.callFunction({
// url: 'client/user/pub/pay',
// data: {
// orderNo: this.info.orderNo,
// billStatus: 'PAID',
// billPayment: JSON.stringify({
// payTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
// receiptAmount: this.info.offAmount * 100,
// paySeqId: 'asdasd'
// })
// }
// })
// this.checkPayInterval = setInterval(() => {
// this.getInfo()
// }, 1000)
// return
const requestTimestamp = dayjs().format('YYYY-MM-DD HH:mm:ss')
const timestamp = dayjs().format('YYYYMMDDHHmmss')
// 平台分账金额
let platformAmount = 0
const goodsList = []
// let goodsName = this.info.goods[0].goodsName
// goods.push({goodsName})
// if (this.info.goods.length > 1) goodsName += `等${this.info.goods.length - 1}件商品`
let subOrderAmount = 0
this.info.goods.forEach((goods, index) => {
const goodsData = {
goodsName: goods.goodsName
}
if (goods.company && goods.company.merchantCode && goods.company.settleRate) {
// subOrderAmount += parseInt((goods.company.settleRate * goods.price).toString())
// goodsData['subOrderAmount'] = parseInt((goods.company.settleRate * goods.price).toString())
subOrderAmount += 9
goodsData['subOrderAmount'] = 9
goodsData['subMerchantId'] = goods.company.merchantCode
goodsData['merOrderId'] = this.info.orderNo + index
}
goodsList.push(goodsData)
})
if (subOrderAmount > 0) platformAmount = this.info.offAmount * 100 - subOrderAmount
// let data = {
// queryUrl: 'https://test-api-open.chinaums.com/v1/inip/upsp/shop/csb/get-qrcode',
// sysSource: 'OPT',
// vaMchntNo: mid,
// vaTermNo: tid,
// timestamp,
// nonce: 'rp84ufhfn20yneo3tp',
// billNo: this.info.orderNo,
// totalAmount: 10,
// notifyUrl: 'https://www.jinjiuxinzg.cn/pay_notify',
// vaFld:
// }
let attachedData = this.info.goods[0].goodsName
if (this.info.goods.length > 1) attachedData += `等${this.info.goods.length - 1}件商品`
let data = {
queryUrl: 'https://api-mop.chinaums.com/v1/netpay/bills/get-qrcode',
timestamp,
nonce: 'rp84ufhfn20yneo3tp',
content: {
billNo: this.info.orderNo,
requestTimestamp,
mid,
tid,
instMid: 'QRPAYDEFAULT',
totalAmount: parseInt(this.info.offAmount * 100).toFixed(0),
notifyUrl: 'https://tcb-n44byxi8bmrfrki-d4bn1c4a206d.service.tcloudbase.com/pay_notify',
// notifyUrl: 'https://www.jinjiuxinzg.cn/pay_notify',
goods: goodsList,
attachedData,
billDesc: attachedData,
}
}
if (platformAmount > 0) {
data['divisionFlag'] = true
data['platformAmount'] = platformAmount
}
console.log(data)
/**
* 调用函数
*/
const loadingInstance = Loading.service({fullscreen: true, text: '请求中'});
sdk.exec(data).then(res => {
this.$nextTick(() => {
loadingInstance.close();
});
const h = this.$createElement;
const result = JSON.parse(res);
if (result.errCode === 'SUCCESS') {
this.showQrcode = true
this.billQRCode = result.billQRCode
setTimeout(() => {
this.checkPayInterval = setInterval(() => {
this.getInfo()
}, 1000)
}, 3000)
}
}).catch(err => {
this.$nextTick(() => {
loadingInstance.close();
});
this.$message({
type: 'error',
message: '服务器繁忙,请稍后再试或联系平台客服'
})
setTimeout(() => {
vk.redirectTo({
url: '/pages/order/order?activeName=0&menuIndex=1',
})
}, 1500)
})
},
async onAddressAction() {
if (!this.name) return this.$message({type: 'error', message: '请填写收件人姓名'})
if (!this.phone) return this.$message({type: 'error', message: '请填写收件人手机号'})
if (!this.addressDetail || this.addressIndex[2] === null) return this.$message({
type: 'error',
message: '请填写地址'
})
const province = this.provinceData[this.addressIndex[0]]
const city = this.cityData[this.addressIndex[0]][this.addressIndex[1]]
const area = this.areaData[this.addressIndex[0]][this.addressIndex[1]][this.addressIndex[2]]
this.addressRegion = {
province: {code: province.code, name: province.name},
city: {code: city.code, name: city.name},
area: {code: area.code, name: area.name},
}
await vk.callFunction({
url: 'client/userAddress/kh/addUpdate',
data: {
id: this.selectedAddressId ?? null,
name: this.name,
phone: this.phone,
addressDetail: this.addressDetail,
addressRegion: this.addressRegion,
isDefault: this.isDefault
}
})
this.name = ''
this.phone = ''
this.addressDetail = ''
this.addressIndex = [null, null, null,]
this.dialogType = 'address-list'
this.dialogTitle = '地址列表'
await this.getUserAddress()
},
async getUserAddress() {
const {rows} = await vk.callFunction({
url: 'client/userAddress/kh/getList'
})
this.addressList = rows
},
showAddress() {
this.dialogType = 'address-list'
this.dialogTitle = '选择地址'
this.dialogVisible = true
},
addressEdit(item) {
this.selectedAddressId = item._id
this.name = item.name
this.phone = item.phone
this.addressDetail = item.addressDetail
this.addressIndex[0] = this.provinceData.findIndex(i => i.code === item.addressRegion.province.code)
this.addressIndex[1] = this.cityData[this.addressIndex[0]].findIndex(i => i.code === item.addressRegion.city.code)
this.addressIndex[2] = this.areaData[this.addressIndex[0]][this.addressIndex[1]].findIndex(i => i.code === item.addressRegion.area.code)
this.dialogType = 'address-action';
this.dialogTitle = ' 编辑地址'
}
},
onLoad(options) {
if (options && options.id) {
this.id = options.id
this.getInfo(true)
this.getUserAddress()
}
},
beforeDestroy() {
if (this.checkPayInterval) clearInterval(this.checkPayInterval)
},
onUnload() {
if (this.checkPayInterval) clearInterval(this.checkPayInterval)
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.goods-cover { .goods-cover {
width: 100px; width: 100px;
height: 100px; height: 100px;
} }
.pay-price { .pay-price {
margin-top: 20px; margin-top: 20px;
} }
.pay-desc { .pay-desc {
font-size: 16px; font-size: 16px;
line-height: 2em; line-height: 2em;
}
.address:hover {
border: 1px solid #a92924;
background-color: #f1c7c7;
}
.default-address {
background-color: #a92924;
color: #fff;
font-size: 14px;
width: 20px;
height: 20px;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 5px;
padding: 2px;
} }
</style> </style>
+294 -208
View File
@@ -1,63 +1,89 @@
<template> <template>
<view> <view>
<top-bar></top-bar> <top-bar></top-bar>
<common-header></common-header> <common-header></common-header>
<category-bar></category-bar> <category-bar></category-bar>
<view class="w-1200"> <view class="w-1200">
<u-swiper :list="list" :height="380" borderRadius="0"></u-swiper> <common-swiper page="shop"/>
<view class="tool-bar"> <view class="tool-bar">
<view class="search"> <view class="search">
<text>地区:</text> <el-row :gutter="10" flex justify="center" align="center">
<el-cascader :options="options" :props="{label: 'name', value: 'code'}" v-model="address" <el-col :span="8">
@change="getGoodsList()" clearable/> <el-input v-model="keyword" placeholder="请输入商品名称" clearable @clear="getGoodsList()"
</view> @keyup.enter.native="getGoodsList()" class="w-100"/>
<view class="buy-btn"> </el-col>
<image src="https://oss.wsdns.cn/20231204/bcc976f4396e437abf19deb11c1f06b4.png" mode="widthFix"/> <el-col :span="10">
</view> <view class="flex justify-start items-center">
</view> <text class="text-25">特产地区:</text>
<view class="tool-bar"> <el-cascader :options="options" :props="{label: 'name', value: 'code'}"
<view class="item">分类:</view> v-model="address"
<view class="item" @click="selectCate(null)">全部</view> @change="getGoodsList()" clearable/>
<view class="item" v-for="(item, index) in categoryList" :key="index" </view>
@click="selectCate(item._id)" </el-col>
:class="[categoryId === item._id? 'active' : '']">{{ item.name }} <el-col :span="6">
</view> <image src="https://oss.wsdns.cn/20231204/bcc976f4396e437abf19deb11c1f06b4.png"
</view> mode="widthFix"/>
</el-col>
</el-row>
</view> </view>
</view>
<view class="goods-list"> <view class="tool-bar">
<view class="flex flex-wrap justify-start is-status"> <view class="item">分类:</view>
<view class="w-20p" v-for="(item, index) in goodsList" :key="index"> <view class="item" @click="selectCate(null)">全部</view>
<view class="p-20"> <view class="item" v-for="(item, index) in categoryList" :key="index"
<view class="grid-content bg-purple pointer" @click="selectCate(item._id)"
@click="navTo(`/pages/index/shop/detail?id=${item._id}`)"> :class="[categoryId === item._id? 'active' : '']">{{ item.name }}
<image :src="item.cover" mode="aspectFill"/>
<view class="comments">
<view class="goods-name">
{{ item.name }}
</view>
<view class="goods-price">¥{{ item.amount }}</view>
</view>
</view>
</view>
</view>
</view>
<div class="pagination">
<el-pagination
background
layout="prev, pager, next"
:total="total"
:page-size="pageSize"
@click="getGoodsList"
>
</el-pagination>
</div>
</view> </view>
<!-- 现货市场 end --> </view>
<gap height="50"/>
<right-bar></right-bar>
<common-footer></common-footer>
</view> </view>
<div class="m-a w-1200 flex justify-start items-center flex-wrap" v-if="adLoaded">
<div v-for="(ad, adIndex) in adList" :key="adIndex"
:style="{width: '600px'}">
<template v-if="ad.length > 0">
<el-carousel :height="`100px`" class="m-a">
<el-carousel-item v-for="(item, index) in ad" :key="index" :style="{width: '600px'}">
<image @click="vk.navigateTo(`/pages/yellowPage/info?id=${item.companyId}`)"
class="pointer" :src="item.swiper" mode="aspectFill"
:style="{width: '100%', height: '100px'}"/>
</el-carousel-item>
</el-carousel>
</template>
</div>
</div>
<view class="goods-list">
<view class="flex flex-wrap justify-start is-status">
<view class="w-20p " v-for="(item, index) in goodsList" :key="index">
<view class="p-20 ">
<view class="grid-content bg-purple pointer pos-r"
@click="navTo(`/pages/index/shop/detail?id=${item._id}`)">
<text class="recommend" v-if="item.recommend === 1">荐</text>
<image :src="item.cover" mode="aspectFill"/>
<view class="comments">
<view class="goods-name" style="height: 60px">
{{ item.name }}
</view>
<view class="goods-price">¥{{ item.amount }}</view>
</view>
</view>
</view>
</view>
</view>
<div class="pagination">
<el-pagination
background
layout="prev, pager, next"
:total="total"
:page-size="pageSize"
@click="getGoodsList"
>
</el-pagination>
</div>
</view>
<!-- 现货市场 end -->
<gap height="50"/>
<right-bar></right-bar>
<common-footer></common-footer>
</view>
</template> </template>
<script> <script>
@@ -66,184 +92,244 @@ import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json"; import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
export default { export default {
components: {UGap}, components: {UGap},
data() { data() {
return { return {
categoryList: [], categoryList: [],
goodsList: [], goodsList: [],
list: [ options: [],
{ address: [],
image: 'https://cdn.uviewui.com/uview/swiper/1.jpg', pageIndex: 1,
title: '昨夜星辰昨夜风,画楼西畔桂堂东' pageSize: 20,
}, total: 0,
{ categoryId: null,
image: 'https://cdn.uviewui.com/uview/swiper/2.jpg', keyword: null,
title: '身无彩凤双飞翼,心有灵犀一点通' adList: [],
}, adNum: 0,
{ adLoaded: false
image: 'https://cdn.uviewui.com/uview/swiper/3.jpg', };
title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳' },
} async onLoad(options) {
], await this.getCategoryList()
options: [], if (options && options.menu) this.currMenu = options.menu
address: [], if (options && options.keyword) this.keyword = options.keyword
pageIndex: 1, if (options && options.cateName) {
pageSize: 20, const cate = this.categoryList.find(item => item.name === options.cateName)
total: 0, if (cate) this.categoryId = cate._id
categoryId: null
};
},
onLoad(options) {
if (options && options.menu) {
this.currMenu = options.menu
}
this.options = provinces.map(item => {
item.children = [];
return item
})
this.options.forEach((province, index) => {
citys[index].forEach(city => {
this.options[index].children.push(city)
})
})
this.getCategoryList()
this.getGoodsList()
},
methods: {
menuSelect(e) {
this.currMenu = e
},
navTo(url) {
vk.navigateTo(url);
},
getCategoryList() {
vk.callFunction({
url: 'client/goods/category/pub/getList'
}).then(res => {
this.categoryList = res.rows
})
},
getGoodsList(pageIndex = 1) {
vk.callFunction({
url: 'client/goods/list/pub/getList',
data: {
pageIndex,
pageSize: this.pageSize,
city: this.address.length > 1 ? this.address[1] : null,
parentId: this.categoryId
}
}).then(res => {
this.goodsList = res.rows
})
},
selectCate(cateId) {
if (this.categoryId === cateId) this.categoryId = null
else this.categoryId = cateId
this.getGoodsList()
}
} }
this.options = provinces.map(item => {
item.children = [];
return item
})
this.options.forEach((province, index) => {
citys[index].forEach(city => {
this.options[index].children.push(city)
})
})
console.error(this.options)
this.getGoodsList()
},
methods: {
menuSelect(e) {
this.currMenu = e
},
navTo(url) {
vk.navigateTo(url);
},
async getCategoryList() {
const res = await vk.callFunction({
url: 'client/goods/category/pub/getList'
})
this.categoryList = res.rows
},
getGoodsList(pageIndex = 1) {
vk.callFunction({
url: 'client/goods/list/pub/getList',
data: {
pageIndex,
pageSize: this.pageSize,
city: this.address.length > 1 ? this.address[1] : null,
parentId: this.categoryId,
keyword: this.keyword
}
}).then(res => {
this.goodsList = res.rows
this.getAdList()
})
},
selectCate(cateId) {
if (this.categoryId === cateId) this.categoryId = null
else this.categoryId = cateId
this.getGoodsList()
},
async getAdList() {
this.adList = [[], [], [], [], []]
if (this.address.length === 0) {
if (!this.categoryId) {
for (let i = 0; i < 5; i++) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 27 + i
}
})
if (res.data) this.adList[i] = res.data
}
} else {
const cate = this.categoryList.find(item => item._id === this.categoryId)
if (cate.ad && cate.ad.length > 0) {
cate.ad.forEach(item => {
this.adList[item.adKey - 27].push(item)
})
}
}
} else {
for (let i = 0; i < 5; i++) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 27 + i,
region: this.address[0]
}
})
if (res.data) this.adList[i] = res.data
// rows.forEach(item => {
// if (item.businessCard.album && item.businessCard.album.length > 0) {
// this.adList[i].push({
// swiper: Array.isArray(item.businessCard.album) ? item.businessCard.album[0] : item.businessCard.album,
// companyId: item._id
// })
// }
// })
}
}
this.adNum = 0
for (let i = 0; i < 5; i++) {
if (this.adList[i].length > 0) {
this.adNum += 1
}
}
this.adLoaded = true
this.$forceUpdate()
},
}
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.w-1200 { .w-1200 {
width: 1200px; width: 1200px;
margin: 20px auto; margin: 20px auto;
background-color: #fff; background-color: #fff;
.test { .test {
height: 50px; height: 50px;
color: #ffffff; color: #ffffff;
font-size: 18px; font-size: 18px;
background-color: #bf2b28; background-color: #bf2b28;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
text { text {
margin: 0 20px; margin: 0 20px;
} }
}
.tool-bar {
display: flex;
justify-content: flex-start;
align-items: center;
padding: 20px;
font-size: 16px;
.search {
display: flex;
align-items: center;
} }
.tool-bar { .item {
display: flex; margin-right: 10px;
justify-content: flex-start; cursor: pointer;
align-items: center;
padding: 20px;
font-size: 16px;
.search {
display: flex;
align-items: center;
}
.item {
margin-right: 10px;
cursor: pointer;
}
.item:hover, .active {
color: #bf2b28;
}
} }
.item:hover, .active {
color: #bf2b28;
}
}
} }
.wrap { .wrap {
flex-wrap: wrap; flex-wrap: wrap;
} }
.goods-list { .goods-list {
width: 1200px; width: 1200px;
margin: 20px auto; margin: 20px auto;
.grid-content { .grid-content {
display: flex;
justify-content: center;
align-items: center;
background-color: #fff;
width: 100%;
padding: 10px;
margin-bottom: 10px;
flex-direction: column;
.comments {
display: flex;
flex-direction: column;
justify-content: start;
align-items: flex-start;
line-height: 2em;
width: 100%;
.goods-name {
font-size: 16px;
display: flex; display: flex;
justify-content: center; align-items: flex-start;
align-items: center; }
background-color: #fff;
width: 100%;
padding: 10px;
margin-bottom: 10px;
flex-direction: column;
.comments { .goods-price {
display: flex; color: #bf2b28;
flex-direction: column; font-size: 20px;
justify-content: start; font-weight: 600;
align-items: flex-start; }
line-height: 2em;
width: 100%;
.goods-name {
font-size: 16px;
display: flex;
align-items: center;
}
.goods-price {
color: #bf2b28;
font-size: 20px;
font-weight: 600;
}
}
} }
}
.bg-purple { .bg-purple {
border-top: 1px solid #f3f3f3; border-top: 1px solid #f3f3f3;
border-right: 1px solid #f3f3f3; border-right: 1px solid #f3f3f3;
image { image {
width: 180px; width: 180px;
height: 180px; height: 180px;
}
} }
}
} }
.pagination { .pagination {
width: 1200px; width: 1200px;
margin: 20px auto; margin: 20px auto;
display: flex; display: flex;
justify-content: center; justify-content: center;
}
.recommend {
position: absolute;
right: 0;
top: 0;
padding: 5px;
background-color: #bf2b28;
color: white;
font-size: 30rpx;
z-index: 999;
} }
</style> </style>
+39
View File
@@ -0,0 +1,39 @@
<template>
<el-form ref="form" label-width="80px">
<el-form-item label="物流公司">
{{ info.expressName }}
</el-form-item>
<el-form-item label="物流单号">
{{ info.expressNo }}
</el-form-item>
<el-form-item label="发货单">
<el-image v-for="(item, index) in info.expressPhoto" :key="index" :src="item"
class="mr-10 mb-10"
:preview-src-list="info.expressPhoto" style="width: 100px;height: 100px"/>
</el-form-item>
<el-form-item label="备注">
{{ info.remark }}
</el-form-item>
<div class="mt-20 flex justify-center items-center text-center">
<el-button type="primary" size="small" plain @click.native="close">关闭</el-button>
</div>
</el-form>
</template>
<script>
export default {
name: "expressInfo",
props: {
info: Object
},
data() {
return {}
},
methods: {
close() {
this.$emit('close')
},
}
}
</script>
+131
View File
@@ -0,0 +1,131 @@
<template>
<view>
<view class="py-20">
<el-row :gutter="10">
<el-col :span="12">
<text class="text-35 font-bold">商品信息</text>
</el-col>
<el-col :span="4">
<text class="text-35 font-bold flex-1">单价</text>
</el-col>
<el-col :span="4">
<text class="text-35 font-bold flex-1">数量</text>
</el-col>
<el-col :span="4">
<text class="text-35 font-bold flex-1">金额</text>
</el-col>
</el-row>
</view>
<view class="p-20 mb-20" v-for="(item, index) in goods" :key="index">
<el-row :gutter="10">
<el-col :span="12">
<view class="flex justify-start items-start">
<el-image :src="item.goods.cover" class="cover ml-20" fit="fit" v-if="item.goods"/>
<view class="flex flex-col justify-start items-start ml-20">
<text class="font-bold mb-15">{{ item.goodsName }}</text>
<text class="text-gray" v-if="order.type === 0">{{ item.sku.label }}</text>
</view>
</view>
</el-col>
<el-col :span="4">
<text class="text-35 font-bold flex-1" v-if="order.type === 0">¥{{ item.sku.values }}</text>
<text class="text-35 font-bold flex-1" v-else>¥{{ item.goodsPrice }}</text>
</el-col>
<el-col :span="4">
<text class="text-35 font-bold flex-1">
x{{ item.num }}
</text>
</el-col>
<el-col :span="4">
<text class="text-35 font-bold flex-1 text-main" v-if="order.type === 0">¥{{
parseFloat(item.sku.values) * item.num
}}
</text>
<text class="text-35 font-bold flex-1 text-main" v-else>¥{{
parseFloat(item.goodsPrice) * item.num
}}
</text>
</el-col>
</el-row>
</view>
<view v-if="order.type === 1">
<p class="text-35 font-bold mb-25">服务详情</p>
<el-descriptions border :column="2">
<el-descriptions-item label="考察对象" v-if="selfProduct.type === 0">
<div style="margin-bottom: .5rem" v-for="(item, index) in selfProduct.contentList" :key="index">
<span>{{ item.name }}</span>
<template v-if="item.type && item.type === '个人'">
({{
item.code
}})--{{ item.addressRegion.province.name }}{{
item.addressRegion.city.name
}}{{ item.addressRegion.area.name }}{{ item.address }}
</template>
</div>
</el-descriptions-item>
<el-descriptions-item label="考察产品" v-else>
<p style="margin-bottom: .5rem" v-for="(item, index) in selfProduct.contentList" :key="index">{{
item.name
}}--{{ item.addressRegion.province.name }}{{
item.addressRegion.city.name
}}{{ item.addressRegion.area.name }}{{ item.address }}</p>
</el-descriptions-item>
<el-descriptions-item label="接收文件电子邮箱">
<span>{{ selfProduct.email }}</span>
</el-descriptions-item>
<el-descriptions-item label="接收文件微信">
<span>{{ selfProduct.wechat }}</span>
</el-descriptions-item>
<el-descriptions-item label="接收文件寄件地址">
<span v-if="selfProduct.receiveAddressRegion.province">{{
selfProduct.receiveAddressRegion.province.name
}}{{ selfProduct.receiveAddressRegion.city.name }}{{
selfProduct.receiveAddressRegion.area.name
}}{{ selfProduct.receiveAddress }}</span>
</el-descriptions-item>
<el-descriptions-item label="申请人">
<span>{{ selfProduct.requestName }}</span>
</el-descriptions-item>
<el-descriptions-item label="业务联系人">
<span>{{ selfProduct.contactName }}</span>
</el-descriptions-item>
<el-descriptions-item label="业务联系方式">
<span>{{ selfProduct.contact }}</span>
</el-descriptions-item>
<el-descriptions-item label="结果文件" v-if="order && order.resultFiles">
<div v-for="(item, index) in order.resultFiles" :key="index">
<a :href="item"
target="_blank">预览:文件{{ index + 1 }}</a>
</div>
</el-descriptions-item>
<el-descriptions-item label="发送途径" v-if="order && order.sendMethod">{{ order.sendMethod }}
</el-descriptions-item>
</el-descriptions>
</view>
</view>
</template>
<script>
export default {
name: "goods",
props: {
goods: Array,
order: Object,
selfProduct: Object,
},
data() {
return {}
},
methods: {}
}
</script>
<style lang="scss" scoped>
.cover {
width: 80px;
height: 80px;
}
</style>
+191
View File
@@ -0,0 +1,191 @@
<template>
<view>
<div class="font-bold">
<span>订单编号: {{ orderInfo.orderNo }}</span>
<span class="ml-20 text-main" v-if="orderInfo.orderStatus > 1">(已发货)</span>
</div>
<div class="font-bold my-25">订单总额: {{ orderInfo.amount }}元</div>
<el-form ref="form" label-width="80px">
<el-form-item label="支付类型" required >
<el-select v-model="payInfo.type" @change="changeType">
<el-option
v-for="item in payTypeList"
:key="item"
:label="item"
:value="item"
:disabled="(!['预付款', '货到付款', '全款'].includes(item) && orderInfo.payStatus === 0)
|| (['预付款', '货到付款', '全款'].includes(item) && orderInfo.payStatus > 0)"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="payInfo.type" required>
<el-input v-model="payInfo.amount" placeholder="请输入金额"/>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="payInfo.remark"/>
</el-form-item>
<template v-if="[0, 1].includes(orderInfo.orderStatus)">
<el-row :gutter="10">
<el-col :span="6">
<el-form-item label="是否发货">
<el-radio-group v-model="payInfo.isExpress"
:disabled="['货到付款', '全款'].includes(payInfo.type)">
<el-radio :label="true">是</el-radio>
<el-radio :label="false">否</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<!-- <el-col :span="12">-->
<!-- <el-form-item label="物流公司" required>-->
<!-- <el-input v-model="payInfo.expressName" placeholder="请输入物流公司"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="物流单号" required>-->
<!-- <el-input v-model="payInfo.expressNo" placeholder="请输入物流单号"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
</el-row>
<el-form-item label="凭证" v-if="!payInfo.isExpress">
<vk-data-upload v-model="payInfo.photos"></vk-data-upload>
</el-form-item>
<el-form-item label="凭证" v-else required>
<vk-data-upload v-model="payInfo.expressPhoto"></vk-data-upload>
</el-form-item>
</template>
<el-form-item label="附件">
<vk-data-upload v-model="payInfo.ext"></vk-data-upload>
</el-form-item>
</el-form>
<el-row>
<el-col :span="24" class="text-center">
<el-button type="primary" size="mini" @click="setPayList">提交</el-button>
<el-button type="warning" size="mini" @click="close">取消
</el-button>
</el-col>
</el-row>
</view>
</template>
<script>
export default {
name: "makePay",
props: {
info: {
type: Object,
default: () => {
return {}
}
},
payTypeList: {
type: Array,
default: () => {
return []
}
},
},
data() {
return {
payInfo: {
orderId: this.info._id,
amount: null,
type: null,
remark: '',
buyerRemark: '',
photos: [],
payerUid: null,
hasPaid: false,
paidVoucher: '',
paidAt: '',
sellerConfirm: false,
confirmAt: '',
buyerUid: this.info.uid,
sellerUid: this.info.sellerUid,
status: 0,
buyerRefuse: false,
refuseReason: null,
buyerPhotos: [],
expressPhoto: [],
isExpress: false,
expressName: null,
expressNo: null,
ext: [],
},
orderInfo: {
payStatus: 0
}
}
},
methods: {
close() {
this.$emit("close")
},
async getOrderInfo() {
this.orderInfo = await vk.callFunction({
url: 'client/order/kh/getInfo',
data: {
id: this.info._id
}
})
},
async setPayList() {
if (!this.payInfo.type) return this.$message({
type: 'error',
message: '请选择支付类型'
})
if (!this.payInfo.amount) return this.$message({
type: 'error',
message: '请输入支付金额'
})
if (this.payInfo.isExpress && this.payInfo.expressPhoto.length === 0) return this.$message({
type: 'error',
message: '请上传凭证'
})
// if (this.payInfo.isExpress && !this.payInfo.expressName) return this.$message({
// type: 'error',
// message: '请输入物流公司'
// })
// if (this.payInfo.isExpress && !this.payInfo.expressNo) return this.$message({
// type: 'error',
// message: '请输入物流单号'
// })
if (this.payInfo.isExpress) {
this.$confirm('发货状态一旦确定无法修改,请谨慎操作', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
await vk.callFunction({
url: 'client/order/kh/makePay',
title: '请求中...',
data: {payInfo: this.payInfo}
})
this.$message({
type: 'success',
message: '支付单创建成功'
})
this.close()
})
} else {
await vk.callFunction({
url: 'client/order/kh/makePay',
title: '请求中...',
data: {payInfo: this.payInfo}
})
this.$message({
type: 'success',
message: '支付单创建成功'
})
this.close()
}
},
changeType() {
this.payInfo.isExpress = ['货到付款', '全款'].includes(this.payInfo.type)
console.log(this.payInfo.isExpress, this.payInfo.type)
}
},
mounted() {
this.getOrderInfo()
}
}
</script>
+195
View File
@@ -0,0 +1,195 @@
<template>
<view>
<view style="margin-bottom: 16px; padding: 12px; background: #fff8e8; color: #8a5a00; line-height: 1.7;">
<view>服务提供方(卖家):请于系统确认支付方已依照协议或约定支付对应订单款项后,再启动对应服务。申请款项付款方在系统端完成划款授权确认操作后,款项到账时间约为工作日T+1,请届时查询确认。</view>
<view style="margin-top: 8px;">服务需求方(买家):请于依照交易规则和协议完成对应服务验收后,再在系统端完成对应申请款项的授权确认操作,系统默认确认时限为72小时(含工作日,届时系统仅提供信息提醒服务),请及时完成该项确认。若您届时未确认且未提出正当异议,系统将默认您已收货或同意支付申请。</view>
</view>
<view v-for="(item, index) in payList" :key="index" class="py-20 border-bottom">
<el-descriptions :title="item.type" :column="2" border :labelStyle="{width: '120px'}">
<template slot="extra">
<div class="flex justify-start items-center">
<template v-if="!item.buyerRefuse">
<el-button plain type="primary" size="mini" @click="showPay(item)"
v-if="item.status === 0 && item.isBuyer && !item.hasPaid">上传支付凭证
</el-button>
<el-button type="primary" size="mini" class="mx-20" @click="confirmPay(item)"
v-if="item.hasPaid && item.isSeller && !item.sellerConfirm">
确认收款
</el-button>
<el-button plain type="primary" size="mini" class="mx-20" @click="paidRefuse(item)"
v-if="item.isBuyer && item.status === 0 && !item.paidVoucher">
驳回
</el-button>
</template>
</div>
</template>
<el-descriptions-item label="支付金额">{{ item.amount }}</el-descriptions-item>
<el-descriptions-item label="支付凭证">
<template v-if="!item.buyerRefuse">
<span v-if="item.isSeller && !item.hasPaid">待买方支付</span>
<view v-else-if="item.paidVoucher">
<el-image :src="item.paidVoucher[0]" style="width: 80px; height: 80px" fit="cover"
:preview-src-list="item.paidVoucher"/>
</view>
<view v-else-if="!item.paidVoucher">
<span>未上传凭证</span>
</view>
</template>
<span v-else class="text-main">买家已拒绝: {{ item.refuseReason }}</span>
</el-descriptions-item>
<el-descriptions-item label="交货凭证">
<el-image v-for="(photo, photoIndex) in item.expressPhoto" :key="photoIndex" :src="photo"
style="width: 80px; height: 80px" fit="cover"
:preview-src-list="item.expressPhoto"/>
</el-descriptions-item>
<el-descriptions-item label="备注">
<text>{{ item.remark ? item.remark : '无' }}</text>
</el-descriptions-item>
<el-descriptions-item label="买家备注">
<text>{{ item.buyerRemark ? item.buyerRemark : '无' }}</text>
</el-descriptions-item>
<el-descriptions-item label="图片">
<template v-if="item.photos && item.photos.length > 0">
<el-image v-for="(photo, photoIndex) in item.photos" :key="photoIndex" :src="photo"
style="width: 80px; height: 80px" fit="cover"
:preview-src-list="item.photos"/>
</template>
<span v-else>无</span>
</el-descriptions-item>
<el-descriptions-item label="我方状态">
<template v-if="item.isSeller">
<span v-if="!item.hasPaid && !item.buyerRefuse">待上传凭证</span>
<span v-if="!item.sellerConfirm && item.hasPaid">待确认收款</span>
<span v-if="item.sellerConfirm && item.hasPaid">已完成</span>
</template>
<template v-if="item.isBuyer">
<span v-if="!item.hasPaid && !item.buyerRefuse">待上传凭证</span>
<span v-if="!item.sellerConfirm && item.hasPaid">完成支付</span>
<span v-if="item.sellerConfirm && item.hasPaid">已完成</span>
</template>
</el-descriptions-item>
<el-descriptions-item label="对方状态">
<!-- 自己是卖家则对方是买家-->
<template v-if="item.isSeller">
<span v-if="!item.hasPaid && !item.buyerRefuse">待上传凭证</span>
<span v-if="!item.sellerConfirm && item.hasPaid">完成支付</span>
<span v-if="item.sellerConfirm && item.hasPaid">已完成</span>
</template>
<template v-if="item.isBuyer">
<span v-if="!item.hasPaid && !item.buyerRefuse">待上传凭证</span>
<span v-if="!item.sellerConfirm && item.hasPaid">待确认收款</span>
<span v-if="item.sellerConfirm && item.hasPaid">已完成</span>
</template>
</el-descriptions-item>
</el-descriptions>
</view>
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="50%" append-to-body="">
<template v-if="dialogVisible && dialogType === 'do-pay'">
<div class="font-bold">支付金额: {{ payInfo.amount }}元</div>
<el-form ref="form" label-width="80px">
<el-form-item label="支付凭证" required>
<vk-data-upload v-model="payInfo.paidVoucher"></vk-data-upload>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="payInfo.buyerRemark"/>
</el-form-item>
<el-form-item label="图片">
<vk-data-upload v-model="payInfo.buyerPhotos"></vk-data-upload>
</el-form-item>
</el-form>
<el-row>
<el-col :span="24" class="text-center">
<el-button type="primary" size="mini" @click="uploadPayVoucher">提交</el-button>
<el-button type="warning" size="mini" @click="dialogVisible = false">取消
</el-button>
</el-col>
</el-row>
</template>
</el-dialog>
</view>
</template>
<script>
import ExpressInfo from "./expressInfo.vue";
import Goods from "./goods.vue";
import SetExpress from "./setExpress.vue";
import MakePay from "./makePay.vue";
export default {
name: "payList",
components: {MakePay, SetExpress, Goods, ExpressInfo},
props: {
payList: {
type: Array,
default: []
}
},
data() {
return {
dialogVisible: false,
dialogType: '',
dialogTitle: '',
payInfo: null
}
},
methods: {
showPay(item) {
this.payInfo = item;
this.dialogTitle = '支付'
this.dialogType = 'do-pay';
this.dialogVisible = true;
},
async confirmPay({_id, type}) {
await vk.callFunction({
url: 'client/order/kh/paidConfirm',
title: '请求中...',
data: {
id: _id
}
})
this.$message({
type: 'success',
message: '确认成功'
})
if (['尾款', '货到付款'].includes(type)) this.$emit('refresh', '4')
else this.$emit('refresh')
},
paidRefuse({_id}) {
this.$prompt('请输入驳回理由', '提示', {
showCancelButton: true,
showInput: true,
}).then(async ({value}) => {
await vk.callFunction({
url: 'client/order/kh/payRefuse',
title: '请求中...',
data: {
id: _id,
refuseReason: value,
}
})
this.$emit('refresh')
this.$message({
type: 'success',
message: '驳回成功'
})
})
},
async uploadPayVoucher() {
if (this.payInfo.paidVoucher.length === 0) return this.$message.error()
await vk.callFunction({
url: 'client/order/kh/uploadPayVoucher',
title: '请求中...',
data: this.payInfo
})
this.$message({
type: 'success',
message: '上传成功'
})
this.$emit('refresh')
this.dialogVisible = false
},
}
}
</script>
+84
View File
@@ -0,0 +1,84 @@
<template>
<el-form ref="form" label-width="80px">
<el-form-item label="客户信息" required>
<p>收件人: {{ info.name }}</p>
<p>收件人联系方式: {{ info.phone }}</p>
<p>收件地址: {{ info.addressRegion.province.name }}{{ info.addressRegion.city.name }}{{ info.addressRegion.area.name }}{{ info.addressDetail }}</p>
</el-form-item>
<el-form-item label="物流公司" required>
<el-input v-model="expressName" placeholder="请输入物流公司"/>
</el-form-item>
<el-form-item label="物流单号" required>
<el-input v-model="expressNo" placeholder="请输入物流单号"/>
</el-form-item>
<el-form-item label="发货单" required>
<vk-data-upload v-model="expressPhoto"></vk-data-upload>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="remark" placeholder="请输入备注"/>
</el-form-item>
<div class="mt-20 flex justify-center items-center text-center">
<el-button type="primary" size="small" plain @click.native="cancel">取消</el-button>
<el-button type="primary" size="small" @click.native="confirm">确定</el-button>
</div>
</el-form>
</template>
<script>
export default {
name: "setExpress",
props: {
id: Number | String,
info: Object
},
data() {
return {
expressName: null,
expressNo: null,
remark: null,
expressPhoto: [],
}
},
methods: {
close() {
this.$emit('close')
},
cancel() {
this.expressName = null
this.expressNo = null
this.remark = null
this.expressPhoto = []
this.$emit('close')
},
async confirm() {
if (!this.expressName) return this.$message({
type: 'error',
message: '请填写物流公司'
})
if (!this.expressNo) return this.$message({
type: 'error',
message: '请填写物流单号'
})
if (this.expressPhoto.length === 0) return this.$message({
type: 'error',
message: '请上传发货单'
})
await vk.callFunction({
url: 'client/order/kh/setExpress',
data: {
id: this.id,
expressName: this.expressName,
expressNo: this.expressNo,
remark: this.remark,
expressPhoto: this.expressPhoto
}
})
this.$emit('close')
this.$message({
type: 'success',
message: '发货成功'
})
}
}
}
</script>
+60
View File
@@ -0,0 +1,60 @@
<template>
<el-form ref="form" label-width="80px">
<el-form-item label="退款原因" required>
<el-input v-model="refundReason" placeholder="请输入退款原因"/>
</el-form-item>
<el-form-item label="图片">
<vk-data-upload v-model="refundPhotos"></vk-data-upload>
</el-form-item>
<div class="mt-20 flex justify-center items-center text-center">
<el-button type="primary" size="small" plain @click.native="cancel">取消</el-button>
<el-button type="primary" size="small" @click.native="confirm">确定</el-button>
</div>
</el-form>
</template>
<script>
export default {
name: "setRefund",
props: {
id: Number | String
},
data() {
return {
refundReason: null,
refundPhotos: [],
}
},
methods: {
close() {
this.$emit('close')
},
cancel() {
this.refundReason = null
this.refundPhotos = []
this.close()
},
async confirm() {
if (!this.refundReason) return this.$message({
type: 'error',
message: '请填写退款原因'
})
const res = await vk.callFunction({
url: 'client/order/kh/refund',
data: {
id: this.id,
refundReason: this.refundReason,
refundPhotos: this.refundPhotos,
}
}).catch(err => false)
if (res) {
this.$emit('close')
this.$message({
type: 'success',
message: '平台将在2个工作日内审核,请您耐心等待'
})
}
}
}
}
</script>
+141
View File
@@ -0,0 +1,141 @@
<template>
<view>
<el-descriptions title="金久信自营订单详情" :column="2" border :labelStyle="{width: '120px'}" v-if="info">
<el-descriptions-item label="服务">
<p v-for="(item, index) in orderInfo.goods" :key="index">{{ item.goodsName }}</p>
</el-descriptions-item>
<el-descriptions-item label="考察对象" v-if="info.type === 0">
<div style="margin-bottom: .5rem" v-for="(item, index) in info.contentList" :key="index">
<span>{{ item.name }}</span>
<template v-if="item.type && item.type === '个人' && item.addressRegion">
({{
item.code
}})--{{ item.addressRegion.province.name }}{{
item.addressRegion.city.name
}}{{ item.addressRegion.area.name }}{{ item.address }}
</template>
</div>
</el-descriptions-item>
<el-descriptions-item label="考察产品" v-else>
<p style="margin-bottom: .5rem" v-for="(item, index) in info.contentList" :key="index">{{
item.name
}}--{{ item.addressRegion.province.name }}{{
item.addressRegion.city.name
}}{{ item.addressRegion.area.name }}{{ item.address }}</p>
</el-descriptions-item>
<el-descriptions-item label="文档">
<div v-for="(item, index) in info.contentList" :key="index">
<template v-if="item.files">
<a v-for="(file, fileIndex) in item.files" :key="fileIndex" :href="file"
target="_blank">预览:文件{{ fileIndex + 1 }}</a>
</template>
</div>
</el-descriptions-item>
<el-descriptions-item label="接收文件电子邮箱">
<span>{{ info.email }}</span>
</el-descriptions-item>
<el-descriptions-item label="接收文件微信">
<span>{{ info.wechat }}</span>
</el-descriptions-item>
<el-descriptions-item label="接收文件寄件地址">
<span v-if="info.receiveAddressRegion.province">{{
info.receiveAddressRegion.province.name
}}{{ info.receiveAddressRegion.city.name }}{{
info.receiveAddressRegion.area.name
}}{{ info.receiveAddress }}</span>
</el-descriptions-item>
<el-descriptions-item label="申请人">
<span>{{ info.requestName }}</span>
</el-descriptions-item>
<el-descriptions-item label="业务联系人">
<span>{{ info.contactName }}</span>
</el-descriptions-item>
<el-descriptions-item label="业务联系方式">
<span>{{ info.contact }}</span>
</el-descriptions-item>
<el-descriptions-item label="接单公司" v-if="info.companyId">
<span>{{ info.company.company.companyName }}</span>
</el-descriptions-item>
<el-descriptions-item label="文件上传">
<vk-data-upload v-model="resultFiles"
:limit="9"
:on-preview="previewUpload"
accept=".jpg,.jpeg,.png,.xlsx,.doc,.docx,.pdf" list-type="text">
</vk-data-upload>
</el-descriptions-item>
<el-descriptions-item label="发送途径">
<el-select v-model="sendMethod" placeholder="请选择发送途径">
<el-option label="接收文件电子邮箱" value="接收文件电子邮箱"/>
<el-option label="接收文件微信" value="接收文件微信"/>
<el-option label="邮寄接收文件地址" value="邮寄接收文件地址"/>
</el-select>
</el-descriptions-item>
<template slot="extra">
<div class="flex justify-start items-center">
<el-button type="primary" size="mini" @click="setSend">确认完成
</el-button>
<el-button plain type="primary" size="mini" class="mx-20" @click="close">
关闭
</el-button>
</div>
</template>
</el-descriptions>
</view>
</template>
<script>
export default {
name: "setSend",
props: {
orderInfo: Object
},
data() {
return {
info: null,
sendMethod: null,
resultFiles: []
}
},
methods: {
async getInfo() {
const {data} = await vk.callFunction({
url: 'client/selfSupport/kh/getDetailByOrder',
data: {
orderId: this.orderInfo._id
}
})
this.info = data
},
async setSend() {
if (this.resultFiles.length === 0) {
vk.toast("请上传文件")
return
}
if (!this.sendMethod) {
vk.toast("请选择发送途径")
return
}
await vk.callFunction({
url: 'client/order/kh/changeOrderStatus',
data: {
id: this.orderInfo._id,
orderStatus: 3,
sendMethod: this.sendMethod,
resultFiles: this.resultFiles,
}
})
this.close()
},
close() {
this.$emit("close")
},
previewUpload({url}) {
window.open(url)
}
},
mounted() {
console.log(this.orderInfo)
this.getInfo()
}
}
</script>
+119
View File
@@ -0,0 +1,119 @@
<template>
<view>
<el-table :data="tableData.rows" style="width: 100%" border stripe>
<el-table-column prop="orderNo" label="订单号" width="200"/>
<el-table-column label="订单类型">
<template v-slot="{ row }">
<span>{{ row.type === 0 ? '普通订单' : '金久信自营订单' }}</span>
</template>
</el-table-column>
<el-table-column label="商品列表" width="250">
<template v-slot="{ row }">
<view class="flex flex-col justify-start items-start">
<view v-for="(item, index) in row.goods" :key="index"
class="flex justify-start items-start">
<image :src="item.goodsCover" class="goods-cover" v-if="row.type === 0"/>
<view class="ml-20 flex flex-col justify-start items-start">
<text class="text-main font-bold">{{ item.goodsName }}</text>
<text class="mt-20">¥{{ item.goodsPrice }}</text>
<text class="mt-20">x{{ item.num }}</text>
</view>
</view>
</view>
</template>
</el-table-column>
<el-table-column prop="amount" label="订单金额"/>
<el-table-column prop="payAmount" label="支付金额"/>
<el-table-column label="订单状态">
<template v-slot="{ row }">
<span v-if="row.orderStatus === 0">待支付</span>
<span v-if="row.orderStatus === 1">已支付</span>
<span v-if="row.orderStatus === 2">待收货</span>
<span v-if="row.orderStatus === 3">已完成</span>
</template>
</el-table-column>
<el-table-column prop="_add_time_str" label="下单时间"/>
<el-table-column label="操作">
<template v-slot="{ row }">
<text v-if="row.orderStatus === 0" class="text-main pointer" @click="repay(row)">去支付</text>
</template>
</el-table-column>
</el-table>
<view class="text-center mt-20">
<el-pagination
:page-size="pageSize"
@current-change="getOrderList"
background
layout="prev, pager, next"
:total="tableData.total">
</el-pagination>
</view>
</view>
</template>
<script>
export default {
name: "shopOrder",
props: {
tableData: Object
},
data() {
return {
tableData: [],
activeIndex: 0,
pageSize: 20,
total: 0,
}
},
methods: {
async repay(row) {
await vk.callFunction({
url: 'client/order/kh/resetOrderNo',
data: {
id: row._id,
}
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${row._id}`
})
},
getOrderList(index){
this.$emit('change-page', index)
}
},
onLoad(options) {
}
}
</script>
<style lang="scss" scoped>
.main-wrap {
width: 1200px;
margin: 20px auto;
position: relative;
.left-wrap {
position: absolute;
width: 220px;
left: -240px;
top: 0;
view {
padding: 20px;
}
.active {
background-color: #a92924;
color: white;
}
}
}
.goods-cover {
width: 80px;
height: 80px;
}
</style>
+959 -778
View File
File diff suppressed because it is too large Load Diff
+43 -31
View File
@@ -1,40 +1,52 @@
<template> <template>
<view> <view>
<top-bar></top-bar> <top-bar></top-bar>
<common-header></common-header> <!-- <common-header></common-header>-->
<category-bar></category-bar> <!-- <category-bar></category-bar>-->
<gap height="50"/> <gap height="50"/>
<view class="w-1200 m-a bg-white p-40"> <view class="w-1200 m-a bg-white p-40">
<view class="text-50 font-bold">{{ info.name }}</view> <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 class="mt-20 text-gray text-28 pb-20 border-bottom">{{
<view v-html="info.content" class="mt-20"></view> info._update_time ? info._update_time : info._add_time_str
</view> }}</view>
<gap height="50"/> <view v-html="info.content" class="mt-20"></view>
<common-footer></common-footer>
</view> </view>
<gap height="50"/>
<common-footer></common-footer>
</view>
</template> </template>
<script> <script>
export default { export default {
name: "detail", name: "detail",
data() { data() {
return { return {
info: { info: {
name: '', name: '',
content: '' content: ''
} }
}
},
onLoad(option) {
if (option.id) this.getInfo(option.id);
},
methods: {
async getInfo(id) {
this.info = await vk.callFunction({
url: `client/otherArticle/list/pub/getDetail`,
data: {id}
});
}
} }
},
onLoad(option) {
if (option.id) {
this.getInfo(option.id);
this.addViewNum(option.id);
}
},
methods: {
async getInfo(id) {
const res = await vk.callFunction({
url: `client/otherArticle/list/pub/getDetail`,
data: {id}
});
this.info = res
},
addViewNum(_id){
vk.callFunction({
url: `client/otherArticle/list/pub/addViewNum`,
data: {_id}
});
}
}
} }
</script> </script>
+56 -3
View File
@@ -1,13 +1,66 @@
<template> <template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<gap height="50"/>
<view class="w-1200 m-a bg-white p-40">
<view v-for="(item, index) in list" :key="index"
@click="navTo(item._id)"
class="py-30 border-bottom flex justify-between items-center pointer">
<text class="font-bold">{{ item.name }}</text>
<text class="text-gray">{{ item._add_time_str }}</text>
</view>
<view class="text-center">
<el-pagination
:page-size="pageSize"
@current-change="getList"
background
layout="prev, pager, next"
:total="total">
</el-pagination>
</view>
</view>
<gap height="50"/>
<common-footer></common-footer>
</view>
</template> </template>
<script> <script>
export default { export default {
name: "list", name: "list",
data() { data() {
return {} return {
list: [],
parentId: null,
pageSize: 20,
total: 0,
}
}, },
methods: {} methods: {
getList(pageIndex) {
vk.callFunction({
url: 'client/otherArticle/list/pub/getList',
pageSize: this.pageSize,
pageIndex,
data: {
parentId: this.parentId
},
success: res => {
this.list = res.rows;
this.total = res.total;
}
})
},
navTo(id) {
vk.navigateTo({
url: `/pages/otherArticle/detail?id=${id}`
})
}
},
onLoad(options) {
if (options) this.parentId = options.id;
this.getList();
}
} }
</script> </script>
+514 -288
View File
@@ -1,261 +1,487 @@
<template> <template>
<view> <view>
<top-bar></top-bar> <top-bar></top-bar>
<common-header></common-header> <common-header></common-header>
<category-bar></category-bar> <category-bar></category-bar>
<view class="page-main" v-if="info"> <view class="page-main" v-if="info">
<view class="flex justify-between items-center"> <view class="flex justify-between items-center">
<text class="text-gray">加工询价单编号:{{ info.orderNo }}</text> <text class="text-gray">加工询价单编号:{{ info.orderNo }}</text>
<text class="text-gray">发布时间:{{ info._add_time_str }}</text> <text class="text-gray">发布时间:{{ info._add_time_str }}</text>
</view> </view>
<view class="my-25 flex justify-between items-center"> <view class="my-25 flex justify-between items-center">
<view class="flex justify-start items-center"> <view class="flex justify-start items-center">
<text class="text-40 font-bold">{{ info.title }}</text> <text class="text-40 font-bold">{{ info.title }}</text>
<view class="ml-20 flex justify-start items-center"> <view class="ml-20 flex justify-start items-center">
<building-one theme="outline" size="24" fill="#a92924" strokeLinecap="square"/> <building-one theme="outline" size="24" fill="#a92924" strokeLinecap="square"/>
<view class="text-main "> <view class="text-main ">
<text class="mx-20">{{ info.quoteList.rows.length }}</text> <text class="mx-20">{{ info.quoteList.rows.length }}</text>
<text>家已报价</text> <text>家已报价</text>
</view>
</view>
</view>
<view class="flex justify-end items-end"
v-if="info.answerEndTime && dayjs().diff(dayjs(info.answerEndTime), 'second') < 0">
<text>距离加工结束还有:</text>
<view class="border-main countdown text-main">{{
dayjs(info.answerEndTime).diff(dayjs(), 'day')
}}
</view>
<text>天</text>
<view class="border-main countdown text-main">
{{ (dayjs(info.answerEndTime).diff(dayjs(), 'hour')) % 24 }}
</view>
<text>时</text>
</view>
</view>
<view class="my-25 flex justify-between items-center pb-20 border-bottom">
<view class="flex justify-start items-center">
<id-card theme="outline" size="24" fill="#a92924" strokeLinecap="square"/>
<text class="ml-15 text-gray">
{{ info.user.accountType === 1 ? info.user.person.personName : info.user.company.companyName }}
</text>
</view>
<el-button type="primary" @click.native="toQuote"
v-if="vk.getVuex('$user.userInfo._id') !== info.userId && info.status === 0">我要申请加工
</el-button>
<el-button type="primary" @click.native="showDialog = true"
v-else-if="vk.getVuex('$user.userInfo._id') === info.userId">查看收到的申请加工
</el-button>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
上传的附件
</view>
</view>
</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
加工商其他要求
</view>
</view>
</view>
<view class="mt-15">{{ info.remark }}</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
纳税和税票
</view>
</view>
</view>
<view class="mt-15">是否含税:{{ info.invoice ? '含税' : '不含税' }}</view>
<view class="mt-15">开票时间:{{ WRITE_INVOICE_TIME[info.writeInvoiceTime] }}</view>
<view class="mt-15">发票种类:{{ INVOICE_TYPE[info.invoiceType] }}</view>
<view class="mt-15">其他要求:{{ info.invoiceOther }}</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
运输要求
</view>
</view>
</view>
<view class="mt-15">随货资料:{{ info.transportDocuments.join() }}</view>
<view class="mt-15">其他要求:{{ info.otherTransportDocuments }}</view>
<view class="mt-15">运输限制要求:{{ info.transportLimit ? '有' : '无' }}</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
交易说明
</view>
</view>
</view>
<view class="mt-15">付款方式:{{ PROCESS_PAY_METHOD[info.payMethod] }}</view>
<view class="mt-15">报价形式:{{ info.offerType === 0 ? '整单报价' : '可分项报价' }}</view>
<view class="mt-15">报价期限:
<text v-if="info.answerStartTime && info.answerEndTime">{{
dayjs(info.answerStartTime).format('YYYY-MM-DD')
}}~{{ dayjs(info.answerEndTime).format('YYYY-MM-DD') }}
</text>
</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
简易合同备注和其他补充条款
</view>
</view>
</view>
<view class="mt-15">违约责任:</view>
<view class="mt-15">
1.乙方所交产品品种、型号、规格、质量不符合规定的,如果甲方同意利用,应当按质论价;如果甲方不能利用的,应根据产品的具体情况,由乙方负责包换或包修,并承担修理、调换或退货而支付的实际费用;2.乙方不予供货违约责任为甲方的实际损失+违约金,如乙方材料符合订货标准,甲方不能退货和不收货,甲方无条件应按实际本合同订货数量支付100%货款,并支付乙方因此产生的实际费用。带有甲乙双方单位相关收货人和发货人签字的本合同的发货清单事项和内容均视为本合同的补充合同,与本合同有相同的法律效力,双方应共同遵照执行。
</view>
<view class="mt-15">解决纠纷的方法:</view>
<view class="mt-15">
1、凡因本合同引起的或与本合同有关的任何争议,均可友好协商或仲裁解决,协商或仲裁不成的,双方协商同意在合同签订地人民法院管辖地起诉,违约一方或对合同争议承担主要责任的一方,应承担对方因仲裁和起诉而产生的全部律师代理费、鉴定(检验)费、诉讼保全费、诉讼保险费、公告费、差旅费、执行费、误工費和获取证据产生费用等其他相关费用。2、双方本合同相关权利放弃均应有双方书面作出并加盖公章或授权委托人签字后生效。
</view>
<view class="mt-15">不可抗力:</view>
<view class="mt-15">
甲乙双方的任何一方由于不可抗力或突发公共事件的原因不能履行合同时,应及时向对方通报不能履行或不能完全履行的理由,以减轻可能给对方造成的损失,在取得有关机构证明以后,允许延期履行、部分履行或者不履行合同,并根据情况可部分或全部免予承担违约责任。
</view>
<view class="mt-15">其他:</view>
<view class="mt-15">
本合同的全部内容由双方平等共同协商一致,共同起草制定,非一方事先拟定,不属于格式条款。本合同自双方签字盖章后生效(包括电子签字、盖章),按本合同内容地址、联系方式寄送的一切文书、函件送达与否,均为视为送达有法律效力,通知途径和本合同内联系方式或地址送达文件双方均予以验证。
</view>
<view class="mt-15">采购方补充条款: 供货方逾期供货承担采购方一切损失</view>
<view class="mt-15"> 供应方补充条款:</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
已收到的加工申请
</view>
</view>
</view>
<view class="mt-15">
<view class="request-header">
<text class="flex-1">加工商</text>
<text class="flex-1">申请时间</text>
</view>
<view class="quote" v-for="(item, index) in info.quoteList.rows" :key="index">
<text class="flex-1">{{
item.user.accountType === 1 ? item.user.person.personName : item.user.company.companyName
}}
</text>
<text class="flex-1">{{ item._add_time_str }}</text>
</view>
</view>
</view> </view>
</view>
</view> </view>
<common-footer></common-footer> <view class="flex justify-end items-end"
<el-dialog :visible.sync="showDialog" width="70%" :show-close="false"> v-if="info.answerEndTime && dayjs(info.answerEndTime).diff(dayjs(), 'second') > 0">
<view slot="title" class="text-main text-40 m-30 flex justify-between items-center"> <text>距离加工结束还有:</text>
<text>收到的加工申请</text> <view class="border-main countdown text-main">{{
<el-button type="primary" @click.native="showDialog = false">关闭</el-button> dayjs(info.answerEndTime).diff(dayjs(), 'day')
}}
</view>
<text>天</text>
<view class="border-main countdown text-main">
{{ (dayjs(info.answerEndTime).diff(dayjs(), 'hour')) % 24 }}
</view>
<text>时</text>
</view>
</view>
<view class="my-25 flex justify-between items-center pb-20 border-bottom">
<view class="flex justify-start items-center">
<id-card theme="outline" size="24" fill="#a92924" strokeLinecap="square"/>
<text class="ml-15 text-gray" v-if="info.user">
{{ info.user.accountType === 1 ? info.user.person.personName : info.user.company.companyName }}
</text>
</view>
<el-button type="primary" @click.native="toQuote" :disabled="info.disabled"
v-if="vk.getVuex('$user.userInfo._id') !== info.userId && info.status === 0">{{
info.disabled ? '已超时无法报价' : '我要申请合作'
}}
</el-button>
<el-button type="primary" @click.native="showDialog = true"
v-else-if="vk.getVuex('$user.userInfo._id') === info.userId">查看收到的申请合作
</el-button>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
上传的附件
</view> </view>
<view class="mt-15" v-if="info && info.quoteList"> </view>
<view class="request-header"> </view>
<text class="flex-1">加工商</text> <view class="mt-15 mr-15" v-if="info.files">
<text class="flex-1">报价</text> <file-type :item="item" v-for="(item, index) in info.files" :key="index" @click.native="openDownload(item)"/>
<text class="flex-1">申请时间</text> </view>
<text class="flex-1">操作</text> </view>
</view>
<view class="quote" v-for="(item, index) in info.quoteList.rows" :key="index"> <view class="item-wrap">
<text class="flex-1">{{ <view class="form-title-wrap">
item.user.accountType === 1 ? item.user.person.personName : item.user.company.companyName <view class="goods-info-title">
}} <view class="form-title">
</text> 加工产品交货地址
<text class="flex-1">{{ item.totalPrice }}元</text>
<text class="flex-1">{{ item._add_time_str }}</text>
<text class="flex-1">
<el-button type="primary" @click.native="createContract(item)" v-if="info.status === 0">选择</el-button>
</text>
</view>
</view> </view>
</el-dialog> </view>
</view>
<view class="mt-15">{{
info.addressRegion ? `${info.addressRegion.province.name}${info.addressRegion.city.name}${info.addressRegion.area ? info.addressRegion.area.name : ''}` : ``
}}{{
info.addressDetail ? info.addressDetail : ''
}}
</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
加工商其他要求
</view>
</view>
</view>
<view class="mt-15">{{ info.remark }}</view>
<template v-if="info.multiFiles">
<file-type :item="item" v-for="(item, index) in info.multiFiles" :key="index"
@click.native="openDownload(item)"/>
<!-- <el-image :src="item" v-for="(item, index) in info.multiFiles" :key="index" style="width: 100px; height: 100px" fit="cover"-->
<!-- :preview-src-list="info.multiFiles"/>-->
</template>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
主要商品
</view>
</view>
</view>
<view class="mt-15">{{ info.title }}</view>
<view class="mt-15">加工产品简述:{{ info.detail }}</view>
<view class="mt-15">加工量:{{ info.num }}</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
纳税和税票
</view>
</view>
</view>
<view class="mt-15">是否含税:{{ info.invoice ? '含税' : '不含税' }}</view>
<view class="mt-15">开票时间:{{ WRITE_INVOICE_TIME[info.writeInvoiceTime] }}</view>
<view class="mt-15" v-if="info.invoiceOther">税票要求:{{ info.invoiceOther }}</view>
<template v-else>
<view class="mt-15">纳税人身份:{{ info.taxType ? info.taxType : '无' }}</view>
<view class="mt-15">发票种类:{{ info.invoiceType ? info.invoiceType : '无' }}</view>
<view class="mt-15">税率:{{ info.taxRate ? info.taxRate : '无' }}</view>
</template>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
运输要求
</view>
</view>
</view>
<view class="mt-15" v-if="info.transportDocuments && info.transportDocuments.length > 0">
随货资料:{{ info.transportDocuments.join() }}
</view>
<view class="mt-15" v-if="info.otherTransportDocuments">其他要求:{{ info.otherTransportDocuments }}</view>
<view class="mt-15">运输限制要求:{{ info.transportLimit ? '有' : '无' }}</view>
<view class="mt-15" v-if="info.transportLimit && info.otherTransportRequest">
运输限制说明:{{ info.otherTransportRequest }}
</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
交易模式
</view>
</view>
</view>
<view class="mt-15">{{ info.tradeMethod === 0 ? '自主交易' : '金久信公证' }}</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
交易说明
</view>
</view>
</view>
<!-- <view class="mt-15" v-if="info.payMethod === 0">付款方式:{{ PROCESS_PAY_METHOD[info.payMethod] }}{{-->
<!-- info.payMethod === 0 ? `${info.advancePayRate}%货到付全款` : ''-->
<!-- }}{{ info.payMethod === 3 ? `${info.reputationPayDay}天` :-->
<!-- ( info.payMethod === 4 ? `:${info.otherPayMethod}` : '') }}-->
<!-- </view>-->
<view class="mt-15" v-if="info.payMethod === 0">付款方式:预付{{ info.advancePayRate }}%货到付全款</view>
<view class="mt-15" v-if="info.payMethod === 1">付款方式:加工验收合格后付全款</view>
<view class="mt-15" v-if="info.payMethod === 3">付款方式:加工验收合格后{{
info.reputationPayDay
}}天内支付全款
</view>
<view class="mt-15">报价形式:{{ info.offerType === 0 ? '整单报价' : '可分项报价' }}</view>
<view class="mt-15">报价期限:
<text v-if="info.answerStartTime && info.answerEndTime">{{
dayjs(info.answerStartTime).format('YYYY-MM-DD')
}}~{{ dayjs(info.answerEndTime).format('YYYY-MM-DD') }}
</text>
</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
交易保证金要求
</view>
</view>
</view>
<view class="mt-15">{{ info.earnestMoney }}</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
采购商信息
</view>
</view>
</view>
<view class="mt-15" v-if="info.companyName">
公司信息:{{ info.companyName ? info.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6") : '' }}
</view>
<view class="mt-15" v-if="info.companyMobile">公司联系方式:{{
info.companyMobile ? info.companyMobile.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : ''
}}
</view>
<view class="mt-15" v-if="info.businessName">
授权业务咨询人:{{ info.businessName ? info.businessName.replace(/^(.).*(.)$/, "$1***$2") : '' }}
</view>
<view class="mt-15" v-if="info.businessMobile">业务咨询联系方式:{{
info.businessMobile ? info.businessMobile.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : ''
}}
</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
签约模式
</view>
</view>
</view>
<view class="mt-15">{{
info.signMethod === 0 ? '线上签约-标准合同' : (info.signMethod !== 1 ? '线上签约-双方协商合同' : '线下签约')
}}
</view>
</view>
<view class="item-wrap" v-if="info.signMethod === 0">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
简易合同备注和其他补充条款
</view>
</view>
</view>
<view class="mt-15">违约责任:</view>
<view class="mt-15">
1.乙方所交产品品种、型号、规格、质量不符合规定的,如果甲方同意利用,应当按质论价;如果甲方不能利用的,应根据产品的具体情况,由乙方负责包换或包修,并承担修理、调换或退货而支付的实际费用;2.乙方不予供货违约责任为甲方的实际损失+违约金,如乙方材料符合订货标准,甲方不能退货和不收货,甲方无条件应按实际本合同订货数量支付100%货款,并支付乙方因此产生的实际费用。带有甲乙双方单位相关收货人和发货人签字的本合同的发货清单事项和内容均视为本合同的补充合同,与本合同有相同的法律效力,双方应共同遵照执行。
</view>
<view class="mt-15">解决纠纷的方法:</view>
<view class="mt-15">
1、凡因本合同引起的或与本合同有关的任何争议,均可友好协商或仲裁解决,协商或仲裁不成的,双方协商同意在合同签订地人民法院管辖地起诉,违约一方或对合同争议承担主要责任的一方,应承担对方因仲裁和起诉而产生的全部律师代理费、鉴定(检验)费、诉讼保全费、诉讼保险费、公告费、差旅费、执行费、误工費和获取证据产生费用等其他相关费用。2、双方本合同相关权利放弃均应有双方书面作出并加盖公章或授权委托人签字后生效。
</view>
<view class="mt-15">不可抗力:</view>
<view class="mt-15">
甲乙双方的任何一方由于不可抗力或突发公共事件的原因不能履行合同时,应及时向对方通报不能履行或不能完全履行的理由,以减轻可能给对方造成的损失,在取得有关机构证明以后,允许延期履行、部分履行或者不履行合同,并根据情况可部分或全部免予承担违约责任。
</view>
<view class="mt-15">其他:</view>
<view class="mt-15">
本合同的全部内容由双方平等共同协商一致,共同起草制定,非一方事先拟定,不属于格式条款。本合同自双方签字盖章后生效(包括电子签字、盖章),按本合同内容地址、联系方式寄送的一切文书、函件送达与否,均为视为送达有法律效力,通知途径和本合同内联系方式或地址送达文件双方均予以验证。
</view>
<view class="mt-15">采购方补充条款: {{ info.supplementary }}</view>
</view>
<template v-else-if="info.signMethod === 2">
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
合同附件
</view>
</view>
</view>
</view>
<view v-for="(item, index) in info.contractAttachment" :key="index" class="mr-25 my-25">
<file-type :item="item" @click.native="openDownload(item)"/>
</view>
</template>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
已收到的加工申请
</view>
</view>
</view>
<view class="mt-15">
<view class="request-header">
<text class="flex-1">加工商</text>
<text class="flex-1">申请时间</text>
</view>
<view class="quote" v-for="(item, index) in info.quoteList.rows" :key="index">
<text class="flex-1" v-if="info.user">{{
item.user.accountType === 1 ? item.user.person.personName : item.user.company.companyName
}}
</text>
<text class="flex-1">{{ item._add_time_str }}</text>
</view>
</view>
</view>
</view> </view>
<common-footer></common-footer>
<el-dialog :visible.sync="showDialog" width="70%" :show-close="false">
<view slot="title" class="text-main text-40 m-30 flex justify-between items-center">
<text>收到的加工合作申请</text>
<el-button type="primary" @click.native="showDialog = false">关闭</el-button>
</view>
<view class="mt-15" v-if="info && info.quoteList">
<view class="request-header">
<text class="flex-1">加工商</text>
<text class="flex-1">报价</text>
<text class="flex-1">附件</text>
<text class="flex-1">补充条款</text>
<text class="flex-1">报价详情</text>
<text class="flex-1">申请时间</text>
<text class="flex-1">操作</text>
</view>
<view class="quote" v-for="(item, index) in info.quoteList.rows" :key="index">
<text class="flex-1" v-if="info.user">{{
item.user.accountType === 1 ? item.user.person.personName : item.user.company.companyName
}}
</text>
<text class="flex-1">{{ item.totalPrice }}元</text>
<view class="flex-1">
<view class="flex-1">
<!-- <view class="mt-15 mr-15" v-for="(item, index) in item.files" :key="index">-->
<!-- <template v-if="['doc', 'docx'].includes(item.split('.').pop())">-->
<!-- <file-word theme="outline" class="pointer" size="40" fill="#4a90e2" strokeLinecap="square"-->
<!-- @click.native="openDownload(item)"/>-->
<!-- </template>-->
<!-- <template v-else-if="['xls', 'xlsx'].includes(item.split('.').pop())">-->
<!-- <file-excel theme="outline" class="pointer" size="40" fill="#417505" strokeLinecap="square"-->
<!-- @click.native="openDownload(item)"/>-->
<!-- </template>-->
<!-- <template v-else-if="['pdf'].includes(item.split('.').pop())">-->
<!-- <file-pdf-one theme="outline" class="pointer" size="40" fill="#f5a623"-->
<!-- strokeLinecap="square"-->
<!-- @click.native="openDownload(item)"/>-->
<!-- </template>-->
<!-- <template v-else>-->
<!-- <el-image :src="item" style="width: 100px; height: 100px" fit="cover"-->
<!-- :preview-src-list="[item]"/>-->
<!-- </template>-->
<!-- </view>-->
<file-type :item="file" v-for="(file, fileIndex) in item.files" :key="fileIndex"
@click.native="openDownload(file)"/>
</view>
</view>
<view class="flex-1 flex flex-col justify-start items-start">
<text>采购方补充条款:{{ info.supplementary ? info.supplementary : '无' }}</text>
<text>加工方补充条款:{{ item.supplierExt ? item.supplierExt : '无' }}</text>
</view>
<text class="flex-1">{{ item.remark }}</text>
<text class="flex-1">{{ item._add_time_str }}</text>
<text class="flex-1">
<el-button type="primary" @click.native="createContract(item)" v-if="info.status === 0">选择
</el-button>
</text>
</view>
</view>
</el-dialog>
</view>
</template> </template>
<script> <script>
import {BuildingOne, IdCard} from '@icon-park/vue' import {BuildingOne, FileExcel, FilePdfOne, FileWord, IdCard} from '@icon-park/vue'
import dayjs from "dayjs"; import dayjs from "dayjs";
import {WRITE_INVOICE_TIME, INVOICE_TYPE, PROCESS_PAY_METHOD} from '@/util' import {WRITE_INVOICE_TIME, INVOICE_TYPE, PROCESS_PAY_METHOD} from '@/util'
import FileType from "../../components/file-type/file-type.vue";
export default { export default {
components: {BuildingOne, IdCard}, components: {FileType, FileWord, FilePdfOne, FileExcel, BuildingOne, IdCard,},
data() { data() {
return { return {
WRITE_INVOICE_TIME, WRITE_INVOICE_TIME,
INVOICE_TYPE, INVOICE_TYPE,
PROCESS_PAY_METHOD, PROCESS_PAY_METHOD,
id: null, id: null,
info: null, info: null,
showDialog: false showDialog: false
}; };
}, },
methods: { methods: {
dayjs, dayjs,
getInfo() { getInfo() {
vk.callFunction({ vk.callFunction({
url: 'client/process/sheet/pub/getInfo', url: 'client/process/sheet/pub/getInfo',
data: { data: {
id: this.id id: this.id
}
}).then((res) => {
this.info = res
})
},
toQuote() {
vk.navigateTo(`/pages/process/quote?sheetId=${this.id}`)
},
createContract({totalPrice, uid, _id}) {
vk.callFunction({
url: 'client/contract/kh/add',
data: {
type: 'process',
productTitle: this.info.title,
transactionId: vk.pubfn.createOrderNo("P", 20),
sheetId: this.id,
quoteId: _id,
buyer: vk.getVuex('$user.userInfo._id'),
seller: uid,
amount: totalPrice,
partyCount: 2,
signCount: 0,
}
}).then((res) => {
this.$message({
message: '选择成功',
type: 'success'
})
setTimeout(() => {
vk.navigateTo('/pages/contract/index')
}, 1500)
})
} }
}).then((res) => {
this.info = res
this.info.disabled = (!this.info.answerEndTime || dayjs(this.info.answerEndTime).isBefore(dayjs()))
})
}, },
onLoad(option) { async toQuote() {
if (!option.id) vk.navigateBack() const {userInfo, accountNum} = await vk.callFunction({
this.id = option.id url: 'user/kh/getMyUserInfo'
this.getInfo() })
if (userInfo.factoryStatus !== 1) return this.$message.error('非加工厂,无法报价,请去个人中心申请加工厂')
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (accountNum === 0) {
this.$confirm('请先到个人中心添加收款账户', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=account'});
})
} else {
if (userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
if (this.info.earnestMoney && this.info.earnestMoney > 0 && userInfo.paidEnsure < this.info.earnestMoney) {
this.$confirm('保证金不足,是否去充值保证金?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=grade'});
})
return
}
vk.navigateTo(`/pages/process/quote?sheetId=${this.id}`)
}
},
createContract({totalPrice, uid, _id}) {
vk.callFunction({
url: 'client/contract/kh/add',
title: '请求中...',
data: {
type: 'process',
productTitle: this.info.title,
transactionId: vk.pubfn.createOrderNo("P", 20),
sheetId: this.id,
quoteId: _id,
buyer: vk.getVuex('$user.userInfo._id'),
seller: uid,
amount: totalPrice,
partyCount: 2,
signCount: 0,
}
}).then((res) => {
this.$message({
message: '选择成功',
type: 'success'
})
this.showDialog = false
setTimeout(() => {
if (this.info.signMethod === 0) vk.navigateTo('/pages/contract/index?tab=1')
else {
if (this.info.signMethod === 1) vk.navigateTo('/pages/store/buyer?menuIndex=0')
else vk.navigateTo('/pages/contract/index?tab=0')
}
}, 1500)
})
},
openDownload(url) {
window.open(url)
} }
},
onLoad(option) {
if (!option.id) vk.navigateBack()
this.id = option.id
this.getInfo()
}
} }
</script> </script>
@@ -263,68 +489,68 @@ export default {
@import "@/common/css/app.scss"; @import "@/common/css/app.scss";
.page-main { .page-main {
width: 1200px; width: 1200px;
margin: 20px auto; margin: 20px auto;
background-color: #FFFFFF; background-color: #FFFFFF;
padding: 20px; padding: 20px;
border-radius: 5px; border-radius: 5px;
} }
.countdown { .countdown {
padding: 2px 5px; padding: 2px 5px;
margin: 0 5px; margin: 0 5px;
} }
.item-wrap { .item-wrap {
margin: 24px 0; margin: 24px 0;
.form-title-wrap { .form-title-wrap {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; 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;
}
.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 { .request-header {
border: 1px solid #EDEDED; border: 1px solid #EDEDED;
background-color: #FFF8F1; background-color: #FFF8F1;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 15px; padding: 15px;
margin-top: 30px; margin-top: 30px;
text { text {
text-align: center; text-align: center;
} }
} }
.quote { .quote {
border-left: 1px solid #EDEDED; border-left: 1px solid #EDEDED;
border-right: 1px solid #EDEDED; border-right: 1px solid #EDEDED;
border-bottom: 1px solid #EDEDED; border-bottom: 1px solid #EDEDED;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 15px; padding: 15px;
text { text {
text-align: center; text-align: center;
} }
} }
</style> </style>
+577
View File
@@ -0,0 +1,577 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="page-nav">
<el-breadcrumb separator=">">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item>
<navigator style="display: inline-block;" url="/pages/index/process/list">找加工</navigator>
</el-breadcrumb-item>
<el-breadcrumb-item class="text-main">加工厂列表</el-breadcrumb-item>
</el-breadcrumb>
<el-row class="">
<el-button @click="toRelease" type="primary" round>发布加工单</el-button>
<el-button @click="toMyEnquiry" type="primary" round plain>我发布的加工单</el-button>
</el-row>
</view>
<view class="w-1200 m-a">
<common-swiper page="factory"/>
</view>
<!-- 筛选表单 -->
<view class="w-1200 m-a" style="margin-top: 30rpx">
<el-form @submit.native.prevent label-width="80px">
<el-form-item label="关键词:" class="border-bottom pb-30">
<el-input @keyup.enter.native="search(1)" clearable placeholder="输入关键字搜索" v-model="keyword">
<i slot="prefix" class="el-input__icon el-icon-search"></i>
<el-button @click="search(1)" type="primary" slot="append" style="border-radius: 0">搜索
</el-button>
</el-input>
</el-form-item>
<el-form-item label="分类:" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="selectCate({name: -1})" class="pointer mr-25"
:class="[(checkCategoryList.includes(-1) || checkCategoryList.length === 0) ? 'text-main selected-cate' : '']">全部
</text>
<view v-for="(item, index) in categoryTreeData" :key="index">
<text @click="selectCate(item)" class="pointer mr-25"
:class="[checkCategoryList.includes(item.name) ? 'text-main selected-cate' : '']">
{{ item.name }}
</text>
</view>
</view>
</el-form-item>
<el-form-item label="地区" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="selectProvince(-1)" class="pointer mr-25 flex-grow-0"
:class="[checkProvinceList.length === 0 ? 'text-main selected-cate' : '']">全国
</text>
<view v-for="(item, index) in provinceData" :key="index" class="flex-grow-0 pointer mr-25">
<text @click="selectProvince(item.code)"
:class="[checkProvinceList.includes(item.code)? 'text-main selected-cate' : '']">
{{ item.name }}
</text>
</view>
</view>
</el-form-item>
</el-form>
</view>
<div class="flex justify-between items-center w-1200 m-a">
<template v-if="ad12.length">
<el-carousel :height="`100px`" :style="{width: '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad12" :key="index" :style="{width: '100%'}">
<image @click="vk.navigateTo(`/pages/yellowPage/info?id=${item.companyId}`)"
class="pointer carousel-img" :src="item.swiper" mode="aspectFill"
:style="{width: '100%'}"/>
</el-carousel-item>
</el-carousel>
</template>
<template v-if="ad122.length">
<el-carousel :height="`100px`" :style="{width: '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad122" :key="index" :style="{width: '100%'}">
<image @click="vk.navigateTo(`/pages/yellowPage/info?id=${item.companyId}`)"
class="pointer carousel-img" :src="item.swiper" mode="aspectFill"
:style="{width: '100%'}"/>
</el-carousel-item>
</el-carousel>
</template>
</div>
<!-- 商品列表 -->
<view class="goods-list">
<view v-for="(item, index) in list.rows" :key="index" class="goods">
<view class="goods-info" @click="navTo(`/pages/yellowPage/factory?userId=${item.uid}`)">
<!-- <el-image src="https://oss.wsdns.cn/20231204/d35332fa6a3b4596b522edf9527ac612.png"-->
<!-- class="goods-img"/>-->
<view class="info">
<view class="field">
<view class="desc" style="width: 1000px">
<view class="text">加工主体</view>
<view class="font-bold" v-if="item.user">{{
item.user.accountType === 2 ? item.user.company.companyName : item.user.person.personName
}}
</view>
</view>
<view class="desc">
<view class="text">所在地区</view>
<view>{{ item.addressRegion.province.name }}{{ item.addressRegion.city.name }}</view>
</view>
<view class="desc">
<view class="text">成立年限</view>
<view>{{ item.year }}年</view>
</view>
<view class="desc">
<view class="text">年产值</view>
<view>{{ item.yearsIncome }}万元</view>
</view>
<view class="desc">
<view class="text">员工人数</view>
<view>{{ item.employeeNum }}人</view>
</view>
<view class="desc">
<view class="text">流水线数量</view>
<view>{{ item.flowNum }}条</view>
</view>
<view class="desc">
<view class="text">厂房归属</view>
<view>{{ item.blongTo }}</view>
</view>
<view class="desc">
<view class="text">厂房面积</view>
<view>{{ item.size }}㎡</view>
</view>
<view class="desc">
<view class="text">服务信息</view>
<view>{{ item.serviceInfo }}</view>
</view>
<view class="desc" v-if="item.mainSpotCategory && item.mainSpotCategory.length > 0">
<view class="text">主营类别</view>
<view>{{ item.mainSpotCategory.join() }}</view>
</view>
<view class="desc">
<view class="text">主营工艺和业务范围</view>
<view>{{ item.mainProcess }}</view>
</view>
</view>
</view>
</view>
<view class="buttons">
<button type="default" class="btn" plain @click="doShowContract(index)">查看电话
</button>
<button type="default" class="btn green mt-20" plain @click="doShowWechat(index)">添加微信
</button>
<button type="default" class="btn mt-20" plain @click="navTo(`/pages/yellowPage/factory?userId=${item.uid}`)">
查看详情
</button>
<view class="wechat"
v-if="item.user && parseInt(item.user.accountType) === 2 && item.user.businessCard && item.user.businessCard.companyWechat && item.showWechat">
<el-image :src="item.user.businessCard.companyWechat" style="width: 100%; height: 100%"/>
</view>
<view class="wechat"
v-if="item.user && parseInt(item.user.accountType) === 1 && item.user.businessCard && item.user.businessCard.personalWechat && item.showWechat">
<el-image :src="item.user.businessCard.personalWechat" style="width: 100%; height: 100%"/>
</view>
<view class="mobile" v-if="item.user && item.showContract && item.user.businessCard">
<i class="el-icon-phone"></i>
<text class="ml-20">{{
(item.user.businessCard && item.user.businessCard.companyMobile) ? item.user.businessCard.companyMobile : '暂无电话'
}}
</text>
</view>
</view>
</view>
<view class="paginatio">
<el-pagination @current-change="search" background layout="prev, pager, next" :total="list.total"
:page-size="pageSize">
</el-pagination>
</view>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import dayjs from "dayjs";
export default {
data() {
return {
checkCategoryList: [],
clickedCateIndex: -1,
provinceData: provinces,
checkProvinceList: [],
keyword: '',
list: {
total: 0,
rows: []
},
showAllProvince: false,
type: 0,
pageSize: 20,
ad12: [],
ad122: [],
categoryTreeData: [],
};
},
onLoad(option) {
if (option.type) this.type = option.type
vk.callFunction({
url: 'client/process/category/pub/getTree',
title: '请求中...',
success: (data) => {
this.categoryTreeData = data.rows
this.allChildCate = []
this.categoryTreeData.forEach(item => {
item.children.forEach(child => {
this.allChildCate.push(child)
})
})
}
});
},
onShow() {
this.search(1)
},
methods: {
navTo(url) {
vk.navigateTo({
url
})
},
selectCate({name}) {
if (name === -1) this.checkCategoryList = []
const index = this.checkCategoryList.indexOf(name)
if (index === -1) {
this.checkCategoryList = [name]
} else {
this.checkCategoryList = []
}
console.log(this.checkCategoryList)
this.search(1)
},
selectProvince(code) {
if (code === -1) this.checkProvinceList = []
else {
this.checkProvinceList = [code]
}
this.search(1)
},
toMyEnquiry() {
vk.navigateTo({
url: '/pages/process/my'
})
},
async toRelease() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (accountNum === 0) {
this.$confirm('请先到个人中心添加收款账户', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=account'});
})
} else {
if (userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
vk.navigateTo({
url: '/pages/process/release'
})
}
},
search(pageIndex) {
// const categoryIds = []
// this.allChildCate.map(item => {
// if (this.checkCategoryList.indexOf(item._id) > -1) categoryIds.push(item.name)
// })
vk.callFunction({
url: 'client/factory/pub/getList',
title: '加载中...',
data: {
pageIndex,
pageSize: this.pageSize,
keyword: this.keyword,
mainSpotCategory: this.checkCategoryList.length ? this.checkCategoryList[0] : null
},
success: ({data}) => {
data.rows.map(item => {
item.showWechat = false
item.showContract = false
return item
})
this.list = data
this.getAd12()
this.getAd122()
}
});
},
getCertUrl() {
vk.callFunction({
url: 'client/fadada.getVerifyUrl',
success: (res) => {
location.href = res.data.url
}
});
},
doShowWechat(index) {
if (parseInt(this.list.rows[index].user.accountType) === 2 && !this.list.rows[index].user.businessCard.companyWechat)
return vk.toast('用户暂未上传')
else if (parseInt(this.list.rows[index].user.accountType) === 1 && !this.list.rows[index].user.businessCard.personalWechat)
return vk.toast('用户暂未上传')
this.list.rows[index].showContract = false
this.list.rows[index].showWechat = !this.list.rows[index].showWechat
},
doShowContract(index) {
this.list.rows[index].showWechat = false
this.list.rows[index].showContract = !this.list.rows[index].showContract
},
async getAd12() {
this.ad12 = []
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 12,
region: this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null
}
})
if (res.data) this.ad12 = res.data
},
async getAd122() {
this.ad122 = []
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 122,
region: this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null
}
})
if (res.data) this.ad122 = res.data
},
},
}
</script>
<style lang="scss" scoped>
.carousel {
width: 1200px;
margin: 20px auto;
}
.page-nav {
display: flex;
justify-content: space-between;
}
.carousel-img {
width: 100%;
height: 100%;
}
.goods-options {
background-color: #FFFFFF;
padding: 20px;
}
.filter-outer {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
}
.tags {
display: flex;
flex-wrap: wrap;
.el-tag {
margin-right: 10px;
}
}
.goods-list {
width: 1200px;
margin: 20px auto;
display: flex;
flex-direction: row;
justify-content: space-between;
flex-wrap: wrap;
}
.goods {
background-color: #FFFFFF;
box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.05);
text-align: center;
width: 1200px;
margin: 10px auto;
padding: 20px;
display: flex;
justify-content: space-between;
.goods-info {
display: flex;
flex: 1;
.goods-img {
width: 200px;
height: 150px;
}
.info {
width: 1000px;
text-align: left;
margin-left: 20px;
.goods-name {
font-size: 20px;
font-weight: 500;
line-height: 2.5em;
}
.field {
display: flex;
flex-wrap: wrap;
.desc {
display: flex;
width: 330px;
line-height: 2.5em;
.text {
width: 140px;
color: #999999;
}
}
}
}
}
.buttons {
padding: 0 20px;
width: 200px;
border-left: 1px solid #f3f3f3;
display: flex;
flex-direction: column;
justify-content: space-around;
position: relative;
.btn {
width: 120px;
}
.green {
background-color: #7ec050 !important;
color: #ffffff;
}
.wechat {
position: absolute;
left: -140px;
top: 0;
width: 150px;
height: 150px;
background-color: white;
border-radius: 10px;
padding: 5px;
box-shadow: 0 1px 10px 0 #eee
}
.mobile {
position: absolute;
left: -110px;
top: 10px;
background-color: white;
border-radius: 10px;
padding: 5px;
box-shadow: 0 1px 10px 0 #eee;
display: flex;
align-items: center;
justify-content: center;
}
}
&-title {
font-size: 15px;
color: #101010;
height: 62px;
padding-top: 20px;
font-weight: bold;
}
&-stock {
font-size: 12px;
color: #BD3124;
}
&-address {
font-size: 12px;
margin: 10px 0;
}
&-image {
width: 200px;
height: 70px;
margin: 0 auto;
image {
width: 100%;
height: 100%;
}
}
&-company {
color: #4F4F4F;
font-size: 14px;
margin: 10px 0;
}
&-buy {
width: 108px;
height: 30px;
line-height: 30px;
background-color: rgba(255, 255, 255, 1);
color: rgba(169, 41, 36, 1);
font-size: 13px;
text-align: center;
font-family: Roboto;
border: 1px solid rgba(169, 41, 36, 1);
margin: 0 auto;
cursor: pointer;
}
.goods-image {
width: 100%;
}
}
.paginatio {
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
}
.selected-cate {
border-bottom: 2px solid #BD3124;
line-height: 40rpx;
}
.child-cate {
background-color: #DB8382;
color: white;
margin-top: 10rpx;
border-radius: 15rpx;
padding: 0 20rpx;
}
</style>
+492 -338
View File
@@ -1,388 +1,542 @@
<template> <template>
<view> <view>
<top-bar></top-bar> <top-bar></top-bar>
<common-header></common-header> <common-header></common-header>
<category-bar></category-bar> <category-bar></category-bar>
<!-- <view class="page-nav"> <!-- <view class="page-nav">
<el-breadcrumb separator="/"> <el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item> <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item><navigator url="/pages/spot/goods/goods">现货市场</navigator></el-breadcrumb-item> <el-breadcrumb-item><navigator url="/pages/spot/goods/goods">现货市场</navigator></el-breadcrumb-item>
</el-breadcrumb> </el-breadcrumb>
</view> --> </view> -->
<view class="carousel"> <view class="carousel">
<el-carousel height="170px"> <common-swiper page="process"/>
<el-carousel-item v-for="item in 4" :key="item"> <view class="goods-options">
<image class="carousel-img" <el-row class="">
src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg" <el-button @click="toRelease" type="primary" round>发布加工单</el-button>
mode="aspectFill"></image> <el-button @click="toMyEnquiry" type="primary" round plain>我发布的加工单</el-button>
</el-carousel-item> <el-button @click="toMyQuote" type="primary" round plain>我的报价</el-button>
</el-carousel> <el-button @click="navTo('/pages/process/factoryList')" type="success" round plain>加工厂列表</el-button>
<view class="goods-options"> </el-row>
<el-row class=""> </view>
<el-button @click="toRelease" type="primary" round>发布加工单</el-button>
<el-button @click="toMyEnquiry" type="primary" round plain>我发布的加工单</el-button>
</el-row>
</view>
</view>
<!-- 筛选表单 -->
<view class="filter-outer">
<el-form @submit.native.prevent label-width="80px">
<el-form-item label="关键词:" class="border-bottom pb-30">
<el-input @keyup.enter.native="search(1)" clearable placeholder="输入关键字搜索" v-model="keyword">
<i slot="prefix" class="el-input__icon el-icon-search"></i>
<el-button @click="search(1)" type="primary" slot="append" style="border-radius: 0">搜索
</el-button>
</el-input>
</el-form-item>
<el-form-item label="分类:" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="clickedCateIndex = -1" class="pointer mr-25"
:class="[clickedCateIndex === -1 ? 'text-main selected-cate' : '']">全部
</text>
<view v-for="(item, index) in categoryTreeData" :key="index">
<text @click="clickedCateIndex = index" class="pointer mr-25"
:class="[clickedCateIndex === index ? 'text-main selected-cate' : '']"
v-if="index < 10">
{{ item.name }}
</text>
</view>
</view>
<view class="child-cate flex justify-start items-center flex-wrap">
<template v-if="clickedCateIndex === -1">
<text class="pointer mr-25" @click="selectCate(item)"
:class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"
v-for="(item, index) in allChildCate" :key="index">{{ item.name }}
</text>
</template>
<template v-else>
<text class="pointer mr-25" @click="selectCate(item)"
:class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"
v-for="(item, index) in categoryTreeData[clickedCateIndex].children" :key="index">
{{ item.name }}
</text>
</template>
<!-- <text @click="showAllTexture = !showAllTexture" class="pointer mr-25" >查看更多-->
<!-- </text>-->
</view>
</el-form-item>
<el-form-item label="供应商:" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="selectCompany(-1)" class="pointer mr-25"
:class="[checkCompanyList.length === 0 ? 'text-main selected-cate' : '']">全部
</text>
<view v-for="(item, index) in companyList" :key="index">
<text @click="selectCompany(item._id)" class="pointer mr-25"
:class="[checkCompanyList.includes(item._id) ? 'text-main selected-cate' : '']"
v-if="index < 10 || showAllCompany">
{{ item.name }}
</text>
</view>
<text @click="showAllCompany = !showAllCompany" class="pointer mr-25"
v-if="companyList.length > 10">查看更多
</text>
</view>
</el-form-item>
<el-form-item label="已选择">
<view class="tags">
<el-tag v-for="(item, index) in checkCategoryArr" :key="index">{{ item.name }}</el-tag>
</view>
</el-form-item>
</el-form>
</view>
<!-- 商品列表 -->
<view class="sheet-list">
<el-table :data="list.rows" style="width: 100%">
<el-table-column align="center" label="标题">
<template v-slot="{ row }">
<p class="text-main">{{ row.title }}</p>
</template>
</el-table-column>
<el-table-column prop="num" label="加工量"/>
<el-table-column align="center" label="采购企业">
<template v-slot="{ row }">
<p>{{
row.user.accountType === 1 ? row.user.person.personName : row.user.company.companyName
}}</p>
</template>
</el-table-column>
<el-table-column align="center" label="报价情况">
<template v-slot="{ row }">
<p>{{ `${row.quoteNum}家已报价` }}</p>
</template>
</el-table-column>
<el-table-column align="center" prop="_add_time_srt" label="发布时间"/>
<el-table-column align="center" label="操作">
<template v-slot="{ row }">
<el-button size="mini" type="primary" plain @click.native="toDetail(row._id)">
{{ vk.getVuex('$user.userInfo._id') === row.userId ? '查看' : '申请加工' }}
</el-button>
</template>
</el-table-column>
</el-table>
<div class="mt-20 text-center">
<el-pagination @current-change="search" background layout="prev, pager, next"
:total="list.total" :page-size="pageSize"/>
</div>
</view>
<right-bar></right-bar>
<common-footer></common-footer>
</view> </view>
<!-- 筛选表单 -->
<view class="filter-outer">
<el-form @submit.native.prevent label-width="80px">
<el-form-item label="关键词:" class="border-bottom pb-30">
<el-input @keyup.enter.native="search(1)" clearable placeholder="输入关键字搜索" v-model="keyword">
<i slot="prefix" class="el-input__icon el-icon-search"></i>
<el-button @click="search(1)" type="primary" slot="append" style="border-radius: 0">搜索
</el-button>
</el-input>
</el-form-item>
<el-form-item label="分类:" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="selectCate({_id: -1})" class="pointer mr-25"
:class="[checkCategoryList.length === 0 ? 'text-main selected-cate' : '']">全部
</text>
<view v-for="(item, index) in categoryTreeData" :key="index">
<text @click="selectCate(item)" class="pointer mr-25"
:class="[checkCategoryList.length && checkCategoryList.includes(item._id) ? 'text-main selected-cate' : '']">
{{ item.name }}
</text>
</view>
</view>
<!-- <view class="child-cate flex justify-start items-center flex-wrap">-->
<!-- <template v-if="clickedCateIndex === -1">-->
<!-- <text class="pointer mr-25" @click="selectCate(item)"-->
<!-- :class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"-->
<!-- v-for="(item, index) in allChildCate" :key="index">{{ item.name }}-->
<!-- </text>-->
<!-- </template>-->
<!-- <template v-else>-->
<!-- <text class="pointer mr-25" @click="selectCate(item)"-->
<!-- :class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"-->
<!-- v-for="(item, index) in categoryTreeData[clickedCateIndex].children" :key="index">-->
<!-- {{ item.name }}-->
<!-- </text>-->
<!-- </template>-->
<!-- &lt;!&ndash; <text @click="showAllTexture = !showAllTexture" class="pointer mr-25" >查看更多&ndash;&gt;-->
<!-- &lt;!&ndash; </text>&ndash;&gt;-->
<!-- </view>-->
</el-form-item>
<!-- <el-form-item label="供应商:" class="border-bottom pb-30">-->
<!-- <view class="flex justify-start items-center flex-wrap">-->
<!-- <text @click="selectCompany(-1)" class="pointer mr-25"-->
<!-- :class="[checkCompanyList.length === 0 ? 'text-main selected-cate' : '']">全部-->
<!-- </text>-->
<!-- <view v-for="(item, index) in companyList" :key="index">-->
<!-- <text @click="selectCompany(item._id)" class="pointer mr-25"-->
<!-- :class="[checkCompanyList.includes(item._id) ? 'text-main selected-cate' : '']"-->
<!-- v-if="index < 10 || showAllCompany">-->
<!-- {{ item.name }}-->
<!-- </text>-->
<!-- </view>-->
<!-- <text @click="showAllCompany = !showAllCompany" class="pointer mr-25"-->
<!-- v-if="companyList.length > 10">查看更多-->
<!-- </text>-->
<!-- </view>-->
<!-- </el-form-item>-->
<el-form-item label="地区:" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="selectProvince(-1)" class="pointer mr-25 flex-grow-0"
:class="[checkProvinceList.length === 0 ? 'text-main selected-cate' : '']">全国
</text>
<view v-for="(item, index) in provinceData" :key="index" class="flex-grow-0 pointer mr-25">
<text @click="selectProvince(item.code)"
:class="[checkProvinceList.includes(item.code)? 'text-main selected-cate' : '']">
{{ item.name }}
</text>
</view>
<!-- <text @click="showAllProvince = !showAllProvince" class="pointer mr-25">查看更多-->
<!-- </text>-->
</view>
</el-form-item>
<el-form-item label="已选择">
<view class="tags">
<el-tag v-for="(item, index) in checkCategoryArr" :key="index">{{ item.name }}</el-tag>
</view>
</el-form-item>
</el-form>
</view>
<div class="flex justify-between items-center w-1200 m-a">
<template v-if="ad13.length">
<el-carousel :height="`100px`" :style="{width: ad14.length ? '50%' : '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad13" :key="index" :style="{width: '100%'}">
<image @click="vk.navigateTo(`/pages/yellowPage/info?id=${item.companyId}`)"
class="pointer carousel-img" :src="item.swiper" mode="aspectFill"
:style="{width: '100%'}"/>
</el-carousel-item>
</el-carousel>
</template>
<template v-if="ad14.length">
<el-carousel :height="`100px`" :style="{width: ad13.length ? '50%' : '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad14" :key="index" :style="{width: '100%'}">
<image @click="vk.navigateTo(`/pages/yellowPage/info?id=${item.companyId}`)"
class="pointer carousel-img" :src="item.swiper" mode="aspectFill"
:style="{width: '100%'}"/>
</el-carousel-item>
</el-carousel>
</template>
</div>
<!-- 商品列表 -->
<view class="sheet-list">
<view class="flex justify-start items-center my-20">
<el-button @click="changeStatus(0)" type="primary" :plain="status === 1" round>正在询价</el-button>
<el-button @click="changeStatus(1)" type="primary" :plain="status === 0" round>合作成交
</el-button>
</view>
<el-table :data="list.rows" style="width: 100%" :loading="loading">
<el-table-column align="center" label="标题">
<template v-slot="{ row }">
<p class="text-main">{{ row.title }}</p>
</template>
</el-table-column>
<el-table-column prop="num" label="加工量" width="80"/>
<el-table-column align="center" label="采购企业" width="260">
<template v-slot="{ row }">
<p v-if="row.user">{{
row.user.accountType === 1 ? row.user.person.personName : row.user.company.companyName
}}</p>
</template>
</el-table-column>
<el-table-column align="center" label="加工产品交货地址">
<template v-slot="{ row }">
<p v-if="row.addressRegion && row.addressRegion.province">{{
row.addressRegion.province.name
}}{{ row.addressRegion.city.name }}{{
row.addressRegion.area.name
}}</p>
</template>
</el-table-column>
<el-table-column align="center" label="报价情况">
<template v-slot="{ row }">
<p>{{ `${row.quoteNum}家已报价` }}</p>
</template>
</el-table-column>
<el-table-column align="center" prop="_add_time_str" label="发布时间"/>
<el-table-column align="center" label="操作">
<template v-slot="{ row }">
<el-button size="mini" type="primary" plain @click.native="toDetail(row._id)" v-if="status === 0">
{{ vk.getVuex('$user.userInfo._id') === row.userId ? '查看' : '申请合作' }}
</el-button>
<el-button size="mini" type="primary" plain @click.native="toDetail(row._id)" v-if="status === 1">
查看详情
</el-button>
</template>
</el-table-column>
</el-table>
<div class="mt-20 text-center">
<el-pagination @current-change="search" background layout="prev, pager, next"
:total="list.total" :page-size="pageSize"/>
</div>
</view>
<right-bar></right-bar>
<common-footer></common-footer>
</view>
</template> </template>
<script> <script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
export default { export default {
data() { data() {
return { return {
categoryTreeData: [], categoryTreeData: [],
checkProvinceList: [], checkProvinceList: [],
allChildCate: [], allChildCate: [],
companyList: [], companyList: [],
checkCompanyList: [], checkCompanyList: [],
clickedCateIndex: -1, clickedCateIndex: -1,
checkCategoryList: [], checkCategoryList: [],
checkCategoryNameList: [], checkCategoryNameList: [],
showAllCompany: false, showAllCompany: false,
keyword: '', keyword: '',
queryParam: {}, queryParam: {},
list: { list: {
rows: [], rows: [],
total: 0 total: 0
}, },
pageSize: 20 pageSize: 20,
}; provinceData: provinces,
showAllProvince: true,
loading: true,
status: 0,
ad13: [],
ad14: [],
};
},
onLoad(options) {
if (options && options.keyword) this.keyword = options.keyword
// this.search(1)
vk.callFunction({
url: 'client/process/category/pub/getTree',
title: '请求中...',
success: (data) => {
this.categoryTreeData = data.rows
this.allChildCate = []
this.categoryTreeData.forEach(item => {
item.children.forEach(child => {
console.log(child)
this.allChildCate.push(child)
})
})
}
});
this.search()
this.getCompany()
},
methods: {
selectCate({_id, name}) {
if (_id === -1) {
this.checkCategoryList = []
this.checkCategoryNameList = []
return this.search(1)
}
const index = this.checkCategoryList.indexOf(_id)
if (index === -1) {
this.checkCategoryList = [_id]
this.checkCategoryNameList = [name]
} else {
this.checkCategoryList.splice(index, 1)
this.checkCategoryNameList.splice(index, 1)
}
this.search(1)
}, },
onLoad() { selectProvince(code) {
// this.search(1) if (code === -1) this.checkProvinceList = []
vk.callFunction({ else {
url: 'client/spot/category/pub/getTree', // const index = this.checkProvinceList.indexOf(code)
title: '请求中...', // if (index === -1) this.checkProvinceList.push(code)
data: {}, // else this.checkProvinceList.splice(index, 1)
success: (data) => { this.checkProvinceList = [code]
this.categoryTreeData = data.rows }
this.allChildCate = [] this.search(1)
this.categoryTreeData.forEach(item => {
item.children.forEach(child => {
this.allChildCate.push(child)
})
})
}
});
this.search()
this.getCompany()
}, },
methods: { getCompany() {
selectCate({_id, name}) { vk.callFunction({
const index = this.checkCategoryList.indexOf(_id) url: 'client/user/pub/getCompany',
console.log(_id, name, index) title: '请求中...',
if (index === -1) { data: {},
this.checkCategoryList.push(_id) success: (data) => {
this.checkCategoryNameList.push(name) this.companyList = data.rows.map(item => {
} else { item.name = item.company.companyName
this.checkCategoryList.splice(index, 1) return item
this.checkCategoryNameList.splice(index, 1) })
}
this.search(1)
},
selectTexture(id) {
if (id === -1) this.checkTextureList = []
else {
const index = this.checkTextureList.indexOf(id)
if (index === -1) this.checkTextureList.push(id)
else this.checkTextureList.splice(index, 1)
}
this.search(1)
},
selectCompany(id) {
if (id === -1) this.checkCompanyList = []
else {
const index = this.checkCompanyList.indexOf(id)
if (index === -1) this.checkCompanyList.push(id)
else this.checkCompanyList.splice(index, 1)
}
this.search(1)
},
getCompany() {
vk.callFunction({
url: 'client/user/pub/getCompany',
title: '请求中...',
data: {},
success: (data) => {
this.companyList = data.rows.map(item => {
item.name = item.company.companyName
return item
})
}
});
},
toMyEnquiry() {
vk.navigateTo({
url: '/pages/process/my'
})
},
async toRelease() {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('请完善名片信息', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=business-card'});
})
} else {
vk.navigateTo({
url: '/pages/process/release'
})
}
},
async toDetail(id) {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm && userInfo.authStatus === 1) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('请完善名片信息', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=business-card');
})
} else {
vk.navigateTo({
url: `/pages/process/detail?id=${id}`
})
}
},
search(pageIndex = 1) {
vk.callFunction({
url: 'client/process/sheet/pub/getList',
data: {
pageIndex,
pageSize: this.pageSize,
keyword: this.keyword,
companyList: this.checkCompanyList,
categoryIds: this.checkCategoryList
},
success: (data) => {
this.list = data
console.log(this.list)
}
});
},
getCertUrl() {
vk.callFunction({
url: 'client/fadada.getVerifyUrl',
success: (res) => {
location.href = res.data.url
}
});
},
},
computed: {
checkCategoryArr() {
let arr = []
this.checkCategoryNameList.forEach(name => {
arr.push({name})
})
this.checkProvinceList.forEach(item => {
arr.push({
...item
})
})
return arr
} }
});
},
toMyEnquiry() {
vk.navigateTo({
url: '/pages/process/my'
})
},
toMyQuote() {
vk.navigateTo({
url: '/pages/process/quote/my'
})
},
async toRelease() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (accountNum === 0) {
this.$confirm('请先到个人中心添加收款账户', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=account'});
})
} else {
if (userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
vk.navigateTo({
url: '/pages/process/release'
})
}
},
async toDetail(id) {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm && userInfo.authStatus === 1) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=fadada');
})
} else {
if (userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
vk.navigateTo({
url: `/pages/process/detail?id=${id}`
})
}
},
search(pageIndex = 1) {
vk.callFunction({
url: 'client/process/sheet/pub/getList',
title: '请求中...',
data: {
pageIndex,
pageSize: this.pageSize,
keyword: this.keyword,
// companyList: this.checkCompanyList,
categoryIds: this.checkCategoryList.length ? this.checkCategoryList : null,
provinceCodes: this.checkProvinceList,
status: this.status,
},
success: (data) => {
this.list = data
this.loading = false
this.getAd13()
this.getAd14()
}
});
},
getCertUrl() {
vk.callFunction({
url: 'client/fadada.getVerifyUrl',
success: (res) => {
location.href = res.data.url
}
});
},
navTo(url) {
vk.navigateTo({url});
},
changeStatus(status) {
this.status = status
this.search(1)
},
async getAd13() {
this.ad13 = []
// if (this.checkProvinceList.length === 0) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 13,
region: this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null
}
})
if (res.data) this.ad13 = res.data
// } else {
// const {rows} = await vk.callFunction({
// url: 'client/user/pub/getCompany',
// data: {
// pageIndex: 1,
// pageSize: 5,
// isCoop: 1,
// province: this.checkProvinceList
// }
// })
// rows.forEach(item => {
// if (item.businessCard.album && item.businessCard.album.length > 0) {
// this.ad13.push({
// swiper: Array.isArray(item.businessCard.album) ? item.businessCard.album[0] : item.businessCard.album,
// companyId: item._id
// })
// }
// })
// }
},
async getAd14() {
this.ad14 = []
// if (this.checkProvinceList.length === 0) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 14,
region: this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null
}
})
if (res.data) this.ad14 = res.data
// } else {
// const {rows} = await vk.callFunction({
// url: 'client/user/pub/getCompany',
// data: {
// pageIndex: 2,
// pageSize: 5,
// isCoop: 1,
// province: this.checkProvinceList
// }
// })
// rows.forEach(item => {
// if (item.businessCard.album && item.businessCard.album.length > 0) {
// this.ad14.push({
// swiper: Array.isArray(item.businessCard.album) ? item.businessCard.album[0] : item.businessCard.album,
// companyId: item._id
// })
// }
// })
// }
},
},
computed: {
checkCategoryArr() {
let arr = []
this.checkCategoryNameList.forEach(name => {
arr.push({name})
})
this.provinceData.forEach(item => {
if (this.checkProvinceList.includes(item.code)) {
arr.push(item)
}
})
return arr
} }
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.carousel { .carousel {
width: 1200px; width: 1200px;
margin: 20px auto; margin: 20px auto;
} }
.carousel-img { .carousel-img {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.goods-options { .goods-options {
background-color: #FFFFFF; background-color: #FFFFFF;
padding: 20px; padding: 20px;
} }
.filter-outer { .filter-outer {
width: 1200px; width: 1200px;
margin: 20px auto; margin: 20px auto;
background-color: #FFFFFF; background-color: #FFFFFF;
padding: 20px; padding: 20px;
} }
.tags { .tags {
display: flex; display: flex;
.el-tag { .el-tag {
margin-right: 10px; margin-right: 10px;
} }
} }
.sheet-list { .sheet-list {
width: 1200px; width: 1200px;
margin: 20px auto; margin: 20px auto;
// display: flex; // display: flex;
} }
.paginatio { .paginatio {
float: none; float: none;
width: 1200px; width: 1200px;
margin: 20px auto; margin: 20px auto;
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
.selected-cate { .selected-cate {
border-bottom: 2px solid #BD3124; border-bottom: 2px solid #BD3124;
line-height: 40rpx; line-height: 40rpx;
} }
.child-cate { .child-cate {
background-color: #DB8382; background-color: #DB8382;
color: white; color: white;
margin-top: 10rpx; margin-top: 10rpx;
border-radius: 15rpx; border-radius: 15rpx;
padding: 0 20rpx; padding: 0 20rpx;
} }
</style> </style>
+298 -244
View File
@@ -1,293 +1,347 @@
<template> <template>
<view> <view>
<top-bar></top-bar> <top-bar></top-bar>
<common-header></common-header> <common-header></common-header>
<category-bar></category-bar> <category-bar></category-bar>
<!-- <view class="page-nav"> <!-- <view class="page-nav">
<el-breadcrumb separator="/"> <el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item> <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item><navigator url="/pages/spot/goods/goods">现货市场</navigator></el-breadcrumb-item> <el-breadcrumb-item><navigator url="/pages/spot/goods/goods">现货市场</navigator></el-breadcrumb-item>
</el-breadcrumb> </el-breadcrumb>
</view> --> </view> -->
<view class="carousel">
<el-carousel height="170px">
<el-carousel-item v-for="item in 4" :key="item">
<image class="carousel-img"
src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"
mode="aspectFill"></image>
</el-carousel-item>
</el-carousel>
<view class="goods-options">
<el-row class="">
<el-button @click="toRelease" type="primary" round>发布加工单</el-button>
<!-- <el-button @click="toMyEnquiry" type="primary" round plain>我发布的加工单</el-button>-->
</el-row>
</view>
</view>
<!-- 加工单列表 -->
<view class="sheet-list">
<vk-data-table ref="table1" :action="table1.action" :columns="table1.columns"
:customRightBtns="table1.customRightBtns"
:pagination="true"></vk-data-table>
</view>
<common-footer></common-footer>
<view class="carousel">
<!-- <el-carousel height="170px">-->
<!-- <el-carousel-item v-for="item in 4" :key="item">-->
<!-- <image class="carousel-img"-->
<!-- src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"-->
<!-- mode="aspectFill"></image>-->
<!-- </el-carousel-item>-->
<!-- </el-carousel>-->
<common-swiper page="process-mine" :height="200"/>
<view class="goods-options">
<el-row class="">
<el-button @click="toRelease" type="primary" round>发布加工单</el-button>
<!-- <el-button @click="toMyEnquiry" type="primary" round plain>我发布的加工单</el-button>-->
</el-row>
</view>
</view> </view>
<!-- 加工单列表 -->
<view class="sheet-list">
<vk-data-table ref="table1" :action="table1.action" :columns="table1.columns"
:customRightBtns="table1.customRightBtns"
:pagination="true"></vk-data-table>
</view>
<common-footer></common-footer>
</view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
categoryTreeData: [], categoryTreeData: [],
checkCategoryList: [], checkCategoryList: [],
checkProvinceList: [], checkProvinceList: [],
keyword: '', keyword: '',
// 表格相关开始 ----------------------------------------------------------- // 表格相关开始 -----------------------------------------------------------
table1: { table1: {
// 表格数据请求地址 // 表格数据请求地址
action: (obj = {}) => { action: (obj = {}) => {
let {data, success, fail, complete} = obj; let {data, success, fail, complete} = obj;
vk.callFunction({ vk.callFunction({
url: `client/process/sheet/pub/getList`, url: `client/process/sheet/pub/getList`,
data: { data: {
...data, ...{ ...data, ...{
userId: vk.getVuex('$user.userInfo._id') userId: vk.getVuex('$user.userInfo._id'),
} isUser: true
}, }
success: (res) => {
if (typeof success === "function") {
success({
rows: res.rows, // 列表数据
total: res.total, // 总记录数
});
}
},
fail: (err => {
}),
complete: (res) => {
if (typeof complete === "function") complete(res);
}
})
},
customRightBtns: [{
title: '详情',
icon: 'el-icon-search',
type: 'primary',
onClick: (item) => {
vk.navigateTo('/pages/process/detail?id=' + item._id);
}
},],
// 表格字段显示规则
columns: [
{
key: "title",
title: "标题",
type: "text",
},
{
key: "num",
title: "加工量",
type: "text"
},
{
key: "productList",
title: "收货地",
type: "text",
minWidth: 200,
formatter: (val, row, column, index) => {
let str = ""
try {
str = val.map(item => {
const addressStr = item.address.region.province.name + "-" + item.address.region.city.name + "-" + item.address.region.area.name
return addressStr
}).join("/")
} catch (err) {
str = ""
}
return str
}
},
// {
// key: "user",
// title: "采购单位",
// type: "text",
// width: 280,
// formatter: (val, row, column, index) => {
// if(val.accountType == 1) {
// return val.person.personName
// }else {
// return val.company.companyName
// }
// }
//
// },
{
key: "_add_time_srt",
title: "添加时间",
type: "time",
width: 160
},
],
// 多选框选中的值
multipleSelection: [],
// 当前高亮的记录
selectItem: "",
}, },
// 表格相关结束 ----------------------------------------------------------- success: (res) => {
}; if (typeof success === "function") {
}, success({
onLoad() { rows: res.rows, // 列表数据
// this.search(1) total: res.total, // 总记录数
vk.callFunction({ });
url: 'client/spot/category/pub/getTree', }
title: '请求中...', },
data: {}, fail: (err => {
success: (data) => {
this.categoryTreeData = data.rows }),
for (var i = 0; i < data.rows.length; i++) { complete: (res) => {
this.checkCategoryList.push([]) if (typeof complete === "function") complete(res);
}
} }
}); })
},
methods: {
toMyEnquiry() {
vk.navigateTo({
url: '/pages/enquiry/my'
})
}, },
toRelease() { customRightBtns: [
{
if (!vk.getVuex('$user.userInfo.fadadaConfirm')) { title: '详情',
this.$confirm('您尚未认证, 是否前往认证?', '提示', { icon: 'el-icon-search',
confirmButtonText: '确定', type: 'primary',
cancelButtonText: '取消', onClick: (item) => {
type: 'warning' vk.navigateTo('/pages/process/detail?id=' + item._id);
}).then(() => {
this.getCertUrl()
})
} else if (vk.pubfn.isNull(vk.getVuex('$user.userInfo.businessCard'))) {
this.$confirm('请完善名片信息', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=business-card');
})
} else {
vk.navigateTo({
url: '/pages/process/release'
})
} }
},
{
}, title: '删除',
search(pageIndex) { icon: 'el-icon-delete',
const categoryIds = [] type: 'primary',
this.checkCategoryList.forEach(item => { onClick: (item) => {
item.forEach(sitem => { this.$confirm('如果你要删除此条信息,之前其他客户填写的留言将无法查看', '提示', {
categoryIds.push(sitem._id) confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.callFunction({
url: 'client/process/sheet/kh/delete',
title: '请求中...',
data: {
_id: item._id
},
}).then(res => {
this.$refs.table1.refresh()
}) })
}) })
let provinceCodes = this.checkProvinceList.map(item => item.code)
if (provinceCodes.includes(9999)) {
provinceCodes = []
} }
},
],
// 表格字段显示规则
columns: [
{
key: "orderNo",
title: "单号",
type: "text",
},
{
key: "title",
title: "标题",
type: "text",
},
{
key: "num",
title: "加工量",
type: "text"
},
{
key: "quoteNum",
title: "报价数",
type: "text",
formatter: (val, row, column, index) => {
return `${val}家已报价`
}
},
// {
// key: "productList",
// title: "收货地",
// type: "text",
// minWidth: 200,
// formatter: (val, row, column, index) => {
// let str = ""
// try {
// str = val.map(item => {
// const addressStr = item.address.region.province.name + "-" + item.address.region.city.name + "-" + item.address.region.area.name
// return addressStr
// }).join("/")
// } catch (err) {
// str = ""
// }
//
// return str
// }
// },
// {
// key: "user",
// title: "采购单位",
// type: "text",
// width: 280,
// formatter: (val, row, column, index) => {
// if(val.accountType == 1) {
// return val.person.personName
// }else {
// return val.company.companyName
// }
// }
//
// },
{
key: "_add_time_str",
title: "发布时间",
type: "time",
},
vk.callFunction({ ],
url: 'client/process/sheet/pub/getList', // 多选框选中的值
data: { multipleSelection: [],
pageIndex: pageIndex, // 当前高亮的记录
pageSize: 20, selectItem: "",
keyword: this.keyword,
},
success: (data) => {
console.log('data: ', data);
this.goodsData = data },
} // 表格相关结束 -----------------------------------------------------------
}); };
}, },
}, onLoad() {
computed: { // this.search(1)
checkCategoryArr() { vk.callFunction({
let arr = [] url: 'client/spot/category/pub/getTree',
title: '请求中...',
this.checkCategoryList.forEach(item => { data: {},
arr.push(...item) success: (data) => {
}) this.categoryTreeData = data.rows
for (var i = 0; i < data.rows.length; i++) {
this.checkProvinceList.forEach(item => { this.checkCategoryList.push([])
arr.push({
...item
})
})
return arr
} }
}
});
},
methods: {
toMyEnquiry() {
vk.navigateTo({
url: '/pages/enquiry/my'
})
},
async toRelease() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (accountNum === 0) {
this.$confirm('请先到个人中心添加收款账户', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=account'});
})
} else {
if (userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
vk.navigateTo({
url: '/pages/process/release'
})
}
},
search(pageIndex) {
const categoryIds = []
this.checkCategoryList.forEach(item => {
item.forEach(sitem => {
categoryIds.push(sitem._id)
})
})
let provinceCodes = this.checkProvinceList.map(item => item.code)
if (provinceCodes.includes(9999)) {
provinceCodes = []
}
vk.callFunction({
url: 'client/process/sheet/pub/getList',
data: {
pageIndex: pageIndex,
pageSize: 20,
keyword: this.keyword,
},
success: (data) => {
console.log('data: ', data);
this.goodsData = data
}
});
},
},
computed: {
checkCategoryArr() {
let arr = []
this.checkCategoryList.forEach(item => {
arr.push(...item)
})
this.checkProvinceList.forEach(item => {
arr.push({
...item
})
})
return arr
} }
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.carousel { .carousel {
width: 1200px; width: 1200px;
margin: 20px auto; margin: 20px auto;
} }
.carousel-img { .carousel-img {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.goods-options { .goods-options {
background-color: #FFFFFF; background-color: #FFFFFF;
padding: 20px; padding: 20px;
} }
.filter-outer { .filter-outer {
width: 1200px; width: 1200px;
margin: 20px auto; margin: 20px auto;
background-color: #FFFFFF; background-color: #FFFFFF;
padding: 20px; padding: 20px;
} }
.tags { .tags {
display: flex; display: flex;
.el-tag { .el-tag {
margin-right: 10px; margin-right: 10px;
} }
} }
.sheet-list { .sheet-list {
width: 1200px; width: 1200px;
margin: 20px auto; margin: 20px auto;
// display: flex; // display: flex;
} }
.paginatio { .paginatio {
float: none; float: none;
width: 1200px; width: 1200px;
margin: 20px auto; margin: 20px auto;
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
</style> </style>
+63 -33
View File
@@ -15,6 +15,7 @@
</view> </view>
<view class="page-main"> <view class="page-main">
<quote-remain-num v-if="reloaded" :amount="sheet.quoteAmount" type="process" :id="sheetId"/>
<vk-data-form <vk-data-form
ref="form1" ref="form1"
v-model="form1.data" v-model="form1.data"
@@ -24,9 +25,16 @@
:form-type="form1.props.formType" :form-type="form1.props.formType"
:loading.sync="form1.props.loading" :loading.sync="form1.props.loading"
:auto-close="true" :auto-close="true"
label-width="140px" label-width="180px"
:show-cancel="false"
@success="onFormSuccess" @success="onFormSuccess"
></vk-data-form> :need-alert="false"
@fail="onFormFail"
>
<template v-slot:totalPrice>
<el-input v-model="form1.data.totalPrice" placeholder="请输入货款总价" @change="formatNumber"></el-input>
</template>
</vk-data-form>
</view> </view>
<common-footer></common-footer> <common-footer></common-footer>
@@ -37,13 +45,17 @@
export default { export default {
data() { data() {
return { return {
reloaded: false,
sheet: null,
sheetId: null,
// 表单相关开始----------------------------------------------------------- // 表单相关开始-----------------------------------------------------------
form1: { form1: {
// 表单请求数据,此处可以设置默认值 // 表单请求数据,此处可以设置默认值
data: { data: {
// radio: 1, // radio: 1,
// checkbox : [1,2] // checkbox : [1,2]
sheetId: null sheetId: null,
totalPrice: null,
}, },
// 表单属性 // 表单属性
props: { props: {
@@ -51,14 +63,15 @@ export default {
action: "client/process/quote/kh/addQuote", action: "client/process/quote/kh/addQuote",
// 表单字段显示规则 // 表单字段显示规则
columns: [ columns: [
{key: "totalPrice", title: "货款总价", type: "number"}, {key: "totalPrice", title: "加工总价(人民币:元)", type: "html"},
{key: "totalPriceStr", title: "人民币大写", type: "text"}, {key: "files", title: "附件", type: "file", accept: '.pdf', tips: '仅限PDF格式附件或合同,非协议合同将读取为合同附件,请仔细核查'},
{key: "remark", title: "报价单详情", type: "editor"}, {key: "remark", title: "报价单详情", type: "textarea"},
{key: "supplierExt", title: "合同补充条款", type: "textarea"},
], ],
// 表单验证规则 // 表单验证规则
rules: { rules: {
text: [ totalPrice: [
{required: true, message: "text不能为空", trigger: "change"}, {required: true, message: "货款总价不能为空", trigger: "change,blur"},
] ]
}, },
// add 代表添加 update 代表修改 // add 代表添加 update 代表修改
@@ -84,7 +97,7 @@ export default {
this.sheetId = sheetId this.sheetId = sheetId
this.form1.data.sheetId = sheetId this.form1.data.sheetId = sheetId
// this.getEnquiryDetail() this.getDetail()
}, },
computed: { computed: {
@@ -97,7 +110,26 @@ export default {
}, },
methods: { methods: {
onFormSuccess() { onFormSuccess() {
vk.navigateBack() vk.redirectTo({url: `/pages/process/detail?id=${this.sheetId}`})
},
onFormFail(data) {
if (data.data.code === 12) {
this.$confirm(data.data.msg, '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(() => {
vk.redirectTo({url: `/pages/user/user?menu=grade`})
})
}else {
this.$confirm(data.data.msg, '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(() => {
vk.navigateBack()
})
}
}, },
// 提交报价单 // 提交报价单
async submit() { async submit() {
@@ -127,29 +159,27 @@ export default {
/** /**
* 获取询价单详情 * 获取询价单详情
*/ */
// getEnquiryDetail() { getDetail() {
// vk.callFunction({ vk.callFunction({
// url: 'client/progress/sheet/pub/getDetail', url: 'client/process/sheet/pub/getInfo',
// title: '请求中...', title: '请求中...',
// data: { data: {
// _id: this.sheetId id: this.sheetId
// }, },
// success: (res) => { success: (res) => {
// this.sheet = res
// res.data.productList.forEach(item => { }
// item.unitPrice = 0 });
// const keys = Object.keys(item.extraAttributes) },
// keys.forEach(citem => { formatNumber(e){
// item.extraAttributes[citem] = JSON.parse(item.extraAttributes[ this.form1.data.totalPrice = parseFloat(this.form1.data.totalPrice).toFixed(2)
// citem]) }
// }) },
// }) onShow() {
// this.reloaded = false
// setTimeout(() => {
// this.sheet = res.data this.reloaded = true
// } }, 500)
// });
// }
} }
} }
</script> </script>
+290
View File
@@ -0,0 +1,290 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<!-- <view class="page-nav">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item><navigator url="/pages/spot/goods/goods">现货市场</navigator></el-breadcrumb-item>
</el-breadcrumb>
</view> -->
<view class="carousel">
<el-carousel height="170px">
<el-carousel-item v-for="item in 4" :key="item">
<image class="carousel-img"
src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"
mode="aspectFill"></image>
</el-carousel-item>
</el-carousel>
<view class="goods-options">
<el-row class="">
<el-button @click="toRelease" type="primary" round>发布加工单</el-button>
<!-- <el-button @click="toMyEnquiry" type="primary" round plain>我发布的加工单</el-button>-->
</el-row>
</view>
</view>
<!-- 加工单列表 -->
<view class="sheet-list">
<vk-data-table ref="table1" :action="table1.action" :columns="table1.columns"
:customRightBtns="table1.customRightBtns"
:pagination="true"></vk-data-table>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
data() {
return {
categoryTreeData: [],
checkCategoryList: [],
checkProvinceList: [],
keyword: '',
// 表格相关开始 -----------------------------------------------------------
table1: {
// 表格数据请求地址
action: (obj = {}) => {
let {data, success, fail, complete} = obj;
vk.callFunction({
url: `client/process/quote/kh/getList`,
data: {
...data, ...{
userId: vk.getVuex('$user.userInfo._id')
}
},
success: (res) => {
if (typeof success === "function") {
success({
rows: res.rows, // 列表数据
total: res.total, // 总记录数
});
}
},
fail: (err => {
}),
complete: (res) => {
if (typeof complete === "function") complete(res);
}
})
},
customRightBtns: [
{
title: '详情',
icon: 'el-icon-search',
type: 'primary',
onClick: (item) => {
vk.navigateTo('/pages/process/detail?id=' + item.sheetId);
}
},
],
// 表格字段显示规则
columns: [
{
key: "sheet.title",
title: "加工标题",
type: "text",
},
{
key: "sheet.num",
title: "加工量",
type: "text"
},
{
key: "totalPrice",
title: "金额",
type: "text",
formatter: (val, row, column, index) => {
return `${val}元`
}
},
{
key: "remark",
title: "备注",
type: "text"
},
{
key: "_add_time_str",
title: "发布时间",
type: "time",
},
],
// 多选框选中的值
multipleSelection: [],
// 当前高亮的记录
selectItem: "",
},
// 表格相关结束 -----------------------------------------------------------
};
},
onLoad() {
// this.search(1)
vk.callFunction({
url: 'client/spot/category/pub/getTree',
title: '请求中...',
data: {},
success: (data) => {
this.categoryTreeData = data.rows
for (var i = 0; i < data.rows.length; i++) {
this.checkCategoryList.push([])
}
}
});
},
methods: {
toMyEnquiry() {
vk.navigateTo({
url: '/pages/enquiry/my'
})
},
async toRelease() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (accountNum === 0 ) {
this.$confirm('请先到个人中心添加收款账户', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=account'});
})
} else {
if (userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
vk.navigateTo({
url: '/pages/process/release'
})
}
},
search(pageIndex) {
const categoryIds = []
this.checkCategoryList.forEach(item => {
item.forEach(sitem => {
categoryIds.push(sitem._id)
})
})
let provinceCodes = this.checkProvinceList.map(item => item.code)
if (provinceCodes.includes(9999)) {
provinceCodes = []
}
vk.callFunction({
url: 'client/process/sheet/pub/getList',
data: {
pageIndex: pageIndex,
pageSize: 20,
keyword: this.keyword,
},
success: (data) => {
console.log('data: ', data);
this.goodsData = data
}
});
},
},
computed: {
checkCategoryArr() {
let arr = []
this.checkCategoryList.forEach(item => {
arr.push(...item)
})
this.checkProvinceList.forEach(item => {
arr.push({
...item
})
})
return arr
}
}
}
</script>
<style lang="scss" scoped>
.carousel {
width: 1200px;
margin: 20px auto;
}
.carousel-img {
width: 100%;
height: 100%;
}
.goods-options {
background-color: #FFFFFF;
padding: 20px;
}
.filter-outer {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
}
.tags {
display: flex;
.el-tag {
margin-right: 10px;
}
}
.sheet-list {
width: 1200px;
margin: 20px auto;
// display: flex;
}
.paginatio {
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
}
</style>
+791 -705
View File
File diff suppressed because it is too large Load Diff
+264 -208
View File
@@ -10,33 +10,42 @@
<el-breadcrumb-item> <el-breadcrumb-item>
<navigator style="display: inline-block;" url="/pages/spot/goods/goods">现货市场</navigator> <navigator style="display: inline-block;" url="/pages/spot/goods/goods">现货市场</navigator>
</el-breadcrumb-item> </el-breadcrumb-item>
<el-breadcrumb-item>{{ product.name }}</el-breadcrumb-item>
</el-breadcrumb> </el-breadcrumb>
</view> </view>
<view class="card"> <view class="card">
<div class="card-header"> <div class="card-header">
<view class="card-header-left"> <view class="card-header-left">
<image class="logo" :src="product.user.businessCard.logo" mode="aspectFit"></image> <image class="logo" :src="product.user.businessCard.logo" mode="aspectFit"
v-if="product.user.businessCard"></image>
<view class="info"> <view class="info">
<view v-if="product.user.accountType === 1" class="info-name"> <template v-if="product.user">
{{ product.user.person.personName }} <view v-if="product.user.accountType === 1" class="info-name">
</view> {{ product.user.person.personName }}
<view v-if="product.user.accountType === 2" class="info-name"> </view>
{{ product.user.company.companyName }} <view v-if="product.user.accountType === 2"
</view> class="info-name flex justify-start items-center">
<text class="mr-25">{{ product.user.company.companyName }}</text>
<el-button type="primary" v-if="product.user.showInYellow === 1" size="small"
@click="navTo(`/pages/yellowPage/info?id=${product.user._id}`)">查看主页
</el-button>
</view>
</template>
<view class="info-update"> <view class="info-update">
<view class="info-update-time"> <view class="info-update-time">
{{ product._add_time_str }} {{ product._add_time_str }}
</view> </view>
<view class="info-update-business"> <view class="info-update-business">
主营业务:{{ product.user.businessCard.mainBusiness }} 主营业务:{{
(product.user.company.mainSpotCategory && product.user.company.mainSpotCategory.length > 0) ? product.user.company.mainSpotCategory.join() : ''
}}
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="card-header-right"> <view class="card-header-right flex flex-col justify-center items-center">
<text class="mb-20 text-main">{{ product.quoteNum }}家已申请合作</text>
<el-button v-if="vk.getVuex('$user.userInfo._id') !== product.userId" @click="toCooperate" <el-button v-if="vk.getVuex('$user.userInfo._id') !== product.userId" @click="toCooperate"
type="primary">申请合作 type="primary">申请合作
</el-button> </el-button>
@@ -50,20 +59,36 @@
<div class="part-head"> <div class="part-head">
<h3>现货详情</h3> <h3>现货详情</h3>
</div> </div>
<view v-if="product.user.accountType == 1" class="card-body-name">{{ product.user.person.personName }} <!-- <template v-if="product.user">-->
</view> <!-- <view v-if="product.user.accountType == 1" class="card-body-name">{{-->
<view v-if="product.user.accountType == 2" class="card-body-name">{{ product.user.company.companyName }} <!-- product.user.person.personName-->
</view> <!-- }}-->
<view class="card-body-stock">库存:{{ product.stock }}吨</view> <!-- </view>-->
<!-- <view v-if="product.user.accountType == 2" class="card-body-name">-->
<!-- {{ product.user.company.companyName }}-->
<!-- </view>-->
<!-- </template>-->
<view class="card-body-stock">库存约:{{ product.stock }}吨</view>
<view class="card-body-address"> <view class="card-body-address">
供货地:{{ product.address.province.name + "-" + product.address.city.name + "-" + product.address.area.name }} 供货地:{{
product.address.province.name + "-" + product.address.city.name + "-" + product.address.area.name
}}
</view> </view>
</view> </view>
<view class="card-body">
<div class="part-head">
<h3>报价有效期</h3>
</div>
<view class="card-body-stock">截止: {{
dayjs(product.answerEndTime).format('YYYY-MM-DD HH:mm:ss')
}}
</view>
</view>
<view class="card-body"> <view class="card-body">
<div class="part-head"> <div class="part-head">
<h3>附件</h3> <h3>产品规格单价</h3>
</div> </div>
<ul class="el-upload-list el-upload-list--text"> <ul class="el-upload-list el-upload-list--text">
<li @click="downloadFile(item)" v-for="(item,index) in product.files" :key="index" tabindex="0" <li @click="downloadFile(item)" v-for="(item,index) in product.files" :key="index" tabindex="0"
@@ -76,6 +101,14 @@
</ul> </ul>
</view> </view>
<view class="card-body">
<div class="part-head">
<h3>产品现场图片</h3>
</div>
<el-image :preview-src-list="product.images" v-for="(item, index) in product.images" :key="index"
:src="item" style="width: 100px; height: 100px" class="mr-10 mb-15" fit="cover"/>
</view>
<view class="card-body"> <view class="card-body">
<div class="part-head"> <div class="part-head">
<h3>已收到的合作申请</h3> <h3>已收到的合作申请</h3>
@@ -84,7 +117,8 @@
:customRightBtns="table1.customRightBtns"></vk-data-table> :customRightBtns="table1.customRightBtns"></vk-data-table>
</view> </view>
</view> </view>
<Gap/>
<common-footer></common-footer>
<el-dialog :visible.sync="showDialog" width="70%" :show-close="false"> <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"> <view slot="title" class="text-main text-40 m-30 flex justify-between items-center">
@@ -93,20 +127,22 @@
</view> </view>
<view class="mt-15" v-if="product"> <view class="mt-15" v-if="product">
<view class="request-header"> <view class="request-header">
<text class="flex-1">企业</text>
<text class="flex-1">申请人</text> <text class="flex-1">申请人</text>
<text class="flex-1">申请时间</text>
<text class="flex-1">联系方式</text> <text class="flex-1">联系方式</text>
<text class="flex-1">合作留言</text>
<text class="flex-1">申请时间</text>
<text class="flex-1">操作</text> <text class="flex-1">操作</text>
</view> </view>
<view class="quote" v-for="(item, index) in product.cooperateList" :key="index"> <view class="quote" v-for="(item, index) in product.cooperateList" :key="index">
<text class="flex-1">{{ <text class="flex-1">{{
item.user.accountType === 1 ? item.user.person.personName : item.user.company.companyName item.user.userId !== product.userId ? item.user.company.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6") : item.user.person.personName.replace(/^(.).*(.)$/, "$1*$2")
}} }}
</text> </text>
<text class="flex-1">{{ item.name }}</text>
<text class="flex-1">{{ item.mobile }}</text>
<text class="flex-1">{{ item.remark }}</text>
<text class="flex-1">{{ item._add_time_str }}</text> <text class="flex-1">{{ item._add_time_str }}</text>
<text class="flex-1">
{{ item.user.accountType === 1 ? item.user.person.mobile : item.user.company.mobile }}
</text>
<text class="flex-1"> <text class="flex-1">
<el-button type="primary" @click.native="doShowInfo(item)">查看申请详情</el-button> <el-button type="primary" @click.native="doShowInfo(item)">查看申请详情</el-button>
</text> </text>
@@ -115,17 +151,39 @@
</el-dialog> </el-dialog>
<el-dialog :visible.sync="form1.props.show" title="申请合作" width="60%" mode="form"> <el-dialog :visible.sync="form1.props.show" title="申请合作" width="60%" mode="form">
<vk-data-form ref="table1" v-model="form1.data" :action="form1.props.action" :columns="form1.props.columns" <el-form ref="form" :model="formData" label-width="120px">
:rules="form1.props.rules" :form-type="form1.props.formType" <el-form-item label="企业名称" v-if="parseInt(vk.getVuex('$user.userInfo.accountType')) === 2">
:loading.sync="form1.props.loading" <el-input v-model="formData.companyName" placeholder="请输入企业名称"/>
:beforeAction="form1.props.beforeAction" :auto-close="true" label-width="140px" </el-form-item>
@success="onFormSuccess"></vk-data-form> <el-form-item label="联系人姓名">
<el-input v-model="formData.name" placeholder="请输入联系人姓名"/>
</el-form-item>
<el-form-item label="联系人电话">
<el-input v-model="formData.mobile" placeholder="请输入联系人电话"/>
</el-form-item>
<el-form-item label="合作留言">
<el-input v-model="formData.remark" placeholder="请输入合作留言"/>
</el-form-item>
<el-form-item label="附件">
<vk-data-upload v-model="formData.files" list-type="text"
accept=".jpg,.jpeg,.png,.xlsx,.doc,.docx,.pdf"/>
</el-form-item>
</el-form>
<view class="text-center">
<el-button type="primary" @click.native="addCoop">确定</el-button>
</view>
<!-- <vk-data-form ref="form1" v-model="form1.data" :action="form1.props.action" :columns="form1.props.columns"-->
<!-- :rules="form1.props.rules" :form-type="form1.props.formType"-->
<!-- :loading.sync="form1.props.loading" :show-cancel="false"-->
<!-- :beforeAction="form1.props.beforeAction" :auto-close="true" label-width="140px"-->
<!-- @success="onFormSuccess">-->
<!-- </vk-data-form>-->
</el-dialog> </el-dialog>
<vk-data-dialog <vk-data-dialog
v-model="showInfo" v-model="showInfo"
title="申请详情" title="申请详情"
width="600px" width="60%"
top="14vh" top="14vh"
center center
:close-on-click-modal="true" :close-on-click-modal="true"
@@ -145,17 +203,38 @@
</template> </template>
<script> <script>
import Gap from "../../../components/gap/gap.vue";
import dayjs from "dayjs";
export default { export default {
components: {Gap},
data() { data() {
return { return {
showDialog: false, showDialog: false,
showInfo: false, showInfo: false,
info: null, info: null,
allChildCate: [],
infoColumns: [ infoColumns: [
{key: "company.companyName", title: "申请人", type: "text"}, {key: "user.company.companyName", title: "企业", type: "text"},
{key: "company.mobile", title: "联系方式", type: "text"}, {key: "name", title: "联系人", type: "text"},
{key: "manager.personName", title: "代理人", type: "text"}, {key: "mobile", title: "联系方式", type: "text"},
{key: "manager.mobile", title: "代理人联系方式", type: "text"}, {key: "remark", title: "合作留言", type: "text"},
{
key: "files", title: "附件", type: "html",
formatter: (val = [], row, column, index) => {
let content = ''
val.forEach((item, itemIndex) => {
content += `<a href="${item}" target="_blank">预览:文件${itemIndex + 1}</a> `
})
return content
}
},
{
key: "_add_time_str",
title: "申请时间",
type: "text",
align: "left",
},
], ],
product: { product: {
name: '现货详情', name: '现货详情',
@@ -169,123 +248,52 @@ export default {
}, },
cooperateList: [] cooperateList: []
}, },
formData: {
companyName: '',
name: '',
mobile: '',
remark: '',
accountType: parseInt(vk.getVuex('$user.userInfo.accountType')),
goodsId: null,
goodsUserId: null,
files: [],
},
// 表单相关开始----------------------------------------------------------- // 表单相关开始-----------------------------------------------------------
form1: { form1: {
// 表单请求数据,此处可以设置默认值 // 表单请求数据,此处可以设置默认值
data: {}, data: {
companyName: '',
name: '',
mobile: '',
remark: '',
},
// 表单属性 // 表单属性
props: { props: {
// 表单请求地址 // 表单请求地址
action: "client/spot/goods/kh/addCooperate", action: "client/spot/goods/kh/addCooperate",
// 表单字段显示规则 // 表单字段显示规则
columns: [{ columns: [
key: "person", {
title: "个人", key: "companyName",
type: "object", title: "企业名称",
showLabel: false,
showRule: (formData) => {
return formData.person.personName != null
},
columns: [{
key: "personName",
title: "姓名",
type: "text", type: "text",
readonly: true,
disabled: true
},
// {
// key: "idCard",
// title: "身份证号",
// type: "text",
// readonly: true,
// disabled: true
// },
{
key: "mobile",
title: "电话",
type: "text",
readonly: true,
disabled: true
},
]
},
{
key: "company",
title: "企业信息",
type: "object",
showLabel: false,
showRule: (formData) => { showRule: (formData) => {
return formData.company.companyName != null return parseInt(vk.getVuex('$user.userInfo.accountType')) === 2
}, },
columns: [{
key: "companyName",
title: "企业名称",
type: "text",
readonly: true,
disabled: true
},
{
key: "organization",
title: "统一社会信用代码",
type: "text",
readonly: true,
disabled: true
},
{
key: "legalName",
title: "法人",
type: "text",
readonly: true,
disabled: true
},
{
key: "legalMobile",
title: "法人电话",
type: "text",
readonly: true,
disabled: true
},
]
}, },
{ {
key: "manager", key: "name",
title: "代理人", title: "联系人姓名",
type: "object", type: "text",
showLabel: false, },
showRule: (formData) => { {
return formData.manager.personName != null key: "mobile",
}, title: "联系人电话",
columns: [{ type: "text",
key: "personName",
title: "代理人",
type: "text",
readonly: true,
disabled: true
},
// {
// key: "idCard",
// title: "代理人身份证号",
// type: "text",
// readonly: true,
// disabled: true
// },
{
key: "mobile",
title: "代理人电话",
type: "text",
readonly: true,
disabled: true
},
]
}, },
{ {
key: "remark", key: "remark",
title: "备注", title: "合作留言",
type: "textarea", type: "textarea",
maxlength: 200, maxlength: 200,
showWordLimit: true, showWordLimit: true,
@@ -293,11 +301,12 @@ export default {
], ],
// 表单验证规则 // 表单验证规则
rules: { rules: {
text: [{ text: [
required: true, {
message: "text不能为空", required: true,
trigger: "change" message: "text不能为空",
}, trigger: "change"
},
{ {
required: true, required: true,
message: "text不能为空", message: "text不能为空",
@@ -323,55 +332,53 @@ export default {
// 表格数据 // 表格数据
data: [], data: [],
// 表格字段显示规则 // 表格字段显示规则
columns: [{ columns: [
key: "subjectName",
title: "申请人",
type: "text",
width: 400,
formatter: (val, row, column, index) => {
if (vk.getVuex('$user.userInfo._id') === this.product.userId) {
return val
}
if (row.accountType === 1) {
return vk.pubfn.hidden(val, 1, 1);
} else {
return vk.pubfn.hidden(val, 2, 4);
}
}
},
{ {
key: "subjectMobile", key: "user.company.companyName",
title: "联系方式", title: "企业",
type: "text", type: "text",
width: 120,
formatter: (val, row, column, index) => { formatter: (val, row, column, index) => {
let str = val if (val) {
if (row.managerMobile) { if (vk.getVuex('$user.userInfo._id') === this.product.userId) {
str = row.managerMobile return val
}
return val.slice(0, 2) + "******";
} }
if (vk.getVuex('$user.userInfo._id') == this.product.userId) { return ''
return str
}
return vk.pubfn.hidden(str, 3, 4);
} }
}, },
// { {
// key: "remark", key: "name",
// title: "备注", title: "申请人",
// type: "textarea", type: "text",
// width: 280, formatter: (val, row, column, index) => {
// formatter: (val, row, column, index) => { if (vk.getVuex('$user.userInfo._id') === this.product.userId) {
// let str = val return val
// if (row.managerMobile) { }
// str = row.managerMobile return val.slice(0, 1) + "**";
// } }
// if (vk.getVuex('$user.userInfo._id') == this.product.userId) { },
// return val {
// } key: "mobile",
// return "******"; title: "联系方式",
// } type: "text",
// }, formatter: (val, row, column, index) => {
if (vk.getVuex('$user.userInfo._id') === this.product.userId) {
return val
}
return "******";
}
},
{
key: "remark",
title: "合作留言",
type: "textarea",
},
{
key: "_add_time",
title: "申请时间",
type: "time",
},
], ],
customRightBtns: [{ customRightBtns: [{
@@ -389,23 +396,9 @@ export default {
} }
}, },
onLoad({ onLoad({id}) {
id
}) {
// 获取现货数据 // 获取现货数据
vk.callFunction({ this.getCategoryTreeData(id)
url: 'client/spot/goods/pub/getDetail',
title: '请求中...',
data: {
_id: id,
},
success: (data) => {
console.log(data);
this.product = data.data
}
});
// 获取用户数据 // 获取用户数据
vk.userCenter.getCurrentUserInfo({ vk.userCenter.getCurrentUserInfo({
success: (data) => { success: (data) => {
@@ -416,22 +409,64 @@ export default {
console.log('form1: ', { console.log('form1: ', {
...this.form1.data ...this.form1.data
}); });
if (data.userInfo.accountType === 1) {
this.formData.name = data.userInfo.person.personName
this.formData.mobile = data.userInfo.person.mobile
} else {
this.formData.companyName = data.userInfo.company.companyName
this.formData.mobile = data.userInfo.company.mobile
if (data.userInfo.manager) this.formData.name = data.userInfo.manager.personName
}
} }
}); });
}, },
methods: { methods: {
dayjs,
getCategoryTreeData(id) {
vk.callFunction({
url: 'client/spot/category/pub/getTree',
title: '请求中...',
data: {},
success: (data) => {
this.allChildCate = []
data.rows.forEach(item => {
item.children.forEach(child => {
this.allChildCate.push(child)
})
})
this.getInfo(id)
}
});
},
getInfo(id) {
vk.callFunction({
url: 'client/spot/goods/pub/getDetail',
title: '请求中...',
data: {
_id: id,
},
success: (data) => {
this.product = data.data
this.product.user.company.mainSpotCategory = []
if (this.product.user.company && this.product.user.company.mainSpotCategoryIds) {
this.allChildCate.forEach(child => {
if (this.product.user.company.mainSpotCategoryIds.includes(child._id)) {
this.product.user.company.mainSpotCategory.push(child.name)
}
})
}
}
});
},
downloadFile(url) { downloadFile(url) {
location.href = url location.href = url
}, },
showCooperate() {
this.table2.show = true
},
async toCooperate() { async toCooperate() {
const {userInfo} = await vk.callFunction({ const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo' url: 'user/kh/getMyUserInfo'
}) })
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) { if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', { this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
@@ -439,12 +474,20 @@ export default {
vk.navigateTo({url: '/pages/user/user?menu=fadada'}); vk.navigateTo({url: '/pages/user/user?menu=fadada'});
}) })
} else if (vk.pubfn.isNull(userInfo.businessCard)) { } else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('请完善名片信息', '提示', { this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=business-card'}); vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (accountNum === 0) {
this.$confirm('请先到个人中心添加收款账户', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=account'});
}) })
} else { } else {
this.form1.props.show = true this.form1.props.show = true
@@ -459,12 +502,25 @@ export default {
} }
}); });
}, },
onFormSuccess() {
this.form1.props.show = false
},
doShowInfo(info) { doShowInfo(info) {
this.info = info this.info = info
this.showInfo = true this.showInfo = true
},
addCoop() {
if (!this.formData.name) return this.$message.error('请填写联系人姓名')
if (!this.formData.mobile) return this.$message.error('请填写联系方式')
this.formData.goodsId = this.product._id
this.formData.goodsUserId = this.product.userId
vk.callFunction({
url: 'client/spot/goods/kh/addCooperate',
data: this.formData
})
this.form1.props.show = false
this.$message.success('提交成功')
this.getInfo(this.product._id)
},
navTo(url) {
vk.navigateTo({url})
} }
}, },
filters: { filters: {
+521 -357
View File
@@ -1,411 +1,575 @@
<template> <template>
<view> <view>
<top-bar></top-bar> <top-bar></top-bar>
<common-header></common-header> <common-header></common-header>
<category-bar></category-bar> <category-bar></category-bar>
<!-- <view class="page-nav"> <!-- <view class="page-nav">
<el-breadcrumb separator="/"> <el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item> <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item><navigator url="/pages/spot/goods/goods">现货市场</navigator></el-breadcrumb-item> <el-breadcrumb-item><navigator url="/pages/spot/goods/goods">现货市场</navigator></el-breadcrumb-item>
</el-breadcrumb> </el-breadcrumb>
</view> --> </view> -->
<view class="carousel"> <view class="carousel">
<el-carousel height="170px"> <common-swiper page="spot"/>
<el-carousel-item v-for="item in 4" :key="item"> <view class="goods-options">
<image class="carousel-img" <el-row class="">
src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg" <el-button @click="toRelease" type="primary" round>发布现货</el-button>
mode="aspectFill"></image> <el-button @click="toMy" type="primary" round plain class="empty-bg-plain-btn">我发布的现货
</el-carousel-item> </el-button>
</el-carousel> </el-row>
<view class="goods-options"> </view>
<el-row class="">
<el-button @click="toRelease" type="primary" round>发布现货</el-button>
<el-button @click="toMy" type="primary" round plain class="empty-bg-plain-btn">我发布的现货
</el-button>
</el-row>
</view>
</view>
<!-- 筛选表单 -->
<view class="filter-outer">
<el-form @submit.native.prevent label-width="80px">
<el-form-item label="关键词" class="border-bottom pb-30">
<el-input @keyup.enter.native="search(1)" clearable placeholder="输入关键字搜索" v-model="keyword">
<i slot="prefix" class="el-input__icon el-icon-search"></i>
<el-button @click="search(1)" type="primary" slot="append" style="border-radius: 0">搜索
</el-button>
</el-input>
</el-form-item>
<el-form-item label="现货分类" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="clickedCateIndex = -1" class="pointer mr-25"
:class="[clickedCateIndex === -1 ? 'text-main selected-cate' : '']">全部
</text>
<view v-for="(item, index) in categoryTreeData" :key="index">
<text @click="clickedCateIndex = index" class="pointer mr-25"
:class="[clickedCateIndex === index ? 'text-main selected-cate' : '']"
v-if="index < 10">
{{ item.name }}
</text>
</view>
</view>
<view class="child-cate flex justify-start items-center flex-wrap">
<template v-if="clickedCateIndex === -1">
<text class="pointer mr-25" @click="selectCate(item._id)"
:class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"
v-for="(item, index) in allChildCate" :key="index">{{ item.name }}
</text>
</template>
<template v-else>
<text class="pointer mr-25" @click="selectCate(item._id)"
:class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"
v-for="(item, index) in categoryTreeData[clickedCateIndex].children" :key="index">
{{ item.name }}
</text>
</template>
</view>
</el-form-item>
<el-form-item label="城市" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="selectProvince(-1)" class="pointer mr-25 flex-grow-0"
:class="[checkProvinceList.length === 0 ? 'text-main selected-cate' : '']">全国
</text>
<view v-for="(item, index) in provinceData" :key="index" class="flex-grow-0 pointer mr-25">
<text @click="selectProvince(item.code)"
:class="[checkProvinceList.includes(item.code)? 'text-main selected-cate' : '']"
v-if="index < 10 || showAllProvince">
{{ item.name }}
</text>
</view>
<text @click="showAllProvince = !showAllProvince" class="pointer mr-25">查看更多
</text>
</view>
</el-form-item>
<el-form-item label="已选择">
<view class="tags">
<el-tag v-for="(item, index) in checkCategoryArr" :key="index">{{ item.name }}</el-tag>
</view>
</el-form-item>
</el-form>
</view>
<!-- 商品列表 -->
<view class="goods-list">
<view v-for="(item, index) in goodsData.rows" :key="index" class="goods"
:style="{marginRight:( (index + 1) % 5 === 0 && index > 0) ? 0 : '28px'}">
<view class="goods-title">{{ item.name }}</view>
<view class="goods-stock mt-40">现货库存:{{ item.stock }}吨</view>
<view class="goods-address text-gray">供货地:{{ item.addressStr }}</view>
<!-- <view class="goods-image">-->
<!-- <image :src="item.user.businessCard.logo" mode="aspectFit"></image>-->
<!-- </view>-->
<view v-if="item.user.accountType == 1" class="goods-company">{{ item.user.person.personName }}</view>
<view v-if="item.user.accountType == 2" class="goods-company">{{ item.user.company.companyName }}</view>
<el-button @click="vk.navigateTo('/pages/spot/goods/detail?id=' + item._id);" type="primary" plain
class="empty-bg-plain-btn"
size="small">立即查看
</el-button>
</view>
</view>
<view class="paginatio">
<el-pagination
:page-size="pageSize"
:current-page="goodsData.page"
@current-change="search"
background
layout="prev, pager, next"
:total="goodsData.total">
</el-pagination>
</view>
<right-bar></right-bar>
<common-footer></common-footer>
</view> </view>
<!-- 筛选表单 -->
<view class="filter-outer">
<el-form @submit.native.prevent label-width="80px">
<el-form-item label="关键词" class="border-bottom pb-30">
<el-input @keyup.enter.native="search(1)" clearable placeholder="输入关键字搜索" v-model="keyword">
<i slot="prefix" class="el-input__icon el-icon-search"></i>
<el-button @click="search(1)" type="primary" slot="append" style="border-radius: 0">搜索
</el-button>
</el-input>
</el-form-item>
<el-form-item label="现货分类" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="clickedCateIndex = -1" class="pointer mr-25"
:class="[clickedCateIndex === -1 ? 'text-main selected-cate' : '']">全部
</text>
<view v-for="(item, index) in categoryTreeData" :key="index">
<text @click="clickedCateIndex = index" class="pointer mr-25"
:class="[clickedCateIndex === index ? 'text-main selected-cate' : '']"
v-if="index < 10">
{{ item.name }}
</text>
</view>
</view>
<view class="child-cate flex justify-start items-center flex-wrap">
<template v-if="clickedCateIndex === -1">
<text class="pointer mr-25" @click="selectCate(item._id)"
:class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"
v-for="(item, index) in allChildCate" :key="index">{{ item.name }}
</text>
</template>
<template v-else>
<text class="pointer mr-25" @click="selectCate(item._id)"
:class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"
v-for="(item, index) in categoryTreeData[clickedCateIndex].children" :key="index">
{{ item.name }}
</text>
</template>
</view>
</el-form-item>
<el-form-item label="城市" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="selectProvince(-1)" class="pointer mr-25 flex-grow-0"
:class="[checkProvinceList.length === 0 ? 'text-main selected-cate' : '']">全国
</text>
<view v-for="(item, index) in provinceData" :key="index" class="flex-grow-0 pointer mr-25">
<text @click="selectProvince(item.code)"
:class="[checkProvinceList.includes(item.code)? 'text-main selected-cate' : '']"
v-if="index < 10 || showAllProvince">
{{ item.name }}
</text>
</view>
<!-- <text @click="showAllProvince = !showAllProvince" class="pointer mr-25">查看更多-->
<!-- </text>-->
</view>
</el-form-item>
<el-form-item label="已选择">
<view class="tags">
<el-tag v-for="(item, index) in checkCategoryArr" :key="index">{{ item.name }}</el-tag>
</view>
</el-form-item>
</el-form>
</view>
<div class="flex justify-between items-center w-1200 m-a">
<template v-if="ad9.length">
<el-carousel :height="`100px`" :style="{width: ad10.length ? '50%' : '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad9" :key="index" :style="{width: '100%'}">
<image @click="vk.navigateTo(`/pages/yellowPage/info?id=${item.companyId}`)"
class="pointer carousel-img" :src="item.swiper" mode="aspectFill"
:style="{width: '100%'}"/>
</el-carousel-item>
</el-carousel>
</template>
<template v-if="ad10.length">
<el-carousel :height="`100px`" :style="{width: ad9.length ? '50%' : '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad10" :key="index" :style="{width: '100%'}">
<image @click="vk.navigateTo(`/pages/yellowPage/info?id=${item.companyId}`)"
class="pointer carousel-img" :src="item.swiper" mode="aspectFill"
:style="{width: '100%'}"/>
</el-carousel-item>
</el-carousel>
</template>
</div>
<!-- 商品列表 -->
<template v-if="!loading">
<template v-if="goodsData.rows.length > 0">
<view class="goods-list">
<view v-for="(item, index) in goodsData.rows" :key="index" class="goods"
:style="{marginRight:( (index + 1) % 5 === 0 && index > 0) ? 0 : '28px'}">
<view class="top" v-if="item.isTop">特别推荐</view>
<view class="top" v-if="!item.isTop && index < 10">最新</view>
<view class="goods-title">{{ item.name }}</view>
<view class="goods-stock mt-40">现货库存:{{ item.stock }}吨</view>
<view class="goods-address text-gray">供货地:{{ item.addressStr }}</view>
<!-- <view class="goods-image">-->
<!-- <image :src="item.user.businessCard.logo" mode="aspectFit"></image>-->
<!-- </view>-->
<view class="goods-company">
<template v-if="item.user">
<view v-if="item.user.accountType == 1">{{
item.user.person.personName.replace(/^(.).*$/, "$1**")
}}
</view>
<view v-if="item.user.accountType == 2">{{
item.user.company.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6")
}}
</view>
</template>
</view>
<el-button @click="vk.navigateTo('/pages/spot/goods/detail?id=' + item._id);" type="primary"
plain
class="empty-bg-plain-btn"
size="small">立即查看
</el-button>
</view>
</view>
</template>
<view v-else class="flex justify-center items-center flex-col">
<data-null theme="outline" size="24" fill="#9b9b9b" strokeLinecap="square"/>
<text class="text-gray mt-20">暂无内容</text>
</view>
</template>
<view class="paginatio">
<el-pagination
:page-size="pageSize"
:current-page="pageIndex"
@current-change="search"
background
layout="prev, pager, next"
:total="goodsData.total">
</el-pagination>
</view>
<right-bar></right-bar>
<common-footer></common-footer>
</view>
</template> </template>
<script> <script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json"; import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import {DataNull} from '@icon-park/vue'
export default { export default {
data() { components: {DataNull},
return { data() {
pageSize: 20, return {
categoryTreeData: [], pageSize: 20,
allChildCate: [], pageIndex: 1,
checkCategoryList: [], categoryTreeData: [],
clickedCateIndex: -1, allChildCate: [],
provinceData: provinces, checkCategoryList: [],
checkProvinceList: [], clickedCateIndex: -1,
keyword: '', provinceData: provinces,
goodsData: { checkProvinceList: [],
total: 0, keyword: '',
rows: [] goodsData: {
}, total: 0,
showAllProvince: false rows: []
}; },
showAllProvince: true,
loading: false,
ad9: [],
ad10: [],
};
},
onLoad(options) {
if (options && options.keyword) this.keyword = options.keyword
},
onShow() {
this.search(1)
vk.callFunction({
url: 'client/spot/category/pub/getTree',
data: {},
success: (data) => {
this.categoryTreeData = data.rows
this.allChildCate = []
this.categoryTreeData.forEach(item => {
item.children.forEach(child => {
this.allChildCate.push(child)
})
})
}
});
},
methods: {
selectCate(id) {
const index = this.checkCategoryList.indexOf(id)
if (index === -1) this.checkCategoryList.push(id)
else this.checkCategoryList.splice(index, 1)
this.search(1)
}, },
onShow() { selectProvince(code) {
this.search(1) if (code === -1) this.checkProvinceList = []
vk.callFunction({ else {
url: 'client/spot/category/pub/getTree', // const index = this.checkProvinceList.indexOf(code)
title: '请求中...', // if (index === -1) this.checkProvinceList.push(code)
data: {}, // else this.checkProvinceList.splice(index, 1)
success: (data) => { this.checkProvinceList = [code]
this.categoryTreeData = data.rows }
this.allChildCate = [] this.search(1)
this.categoryTreeData.forEach(item => {
item.children.forEach(child => {
this.allChildCate.push(child)
})
})
}
});
}, },
methods: { async toRelease() {
selectCate(id) { const {userInfo, accountNum} = await vk.callFunction({
const index = this.checkCategoryList.indexOf(id) url: 'user/kh/getMyUserInfo'
if (index === -1) this.checkCategoryList.push(id) })
else this.checkCategoryList.splice(index, 1) console.log(userInfo.businessCard)
this.search(1) if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
}, this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
selectProvince(code) { confirmButtonText: '确定',
if (code === -1) this.checkProvinceList = [] cancelButtonText: '取消',
else { type: 'warning'
const index = this.checkProvinceList.indexOf(code) }).then(() => {
if (index === -1) this.checkProvinceList.push(code) vk.navigateTo({url: '/pages/user/user?menu=fadada'});
else this.checkProvinceList.splice(index, 1) })
} } else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.search(1) this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
}, confirmButtonText: '确定',
async toRelease() { cancelButtonText: '取消',
const {userInfo} = await vk.callFunction({ type: 'warning'
url: 'user/kh/getMyUserInfo' }).then(() => {
}) vk.navigateTo({url: '/pages/user/user?menu=fadada'});
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) { })
this.$confirm('您尚未认证, 是否前往认证?', '提示', { } else if (accountNum === 0) {
confirmButtonText: '确定', this.$confirm('请先到个人中心添加收款账户', '提示', {
cancelButtonText: '取消', confirmButtonText: '确定',
type: 'warning' cancelButtonText: '取消',
}).then(() => { type: 'warning'
vk.navigateTo({url: '/pages/user/user?menu=fadada'}); }).then(() => {
}) vk.navigateTo({url: '/pages/user/user?menu=account'});
} else if (vk.pubfn.isNull(userInfo.businessCard)) { })
this.$confirm('请完善名片信息', '提示', { } else {
confirmButtonText: '确定', if (userInfo.businessCard.status !== 1) {
cancelButtonText: '取消', this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
type: 'warning' confirmButtonText: '确定',
}).then(() => { cancelButtonText: '取消',
vk.navigateTo({url: '/pages/user/user?menu=business-card'}); type: 'warning'
}) })
} else { return
vk.navigateTo({
url: '/pages/spot/release/release'
})
}
},
async toMy() {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm && userInfo.authStatus === 1) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.getCertUrl()
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('请完善名片信息', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=business-card');
})
} else {
vk.navigateTo({
url: '/pages/spot/goods/my'
})
}
},
search(pageIndex) {
vk.callFunction({
url: 'client/spot/goods/pub/getList',
data: {
pageIndex: pageIndex,
pageSize: this.pageSize,
keyword: this.keyword,
categoryIds: this.checkCategoryList,
provinceCodes: this.checkProvinceList
},
success: (data) => {
console.log('data: ', data);
data.rows.forEach(item => {
try {
item.addressStr = item.address.province.name + "-" + item.address.city.name + "-" + item.address.area.name
} catch (err) {
item.addressStr = ""
}
})
this.goodsData = data
}
});
},
getCertUrl() {
vk.callFunction({
url: 'client/fadada.getVerifyUrl',
success: (res) => {
location.href = res.data.url
}
});
},
},
computed: {
checkCategoryArr() {
const arr = []
this.allChildCate.forEach(item => {
if (this.checkCategoryList.includes(item._id)) arr.push(item)
})
this.provinceData.forEach(item => {
if (this.checkProvinceList.includes(item.code)) {
arr.push(item)
}
})
return arr
} }
if (userInfo.userLevel < 1) {
this.$confirm('非年费会员,无法发布现货', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
vk.navigateTo({
url: '/pages/spot/release/release'
})
}
},
async toMy() {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm && userInfo.authStatus === 1) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=fadada');
})
} else {
if (userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
if (userInfo.userLevel < 1) {
this.$confirm('非年费会员,无法发布现货', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
vk.navigateTo({
url: '/pages/spot/goods/my'
})
}
},
search(pageIndex) {
this.loading = true
vk.callFunction({
url: 'client/spot/goods/pub/getList',
title: '请求中...',
data: {
pageIndex: pageIndex,
pageSize: this.pageSize,
keyword: this.keyword,
// categoryIds: this.allChildCate.filter(item => this.checkCategoryList.includes(item._id)).map(item => item.name),
categoryIds: this.checkCategoryList,
provinceCodes: this.checkProvinceList
},
success: (data) => {
this.loading = false
data.rows.forEach(item => {
try {
item.addressStr = item.address.province.name + "-" + item.address.city.name + "-" + item.address.area.name
} catch (err) {
item.addressStr = ""
}
})
this.goodsData = data
this.getAd9()
this.getAd10()
}
});
},
getCertUrl() {
vk.callFunction({
url: 'client/fadada.getVerifyUrl',
success: (res) => {
location.href = res.data.url
}
});
},
async getAd9() {
this.ad9 = []
// if (this.checkProvinceList.length === 0) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 9,
region: this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null
}
})
if (res.data) this.ad9 = res.data
// }else {
// const {rows} = await vk.callFunction({
// url: 'client/user/pub/getCompany',
// data: {
// pageIndex: 1,
// pageSize: 5,
// isCoop: 1,
// province: this.checkProvinceList
// }
// })
// rows.forEach(item => {
// if (item.businessCard.album && item.businessCard.album.length > 0) {
// this.ad9.push({
// swiper: Array.isArray(item.businessCard.album) ? item.businessCard.album[0] : item.businessCard.album,
// companyId: item._id
// })
// }
// })
// }
},
async getAd10() {
this.ad10 = []
// if (this.checkProvinceList.length === 0) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 10,
region: this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null
}
})
if (res.data) this.ad10 = res.data
// } else {
// const {rows} = await vk.callFunction({
// url: 'client/user/pub/getCompany',
// data: {
// pageIndex: 2,
// pageSize: 5,
// isCoop: 1,
// province: this.checkProvinceList
// }
// })
// rows.forEach(item => {
// if (item.businessCard.album && item.businessCard.album.length > 0) {
// this.ad10.push({
// swiper: Array.isArray(item.businessCard.album) ? item.businessCard.album[0] : item.businessCard.album,
// companyId: item._id
// })
// }
// })
// }
},
},
computed: {
checkCategoryArr() {
const arr = []
this.allChildCate.forEach(item => {
if (this.checkCategoryList.includes(item._id)) arr.push(item)
})
this.provinceData.forEach(item => {
if (this.checkProvinceList.includes(item.code)) {
arr.push(item)
}
})
return arr
} }
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.carousel { .carousel {
width: 1200px; width: 1200px;
margin: 20px auto; margin: 20px auto;
} }
.carousel-img { .carousel-img {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.goods-options { .goods-options {
background-color: #FFFFFF; background-color: #FFFFFF;
padding: 20px; padding: 20px;
} }
.filter-outer { .filter-outer {
width: 1200px; width: 1200px;
margin: 20px auto; margin: 20px auto;
background-color: #FFFFFF; background-color: #FFFFFF;
padding: 20px; padding: 20px;
} }
.tags { .tags {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
.el-tag { .el-tag {
margin-right: 10px; margin-right: 10px;
} }
} }
.goods-list { .goods-list {
width: 1200px; width: 1200px;
margin: 20px auto; margin: 20px auto;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
} }
.goods { .goods {
width: 217px; width: 217px;
background-color: #FFFFFF; background-color: #FFFFFF;
box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.05); box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.05);
text-align: center;
margin-right: 20px;
margin-bottom: 25px;
padding: 10px 20px;
position: relative;
.top {
position: absolute;
right: 0;
top: 0;
background-color: rgba(169, 41, 36, 1);
padding: 2px 5px;
border-radius: 0 0 0 5px;
color: #FFFFFF;
}
&-title {
font-size: 15px;
color: #101010;
height: 62px;
padding-top: 20px;
font-weight: bold;
}
&-stock {
font-size: 12px;
color: #BD3124;
}
&-address {
font-size: 12px;
margin: 10px 0;
height: 35px;
}
&-image {
width: 200px;
height: 70px;
margin: 0 auto;
image {
width: 100%;
height: 100%;
}
}
&-company {
color: #4F4F4F;
font-size: 14px;
margin: 10px 0;
height: 45px;
}
&-buy {
width: 108px;
height: 30px;
line-height: 30px;
background-color: rgba(255, 255, 255, 1);
color: rgba(169, 41, 36, 1);
font-size: 13px;
text-align: center; text-align: center;
margin-right: 20px; font-family: Roboto;
margin-bottom: 25px; border: 1px solid rgba(169, 41, 36, 1);
padding: 10px 20px; margin: 0 auto;
cursor: pointer;
}
&-title { .goods-image {
font-size: 15px; width: 100%;
color: #101010; }
height: 62px;
padding-top: 20px;
font-weight: bold;
}
&-stock {
font-size: 12px;
color: #BD3124;
}
&-address {
font-size: 12px;
margin: 10px 0;
}
&-image {
width: 200px;
height: 70px;
margin: 0 auto;
image {
width: 100%;
height: 100%;
}
}
&-company {
color: #4F4F4F;
font-size: 14px;
margin: 10px 0;
}
&-buy {
width: 108px;
height: 30px;
line-height: 30px;
background-color: rgba(255, 255, 255, 1);
color: rgba(169, 41, 36, 1);
font-size: 13px;
text-align: center;
font-family: Roboto;
border: 1px solid rgba(169, 41, 36, 1);
margin: 0 auto;
cursor: pointer;
}
.goods-image {
width: 100%;
}
} }
.paginatio { .paginatio {
float: none; float: none;
width: 1200px; width: 1200px;
margin: 20px auto; margin: 20px auto;
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
.selected-cate { .selected-cate {
border-bottom: 2px solid #BD3124; border-bottom: 2px solid #BD3124;
line-height: 40rpx; line-height: 40rpx;
} }
.child-cate { .child-cate {
background-color: #DB8382; background-color: #DB8382;
color: white; color: white;
margin-top: 10rpx; margin-top: 10rpx;
border-radius: 15rpx; border-radius: 15rpx;
padding: 0 20rpx; padding: 0 20rpx;
} }
</style> </style>
+14 -13
View File
@@ -4,13 +4,14 @@
<common-header></common-header> <common-header></common-header>
<category-bar></category-bar> <category-bar></category-bar>
<view class="carousel"> <view class="carousel">
<el-carousel height="170px"> <!-- <el-carousel height="170px">-->
<el-carousel-item v-for="item in 4" :key="item"> <!-- <el-carousel-item v-for="item in 4" :key="item">-->
<image class="carousel-img" <!-- <image class="carousel-img"-->
src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg" <!-- src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"-->
mode="aspectFill"></image> <!-- mode="aspectFill"></image>-->
</el-carousel-item> <!-- </el-carousel-item>-->
</el-carousel> <!-- </el-carousel>-->
<common-swiper page="spot-mine" :height="200"/>
<view class="goods-options"> <view class="goods-options">
<el-row class=""> <el-row class="">
<el-button @click="toRelease" type="primary" round>发布现货</el-button> <el-button @click="toRelease" type="primary" round>发布现货</el-button>
@@ -67,7 +68,7 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
vk.callFunction({ vk.callFunction({
url: 'client/enquiry/sheet/kh/delete', url: 'client/spot/goods/kh/delete',
title: '请求中...', title: '请求中...',
data: { data: {
_id: item._id _id: item._id
@@ -101,7 +102,7 @@
}, },
{ {
key: "_add_time_srt", key: "_add_time_str",
title: "发布时间", title: "发布时间",
type: "time", type: "time",
width: 160 width: 160
@@ -123,20 +124,20 @@
toRelease() { toRelease() {
if (!vk.getVuex('$user.userInfo.fadadaConfirm')) { if (!vk.getVuex('$user.userInfo.fadadaConfirm')) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', { this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.getCertUrl() vk.navigateTo({url: '/pages/user/user?menu=fadada'});
}) })
} else if (vk.pubfn.isNull(vk.getVuex('$user.userInfo.businessCard'))) { } else if (vk.pubfn.isNull(vk.getVuex('$user.userInfo.businessCard'))) {
this.$confirm('请完善名片信息', '提示', { this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
vk.navigateTo('/pages/user/user?menu=business-card'); vk.navigateTo('/pages/user/user?menu=fadada');
}) })
} else { } else {
uni.navigateTo({ uni.navigateTo({
+357 -162
View File
@@ -1,177 +1,372 @@
<template> <template>
<view> <view>
<top-bar></top-bar> <top-bar></top-bar>
<common-header></common-header> <common-header></common-header>
<category-bar></category-bar> <category-bar></category-bar>
<view class="page-nav"> <view class="page-nav">
<el-breadcrumb separator="/"> <el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item> <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item><navigator style="display: inline-block;" url="/pages/spot/goods/goods">现货市场</navigator></el-breadcrumb-item> <el-breadcrumb-item>
<el-breadcrumb-item>发布现货</el-breadcrumb-item> <navigator style="display: inline-block;" url="/pages/spot/goods/goods">现货市场</navigator>
</el-breadcrumb> </el-breadcrumb-item>
</view> <el-breadcrumb-item>发布现货</el-breadcrumb-item>
</el-breadcrumb>
</view>
<view class="form-view"> <view class="form-view">
<vk-data-form ref="form1" v-model="form1.data" :action="form1.props.action" :columns="form1.props.columns" <!-- <vk-data-form ref="form1" v-model="form1.data" :action="form1.props.action" :columns="form1.props.columns"-->
:rules="form1.props.rules" :form-type="form1.props.formType" :loading.sync="form1.props.loading" <!-- :rules="form1.props.rules" :form-type="form1.props.formType"-->
:before-action="form1.props.beforeAction" :auto-close="true" label-width="140px" <!-- :loading.sync="form1.props.loading"-->
@success="onFormSuccess"> <!-- :before-action="form1.props.beforeAction" :auto-close="true" label-width="140px"-->
<template v-slot:name="{ form, keyName }"> <!-- :show-cancel="false"-->
<el-input v-model="productName" readonly placeholder="请添加现货分类"></el-input> <!-- @success="onFormSuccess">-->
</template> <!-- <template v-slot:name="{ form, keyName }">-->
</vk-data-form> <!-- <el-input v-model="productName" readonly placeholder="请添加现货分类"></el-input>-->
</view> <!-- </template>-->
</view> <!-- </vk-data-form>-->
<el-form ref="form" :model="form1.data" label-width="140px">
<el-form-item label="现货名称">
<el-input v-model="form1.data.name" placeholder="请输入现货名称" readonly></el-input>
</el-form-item>
<el-form-item label="现货分类" required>
<el-checkbox-group v-model="form1.data.categoryIds" @change="makeTitle">
<el-checkbox v-for="(item, index) in category" :key="index" :label="item._id">{{
item.name
}}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="库存(吨)" required>
<el-input v-model="form1.data.stock" placeholder="请输入库存(吨)" type="number"/>
</el-form-item>
<el-form-item label="现货存放地" required>
<vk-data-input-address :level="3" v-model="form1.data.address" @change="getAmount()"/>
</el-form-item>
<el-form-item label="产品规格单价">
<vk-data-upload v-model="form1.data.files" list-type="text"
accept=".jpg,.jpeg,.png,.xlsx,.doc,.docx,.pdf"/>
</el-form-item>
<el-form-item label="报价有效期">
<el-date-picker :picker-options="pickerOptions"
v-model="form1.data.answerEndTime"
type="datetime"/>
</el-form-item>
<el-form-item label="产品现场图片">
<vk-data-upload v-model="form1.data.images" list-type="text" accept=".jpg,.jpeg,.png"/>
</el-form-item>
<el-form-item label="是否购买全国广告位">
<el-radio-group v-model="form1.data.buyAll" @change="getAmount(true)">
<el-radio :label="true">是</el-radio>
<el-radio :label="false">否</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="是否购买省份广告位">
<el-radio-group v-model="form1.data.buyTop" @change="getAmount()"
:disabled="form1.data.buyAll || JSON.stringify(form1.data.address) === '{}' || totalAmount === 0">
<el-radio :label="true">是</el-radio>
<el-radio :label="false">否</el-radio>
</el-radio-group>
</el-form-item>
<p class="text-main text-25 my-20" v-if="form1.data.buyAll">
您已选择购买全国广告位,无法继续购买省份广告位</p>
<el-form-item label="购买时长(月)">
<el-input-number v-model="form1.data.buyTopNum" :min="1"/>
</el-form-item>
<el-form-item label="广告位价格">
{{ totalAmount }}元
</el-form-item>
</el-form>
<div class="text-center">
<el-button type="primary" @click="add">发布</el-button>
</div>
</view>
</view>
</template> </template>
<script> <script>
export default {
data() {
return {
// 表单相关开始-----------------------------------------------------------
form1: {
// 表单请求数据,此处可以设置默认值
data: {
}, export default {
// 表单属性 data() {
props: { return {
// 表单请求地址 pickerOptions: {
action: "client/spot/goods/kh/addUpdate", disabledDate(time) {
// 表单字段显示规则 return time.getTime() < Date.now();
columns: [{ },
key: "name", },
title: "现货名称", category: [],
type: "text", // 表单相关开始-----------------------------------------------------------
}, form1: {
{ // 表单请求数据,此处可以设置默认值
key: "categoryIds", data: {
title: "现货分类", name: '',
type: "checkbox", stock: '',
action: "client/spot/category/pub/getList", buyTop: false,
actionData: { buyAll: false,
whereJson: { buyTopNum: 1,
level: 2 categoryIds: [],
} files: [],
}, images: [],
props: { address: {},
list: "data", answerEndTime: null
value: "_id", },
label: "name" // 表单属性
}, props: {
watch: ({ // 表单请求地址
option action: "client/spot/goods/kh/addUpdate",
}) => { // 表单字段显示规则
console.log('res: ', option) columns: [{
key: "name",
this.form1.data.name = option.map(item => item.name).join('、') title: "现货名称",
this.productName = option.map(item => item.name).join('、') type: "text",
console.log(this.form1); },
} {
key: "categoryIds",
title: "现货分类",
type: "checkbox",
action: "client/spot/category/pub/getList",
actionData: {
whereJson: {
level: 2
}
},
props: {
list: "data",
value: "_id",
label: "name"
},
watch: ({
option
}) => {
if (this.form1.data.categoryIds.length > 5) {
this.$message.error('最多选择五个分类')
this.form1.data.categoryIds.splice(-1, 1)
return
}
}, this.form1.data.name = option.map(item => item.name).join('、')
{ this.productName = option.map(item => item.name).join('、')
key: "stock", },
title: "库存(吨)", },
type: "number" {
}, key: "stock",
{ title: "库存(吨)",
key: "address", type: "number"
title: "供货地", },
type: "address" {
}, key: "address",
{ title: "供货地",
key: "files", type: "address"
title: "附件文档", },
type: "file", {
buttonText: "点击上传", key: "files",
limit: 9, title: "附件文档",
accept: ".jpg,.png,.xlsx,.doc,.docx", type: "file",
tips: '上传自有采购单图片或文档,支持jpg/png/word/excel' buttonText: "点击上传",
}, limit: 9,
accept: ".jpg,.jpeg,.png,.xlsx,.doc,.docx,.pdf",
tips: '上传自有采购单图片或文档,支持jpg/png/word/excel'
},
{
key: "buyAll",
title: "是否购买全国广告位",
type: "radio",
data: [
{
value: true,
label: "是"
},
{
value: false,
label: "否"
}
],
watch: ({value, formData}) => {
if (value) {
formData.buyTop = false
}
}
},
{
key: "buyTop",
title: "是否购买广告位",
type: "radio",
data: [
{
value: true,
label: "是"
},
{
value: false,
label: "否"
}
],
disabled: formData => {
return formData.buyAll
}
},
{
key: "buyTopNum",
title: "购买广告位时长(月)",
type: "number",
controls: true,
precision: 0,
min: 1,
step: 1,
rightText: '月'
},
{
key: "amount",
title: "价格",
type: "text",
readonly: true,
placeholder: '请选择供货地'
},
], ],
// 表单验证规则 // 表单验证规则
rules: { rules: {
categoryIds: [ categoryIds: [
{ {
required: true, required: true,
message: "现货名称不能为空", message: "现货名称不能为空",
trigger: ['blur', 'change'] trigger: ['blur', 'change']
}, },
{ {
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
if (value.length > 5) { if (value.length > 5) {
callback(new Error('最多选择五个分类')); callback(new Error('最多选择五个分类'));
} else { } else {
callback() callback()
} }
}, },
trigger: ['blur', 'change'] trigger: ['blur', 'change']
}, },
], ],
stock: [ stock: [
{ {
required: true, required: true,
message: "请填写库存", message: "请填写库存",
trigger: ['blur', 'change'] trigger: ['blur', 'change']
}, },
{ {
min: 0, min: 0,
type: 'number', type: 'number',
message: "库存不能小于0", message: "库存不能小于0",
trigger: ['blur', 'change'] trigger: ['blur', 'change']
}, },
], ],
address: [ address: [
{ {
required: true, required: true,
message: "请填写地址", message: "请填写地址",
trigger: ['blur', 'change'] trigger: ['blur', 'change']
} }
] ]
},
}, // add 代表添加 update 代表修改
// add 代表添加 update 代表修改 formType: "add",
formType: "add", // 表单是否在请求中
// 表单是否在请求中 loading: false,
loading: false, // 是否显示表单1 的弹窗
// 是否显示表单1 的弹窗 show: false
show: false }
} },
}, productName: '',
productName: '' amount: '',
// 表单相关结束----------------------------------------------------------- // 表单相关结束-----------------------------------------------------------
}; };
}, },
onLoad() { onLoad() {
vk.callFunction({ this.getCategory()
url: 'client/spot/goods/kh/getSelfOne', vk.callFunction({
success: (res) => { url: 'client/spot/goods/kh/getSelfOne',
if(res.data) { success: (res) => {
this.$refs.form1.setResetFormData(res.data); if (res.data) {
this.$refs.form1.resetForm(); this.$refs.form1.setResetFormData(res.data);
this.productName = res.data.name this.$refs.form1.resetForm();
} this.productName = res.data.name
}
}
});
},
methods: {
onFormSuccess() {
vk.navigateBack()
} }
} });
} },
methods: {
onFormSuccess(res) {
if (this.form1.data.buyTop) {
vk.navigateTo({
url: `/pages/index/shop/pay?id=${res.data.data}`
})
} else vk.redirectTo({url: '/pages/spot/goods/goods'});
},
getCategory() {
vk.callFunction({
url: 'client/spot/category/pub/getList',
data: {
whereJson: {
level: 2
},
},
success: (res) => {
if (res.data) {
this.category = res.data;
}
}
});
},
makeTitle(val) {
if (val.length > 5) {
this.form1.data.categoryIds.splice(-1)
return this.$message.error('最多选择五个分类');
}
this.form1.data.name = this.category.filter(item => val.includes(item._id)).map(item => item.name).join('、')
this.$forceUpdate()
},
getAmount(isAll = false) {
if (!isAll && JSON.stringify(this.form1.data.address) === '{}') return
vk.callFunction({
url: 'client/spot/amount/pub/getDetail',
data: {
province: isAll ? -1 : this.form1.data.address.province.code,
},
success: (res) => {
if (res.data) {
this.amount = parseFloat(res.data.amount)
}
}
});
},
async add() {
if (this.form1.data.categoryIds.length === 0) return this.$message.error('请选择分类')
if (!this.form1.data.stock) return this.$message.error('请填写库存')
if (JSON.stringify(this.form1.data.address) === '{}') return this.$message.error('请选择供货地')
const res = await vk.callFunction({
title: '请求中...',
url: 'client/spot/goods/kh/addUpdate',
data: this.form1.data
})
if (this.form1.data.buyTop || this.form1.data.buyAll) {
vk.navigateTo({
url: `/pages/index/shop/pay?id=${res.data}`
})
} else vk.redirectTo({url: '/pages/spot/goods/goods'});
}
},
computed: {
totalAmount() {
let amount = 0
if (this.amount) amount = this.amount * this.form1.data.buyTopNum
return amount
}
}
}
</script> </script>
<style lang="scss"> <style lang="scss">
.form-view { .form-view {
width: 1200px; width: 1200px;
margin: 0 auto; margin: 0 auto;
background-color: #FFFFFF; background-color: #FFFFFF;
padding: 20rpx; padding: 20rpx;
} }
</style> </style>
+24
View File
@@ -0,0 +1,24 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="flex justify-center items-center p-20 bg-white" style="overflow: hidden">
<iframe src="/static/gangcai-cal/index.html" frameborder="0" scrolling="no"
style="width: 500px; height: 600px;overflow: hidden"></iframe>
<image src="/static/images/banner@2x.png" class="ml-20" style="width: 406px;height: 512px"/>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
name: "stealCal",
data() {
return {}
},
methods: {}
}
</script>
+900 -573
View File
File diff suppressed because it is too large Load Diff
+79
View File
@@ -0,0 +1,79 @@
<template>
<el-card>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
询价单管理
</view>
</view>
<text class="text-gray text-25 pointer">查看全部 <i class="el-icon-arrow-right"></i></text>
</view>
</view>
<view class="flex justify-center items-center">
<view class="flex flex-col justify-center items-center">
<text class="text-main text-50">{{ enquiry.noQuote }}</text>
<text>待报价</text>
</view>
<view class="flex flex-col justify-center items-center">
<text class="text-main text-50">{{ enquiry.notPick }}</text>
<text>待选商</text>
</view>
<view class="flex flex-col justify-center items-center">
<text class="text-main text-50">{{ enquiry.picked }}</text>
<text>已选商</text>
</view>
<view class="flex flex-col justify-center items-center">
<text class="text-main text-50">{{ enquiry.closed }}</text>
<text>已关闭</text>
</view>
</view>
</el-card>
</template>
<script>
export default {
name: "enquiryData",
data() {
return {
enquiry: {
noQuote: 0,
notPick: 0,
picked: 0,
closed: 0
},
}
},
methods: {}
}
</script>
<style scoped lang="scss">
@import "@/common/css/app.scss";
.item-wrap {
margin: 24px 0;
.form-title-wrap {
display: flex;
align-items: center;
justify-content: space-between;
.goods-info-title {
display: flex;
align-items: center;
justify-content: flex-start;
}
.form-title {
padding-left: 10px;
color: $--color-primary;
font-size: 18px;
line-height: 18px;
border-left: 4px solid $--color-primary;
}
}
}
</style>
+32 -6
View File
@@ -11,18 +11,30 @@
<view class="mt-15"> <view class="mt-15">
<view class="request-header"> <view class="request-header">
<text class="flex-1">供应商</text> <text class="flex-1">供应商</text>
<text class="flex-1">报价时间</text>
<text class="flex-1">联系方式</text> <text class="flex-1">联系方式</text>
<text class="flex-1">报价</text> <text class="flex-1">报价</text>
<text class="flex-1">详情</text>
<text class="flex-1">供应商合同补充条款</text>
<text class="flex-1">报价时间</text>
<text class="flex-1">附件</text>
<text class="flex-1">操作</text> <text class="flex-1">操作</text>
</view> </view>
<view class="quote" v-for="(item, index) in quoteList" :key="index"> <view class="quote" v-for="(item, index) in quoteList" :key="index">
<text class="flex-1">{{ item.subjectName }}</text> <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.subjectMobile }}</text>
<text class="flex-1">{{ item.totalPrice }}元</text> <text class="flex-1">{{ item.totalPrice }}元</text>
<text class="flex-1">{{ item.remark ? item.remark : '无' }}</text>
<text class="flex-1">{{ item.supplierExt ? item.supplierExt : '无' }}</text>
<text class="flex-1">{{ item._add_time_str }}</text>
<text class="flex-1"> <text class="flex-1">
<el-button type="primary" v-if="status === 0" @click.native="confirm(item)">选择</el-button> <template v-if="item.files && item.files.length > 0">
<file-type v-for="(file, fileIndex) in item.files" :key="fileIndex" :item="file"
@click.native="openDownload(file)"/>
</template>
<text v-else>无</text>
</text>
<text class="flex-1">
<el-button type="primary" v-if="item.status === 0" @click.native="confirm(item)">选择</el-button>
</text> </text>
</view> </view>
</view> </view>
@@ -33,8 +45,11 @@
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json"; 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 citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json"; import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
import FileType from "../../../components/file-type/file-type.vue";
export default { export default {
name: "enquiryModal", name: "enquiryModal",
components: {FileType},
data() { data() {
return { return {
provinceData: provinces, provinceData: provinces,
@@ -43,12 +58,13 @@ export default {
id: null, id: null,
dialogVisible: false, dialogVisible: false,
quoteList: [], quoteList: [],
status: 0 info: null
} }
}, },
methods: { methods: {
open(status, quoteList) { open(info) {
this.quoteList = quoteList this.info = info
this.quoteList = info.quoteList
this.dialogVisible = true this.dialogVisible = true
}, },
handleClose() { handleClose() {
@@ -72,8 +88,18 @@ export default {
type: 'success', type: 'success',
message: '报价确认成功' message: '报价确认成功'
}) })
setTimeout(() => {
if (this.info.signMethod === 0) vk.navigateTo('/pages/contract/index?tab=1')
else {
if (this.info.signMethod === 1) vk.navigateTo('/pages/store/buyer')
else vk.navigateTo('/pages/contract/index?tab=0')
}
}, 500)
} }
}); });
},
openDownload(url) {
window.open(url)
} }
} }
} }
+178
View File
@@ -0,0 +1,178 @@
<template>
<view>
<el-dialog
title="报价列表"
:visible.sync="dialogVisible"
width="60%"
:before-close="handleClose">
<view slot="title" class="text-main text-40 m-30 flex justify-between items-center">
<text>收到的报价列表</text>
<el-button type="primary" @click.native="dialogVisible = false">关闭</el-button>
</view>
<view class="mt-15" v-if="quoteList">
<view class="request-header">
<text class="flex-1">报价方</text>
<text class="flex-1">报价时间</text>
<text class="flex-1">联系方式</text>
<text class="flex-1">报价</text>
<text class="flex-1">详情</text>
<text class="flex-1">补充协议</text>
<text class="flex-1">附件</text>
<text class="flex-1">操作</text>
</view>
<view class="quote" v-for="(item, index) in quoteList" :key="index">
<text class="flex-1">{{ item.subjectName }}</text>
<text class="flex-1">{{ item._add_time_str }}</text>
<text class="flex-1">{{ item.user.mobile }}</text>
<text class="flex-1">{{ item.totalPrice }}元</text>
<text class="flex-1">{{ item.remark }}</text>
<text class="flex-1">{{ item.supplierExt ? item.supplierExt : '无' }}</text>
<view class="flex-1">
<view class="flex-1">
<view class="mt-15 mr-15" v-for="(file, fileIndex) in item.files" :key="fileIndex">
<file-type :item="file" @click.native="openDownload(file)"/>
</view>
</view>
</view>
<text class="flex-1">
<el-button type="primary" @click.native="createContract(item._id)" v-if="status === 0">选择</el-button>
</text>
</view>
</view>
</el-dialog>
<vk-data-dialog
v-model="showInfo"
title="申请详情"
width="600px"
top="14vh"
center
:close-on-click-modal="true"
>
<vk-data-detail-table
:data="info"
:columns="infoColumns"
size="medium"
label-width="150px"
></vk-data-detail-table>
<template v-slot:footer>
<el-button @click="showInfo = false">关闭</el-button>
</template>
</vk-data-dialog>
</view>
</template>
<script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
import {FileExcel, FilePdfOne, FileWord} from "@icon-park/vue";
export default {
name: "oldModal",
components: {FilePdfOne, FileExcel, FileWord},
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
id: null,
dialogVisible: false,
quoteList: [],
status: 0,
infoColumns: [
{key: "company.companyName", title: "申请人", type: "text"},
{key: "company.mobile", title: "联系方式", type: "text"},
{key: "manager.personName", title: "代理人", type: "text"},
{key: "manager.mobile", title: "代理人联系方式", type: "text"},
],
info: null,
showInfo: false,
signMethod: 0
}
},
methods: {
open(id, status, quoteList, signMethod) {
this.id = id
this.status = status
this.quoteList = quoteList
this.signMethod = signMethod
this.dialogVisible = true
},
handleClose() {
this.dialogVisible = false
},
toQuote() {
vk.navigateTo(`/pages/process/quote?sheetId=${this.id}`)
},
async createContract(quoteId) {
await vk.callFunction({
url: 'client/old/kh/confirmQuote',
title: '请求中...',
data: {
quoteId,
}
});
this.dialogVisible = false
this.$message({
message: "选择成功",
type: 'success'
})
if (this.signMethod === 0) vk.navigateTo('/pages/contract/index?tab=1')
else {
if (this.signMethod === 1) vk.navigateTo('/pages/store/store?menuIndex=2')
else vk.navigateTo('/pages/contract/index?tab=0&tradeMethod=0')
}
},
getOldInfo() {
vk.callFunction({
url: 'client/old/pub/getDetail',
title: '请求中...',
data: {
id: this.id,
}
}).then(res => {
this.info = res.data
})
},
doShowInfo(info) {
this.info = info
this.showInfo = true
},
openDownload(url) {
window.open(url)
}
}
}
</script>
<style lang="scss" scoped>
.request-header {
border: 1px solid #EDEDED;
background-color: #FFF8F1;
display: flex;
align-items: center;
justify-content: center;
padding: 15px;
margin-top: 30px;
text {
text-align: center;
}
}
.quote {
border-left: 1px solid #EDEDED;
border-right: 1px solid #EDEDED;
border-bottom: 1px solid #EDEDED;
display: flex;
align-items: center;
justify-content: center;
padding: 15px;
text {
text-align: center;
}
}
</style>
+120 -97
View File
@@ -1,120 +1,143 @@
<template> <template>
<el-dialog <el-dialog
title="报价列表" title="报价列表"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
width="60%" width="60%"
:before-close="handleClose"> :before-close="handleClose">
<view slot="title" class="text-main text-40 m-30 flex justify-between items-center"> <view slot="title" class="text-main text-40 m-30 flex justify-between items-center">
<text>收到的加工申请</text> <text>收到的加工申请</text>
<el-button type="primary" @click.native="dialogVisible = false">关闭</el-button> <el-button type="primary" @click.native="dialogVisible = false">关闭</el-button>
</view>
<view class="mt-15">
<view class="request-header">
<text class="flex-1">申请人</text>
<text class="flex-1">报价</text>
<text class="flex-1">补充条款</text>
<text class="flex-1">附件</text>
<text class="flex-1">申请时间</text>
<text class="flex-1">操作</text>
</view>
<view class="quote" v-for="(item, index) in quoteList.rows" :key="index">
<text class="flex-1" v-if="item.user">{{
item.user.accountType === 1 ? item.user.person.personName : item.user.company.companyName
}}
</text>
<text class="flex-1">{{ item.totalPrice }}元</text>
<view class="flex-1 flex flex-col justify-start items-start">
<text>加工方补充条款:{{ item.supplierExt ? item.supplierExt : '无' }}</text>
</view> </view>
<view class="mt-15" > <!-- <text class="flex-1">{{ item.remark }}</text>-->
<view class="request-header"> <text class="flex-1">
<text class="flex-1">加工商</text> <file-type v-for="(file, fileIndex) in item.files" :key="fileIndex" :item="file"
<text class="flex-1">报价</text> @click.native="openDownload(file)"/>
<text class="flex-1">申请时间</text> </text>
<text class="flex-1">操作</text> <text class="flex-1">{{ item._add_time_str }}</text>
</view> <text class="flex-1">
<view class="quote" v-for="(item, index) in quoteList.rows" :key="index"> <el-button type="primary" @click.native="createContract(item)" v-if="item.status === 0">选择</el-button>
<text class="flex-1">{{ </text>
item.user.accountType === 1 ? item.user.person.personName : item.user.company.companyName </view>
}} </view>
</text> </el-dialog>
<text class="flex-1">{{ item.totalPrice }}元</text>
<text class="flex-1">{{ item._add_time_str }}</text>
<text class="flex-1">
<el-button type="primary" @click.native="createContract(item)" v-if="status === 0">选择</el-button>
</text>
</view>
</view>
</el-dialog>
</template> </template>
<script> <script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json"; 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 citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json"; import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
import FileType from "../../../components/file-type/file-type.vue";
export default { export default {
name: "processModal", name: "processModal",
data() { components: {FileType},
return { data() {
provinceData: provinces, return {
cityData: citys, provinceData: provinces,
areaData: areas, cityData: citys,
id: null, areaData: areas,
dialogVisible: false, id: null,
quoteList: [], info: null,
status: 0 dialogVisible: false,
} quoteList: [],
}, status: 0
methods: {
open(status, quoteList) {
console.log(status, quoteList)
this.quoteList = quoteList
this.dialogVisible = true
},
handleClose() {
this.dialogVisible = false
},
toQuote() {
vk.navigateTo(`/pages/process/quote?sheetId=${this.id}`)
},
createContract({totalPrice, uid, _id}) {
vk.callFunction({
url: 'client/contract/kh/add',
data: {
type: 'process',
productTitle: this.info.title,
transactionId: vk.pubfn.createOrderNo("P", 20),
sheetId: this.id,
quoteId: _id,
buyer: vk.getVuex('$user.userInfo._id'),
seller: uid,
amount: totalPrice,
partyCount: 2,
signCount: 0,
}
}).then((res) => {
this.$message({
message: '选择成功',
type: 'success'
})
setTimeout(() => {
vk.navigateTo('/pages/contract/index')
}, 1500)
})
}
} }
},
methods: {
open(info) {
this.info = info
this.id = info._id
this.quoteList = info.quoteList
this.dialogVisible = true
},
handleClose() {
this.dialogVisible = false
},
toQuote() {
vk.navigateTo(`/pages/process/quote?sheetId=${this.id}`)
},
createContract({totalPrice, uid, _id}) {
vk.callFunction({
url: 'client/contract/kh/add',
data: {
type: 'process',
productTitle: this.info.title,
transactionId: vk.pubfn.createOrderNo("P", 20),
sheetId: this.id,
quoteId: _id,
buyer: vk.getVuex('$user.userInfo._id'),
seller: uid,
amount: totalPrice,
partyCount: 2,
signCount: 0,
}
}).then((res) => {
this.dialogVisible = false
this.$message({
message: '选择成功',
type: 'success'
})
setTimeout(() => {
if (this.info.signMethod === 0) vk.navigateTo('/pages/contract/index?tab=1')
else {
if (this.info.signMethod === 1) vk.navigateTo('/pages/store/buyer')
else vk.navigateTo('/pages/contract/index?tab=0')
}
}, 500)
})
},
openDownload(url) {
window.open(url)
}
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.request-header { .request-header {
border: 1px solid #EDEDED; border: 1px solid #EDEDED;
background-color: #FFF8F1; background-color: #FFF8F1;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 15px; padding: 15px;
margin-top: 30px; margin-top: 30px;
text { text {
text-align: center; text-align: center;
} }
} }
.quote { .quote {
border-left: 1px solid #EDEDED; border-left: 1px solid #EDEDED;
border-right: 1px solid #EDEDED; border-right: 1px solid #EDEDED;
border-bottom: 1px solid #EDEDED; border-bottom: 1px solid #EDEDED;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 15px; padding: 15px;
text { text {
text-align: center; text-align: center;
} }
} }
</style> </style>
+132
View File
@@ -0,0 +1,132 @@
<template>
<el-dialog
title="自营询价详情"
:visible.sync="dialogVisible"
width="60%"
:before-close="handleClose">
<el-descriptions border size="small" :column="2">
<el-descriptions-item label="询价区域">
<span>{{ info.province.name }}{{ info.city.name }} </span>
</el-descriptions-item>
<el-descriptions-item label="联系人">
<span>{{ info.name }}</span>
</el-descriptions-item>
<el-descriptions-item label="联系方式">
<span>{{ info.phone }}</span>
</el-descriptions-item>
<el-descriptions-item label="用户名称">
<span>{{ info.company }}</span>
</el-descriptions-item>
<el-descriptions-item label="询价单附件">
<view class="mt-15 mr-15" v-for="(file, fileIndex) in info.files" :key="fileIndex">
<file-type :item="file" @click.native="openDownload(file)"/>
</view>
</el-descriptions-item>
<template v-if="info.quoteList && info.status === 1">
<el-descriptions-item label="报价列表">
<div class="py-20 border-bottom" v-for="(item, index) in info.quoteList" :key="index">
<p>公司:{{ item.user.company.companyName }}</p>
<template v-if="item.amount">
<p>报价:¥{{ item.amount }}</p>
<span v-if="item.remark">备注:{{ item.remark }}</span>
<view class="mt-15 mr-15" v-for="(file, fileIndex) in item.files" :key="fileIndex">
<file-type :item="file" @click.native="openDownload(file)"/>
</view>
</template>
<p v-else>未报价</p>
</div>
</el-descriptions-item>
</template>
<template v-if="info.quoteList && info.status === 2">
<el-descriptions-item label="报价公司">
<div class="py-20 border-bottom" v-for="(item, index) in info.quoteList.filter(q => q.status === 1)"
:key="index">
<p>{{ item.user.company.companyName }}</p>
</div>
</el-descriptions-item>
</template>
<template v-if="info.quote">
<el-descriptions-item label="报价">
<span>¥{{ info.quote.amount }}</span>
</el-descriptions-item>
<el-descriptions-item label="备注">
<span>{{ info.quote.remark }}</span>
</el-descriptions-item>
<el-descriptions-item label="报价单附件">
<view class="mt-15 mr-15" v-for="(file, fileIndex) in info.quote.files" :key="fileIndex">
<file-type :item="file" @click.native="openDownload(file)"/>
</view>
</el-descriptions-item>
</template>
</el-descriptions>
</el-dialog>
</template>
<script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
import FileType from "../../../components/file-type/file-type.vue";
export default {
name: "selfSupportModal",
components: {FileType},
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
id: null,
info: null,
dialogVisible: false,
quoteList: [],
status: 0,
quote: null,
}
},
methods: {
open(info) {
this.info = info
this.dialogVisible = true
},
handleClose() {
this.dialogVisible = false
},
openDownload(url) {
window.open(url)
}
}
}
</script>
<style lang="scss" scoped>
.request-header {
border: 1px solid #EDEDED;
background-color: #FFF8F1;
display: flex;
align-items: center;
justify-content: center;
padding: 15px;
margin-top: 30px;
text {
text-align: center;
}
}
.quote {
border-left: 1px solid #EDEDED;
border-right: 1px solid #EDEDED;
border-bottom: 1px solid #EDEDED;
display: flex;
align-items: center;
justify-content: center;
padding: 15px;
text {
text-align: center;
}
}
</style>
@@ -0,0 +1,107 @@
<template>
<el-dialog
title="自营询价详情"
:visible.sync="dialogVisible"
width="60%"
:before-close="handleClose">
<el-descriptions border size="small" :column="2">
<el-descriptions-item label="询价区域">
<span>{{ info.sheet.province.name }}{{ info.sheet.city.name }} </span>
</el-descriptions-item>
<el-descriptions-item label="联系人">
<span>{{ info.sheet.name }}</span>
</el-descriptions-item>
<el-descriptions-item label="联系方式">
<span>{{ info.sheet.phone }}</span>
</el-descriptions-item>
<el-descriptions-item label="用户名称">
<span>{{ info.sheet.company }}</span>
</el-descriptions-item>
<el-descriptions-item label="询价单附件">
<view class="mt-15 mr-15" v-for="(file, fileIndex) in info.files" :key="fileIndex">
<file-type :item="file" @click.native="openDownload(file)"/>
</view>
</el-descriptions-item>
<el-descriptions-item label="报价">
<span>¥{{ info.amount }}</span>
</el-descriptions-item>
<el-descriptions-item label="备注">
<span>{{ info.remark }}</span>
</el-descriptions-item>
<el-descriptions-item label="报价单附件">
<view class="mt-15 mr-15" v-for="(file, fileIndex) in info.files" :key="fileIndex">
<file-type :item="file" @click.native="openDownload(file)"/>
</view>
</el-descriptions-item>
</el-descriptions>
</el-dialog>
</template>
<script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
import FileType from "../../../components/file-type/file-type.vue";
export default {
name: "selfSupportQuoteModal",
components: {FileType},
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
id: null,
info: null,
dialogVisible: false,
quoteList: [],
status: 0
}
},
methods: {
open(info) {
this.info = info
console.log(this.info)
this.dialogVisible = true
},
handleClose() {
this.dialogVisible = false
},
openDownload(url) {
window.open(url)
}
}
}
</script>
<style lang="scss" scoped>
.request-header {
border: 1px solid #EDEDED;
background-color: #FFF8F1;
display: flex;
align-items: center;
justify-content: center;
padding: 15px;
margin-top: 30px;
text {
text-align: center;
}
}
.quote {
border-left: 1px solid #EDEDED;
border-right: 1px solid #EDEDED;
border-bottom: 1px solid #EDEDED;
display: flex;
align-items: center;
justify-content: center;
padding: 15px;
text {
text-align: center;
}
}
</style>
+12 -13
View File
@@ -12,23 +12,22 @@
</view> </view>
<view class="mt-15" v-if="cooperateList"> <view class="mt-15" v-if="cooperateList">
<view class="request-header"> <view class="request-header">
<text class="flex-1">申请人</text> <text class="flex-1">公司名称</text>
<text class="flex-1">申请时间</text> <text class="flex-1">联系人</text>
<text class="flex-1">联系方式</text> <text class="flex-1">联系方式</text>
<text class="flex-1">操作</text> <text class="flex-1">备注</text>
<text class="flex-1">附件</text>
<text class="flex-1">申请时间</text>
</view> </view>
<view class="quote" v-for="(item, index) in cooperateList" :key="index"> <view class="quote" v-for="(item, index) in cooperateList" :key="index">
<text class="flex-1">{{ <text class="flex-1">{{ item.user.company.companyName }}</text>
item.user.accountType === 1 ? item.user.person.personName : item.user.company.companyName <text class="flex-1">{{ item.name }}</text>
}} <text class="flex-1"> {{ item.mobile }}</text>
</text> <text class="flex-1">{{ item.remark }}</text>
<view class="flex-1">
<a v-for="(file, fileIndex) in item.files" :key="fileIndex" :href="file" target="_blank">预览:文件{{ fileIndex + 1 }}</a>
</view>
<text class="flex-1">{{ item._add_time_str }}</text> <text class="flex-1">{{ item._add_time_str }}</text>
<text class="flex-1">
{{ item.user.accountType === 1 ? item.user.person.mobile : item.user.company.mobile }}
</text>
<text class="flex-1">
<el-button type="primary" @click.native="doShowInfo(item)">查看申请详情</el-button>
</text>
</view> </view>
</view> </view>
</el-dialog> </el-dialog>
+1043 -578
View File
File diff suppressed because it is too large Load Diff
+155
View File
@@ -0,0 +1,155 @@
<template>
<el-card>
<view class="flex justify-end items-center">
<el-button type="primary" @click="showAdd" v-if="!isAdd">新增收款账户</el-button>
</view>
<view class="mt-20" v-if="isAdd">
<el-form ref="form" :model="form" label-width="120px">
<el-form-item label="类型" required v-if="vk.getVuex('$user.userInfo.accountType') === 2">
<el-select v-model="form.type" placeholder="请选择账号类型">
<el-option label="对公账号" value="company"/>
<el-option label="个人账号" value="person"/>
</el-select>
</el-form-item>
<el-form-item label="开户行" required>
<el-input v-model="form.bankName" placeholder="请输入开户行"/>
</el-form-item>
<el-form-item label="账号名称" required>
<el-input v-model="form.accountName" placeholder="请输入账号名称"/>
</el-form-item>
<el-form-item label="账号" required>
<el-input v-model="form.account" placeholder="请输入账号"/>
</el-form-item>
<el-form-item label="默认账号">
<el-switch v-model="form.isDefault"/>
</el-form-item>
</el-form>
<view class="mt-30 flex justify-center items-center">
<el-button plain @click="isAdd = !isAdd">取消</el-button>
<el-button type="primary" @click="addContact">确定</el-button>
</view>
</view>
<view v-else>
<view class="py-20 border-bottom flex justify-between items-center" v-for="(item, index) in list"
:key="index">
<view class="flex flex-col justify-start items-start">
<view class="flex justify-start items-center">
<el-tag type="primary" size="small" class="mr-25" v-if="item.isDefault">默认</el-tag>
<el-tag type="success" size="small" class="mr-25">{{
item.type === 'company' ? '对公' : '个人'
}}
</el-tag>
<text class="font-bold text-40">{{ item.account }}</text>
</view>
<view class="my-20">{{ item.accountName }}</view>
<view class="my-20">{{ item.bankName }}</view>
</view>
<view class="flex flex-col justify-end">
<el-button type="primary" size="small" @click="edit(item)">编辑</el-button>
<view class="mt-20">
<el-button type="primary" size="small" @click="del(item._id)" plain>删除</el-button>
</view>
</view>
</view>
</view>
</el-card>
</template>
<script>
export default {
name: "account",
data() {
return {
isAdd: false,
form: {
_id: null,
bankName: '',
accountName: '',
account: '',
type: '',
isDefault: false,
},
list: []
}
},
methods: {
async addContact() {
if (!this.form.bankName) {
this.$message.error('请输入开户行')
return
}
if (!this.form.accountName) {
this.$message.error('请输入账号名称')
return
}
if (!this.form.account) {
this.$message.error('请输入账号')
return
}
if (!this.form.type && parseInt(vk.getVuex('$user.userInfo.accountType')) === 2) {
this.$message.error('请选择类型')
return
}
await vk.callFunction({
url: 'client/account/kh/action',
data: this.form
})
this.$message.success(this.form._id ? '修改成功' : '新增成功')
await this.getList()
this.isAdd = false
this.form = {
_id: null,
bankName: '',
accountName: '',
account: '',
type: '',
isDefault: false,
}
},
async getList() {
const {rows} = await vk.callFunction({
url: 'client/account/kh/getList',
})
this.list = rows
},
del(_id) {
this.$confirm('确认删除该账号吗?', '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(async () => {
await vk.callFunction({
url: 'client/account/kh/delete',
data: {_id}
})
await this.getList()
})
},
edit(item) {
for (let key in this.form) this.form[key] = item[key]
this.isAdd = true
},
showAdd() {
const user = vk.getVuex('$user.userInfo')
if (vk.getVuex('$user.userInfo.accountType') === 2) {
this.form.account = user.company.companyAccount
this.form.bankName = user.company.companyBankName
this.form.accountName = user.company.companyName
}else {
this.form.account = user.person.personAccount
this.form.bankName = user.person.personBankName
this.form.accountName = user.person.accountName
console.log(user)
}
this.isAdd = true
}
},
mounted() {
if (parseInt(vk.getVuex('$user.userInfo.authStatus')) !== 1) {
this.$message.error('请先完成实名认证')
this.$emit('done', 'fadada')
}
this.getList()
}
}
</script>
+4 -3
View File
@@ -51,7 +51,7 @@
</div> </div>
<div class="pay-price" v-if="billQRCode"> <div class="pay-price" v-if="billQRCode">
<uv-qrcode ref="qrcode" size="240px" :value="billQRCode"></uv-qrcode> <uv-qrcode ref="qrcode" size="240px" :value="billQRCode"></uv-qrcode>
<div class="pay-desc">请打开手机微信,扫一扫完成支付</div> <div class="pay-desc">微信、支付宝、云闪付扫码完成支付</div>
<el-button type="success" @click="onPayStatus">已完成支付</el-button> <el-button type="success" @click="onPayStatus">已完成支付</el-button>
</div> </div>
<el-button v-else type="danger" @click="onPay">立即支付</el-button> <el-button v-else type="danger" @click="onPay">立即支付</el-button>
@@ -202,7 +202,8 @@ export default {
tid: '88880001', tid: '88880001',
instMid: 'QRPAYDEFAULT', instMid: 'QRPAYDEFAULT',
totalAmount: 1, totalAmount: 1,
notifyUrl: 'https://static-mp-0737e52b-fffa-4223-bcdf-d4ad3d9968a5.next.bspapp.com/#/' // notifyUrl: 'https://static-mp-0737e52b-fffa-4223-bcdf-d4ad3d9968a5.next.bspapp.com/#/'
notifyUrl: 'https://tcb-n44byxi8bmrfrki-d4bn1c4a206d.service.tcloudbase.com/pay_notify'
} }
} }
/** /**
@@ -214,7 +215,7 @@ export default {
if (result.errCode === 'SUCCESS') { if (result.errCode === 'SUCCESS') {
this.showQrcode = true this.showQrcode = true
this.billQRCode = result.billQRCode this.billQRCode = result.billQRCode
// this.$alert('', '请打开手机微信,扫一扫完成支付', { // this.$alert('', '微信、支付宝、云闪付扫码完成支付', {
// confirmButtonText: '确定', // confirmButtonText: '确定',
// callback: action => { // callback: action => {
// this.$message({ // this.$message({
+345 -211
View File
@@ -1,224 +1,358 @@
<template> <template>
<el-card> <el-card>
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>我的名片</span> <span>我的名片</span>
</div>
<p class="text-main" v-if="parseInt(vk.getVuex('$user.userInfo.authStatus')) !== 1">请先完成认证</p>
<template
v-else-if="parseInt(vk.getVuex('$user.userInfo.authStatus')) === 1 && vk.getVuex('$user.userInfo.businessCard')">
<div class="text-main flex justify-start items-center">
<info theme="outline" size="18" fill="#a92924" strokeLinecap="square"
style="height: 18px"/>
<span v-if="parseInt(vk.getVuex('$user.userInfo.businessCard.status')) === 0">名片审核中</span>
<span v-if="parseInt(vk.getVuex('$user.userInfo.businessCard.status')) === 2">名片审核失败: {{
vk.getVuex('$user.userInfo.businessCard.refuseReason')
}}</span>
<span v-if="parseInt(vk.getVuex('$user.userInfo.businessCard.status')) === 1">名片审核通过</span>
</div>
</template>
<!-- 表单开始 -->
<vk-data-form
v-if="parseInt(vk.getVuex('$user.userInfo.authStatus')) === 1"
ref="form1"
v-model="form1.data"
:rules="form1.props.rules"
:action="form1.props.action"
:form-type="form1.props.formType"
:columns='form1.props.columns'
:loading.sync="form1.props.loading"
label-width="140px"
input-width="400px"
:before-action="form1.props.beforeAction"
:show-cancel="false"
submit-text="保存名片"
:submit-disabled="!!vk.getVuex('$user.userInfo.businessCard') && parseInt(vk.getVuex('$user.userInfo.businessCard.status')) === 0"
>
<!-- v-slot:editor 中的 editor 对应 columns中的 key, form对应 form1.data keyName 对应 columns中的 key -->
<template v-slot:video="{ form, keyName }">
<vk-data-upload v-model="form1.data.video" list-type="text" :limit="1"
accept="video/*">
</vk-data-upload>
</template>
<template v-slot:album="{ form, keyName }">
<vk-data-upload v-model="form1.data.album" list-type="picture-card"
:limit="albumLimit"
accept=".jpg,.jpeg,.png">
</vk-data-upload>
</template>
<template v-slot:productImageList="{ form, keyName }">
<vk-data-upload v-model="form1.data.productImageList" list-type="picture-card"
:limit="productImageLimit"
accept=".jpg,.jpeg,.png">
</vk-data-upload>
</template>
<template v-slot:exampleImageList="{ form, keyName }">
<vk-data-upload v-model="form1.data.exampleImageList" list-type="picture-card"
:limit="productImageLimit"
accept=".jpg,.jpeg,.png">
</vk-data-upload>
</template>
<template v-slot:map="{ form, keyName }">
<div class="mapDiv">
<tdt-map :center="center" :zoom="zoom" @click="mapClick">
<tdt-marker :position="[form1.data.longitude, form1.data.latitude]" :draggable="false"/>
</tdt-map>
</div> </div>
</template>
<!-- 表单开始 --> </vk-data-form>
<vk-data-form </el-card>
ref="form1"
v-model="form1.data"
:rules="form1.props.rules"
:action="form1.props.action"
:form-type="form1.props.formType"
:columns='form1.props.columns'
:loading.sync="form1.props.loading"
label-width="140px"
input-width="400px"
:before-action="form1.props.beforeAction"
:show-cancel="false"
submit-text="保存名片"
@success="onFormSuccess"
>
<!-- v-slot:editor 中的 editor 对应 columns中的 key, form对应 form1.data keyName 对应 columns中的 key -->
<!-- <template v-slot:editor="{ form, keyName }">
<vk-data-input-editor v-model="form[keyName]" placeholder="开始输入" width="750px"></vk-data-input-editor>
</template> -->
</vk-data-form>
</el-card>
</template> </template>
<script> <script>
import {Info} from "@icon-park/vue";
import MapInit from '@/util/MapInit'
export default { export default {
data() { components: {Info},
return { data() {
// 表单相关开始----------------------------------------------------------- return {
form1: { T: null,
// 表单请求数据,此处可以设置默认值 tMap: null,
data: { userInfo: {
companyIntroduction: '' accountType: 1,
}, userLevel: -1,
// 表单属性 },
props: { productImageLimit: 2,
// 表单请求地址 albumLimit: 2,
action: "no", dialogVisible: false,
// 表单字段显示规则 center: [108.358150, 22.826820],
columns: [ zoom: 12,
{ // 表单相关开始-----------------------------------------------------------
type: 'group', form1: {
columns: [ // 表单请求数据,此处可以设置默认值
{ data: {
key: "logo", companyIntroduction: '',
title: "Logo", video: '',
type: "image", longitude: 108.358150,
limit: 1 latitude: 22.826820,
}, album: [],
{ productImageList: [],
key: "personalWechat", exampleImageList: [],
title: "个人微信",
type: "image",
limit: 1
},
{
key: "companyWechat",
title: "企业微信",
type: "image",
limit: 1
},
]
},
{
key: "position",
title: "职位",
type: "text"
},
{
key: "companyMobile",
title: "公司电话",
type: "text"
},
{
key: "managerMobile",
title: "负责人电话",
type: "text"
},
{
key: "address",
title: "地区",
type: "address"
},
{
key: "addressDetail",
title: "详细地址",
type: "text"
},
{
key: "email",
title: "邮箱",
type: "text"
},
{
key: "website",
title: "网址",
type: "text"
},
{
key: "mainBusiness",
title: "主营业务",
type: "textarea"
},
{
key: "companyIntroduction",
title: "企业简介",
type: "editor"
},
],
// 表单验证规则
rules: {
logo: [{
required: true,
message: "请上传Logo",
trigger: ['blur', 'change']
}],
personalWechat: [{
required: true,
message: "请上传个人微信",
trigger: ['blur', 'change']
}],
companyWechat: [{
required: true,
message: "请上传企业微信",
trigger: ['blur', 'change']
}],
personName: [{
required: true,
message: "姓名不能为空",
trigger: ['blur', 'change']
}],
position: [{
required: true,
message: "职位不能为空",
trigger: ['blur', 'change']
}],
address: [{
required: true,
message: "地区不能为空",
trigger: ['blur', 'change']
}],
addressDetail: [{
required: true,
message: "详细地址不能为空",
trigger: ['blur', 'change']
}],
email: [{
required: true,
message: "邮箱不能为空",
trigger: ['blur', 'change']
}],
// website: [{
// required: true,
// message: "logo不能为空",
// trigger: ['blur', 'change']
// }],
mainBusiness: [{
required: true,
message: "主营业务不能为空",
trigger: ['blur', 'change']
}],
mainSpotCategoryIds: [{
required: true,
message: "主营商品不能为空",
trigger: ['blur', 'change']
}],
},
// add 代表添加 update 代表修改
formType: "update",
// 表单是否在请求中
loading: false,
// 是否显示表单1 的弹窗
show: false,
beforeAction: (formData) => {
vk.callFunction({
url: 'client/user/kh/addAuth',
data: {
businessCard: formData
},
success: (data) => {
// 成功后的逻辑
this.$message({
type: 'success',
message: '保存成功'
})
}
});
return false;
},
}
},
// 表单相关结束-----------------------------------------------------------
}
},
created() {
this.getUserInfo()
},
methods: {
getUserInfo() {
vk.userCenter.getCurrentUserInfo({
success: (data) => {
if (data.userInfo.businessCard) {
this.form1.data = data.userInfo.businessCard
}
// 成功后的逻辑
console.log('用户信息: ', data);
}
});
}, },
// 表单属性
props: {
// 表单请求地址
action: "no",
// 表单字段显示规则
columns: [
{
type: 'group',
columns: [
{
key: "logo",
title: "Logo",
type: "image",
limit: 1
},
{
key: "personalWechat",
title: "个人微信",
type: "image",
limit: 1
},
{
key: "companyWechat",
title: "企业微信",
type: "image",
limit: 1,
showRule: (formData) => {
console.log('formData', this.userInfo)
return parseInt(this.userInfo.accountType) === 2
},
},
]
},
{
key: "position",
title: "职位",
type: "text",
showRule: (formData) => {
return parseInt(this.userInfo.accountType) !== 2
},
},
{
key: "companyMobile",
title: "公司电话",
type: "text"
},
{
key: "managerMobile",
title: "负责人电话",
type: "text"
},
{
key: "address",
title: "地区",
type: "address"
},
{
key: "addressDetail",
title: "详细地址",
type: "text"
},
{
key: "email",
title: "有效邮箱",
type: "text"
},
{
key: "website",
title: "网址",
type: "text",
showRule: (formData) => {
return parseInt(this.userInfo.accountType) === 2 && parseInt(this.userInfo.userLevel) > 2
},
},
{
key: "companyIntroduction",
title: "企业简介",
type: "editor"
},
{
key: "video",
title: "视频",
type: "html",
showRule: (formData) => {
return parseInt(this.userInfo.accountType) === 2 && parseInt(this.userInfo.userLevel) > 2
},
},
{
key: "album",
title: `首页大图`,
type: "html",
},
{
key: "productImageList",
title: `产品展示`,
type: "html",
},
{
key: "exampleImageList",
title: `案例展示`,
type: "html",
},
{
key: "map",
title: `地图定位`,
type: "html",
showRule: (formData) => {
return parseInt(this.userInfo.accountType) === 2 && parseInt(this.userInfo.userLevel) > 1
},
},
],
// 表单验证规则
rules: {
logo: [{
required: true,
message: "请上传Logo",
trigger: ['blur', 'change']
}],
personalWechat: [{
required: true,
message: "请上传个人微信",
trigger: ['blur', 'change']
}],
personName: [{
required: true,
message: "姓名不能为空",
trigger: ['blur', 'change']
}],
address: [{
required: true,
message: "地区不能为空",
trigger: ['blur', 'change']
}],
addressDetail: [{
required: true,
message: "详细地址不能为空",
trigger: ['blur', 'change']
}],
email: [{
required: true,
message: "邮箱不能为空",
trigger: ['blur', 'change']
}],
// website: [{
// required: true,
// message: "logo不能为空",
// trigger: ['blur', 'change']
// }],
mainBusiness: [{
required: true,
message: "主营业务不能为空",
trigger: ['blur', 'change']
}],
mainSpotCategoryIds: [{
required: true,
message: "主营商品不能为空",
trigger: ['blur', 'change']
}],
},
// add 代表添加 update 代表修改
formType: "update",
// 表单是否在请求中
loading: false,
// 是否显示表单1 的弹窗
show: false,
beforeAction: (formData) => {
vk.callFunction({
url: 'client/user/kh/addAuth',
data: {
businessCard: {...formData, status: 0},
isBusinessCard: true
},
success: (data) => {
// 成功后的逻辑
this.$message({
type: 'success',
message: '提交成功,新信息将在审核通过后显示',
duration: 5000
})
setTimeout(() => {
window.location.reload()
}, 1000)
}
});
return false;
},
}
},
// 表单相关结束-----------------------------------------------------------
} }
},
created() {
this.getUserInfo()
},
methods: {
getUserInfo() {
vk.userCenter.getCurrentUserInfo({
success: (data) => {
if (data.userInfo.businessCard) {
this.form1.data = data.userInfo.businessCard
}
for (let key in this.userInfo) this.userInfo[key] = data.userInfo[key]
if (!data.userInfo.businessCard) {
if (this.userInfo.company.mobile) this.form1.data.companyMobile = this.userInfo.company.mobile
if (this.userInfo.manager.mobile) this.form1.data.managerMobile = this.userInfo.manager.mobile
if (this.userInfo.company.email) this.form1.data.email = this.userInfo.company.email
} else {
if (data.userInfo.businessCard.album && !Array.isArray(data.userInfo.businessCard.album)) this.form1.data.album = [data.userInfo.businessCard.album]
}
if (!this.form1.data.longitude) this.form1.data.longitude = 108.358150
if (!this.form1.data.latitude) this.form1.data.latitude = 22.826820
if (this.userInfo.userLevel === 0) {
this.albumLimit = 1
this.productImageLimit = 2
} else if (this.userInfo.userLevel === 1) {
this.albumLimit = 2
this.productImageLimit = 4
} else if (this.userInfo.userLevel === 2) {
this.albumLimit = 2
this.productImageLimit = 12
} else if (this.userInfo.userLevel > 2) {
this.albumLimit = 4
if (this.userInfo.userLevel > 3) {
this.albumLimit = 6
}
this.productImageLimit = 30
}
}
});
},
mapClick({type, lnglat}) {
if (type === "click") {
this.form1.data.longitude = parseFloat(lnglat.lng);
this.form1.data.latitude = parseFloat(lnglat.lat);
this.$message.success("已选择");
console.log(this.form1.data.longitude, this.form1.data.latitude)
this.$forceUpdate()
}
}
}
} }
</script> </script>
<style> <style scoped>
.mapDiv {
width: 100%;
height: 300px;
}
</style> </style>
+125
View File
@@ -0,0 +1,125 @@
<template>
<el-card>
<view class="flex justify-end items-center">
<el-button type="primary" @click="isAdd = !isAdd" v-if="!isAdd">新增业务联系人</el-button>
</view>
<view class="mt-20" v-if="isAdd">
<el-form ref="form" :model="form" label-width="120px">
<el-form-item label="姓名" required>
<el-input v-model="form.name" placeholder="请输入姓名"/>
</el-form-item>
<el-form-item label="手机号" required>
<el-input v-model="form.phone" placeholder="请输入手机号"/>
</el-form-item>
<el-form-item label="邮箱" required>
<el-input v-model="form.email" placeholder="请输入邮箱"/>
</el-form-item>
<el-form-item label="职位" required>
<el-input v-model="form.position" placeholder="请输入职位"/>
</el-form-item>
</el-form>
<view class="mt-30 flex justify-center items-center">
<el-button plain @click="isAdd = !isAdd">取消</el-button>
<el-button type="primary" @click="addContact">确定</el-button>
</view>
</view>
<view v-else>
<view class="py-20 border-bottom flex justify-between items-center" v-for="(item, index) in list"
:key="index">
<view class="flex flex-col justify-start items-start">
<view>
<text class="font-bold text-40">{{ item.name }}</text>
<text class="ml-20 text-gray">({{ item.position }})</text>
</view>
<view class="my-20">手机号:{{ item.phone }}</view>
<view class="my-20">邮箱:{{ item.email }}</view>
</view>
<view class="flex flex-col justify-end">
<el-button type="primary" size="small" @click="edit(item)">编辑</el-button>
<view class="mt-20">
<el-button type="primary" size="small" @click="del(item._id)" plain>删除</el-button>
</view>
</view>
</view>
</view>
</el-card>
</template>
<script>
export default {
name: "business-contact",
data() {
return {
isAdd: false,
form: {
_id: null,
phone: '',
name: '',
email: '',
position: '',
},
list: []
}
},
methods: {
async addContact() {
if (!this.form.name) {
this.$message.error('请输入姓名')
return
}
if (!this.form.phone) {
this.$message.error('请输入手机号')
return
}
if (!this.form.email) {
this.$message.error('请输入邮箱')
return
}
if (!this.form.position) {
this.$message.error('请输入职位')
return
}
await vk.callFunction({
url: 'client/businessContact/kh/action',
data: this.form
})
this.$message.success(this.form._id ? '修改成功' : '新增成功')
await this.getList()
this.isAdd = false
this.form = {
_id: null,
phone: '',
name: '',
email: '',
position: '',
}
},
async getList() {
const {rows} = await vk.callFunction({
url: 'client/businessContact/kh/getList',
})
this.list = rows
},
del(_id) {
this.$confirm('确认删除该业务联系人吗?', '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(async () => {
await vk.callFunction({
url: 'client/businessContact/kh/delete',
data: {_id}
})
await this.getList()
})
},
edit(item) {
for (let key in this.form) this.form[key] = item[key]
this.isAdd = true
}
},
mounted() {
this.getList()
}
}
</script>
File diff suppressed because it is too large Load Diff
+334
View File
@@ -0,0 +1,334 @@
<template>
<el-card shadow="never">
<p class="text-main font-bold mb-20">加工商状态: {{
(isNaN(factoryStatus) || factoryStatus === -1) ? '未提交审核' : (factoryStatus === 0 ? '审核中' : (factoryStatus === 1 ? '审核通过' : `审核不通过:${refuseReason}`))
}}</p>
<p class="text-main font-bold mb-20" v-if="factoryStatus === 0">
温馨提示:审核中不能修改内容,如有数据变更审核通过后再次修改提交。
</p>
<el-form ref="form" :model="form" label-width="140px">
<el-divider>
<span class="text-50 text-main font-bold">工厂信息</span>
</el-divider>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="成立年限" required>
<el-input v-model="form.year" placeholder="请输入成立年限" type="number"
:readonly="factoryStatus === 0">
<template #append>年</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="年产值" required>
<el-input v-model="form.yearsIncome" placeholder="请输入年产值" type="number"
:readonly="factoryStatus === 0">
<template #append>万元</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10" class="mt-20">
<el-col :span="12">
<el-form-item label="员工人数" required>
<el-input v-model="form.employeeNum" placeholder="请输入员工人数" type="number"
:readonly="factoryStatus === 0">
<template #append>人</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="流水线数量" required>
<el-input v-model="form.flowNum" placeholder="请输入流水线数量" type="number"
:readonly="factoryStatus === 0">
<template #append>条</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10" class="mt-20">
<el-col :span="12">
<el-form-item label="厂房归属" required>
<el-input v-model="form.blongTo" placeholder="请输入厂房归属" :readonly="factoryStatus === 0"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="厂房面积" required>
<el-input v-model="form.size" placeholder="请输入厂房面积" :readonly="factoryStatus === 0">
<template #append>平方米</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="所在地" required>
<el-cascader :options="options" :props="{label: 'name', value: 'code'}" v-model="addressRegion"
clearable :disabled="factoryStatus === 0"/>
</el-form-item>
<el-form-item label="主营类别" required>
<el-select multiple v-model="form.mainSpotCategory" style="width: 100%">
<el-option v-for="(item, index) in goodsCate" :key="index" :value="item.name">{{ item.name }}</el-option>
</el-select>
</el-form-item>
<el-form-item label="主营工艺和业务范围">
<el-input v-model="form.mainProcess" placeholder="请输入主营工艺和业务范围"
:readonly="factoryStatus === 0"/>
</el-form-item>
<el-form-item label="服务信息">
<el-input v-model="form.serviceInfo" placeholder="请输入服务信息" type="textarea"
:readonly="factoryStatus === 0"/>
</el-form-item>
<el-form-item label="视频">
<vk-data-upload v-model="form.video" list-type="text"
accept="video/*">
</vk-data-upload>
</el-form-item>
<el-divider>
<span class="text-50 text-main font-bold">设备信息</span>
</el-divider>
<el-row :gutter="10" class="p-20 bg-gray-light">
<el-col :span="3">
<p class="text-center">设备名称</p>
</el-col>
<el-col :span="3">
<p class="text-center">设备数量({{ deviceNum }}台)</p>
</el-col>
<el-col :span="3">
<p class="text-center">设备来源</p>
</el-col>
<el-col :span="3">
<p class="text-center">设备类型</p>
</el-col>
<el-col :span="3">
<p class="text-center">品牌</p>
</el-col>
<el-col :span="3">
<p class="text-center">型号</p>
</el-col>
<el-col :span="3">
<p class="text-center">投产年限</p>
</el-col>
<el-col :span="3">
<p class="text-center">特点描述</p>
</el-col>
</el-row>
<el-row :gutter="10" class="p-20 bg-gray-light pos-r" v-for="(item, index) in form.deviceList" :key="index">
<el-col :span="3">
<el-input v-model="form.deviceList[index].name" placeholder="设备名称"
:readonly="factoryStatus === 0"/>
</el-col>
<el-col :span="3">
<el-input v-model="form.deviceList[index].num" placeholder="设备数量" type="number"
:readonly="factoryStatus === 0"/>
</el-col>
<el-col :span="3">
<el-select v-model="form.deviceList[index].source" placeholder="请选择设备来源"
:disabled="factoryStatus === 0">
<el-option v-for="item in deviceSource" :key="item" :label="item" :value="item"/>
</el-select>
</el-col>
<el-col :span="3">
<el-select v-model="form.deviceList[index].type" placeholder="请选择设备类型"
:disabled="factoryStatus === 0">
<el-option v-for="item in deviceType" :key="item" :label="item" :value="item"/>
</el-select>
</el-col>
<el-col :span="3">
<el-input v-model="form.deviceList[index].brand" placeholder="品牌"
:readonly="factoryStatus === 0"/>
</el-col>
<el-col :span="3">
<el-input v-model="form.deviceList[index].model" placeholder="型号"
:readonly="factoryStatus === 0"/>
</el-col>
<el-col :span="3">
<el-input v-model="form.deviceList[index].year" placeholder="投产年限" type="number"
:readonly="factoryStatus === 0"/>
</el-col>
<el-col :span="3">
<el-input v-model="form.deviceList[index].desc" placeholder="特点描述"
:readonly="factoryStatus === 0"/>
</el-col>
<i class="el-icon-remove pointer text-main text-40 pos-a" style="right: -10px; top: 20px"
@click="remove(index)" v-if="factoryStatus !== 0"/>
</el-row>
<div class="mt-20 text-center">
<el-button type="text" @click.native="addDevice" v-if="factoryStatus !== 0">添加设备</el-button>
</div>
<el-divider>
<span class="text-50 text-main font-bold">工厂实景</span>
</el-divider>
<vk-data-upload v-model="form.album" :limit="userLevel.factoryPicNum"
:disabled="factoryStatus === 0"></vk-data-upload>
<div class="mt-20 text-center">
<el-button type="primary" @click.native="submit" v-if="factoryStatus !== 0">提交</el-button>
</div>
</el-form>
</el-card>
</template>
<script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
export default {
name: "factory",
data() {
return {
form: {
year: null,
yearsIncome: null,
employeeNum: null,
flowNum: null,
blongTo: null,
size: null,
addressRegion: {
province: null,
city: null,
},
mainProcess: null,
serviceInfo: null,
video: '',
deviceList: [],
album: [],
mainSpotCategory: [],
},
options: [],
addressRegion: [],
deviceSource: ['国产', '进口'],
deviceType: ['生产设备', '维护设备'],
userLevel: {
factoryPicNum: 0
},
factoryStatus: parseInt(vk.getVuex('$user.userInfo.factoryStatus')),
refuseReason: '',
goodsCate: []
}
},
methods: {
addDevice() {
this.form.deviceList.push({
name: null,
num: null,
source: null,
type: null,
brand: null,
model: null,
year: null,
desc: null
})
},
getGoodsCate() {
vk.callFunction({
url: 'client/process/category/pub/getList',
success: (res) => {
this.goodsCate = res.data
}
});
},
remove(index) {
this.form.deviceList.splice(index, 1)
},
async getUserLevelInfo() {
const res = await vk.callFunction({
url: "client/userLevel/kh/getInfoByUser",
})
if (res) {
if (!res.data) {
this.$message({
type: 'error',
message: '请先完成认证'
})
setTimeout(() => {
this.$emit('done', 'fadada')
}, 1000)
return
}
this.userLevel.factoryPicNum = res.factoryPicNum
}
},
async submit() {
if (!this.form.year) return this.$message.error('请输入投产年限')
if (!this.form.yearsIncome) return this.$message.error('请输入年收入')
if (!this.form.employeeNum) return this.$message.error('请选输入员工人数')
if (!this.form.flowNum) return this.$message.error('请输入流水线数量')
if (!this.form.blongTo) return this.$message.error('请输入厂房归属')
if (!this.form.size) return this.$message.error('请输入厂房面积')
if (this.addressRegion.length === 0) return this.$message.error('请选择所在地')
if (this.form.deviceList.length === 0) return this.$message.error('请添加设备信息')
if (this.form.mainSpotCategory.length === 0) return this.$message.error('请选择主营类别')
// if (this.form.album.length === 0) return this.$message.error('请上传工厂实景图')
const province = provinces.find(item => item.code === this.addressRegion[0])
const city = province.children.find(item => item.code === this.addressRegion[1])
const addressRegion = {
province: {
code: province.code,
name: province.name,
},
city: {
code: city.code,
name: city.name,
}
}
await vk.callFunction({
url: "client/factory/kh/addUpdate",
data: {
year: this.form.year,
yearsIncome: this.form.yearsIncome,
employeeNum: this.form.employeeNum,
flowNum: this.form.flowNum,
blongTo: this.form.blongTo,
size: this.form.size,
addressRegion,
mainProcess: this.form.mainProcess,
serviceInfo: this.form.serviceInfo,
deviceList: this.form.deviceList,
album: this.form.album,
video: this.form.video,
mainSpotCategory: this.form.mainSpotCategory,
}
})
this.$message.success('提交成功')
this.factoryStatus = 0
},
async getInfo() {
const res = await vk.callFunction({
url: "client/factory/kh/getInfo",
})
if (res) {
for (let key in this.form) this.form[key] = res[key]
this.addressRegion = [res.addressRegion.province.code, res.addressRegion.city.code]
if (res.status === 2) this.refuseReason = res.refuseReason
}
}
},
mounted() {
this.options = provinces.map(item => {
item.children = [];
return item
})
this.options.forEach((province, index) => {
citys[index].forEach(city => {
this.options[index].children.push(city)
})
})
this.getGoodsCate()
this.getUserLevelInfo()
vk.userCenter.getCurrentUserInfo({
success: (data) => {
const factoryStatus = parseInt(data.userInfo.factoryStatus)
this.factoryStatus = (isNaN(factoryStatus) || factoryStatus === -1) ? -1 : factoryStatus
if (this.factoryStatus > -1) this.getInfo()
}
})
},
computed: {
deviceNum() {
let num = 0
this.form.deviceList.forEach(item => {
if (item.num && !isNaN(parseInt(item.num))) num += parseInt(item.num)
})
return num
}
}
}
</script>
+124 -63
View File
@@ -5,12 +5,13 @@
</div> </div>
<div class="grade-list"> <div class="grade-list">
<div class="item pointer" v-for="(item,index) in gradeList" :key="index" <div class="item pointer" v-for="(item,index) in gradeList" :key="index"
:class="gradeIndex === index ? 'active' : ''" @click="onChange(index)"> :class="[parseInt(gradeIndex) === index ? 'active' : '', item.disabled ? 'disabled' : '']"
@click="onChange(index)">
<div class="item-box"> <div class="item-box">
<div class="title">{{ item.name }}</div> <div class="title">{{ item.name }}</div>
<div class="title"> <div class="title">
<span>{{ item.amount }}元/年</span> <span>{{ item.amount }}元/年</span>
<span v-if="parseFloat(item.ensureAmount) > 0">+交易保证金</span> <span v-if="parseFloat(item.ensureAmount) > 0">+交易保证金({{ item.ensureAmount }}元)</span>
</div> </div>
</div> </div>
<div class="select"> <div class="select">
@@ -19,11 +20,46 @@
</div> </div>
</div> </div>
</div> </div>
<div class="item pointer"
:class="[gradeIndex === -2 ? 'active' : '']" @click="onChange(-2)">
<div class="item-box">
<div class="title">交易保证金缴纳</div>
<div class="title">
<el-select v-model="ensureAmount" size="small">
<el-option
v-for="item in ensureList"
:key="item.amount"
:label="`${item.amount.toFixed(2)}元`"
:value="item.amount">
</el-option>
</el-select>
</div>
</div>
<div class="select">
<div class="icon">
<i class="el-icon-check"></i>
</div>
</div>
</div>
<div class="flex justify-start items-center mt-20" v-if="gradeIndex === 2">
<div @click="ensureIndex = 0"
:style="{backgroundColor: ensureIndex === 0 ? '#a92924' : '', color: ensureIndex === 0 ? 'white' : ''}"
class="border rounded p-20">50000元保证金
</div>
<div @click="ensureIndex = 1"
:style="{backgroundColor: ensureIndex === 1 ? '#a92924' : '', color: ensureIndex === 1 ? 'white' : ''}"
class="border rounded p-20 mx-20">100000元保证金
</div>
<div @click="ensureIndex = 2"
:style="{backgroundColor: ensureIndex === 2 ? '#a92924' : '', color: ensureIndex === 2 ? 'white' : ''}"
class="border rounded p-20">200000元保证金
</div>
</div>
</div> </div>
<div class="bzj-readme"> <div class="bzj-readme">
<div class="sub-title">保证金说明</div> <div class="sub-title">保证金协议</div>
<div class="content"> <div class="content">
保证金说明内容... {{ desc }}
</div> </div>
</div> </div>
<div class="payment"> <div class="payment">
@@ -41,7 +77,7 @@
</div> </div>
<div class="pay-price" v-if="billQRCode"> <div class="pay-price" v-if="billQRCode">
<uv-qrcode ref="qrcode" size="240px" :value="billQRCode"></uv-qrcode> <uv-qrcode ref="qrcode" size="240px" :value="billQRCode"></uv-qrcode>
<div class="pay-desc">请打开手机微信,扫一扫完成支付</div> <div class="pay-desc">微信、支付宝、云闪付扫码完成支付</div>
<el-button type="success" @click="onPayStatus">已完成支付</el-button> <el-button type="success" @click="onPayStatus">已完成支付</el-button>
</div> </div>
<el-button v-else type="danger" @click="onPay">立即支付</el-button> <el-button v-else type="danger" @click="onPay">立即支付</el-button>
@@ -67,80 +103,80 @@ export default {
payment: ["银联支付"], payment: ["银联支付"],
showQrcode: false, showQrcode: false,
billQRCode: '', billQRCode: '',
gradeIndex: 1, gradeIndex: null,
gradeList: [] desc: '',
gradeList: [],
ensureList: [],
ensureAmount: null,
ensureIndex: 0
} }
}, },
created() { created() {
this.getUserLevelList() this.getUserLevelList()
this.getDesc()
this.getEnsureConfig()
}, },
methods: { methods: {
getUserInfo() { getUserInfo() {
vk.userCenter.getCurrentUserInfo({ vk.userCenter.getCurrentUserInfo({
success: (data) => { success: (data) => {
if (data.userInfo.businessCard) { this.gradeList.map(item => {
this.form1.data = data.userInfo.businessCard item.disabled = false
if (data.userInfo.userLevel && parseInt(data.userInfo.userLevel) > -1) {
item.disabled = parseInt(item.level) < parseInt(data.userInfo.userLevel)
}
return item
})
for (let i in this.gradeList) {
if (!this.gradeList[i].disabled) {
this.gradeIndex = i
break
}
} }
// 成功后的逻辑
console.log('用户信息: ', data);
} }
}); });
}, },
onChange(index) { onChange(index) {
this.gradeIndex = index if (index === -2) this.gradeIndex = index
else {
if (this.gradeList[index].disabled) return
this.gradeIndex = index
}
}, },
async onPay() { async onPay() {
let res
const res = await vk.callFunction({ if (this.gradeIndex === -2) {
url: 'client/order/kh/add', res = await vk.callFunction({
data: { url: 'client/order/kh/add',
goods: { data: {
name: '会员升级', goods: {
amount: this.amount, name: `交易保证金-${this.ensureAmount}元`,
cover: null amount: this.ensureAmount,
}, cover: null
type: 3, },
goodsId: parseInt(this.gradeList[this.gradeIndex].level), type: 2,
num: 1, goodsId: null,
} num: 1,
}) }
const requestTimestamp = dayjs().format('YYYY-MM-DD HH:mm:ss') })
const timestamp = dayjs().format('YYYYMMDDHHmmss') } else {
let data = { res = await vk.callFunction({
queryUrl: 'https://test-api-open.chinaums.com/v1/netpay/bills/get-qrcode', url: 'client/order/kh/add',
timestamp, data: {
nonce: 'rp84ufhfn20yneo3tp', goods: {
content: { name: `会员升级-${this.gradeList[this.gradeIndex].name}`,
billNo: res.data, amount: this.amount,
requestTimestamp, cover: null
mid: '898201612345678', },
tid: '88880001', type: 3,
instMid: 'QRPAYDEFAULT', goodsId: parseInt(this.gradeList[this.gradeIndex].level),
totalAmount: 1, ensureIndex: this.ensureIndex,
notifyUrl: 'https://static-mp-0737e52b-fffa-4223-bcdf-d4ad3d9968a5.next.bspapp.com/#/' num: 1,
} }
})
} }
/** vk.redirectTo({url: `/pages/index/shop/pay?id=${res.data}`})
* 调用函数
*/
sdk.exec(data).then(res => {
const h = this.$createElement;
const result = JSON.parse(res);
if (result.errCode === 'SUCCESS') {
this.showQrcode = true
this.billQRCode = result.billQRCode
// this.$alert('', '请打开手机微信,扫一扫完成支付', {
// confirmButtonText: '确定',
// callback: action => {
// this.$message({
// type: 'success',
// message: `已完成支付`
// });
// }
// });
}
})
}, },
getUserLevelList() { getUserLevelList() {
vk.callFunction({ vk.callFunction({
@@ -151,13 +187,33 @@ export default {
}, },
success: (data) => { success: (data) => {
this.gradeList = data.rows.filter(item => parseFloat(item.amount) > 0) this.gradeList = data.rows.filter(item => parseFloat(item.amount) > 0)
this.getUserInfo()
} }
}); });
} },
async getDesc() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '880c33886636217300376edd5a56e1e6'
},
})
this.desc = res.content
},
async getEnsureConfig() {
const {rows} = await vk.callFunction({
url: 'client/ensureConfig/pub/getList',
})
this.ensureList = rows
this.ensureAmount = this.ensureList[0].amount
},
}, },
computed: { computed: {
amount() { amount() {
return parseFloat(this.gradeList[this.gradeIndex].amount) + parseFloat(this.gradeList[this.gradeIndex].ensureAmount) if (this.gradeIndex === -2) return this.ensureAmount
else if (this.gradeIndex === 2) return parseFloat(this.gradeList[this.gradeIndex].amount) + [50000, 100000, 200000][this.ensureIndex]
else return parseFloat(this.gradeList[this.gradeIndex].amount) + parseFloat(this.gradeList[this.gradeIndex].ensureAmount)
} }
}, },
} }
@@ -288,4 +344,9 @@ export default {
font-size: 16px; font-size: 16px;
line-height: 2em; line-height: 2em;
} }
.disabled {
cursor: not-allowed;
background-color: #F0F0F0;
}
</style> </style>
+2 -2
View File
@@ -77,13 +77,13 @@ export default {
}, },
{ {
key: "headPhotoPath", key: "headPhotoPath",
title: "身份证正面", title: "身份证头像面",
type: "image", type: "image",
limit: 1 limit: 1
}, },
{ {
key: "backgroundIdCardPath", key: "backgroundIdCardPath",
title: "身份证反面", title: "身份证国徽面",
type: "image", type: "image",
limit: 1 limit: 1
}, },
+114
View File
@@ -0,0 +1,114 @@
<template>
<el-card>
<view class="flex justify-end items-center">
<el-button type="primary" @click="showAdd" v-if="!isAdd">新增新闻动态</el-button>
</view>
<view class="mt-20" v-if="isAdd">
<el-form ref="form" :model="form" label-width="120px">
<el-form-item label="标题" required>
<el-input v-model="form.title" placeholder="请输入标题"/>
</el-form-item>
<el-form-item label="内容">
<vk-data-input-editor v-model="form.content" width="750px"></vk-data-input-editor>
</el-form-item>
</el-form>
<view class="mt-30 flex justify-center items-center">
<el-button plain @click="cancel">取消</el-button>
<el-button type="primary" @click="addArticle">确定</el-button>
</view>
</view>
<view v-else>
<view class="py-20 border-bottom flex justify-between items-center" v-for="(item, index) in list"
:key="index">
<view class="flex flex-col justify-start items-start">
<text>{{ item.title }}</text>
<text class="mt-20 text-gray text-28">{{ item._add_time_str }}</text>
</view>
<view class="flex flex-col justify-end">
<el-button type="primary" size="small" @click="edit(item)">编辑</el-button>
<view class="mt-20">
<el-button type="primary" size="small" @click="del(item._id)" plain>删除</el-button>
</view>
</view>
</view>
</view>
</el-card>
</template>
<script>
export default {
name: "news",
data() {
return {
isAdd: false,
form: {
_id: null,
title: '',
content: '',
},
list: []
}
},
methods: {
async addArticle() {
if (!this.form.title) {
this.$message.error('请输入标题')
return
}
if (!this.form.content) {
this.$message.error('请输入内容')
return
}
await vk.callFunction({
url: 'client/userArticle/kh/action',
data: this.form
})
this.$message.success(this.form._id ? '修改成功' : '新增成功')
await this.getList()
this.isAdd = false
this.form = {
_id: null,
title: '',
content: '',
}
},
async getList() {
const {rows} = await vk.callFunction({
url: 'client/userArticle/kh/getList',
})
this.list = rows
},
del(_id) {
this.$confirm('确认删除该新闻动态吗?', '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(async () => {
await vk.callFunction({
url: 'client/userArticle/kh/delete',
data: {_id}
})
await this.getList()
})
},
edit(item) {
for (let key in this.form) this.form[key] = item[key]
this.isAdd = true
},
showAdd() {
this.isAdd = true
},
cancel(){
this.isAdd = !this.isAdd
this.form = {
_id: null,
title: '',
content: '',
}
}
},
mounted() {
this.getList()
}
}
</script>
+90 -23
View File
@@ -1,7 +1,12 @@
<template> <template>
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="flex justify-between items-start">
<span>您有<em style="color: #bf2b28;padding: 0 3px;font-weight: 500">{{ unreadNum }}</em>条未读消息</span> <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" <el-button style="float: right; padding: 3px 0; color: #666" type="text" @click="onSetting"
v-if="parseInt(vk.getVuex('$user.userInfo.userLevel')) > 0"><i v-if="parseInt(vk.getVuex('$user.userInfo.userLevel')) > 0"><i
class="el-icon-setting"></i> 消息推送设置 class="el-icon-setting"></i> 消息推送设置
@@ -25,7 +30,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="desc"> <div class="desc pointer" @click="toDetail(item, index)">
{{ item.content }} {{ item.content }}
</div> </div>
</div> </div>
@@ -35,7 +40,24 @@
</div> </div>
</div> </div>
<!-- 添加或编辑的弹窗结束 --> <el-dialog title="提示" :visible.sync="dialogVisible" width="70%">
<el-descriptions title="报价详情" v-if="sheet && dialogVisible" border :column="1">
<el-descriptions-item label="公司">{{ sheet.user.company.companyName }}</el-descriptions-item>
<el-descriptions-item label="联系人">{{ sheet.user.manager.personName }}</el-descriptions-item>
<el-descriptions-item label="联系方式">{{ sheet.user.businessCard.companyMobile }}</el-descriptions-item>
<el-descriptions-item label="价格">{{ sheet.amount }}元</el-descriptions-item>
<el-descriptions-item label="附件">
<p v-for="(item, index) in sheet.files" :key="index">
<a :href="item" target="_blank">预览:文件{{ index + 1 }}</a>
</p>
</el-descriptions-item>
<el-descriptions-item label="备注">{{ sheet.remark }}</el-descriptions-item>
</el-descriptions>
<div slot="footer" class="dialog-footer">
<el-button @click="toContact" type="primary">去签合同</el-button>
<el-button @click="dialogVisible = false">关闭</el-button>
</div>
</el-dialog>
</el-card> </el-card>
</template> </template>
@@ -46,27 +68,33 @@ export default {
return { return {
unreadNum: 0, unreadNum: 0,
noticeList: [], noticeList: [],
pageSize: 20, pageSize: 10,
total: 0 total: 0,
dialogVisible: false,
sheet: null,
} }
}, },
created() { created() {
this.getList() this.getList()
this.getUnreadNum()
}, },
methods: { methods: {
async getList(pageIndex = 1) { async getList(pageIndex = 1) {
const {rows} = await vk.callFunction({ const {rows, total} = await vk.callFunction({
url: 'client/message/kh/getList', url: 'client/message/kh/getList',
data: { data: {
pageIndex, pageIndex,
pageSize: this.pageSize, pageSize: this.pageSize,
} }
}) })
this.unreadNum = 0 this.total = total
this.noticeList = rows this.noticeList = rows
this.noticeList.forEach(item => { },
if (!item.hasRead) this.unreadNum++ async getUnreadNum() {
}) const {data} = await vk.callFunction({
url: 'client/message/kh/getUnreadCount',
});
this.unreadNum = data
}, },
async setRead(index) { async setRead(index) {
this.noticeList[index].hasRead = true this.noticeList[index].hasRead = true
@@ -77,29 +105,66 @@ export default {
} }
}) })
}, },
async del(index) { del(index) {
await vk.callFunction({ this.$confirm('确认删除吗?', '提示', {
url: 'client/message/kh/delete', confirmButtonText: '确定',
data: { cancelButtonText: '取消',
id: this.noticeList[index]._id type: 'warning'
} }).then(async () => {
await vk.callFunction({
url: 'client/message/kh/delete',
data: {
id: this.noticeList[index]._id
}
})
this.$message({
type: 'success',
message: '删除成功'
})
await this.getList()
await this.getUnreadNum()
}) })
this.$message({
type: 'success',
message: '删除成功'
})
await this.getList()
}, },
onSetting() { onSetting() {
this.$emit('done', 'setting') this.$emit('done', 'setting')
}, },
toDetail(item, index) { toDetail(item, index) {
this.setRead(index) if (!item.hasRead) this.setRead(index)
let url = null let url = null
if (item.type === 'old') url = `/pages/index/old/detail?id=${item.pk}` if (item.type === 'old') url = `/pages/index/old/detail?id=${item.pk}`
else if (item.type === 'enquiry') url = `/pages/enquiry/detail?id=${item.pk}` else if (item.type === 'enquiry') url = `/pages/enquiry/detail?id=${item.pk}`
else if (item.type === 'process') url = `/pages/process/detail?id=${item.pk}` else if (item.type === 'process') url = `/pages/process/detail?id=${item.pk}`
else if (item.type === 'contract') url = `/pages/contract/index?tab=1`
else if (item.type === 'self-support') url = `/pages/index/self-support/quote?id=${item.pk}`
else if (item.type === 'self-product') url = `/pages/order/order`
else if (item.type === 'self-support-quote') {
this.getQuoteDetail(item.pk)
}
if (url) vk.navigateTo({url}) if (url) vk.navigateTo({url})
},
async allRead() {
await vk.callFunction({
url: 'client/message/kh/setAllRead'
})
await this.getList(1)
await this.getUnreadNum()
},
async getQuoteDetail(_id){
await vk.callFunction({
url: 'client/selfSupport/kh/getQuoteDetail',
data: {
_id
},
success: ({rows}) => {
this.sheet = rows
this.dialogVisible = true
}
});
},
toContact(){
this.dialogVisible = false
vk.navigateTo({url: '/pages/contract/index?tab=1'})
} }
} }
} }
@@ -114,6 +179,8 @@ export default {
.item { .item {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding: 10px 0;
border-bottom: 1px solid #ddd;
.title-box { .title-box {
display: flex; display: flex;

Some files were not shown because too many files have changed in this diff Show More