20261008
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
/.hbuilderx/launch.json
|
||||
/unpackage/dist/*
|
||||
/node_modules/*
|
||||
Generated
+3
@@ -0,0 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
Generated
+17
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="cn.fjdmy.uniapp.UniappProjectDataService">
|
||||
<option name="basePath" value="$PROJECT_DIR$" />
|
||||
<option name="dataVersion" value="2" />
|
||||
<option name="generalBasePath" value="$PROJECT_DIR$" />
|
||||
<option name="manifestPath" value="$PROJECT_DIR$/manifest.json" />
|
||||
<option name="manifestStamp" value="0" />
|
||||
<option name="pagesPath" value="$PROJECT_DIR$/pages.json" />
|
||||
<option name="scanNum" value="1" />
|
||||
<option name="type" value="store" />
|
||||
<option name="uniapp" value="true" />
|
||||
<option name="uniappHx" value="true" />
|
||||
<option name="vueVersion" value="2" />
|
||||
<option name="wxAppId" value="wxbdc125d352e2f012" />
|
||||
</component>
|
||||
</project>
|
||||
+125
@@ -0,0 +1,125 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="HtmlUnknownAttribute" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="myValues">
|
||||
<value>
|
||||
<list size="2">
|
||||
<item index="0" class="java.lang.String" itemvalue="class" />
|
||||
<item index="1" class="java.lang.String" itemvalue="style" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
<option name="myCustomValuesEnabled" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="HtmlUnknownTag" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="myValues">
|
||||
<value>
|
||||
<list size="100">
|
||||
<item index="0" class="java.lang.String" itemvalue="nobr" />
|
||||
<item index="1" class="java.lang.String" itemvalue="noembed" />
|
||||
<item index="2" class="java.lang.String" itemvalue="comment" />
|
||||
<item index="3" class="java.lang.String" itemvalue="noscript" />
|
||||
<item index="4" class="java.lang.String" itemvalue="embed" />
|
||||
<item index="5" class="java.lang.String" itemvalue="script" />
|
||||
<item index="6" class="java.lang.String" itemvalue="el-form" />
|
||||
<item index="7" class="java.lang.String" itemvalue="el-input" />
|
||||
<item index="8" class="java.lang.String" itemvalue="el-form-item" />
|
||||
<item index="9" class="java.lang.String" itemvalue="el-button" />
|
||||
<item index="10" class="java.lang.String" itemvalue="el-container" />
|
||||
<item index="11" class="java.lang.String" itemvalue="el-header" />
|
||||
<item index="12" class="java.lang.String" itemvalue="el-menu" />
|
||||
<item index="13" class="java.lang.String" itemvalue="el-menu-item" />
|
||||
<item index="14" class="java.lang.String" itemvalue="el-submenu" />
|
||||
<item index="15" class="java.lang.String" itemvalue="el-breadcrumb" />
|
||||
<item index="16" class="java.lang.String" itemvalue="el-breadcrumb-item" />
|
||||
<item index="17" class="java.lang.String" itemvalue="el-dialog" />
|
||||
<item index="18" class="java.lang.String" itemvalue="el-row" />
|
||||
<item index="19" class="java.lang.String" itemvalue="el-col" />
|
||||
<item index="20" class="java.lang.String" itemvalue="el-table-column" />
|
||||
<item index="21" class="java.lang.String" itemvalue="el-table" />
|
||||
<item index="22" class="java.lang.String" itemvalue="el-pagination" />
|
||||
<item index="23" class="java.lang.String" itemvalue="el-upload" />
|
||||
<item index="24" class="java.lang.String" itemvalue="el-select" />
|
||||
<item index="25" class="java.lang.String" itemvalue="el-option" />
|
||||
<item index="26" class="java.lang.String" itemvalue="el-date-picker" />
|
||||
<item index="27" class="java.lang.String" itemvalue="el-switch" />
|
||||
<item index="28" class="java.lang.String" itemvalue="u-swiper" />
|
||||
<item index="29" class="java.lang.String" itemvalue="u-image" />
|
||||
<item index="30" class="java.lang.String" itemvalue="u-button" />
|
||||
<item index="31" class="java.lang.String" itemvalue="web-view" />
|
||||
<item index="32" class="java.lang.String" itemvalue="u-avatar" />
|
||||
<item index="33" class="java.lang.String" itemvalue="u-text" />
|
||||
<item index="34" class="java.lang.String" itemvalue="u-grid" />
|
||||
<item index="35" class="java.lang.String" itemvalue="u-grid-item" />
|
||||
<item index="36" class="java.lang.String" itemvalue="u-icon" />
|
||||
<item index="37" class="java.lang.String" itemvalue="u-cell-group" />
|
||||
<item index="38" class="java.lang.String" itemvalue="u-cell" />
|
||||
<item index="39" class="java.lang.String" itemvalue="u-tabs" />
|
||||
<item index="40" class="java.lang.String" itemvalue="u-gap" />
|
||||
<item index="41" class="java.lang.String" itemvalue="scroll-view" />
|
||||
<item index="42" class="java.lang.String" itemvalue="u-toast" />
|
||||
<item index="43" class="java.lang.String" itemvalue="u-subsection" />
|
||||
<item index="44" class="java.lang.String" itemvalue="u-empty" />
|
||||
<item index="45" class="java.lang.String" itemvalue="u-popup" />
|
||||
<item index="46" class="java.lang.String" itemvalue="uqrcode" />
|
||||
<item index="47" class="java.lang.String" itemvalue="temlate" />
|
||||
<item index="48" class="java.lang.String" itemvalue="el-tree" />
|
||||
<item index="49" class="java.lang.String" itemvalue="el-card" />
|
||||
<item index="50" class="java.lang.String" itemvalue="el-tag" />
|
||||
<item index="51" class="java.lang.String" itemvalue="u-modal" />
|
||||
<item index="52" class="java.lang.String" itemvalue="rich-text" />
|
||||
<item index="53" class="java.lang.String" itemvalue="u--text" />
|
||||
<item index="54" class="java.lang.String" itemvalue="u-line-progress" />
|
||||
<item index="55" class="java.lang.String" itemvalue="u--image" />
|
||||
<item index="56" class="java.lang.String" itemvalue="page" />
|
||||
<item index="57" class="java.lang.String" itemvalue="el-aside" />
|
||||
<item index="58" class="java.lang.String" itemvalue="house" />
|
||||
<item index="59" class="java.lang.String" itemvalue="el-dropdown" />
|
||||
<item index="60" class="java.lang.String" itemvalue="arrowdown" />
|
||||
<item index="61" class="java.lang.String" itemvalue="el-dropdown-menu" />
|
||||
<item index="62" class="java.lang.String" itemvalue="caretleft" />
|
||||
<item index="63" class="java.lang.String" itemvalue="close" />
|
||||
<item index="64" class="java.lang.String" itemvalue="fold" />
|
||||
<item index="65" class="java.lang.String" itemvalue="expand" />
|
||||
<item index="66" class="java.lang.String" itemvalue="caretright" />
|
||||
<item index="67" class="java.lang.String" itemvalue="upload" />
|
||||
<item index="68" class="java.lang.String" itemvalue="el-cascader" />
|
||||
<item index="69" class="java.lang.String" itemvalue="u-search" />
|
||||
<item index="70" class="java.lang.String" itemvalue="u-scroll-list" />
|
||||
<item index="71" class="java.lang.String" itemvalue="u-navbar" />
|
||||
<item index="72" class="java.lang.String" itemvalue="u-loadmore" />
|
||||
<item index="73" class="java.lang.String" itemvalue="u-parse" />
|
||||
<item index="74" class="java.lang.String" itemvalue="u-number-box" />
|
||||
<item index="75" class="java.lang.String" itemvalue="u-tag" />
|
||||
<item index="76" class="java.lang.String" itemvalue="u-checkbox" />
|
||||
<item index="77" class="java.lang.String" itemvalue="u-checkbox-group" />
|
||||
<item index="78" class="java.lang.String" itemvalue="checkbox" />
|
||||
<item index="79" class="java.lang.String" itemvalue="u-action-sheet" />
|
||||
<item index="80" class="java.lang.String" itemvalue="u-line" />
|
||||
<item index="81" class="java.lang.String" itemvalue="u-count-to" />
|
||||
<item index="82" class="java.lang.String" itemvalue="u-swipe-action" />
|
||||
<item index="83" class="java.lang.String" itemvalue="u-swipe-action-item" />
|
||||
<item index="84" class="java.lang.String" itemvalue="u-form" />
|
||||
<item index="85" class="java.lang.String" itemvalue="u-form-item" />
|
||||
<item index="86" class="java.lang.String" itemvalue="u-input" />
|
||||
<item index="87" class="java.lang.String" itemvalue="u-switch" />
|
||||
<item index="88" class="java.lang.String" itemvalue="u-textarea" />
|
||||
<item index="89" class="java.lang.String" itemvalue="u-picker" />
|
||||
<item index="90" class="java.lang.String" itemvalue="u-sticky" />
|
||||
<item index="91" class="java.lang.String" itemvalue="el-popover" />
|
||||
<item index="92" class="java.lang.String" itemvalue="plus" />
|
||||
<item index="93" class="java.lang.String" itemvalue="el-input-number" />
|
||||
<item index="94" class="java.lang.String" itemvalue="el-checkbox" />
|
||||
<item index="95" class="java.lang.String" itemvalue="el-checkbox-group" />
|
||||
<item index="96" class="java.lang.String" itemvalue="el-radio-group" />
|
||||
<item index="97" class="java.lang.String" itemvalue="el-radio-button" />
|
||||
<item index="98" class="java.lang.String" itemvalue="el-collapse" />
|
||||
<item index="99" class="java.lang.String" itemvalue="el-collapse-item" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
<option name="myCustomValuesEnabled" value="true" />
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
||||
Generated
+7
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="JavaScriptLibraryMappings">
|
||||
<file url="PROJECT" libraries="{@types/node, @types/uni-app, uview}" />
|
||||
<includedPredefinedLibrary name="Node.js Core" />
|
||||
</component>
|
||||
</project>
|
||||
Generated
+7
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="WebPackConfiguration">
|
||||
<option name="mode" value="MANUAL" />
|
||||
<option name="path" value="$PROJECT_DIR$/webstorm.ide.js" />
|
||||
</component>
|
||||
</project>
|
||||
Generated
+8
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/steel.iml" filepath="$PROJECT_DIR$/.idea/steel.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
Generated
+15
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="@types/node" level="application" />
|
||||
<orderEntry type="library" name="@types/uni-app" level="application" />
|
||||
<orderEntry type="library" name="uview" level="application" />
|
||||
</component>
|
||||
</module>
|
||||
Generated
+6
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,295 @@
|
||||
<script>
|
||||
export default {
|
||||
onLaunch: function () {
|
||||
console.log('App Launch')
|
||||
},
|
||||
onShow: function () {
|
||||
console.log('App Show')
|
||||
},
|
||||
onHide: function () {
|
||||
console.log('App Hide')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "@/uni_modules/uview-ui/index.scss";
|
||||
/*每个页面公共css */
|
||||
page {
|
||||
background: #F5F9FA;
|
||||
}
|
||||
|
||||
uni-modal {
|
||||
z-index: 999999 !important;
|
||||
}
|
||||
|
||||
.wrap {
|
||||
margin: 0 auto;
|
||||
// min-width: 320px;
|
||||
// max-width: 750px;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.red {
|
||||
color: #A92924 !important;
|
||||
}
|
||||
|
||||
.m-top-10 {
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.m-top-20 {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.m-top-30 {
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.m-left-10 {
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
.m-left-20 {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
.m-left-30 {
|
||||
margin-left: 30rpx;
|
||||
}
|
||||
|
||||
.m-right-10 {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.m-right-20 {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.m-right-30 {
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
|
||||
.p-30 {
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.p-top-10 {
|
||||
padding-top: 10rpx;
|
||||
}
|
||||
|
||||
.p-top-20 {
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
|
||||
.p-top-30 {
|
||||
padding-top: 30rpx;
|
||||
}
|
||||
|
||||
.p-left-10 {
|
||||
padding-left: 10rpx;
|
||||
}
|
||||
|
||||
.p-left-20 {
|
||||
padding-left: 20rpx;
|
||||
}
|
||||
|
||||
.p-left-30 {
|
||||
padding-left: 30rpx !important;
|
||||
}
|
||||
|
||||
.p-right-10 {
|
||||
padding-right: 10rpx;
|
||||
}
|
||||
|
||||
.p-right-20 {
|
||||
padding-right: 20rpx;
|
||||
}
|
||||
|
||||
.p-right-30 {
|
||||
padding-right: 30rpx !important;
|
||||
}
|
||||
|
||||
.p-30{
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.radius {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.full {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.fl {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.fr {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.clear:after {
|
||||
display: block;
|
||||
content: '';
|
||||
height: 0;
|
||||
line-height: 0;
|
||||
visibility: hidden;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.text-right {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.text-left {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.text-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.bg-white {
|
||||
background: white;
|
||||
}
|
||||
|
||||
// 单行文字
|
||||
.text-single {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
-o-text-overflow: ellipsis;
|
||||
-moz-text-overflow: ellipsis;
|
||||
-webkit-text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
// 两行文字
|
||||
.text-both {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
// 三行文字
|
||||
.text-three {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 3;
|
||||
-webkit-box-orient: vertical;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
// 平均分段
|
||||
.hundred {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.half {
|
||||
width: 50%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.third {
|
||||
width: 33.333%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.fourth {
|
||||
width: 25%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.fifth {
|
||||
width: 20%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
// 弹性盒子
|
||||
.flex {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.flex-1 {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.justify-start {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.justify-center {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.justify-end {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.justify-between {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.justify-around {
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.direction-column {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.align-center {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.flex-wrap {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.flex-nowrap {
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
.index-h2 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 10rpx 0rpx;
|
||||
|
||||
.big {
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
line-height: 48rpx;
|
||||
color: #101010;
|
||||
}
|
||||
|
||||
.more {
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
color: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.issue {
|
||||
position: fixed;
|
||||
right: 30rpx;
|
||||
bottom: 120rpx;
|
||||
z-index: 99;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
border-radius: 50%;
|
||||
background: #A92924;
|
||||
}
|
||||
</style>
|
||||
+148
@@ -0,0 +1,148 @@
|
||||
// 引入自定义公共函数
|
||||
export default {
|
||||
// 开发模式启用调式模式(请求时会打印日志)
|
||||
debug: process.env.NODE_ENV !== 'production',
|
||||
// 主云函数名称
|
||||
functionName: "router",
|
||||
// 登录页面路径
|
||||
login: {
|
||||
url: '/pages/login/login'
|
||||
},
|
||||
// 首页页面路径
|
||||
index: {
|
||||
url: '/pages/index/index'
|
||||
},
|
||||
// 404 Not Found 错误页面路径
|
||||
error: {
|
||||
url: '/pages/error/404/404'
|
||||
},
|
||||
// 前端默认时区(中国为8)
|
||||
targetTimezone:8,
|
||||
// 日志风格
|
||||
logger: {
|
||||
colorArr: [
|
||||
"#0095f8",
|
||||
"#67C23A"
|
||||
]
|
||||
},
|
||||
/**
|
||||
* app主题颜色
|
||||
* vk.getVuex('$app.color.main')
|
||||
* vk.getVuex('$app.color.secondary')
|
||||
*/
|
||||
color: {
|
||||
main: "#ff4444",
|
||||
secondary: "#555555"
|
||||
},
|
||||
// 需要检查是否登录的页面列表
|
||||
checkTokenPages: {
|
||||
/**
|
||||
* 如果 mode = 0 则代表自动检测
|
||||
* 如果 mode = 1 则代表list内的页面需要登录,不在list内的页面不需要登录
|
||||
* 如果 mode = 2 则代表list内的页面不需要登录,不在list内的页面需要登录
|
||||
* 注意1: list内是通配符表达式,非正则表达式
|
||||
* 注意2: 需要使用 vk.navigateTo 代替 uni.navigateTo 进行页面跳转才会生效
|
||||
* 注意3: 想要让 tabbar 页面必须登录才能访问,则需要手动在页面的onLoad里加 vk.pubfn.checkLogin();
|
||||
* 在无需登录的页面上执行kh或sys函数,也会自动判断是否登录,未登录会自动跳登录页面,登录成功后会自动返回本来要跳转的页面。
|
||||
*/
|
||||
mode: 2,
|
||||
list: [
|
||||
"/pages_template/*",
|
||||
"/pages/login/*",
|
||||
"/pages/index/*",
|
||||
"/pages/error/*"
|
||||
]
|
||||
},
|
||||
// 需要检查是否可以分享的页面列表(仅小程序有效)
|
||||
checkSharePages: {
|
||||
/**
|
||||
* 如果 mode = 0 则不做处理
|
||||
* 如果 mode = 1 则代表list内的页面可以被分享,不在list内的页面不可以被分享
|
||||
* 如果 mode = 2 则代表list内的页面不可以被分享,不在list内的页面可以被分享
|
||||
* 注意: list内是通配符表达式,非正则表达式
|
||||
*/
|
||||
mode: 0,
|
||||
// ['shareAppMessage', 'shareTimeline'],
|
||||
menus: ['shareAppMessage'],
|
||||
list: [
|
||||
"/pages/index/*",
|
||||
"/pages/goods/*",
|
||||
"/pages_template/*",
|
||||
]
|
||||
},
|
||||
// 静态文件的资源URL地址
|
||||
staticUrl: {
|
||||
// Logo
|
||||
logo: '/static/logo.png',
|
||||
},
|
||||
// 自定义公共函数,myPubFunction内的函数可通过vk.myfn.xxx() 调用
|
||||
myfn: null,
|
||||
// 第三方服务配置
|
||||
service: {
|
||||
// 密钥和签名信息 (由于签名的获取比较麻烦,建议初学者使用上传到unicloud的方案,上传到阿里云OSS是给有特殊需求的用户使用)
|
||||
// 相关文档 : https://help.aliyun.com/document_detail/31925.html?spm=a2c4g.11186623.6.1757.b7987d9czoFCVu
|
||||
aliyunOSS: {
|
||||
// 密钥和签名信息
|
||||
uploadData: {
|
||||
OSSAccessKeyId: "",
|
||||
policy: "",
|
||||
signature: "",
|
||||
},
|
||||
// oss上传地址
|
||||
action: "https://xxx.oss-cn-hangzhou.aliyuncs.com",
|
||||
// 根目录名称
|
||||
dirname: "test",
|
||||
// oss外网访问地址,也可以是阿里云cdn地址
|
||||
host: "https://xxx.xxx.com",
|
||||
// 上传时,是否按用户id进行分组储存
|
||||
groupUserId: true,
|
||||
// 是否默认上传到阿里云OSS
|
||||
isDefault: false
|
||||
},
|
||||
service: {
|
||||
// 云储存相关配置
|
||||
cloudStorage: {
|
||||
/**
|
||||
* vk.uploadFile 接口默认使用哪个存储
|
||||
* unicloud 空间内置存储(默认)
|
||||
* extStorage 扩展存储
|
||||
* aliyun 阿里云oss
|
||||
*/
|
||||
defaultProvider: "unicloud", // 这里若设置 extStorage 则 vk.uploadFile默认会上传至 扩展存储
|
||||
|
||||
}
|
||||
},
|
||||
},
|
||||
// 全局异常码,可以自定义提示结果
|
||||
globalErrorCode: {
|
||||
// 阿里云10秒非正常超时,其实请求还在执行(且一般已经成功了,但前端接受不到成功结果)
|
||||
"cloudfunction-unusual-timeout": "请求超时,但请求还在执行,请重新进入页面。",
|
||||
// 请求超时(真正的请求超时)
|
||||
"cloudfunction-timeout": "请求超时,请重试!",
|
||||
// 不在预期内的异常(如数据库异常、云函数编译异常等)
|
||||
"cloudfunction-system-error": "网络开小差了!"
|
||||
},
|
||||
// 自定义拦截器
|
||||
interceptor: {
|
||||
|
||||
// login:function(obj){
|
||||
// let { vk, params, res } = obj;
|
||||
// //console.log("params:",params);
|
||||
// //console.log("res:",res);
|
||||
// if(!params.noAlert){
|
||||
// vk.alert(res.msg);
|
||||
// }
|
||||
// console.log("跳自己的登录页面");
|
||||
// // 上方代码可自己修改,写成你自己的逻辑处理。
|
||||
// },
|
||||
|
||||
// fail:function(obj){
|
||||
// let { vk, params, res } = obj;
|
||||
// //console.log("params:",params);
|
||||
// //console.log("res:",res);
|
||||
// return false;// 返回false则取消框架内置fail的逻辑,返回true则会继续执行框架内置fail的逻辑
|
||||
// // 上方代码可自己修改,写成你自己的逻辑处理。
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
const debug = process.env.NODE_ENV !== 'production';
|
||||
// 开发环境和正式环境中都会显示的静态菜单
|
||||
import menus from './static_menu/menu.json'
|
||||
// 只在开发环境中显示的静态菜单
|
||||
import devMenus from './static_menu/menu-dev.json'
|
||||
var menusList = [];
|
||||
if (debug && devMenus) {
|
||||
menusList = menus.concat(devMenus);
|
||||
} else {
|
||||
menusList = menus;
|
||||
}
|
||||
|
||||
export default menusList;
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* 自定义公共函数
|
||||
*/
|
||||
var myfn = {};
|
||||
/**
|
||||
* 测试函数test1
|
||||
* vk.myfn.test1();
|
||||
*/
|
||||
myfn.test1 = function(obj = {}) {
|
||||
let vk = uni.vk;
|
||||
console.log("执行了自定义公共函数test1");
|
||||
return obj;
|
||||
};
|
||||
|
||||
export default myfn;
|
||||
@@ -0,0 +1,23 @@
|
||||
// 纯黑主题
|
||||
export default {
|
||||
// 左侧菜单样式
|
||||
leftMenu: {
|
||||
backgroundColor: "#191a23",
|
||||
subBackgroundColor:"#101117",
|
||||
textColor: "rgba(255,255,255,0.9)",
|
||||
activeTextColor: "#ffffff",
|
||||
activeBackgroundColor: "#2d8cf0",
|
||||
collapseActiveTextColor:"#2d8cf0",
|
||||
collapseActiveBackgroundColor: "#2c3239",
|
||||
hoverTextColor: "#ffffff",
|
||||
hoverBackgroundColor: "#545f6c",
|
||||
boxShadow: "0px 0 0px rgba(0,21,4,0.2)",
|
||||
//boxShadow: "2px 0 2px rgba(0,21,4,0.2)",
|
||||
//borderTop: "1px solid #101117"
|
||||
},
|
||||
// 顶部菜单样式
|
||||
topMenu: {
|
||||
backgroundColor: "#191a23",
|
||||
textColor: "#f0f0f0",
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
// 黑白主题(左侧菜单黑,顶部白)
|
||||
export default {
|
||||
// 左侧菜单样式
|
||||
leftMenu: {
|
||||
backgroundColor: "#191a23",
|
||||
subBackgroundColor:"#101117",
|
||||
textColor: "rgba(255,255,255,0.9)",
|
||||
activeTextColor: "#ffffff",
|
||||
activeBackgroundColor: "#2d8cf0",
|
||||
collapseActiveTextColor:"#2d8cf0",
|
||||
collapseActiveBackgroundColor: "#2c3239",
|
||||
hoverTextColor: "#ffffff",
|
||||
hoverBackgroundColor: "#545f6c",
|
||||
boxShadow: "0px 0 0px rgba(0,21,4,0.25)",
|
||||
//boxShadow: "2px 0 4px rgba(0,21,4,0.25)",
|
||||
//borderTop: "1px solid #101117"
|
||||
},
|
||||
// 顶部菜单样式
|
||||
topMenu: {
|
||||
backgroundColor: "#ffffff",
|
||||
textColor: "#999999",
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import white from './white.js'
|
||||
import black from './black.js'
|
||||
import blackWhite from './blackWhite.js'
|
||||
|
||||
export default {
|
||||
white,
|
||||
black,
|
||||
blackWhite
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
// 纯白主题
|
||||
export default {
|
||||
// 左侧菜单样式
|
||||
leftMenu: {
|
||||
backgroundColor: "#ffffff",
|
||||
subBackgroundColor:"#ffffff",
|
||||
textColor: "#303133",
|
||||
activeTextColor: "#409EFF",
|
||||
activeBackgroundColor: "#ecf5ff",
|
||||
collapseActiveTextColor:"#409EFF",
|
||||
collapseActiveBackgroundColor: "#ecf5ff",
|
||||
hoverTextColor: "#303133",
|
||||
hoverBackgroundColor: "#efefef",
|
||||
boxShadow: "0px 0 0px 0 rgba(29,35,41,0.05)",
|
||||
//boxShadow: "2px 0 0px 0 rgba(29,35,41,0.05)",
|
||||
borderTop: "1px solid #f8f8f9"
|
||||
},
|
||||
// 顶部菜单样式
|
||||
topMenu: {
|
||||
backgroundColor: "#ffffff",
|
||||
textColor: "#999999",
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
<template>
|
||||
<u-picker ref="uPicker" :show="show" :columns="columns" @change="change" keyName="name"
|
||||
:defaultIndex="defaultIndex"
|
||||
@cancel="show = false" @close="show = false" closeOnClickOverlay @confirm="confirm">
|
||||
<template slot="more" v-if="addNation">
|
||||
<text @click="selectAll">全国</text>
|
||||
</template>
|
||||
</u-picker>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import provinces from '@/util/address/provinces.json'
|
||||
import citys from '@/util/address/citys.json'
|
||||
import areas from '@/util/address/areas.json'
|
||||
|
||||
export default {
|
||||
name: "AddressSelect",
|
||||
data() {
|
||||
return {
|
||||
level: 3,
|
||||
show: false,
|
||||
columns: [],
|
||||
defaultIndex: [0, 0, 0],
|
||||
addNation: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open(data, level = 3, addNation = false) {
|
||||
this.show = true
|
||||
this.addNation = addNation
|
||||
if (level) this.level = level
|
||||
if (this.level === 3) {
|
||||
const cityCol = citys[0]
|
||||
if (cityCol[0].name !== '不限区域') {
|
||||
cityCol.unshift({
|
||||
'code': '0',
|
||||
'name': '不限区域',
|
||||
})
|
||||
}
|
||||
const areaCol = areas[0][0]
|
||||
if (areaCol[0].name !== '不限区域') {
|
||||
areaCol.unshift({
|
||||
'code': '0',
|
||||
'name': '不限区域',
|
||||
})
|
||||
}
|
||||
this.columns = [provinces,
|
||||
cityCol,
|
||||
areaCol
|
||||
]
|
||||
} else if (this.level === 2) this.columns = [provinces, citys[0]]
|
||||
else if (this.level === 1) this.columns = [provinces]
|
||||
if (data && data.province && data.province.name) {
|
||||
const provinceIndex = provinces.findIndex(item => item.name === data.province.name)
|
||||
let cityIndex = 0
|
||||
if (this.level > 1) {
|
||||
this.columns[1] = citys[provinceIndex]
|
||||
if (this.columns[1][0].name !== '不限区域') {
|
||||
this.columns[1].unshift({
|
||||
'code': '0',
|
||||
'name': '不限区域',
|
||||
})
|
||||
}
|
||||
this.$refs.uPicker.setColumnValues(1, this.columns[1])
|
||||
if (data.city && data.city.name) {
|
||||
cityIndex = this.columns[1].findIndex(item => item.name === data.city.name)
|
||||
}
|
||||
}
|
||||
if (this.level === 3) {
|
||||
this.columns[2] = areas[provinceIndex][cityIndex - 1]
|
||||
if (this.columns[2][0].name !== '不限区域') {
|
||||
this.columns[2].unshift({
|
||||
'code': '0',
|
||||
'name': '不限区域',
|
||||
})
|
||||
}
|
||||
this.$refs.uPicker.setColumnValues(2, this.columns[2])
|
||||
let areaIndex = 0
|
||||
if (data.area && data.area.name) {
|
||||
areaIndex = this.columns[2].findIndex(item => item.name === data.area.name)
|
||||
}
|
||||
this.defaultIndex = [provinceIndex, cityIndex, areaIndex]
|
||||
} else if (this.level === 2) this.defaultIndex = [provinceIndex, cityIndex]
|
||||
else if (this.level === 1) this.defaultIndex = [provinceIndex]
|
||||
}
|
||||
},
|
||||
change({columnIndex, index, indexs}) {
|
||||
console.log('index', columnIndex, index)
|
||||
console.log('indexs', indexs)
|
||||
// return
|
||||
if (columnIndex === 0 && this.level > 1) {
|
||||
console.log('here1')
|
||||
this.columns[1] = citys[index]
|
||||
if (this.columns[1][0].name !== '不限区域') {
|
||||
this.columns[1].unshift({
|
||||
'code': '0',
|
||||
'name': '不限区域',
|
||||
})
|
||||
}
|
||||
this.$refs.uPicker.setColumnValues(1, this.columns[1])
|
||||
if (this.level === 3) {
|
||||
this.columns[2] = areas[index][0]
|
||||
if (this.columns[2][0].name !== '不限区域') {
|
||||
this.columns[2].unshift({
|
||||
'code': '0',
|
||||
'name': '不限区域',
|
||||
})
|
||||
}
|
||||
this.$refs.uPicker.setColumnValues(2, this.columns[2])
|
||||
}
|
||||
} else if (columnIndex === 1 && this.level === 3 && indexs[1] !== 0) {
|
||||
console.log('here')
|
||||
if (index === 0) {
|
||||
this.columns[2] = [{
|
||||
'code': '0',
|
||||
'name': '不限区域',
|
||||
}]
|
||||
} else {
|
||||
console.log(indexs)
|
||||
this.columns[2] = areas[indexs[0]][indexs[1] - 1]
|
||||
if (this.columns[2][0].name !== '不限区域') {
|
||||
this.columns[2].unshift({
|
||||
'code': '0',
|
||||
'name': '不限区域',
|
||||
})
|
||||
}
|
||||
}
|
||||
this.$refs.uPicker.setColumnValues(2, this.columns[2])
|
||||
}
|
||||
this.defaultIndex = indexs
|
||||
this.$forceUpdate()
|
||||
},
|
||||
confirm({value}) {
|
||||
console.log(value)
|
||||
this.$emit('confirm', {
|
||||
province: value[0],
|
||||
city: this.level > 1 ? value[1] : null,
|
||||
area: this.level === 3 ? value[2] : null
|
||||
})
|
||||
this.show = false
|
||||
},
|
||||
selectAll() {
|
||||
this.confirm({
|
||||
value: [{code: null, name: '全国'}, {code: null, name: '全国'}, {code: null, name: '全国'}]
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,40 @@
|
||||
<template>
|
||||
<u-modal :show="showContact" title="交易方信息" @confirm="showContact = false">
|
||||
<view class="flex flex-col justify-start items-start">
|
||||
<view class="pb-20 border-bottom">
|
||||
<p>对方信息:</p>
|
||||
<p>{{ otherName }}</p>
|
||||
<p>{{ otherPhone }}</p>
|
||||
</view>
|
||||
<view class="mt-10">
|
||||
<p>我方联系方式:</p>
|
||||
<p>{{ mineName }}</p>
|
||||
<p>{{ minePhone }}</p>
|
||||
</view>
|
||||
</view>
|
||||
</u-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "ContactModal",
|
||||
data() {
|
||||
return {
|
||||
showContact: false,
|
||||
otherPhone: '',
|
||||
minePhone: '',
|
||||
otherName: '',
|
||||
mineName: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open(otherPhone = null, minePhone = null, otherName = null, mineName = null,) {
|
||||
this.showContact = true;
|
||||
this.otherPhone = otherPhone ?? '未留下联系方式'
|
||||
this.minePhone = minePhone ?? '未留下联系方式'
|
||||
this.otherName = otherName ?? '未留下联系方式'
|
||||
this.mineName = mineName ?? '未留下联系方式'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,67 @@
|
||||
<template>
|
||||
<el-carousel :height="`${height}rem`" :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: "11"
|
||||
},
|
||||
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>
|
||||
|
||||
<style>
|
||||
/deep/ .el-carousel__indicators {
|
||||
height: 30px !important;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,27 @@
|
||||
<template>
|
||||
<view class="component">
|
||||
<view class="layout-empty">
|
||||
<view class="text">暂无更多内容~</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.layout-empty {
|
||||
padding: 50rpx 30rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
text-align: center;
|
||||
color: #A7A7A7;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,77 @@
|
||||
<template>
|
||||
<view class="wrap">
|
||||
<view class="layout layout-fourth flex justify-between align-center">
|
||||
<view class="item" @click="listLink(0)">
|
||||
<view class="icon">
|
||||
<image class="radius" src="/static/img/four-1.png" mode=""></image>
|
||||
</view>
|
||||
<view :class="['text',{red: type === 0}]">拍卖信息</view>
|
||||
</view>
|
||||
<view class="item" @click="listLink(1)">
|
||||
<view class="icon">
|
||||
<image class="radius" src="/static/img/four-2.png" mode=""></image>
|
||||
</view>
|
||||
<view :class="['text',{red: type === 1}]">采购信息</view>
|
||||
</view>
|
||||
<view class="item" @click="listLink(2)">
|
||||
<view class="icon">
|
||||
<image class="radius" src="/static/img/four-3.png" mode=""></image>
|
||||
</view>
|
||||
<view :class="['text',{red: type === 2}]">租赁信息</view>
|
||||
</view>
|
||||
<view class="item" @click="listLink(3)">
|
||||
<view class="icon">
|
||||
<image class="radius" src="/static/img/four-4.png" mode=""></image>
|
||||
</view>
|
||||
<view :class="['text',{red: type === 3}]">物资回收信息</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
},
|
||||
props: {
|
||||
type: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
listLink(type) {
|
||||
vk.navigateTo(`/pages/junk/list?type=${type}`);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
console.log(this.type)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.layout-fourth {
|
||||
padding: 20rpx 30rpx;
|
||||
.item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.icon {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
}
|
||||
.text {
|
||||
margin-top: 8rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: bold;
|
||||
color: #101010;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,86 @@
|
||||
<template>
|
||||
<view class="component">
|
||||
<view class="layout-search flex justify-between align-center">
|
||||
<u-icon name="arrow-left" color="#ffffff" size="22" @click="handBack" v-if="showBack"></u-icon>
|
||||
<view class="search-box flex justify-between align-center">
|
||||
<u-icon name="search" size="24"></u-icon>
|
||||
<input class="flex-1 search-input" type="text" :placeholder="placeholder" v-model="keyword" @input="search"/>
|
||||
<view class="search-btn" @click="search">搜索</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
k: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: '请输入关键词',
|
||||
},
|
||||
showBack: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
keyword: ''
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
handBack() {
|
||||
uni.navigateBack()
|
||||
},
|
||||
search() {
|
||||
this.$emit('search', this.keyword)
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
k: {
|
||||
deep: true,
|
||||
handler(val) {
|
||||
console.log(val)
|
||||
this.keyword = val
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.keyword = this.k
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.layout-search {
|
||||
// width: 690rpx;
|
||||
height: 80rpx;
|
||||
padding: 0 30rpx;
|
||||
background: #ae4f4d;
|
||||
}
|
||||
|
||||
.search-box {
|
||||
width: 560rpx;
|
||||
height: 56rpx;
|
||||
padding: 0 20rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 10rpx;
|
||||
|
||||
.search-input {
|
||||
padding: 4rpx 10rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.search-btn {
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #A92924;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,81 @@
|
||||
<template>
|
||||
<view class="wrap">
|
||||
<view class="layout layout-swiper">
|
||||
<u-swiper
|
||||
:list="list"
|
||||
radius="0"
|
||||
:indicator="false"
|
||||
:height="height"
|
||||
></u-swiper>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
};
|
||||
},
|
||||
props: {
|
||||
page: {
|
||||
type: String,
|
||||
default: "index"
|
||||
},
|
||||
height: {
|
||||
type: String | Number,
|
||||
default: "150rpx"
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
default: "100%"
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getSwiperList() {
|
||||
vk.callFunction({
|
||||
url: 'client/album/pub/list',
|
||||
data: {
|
||||
page: this.page
|
||||
},
|
||||
success: res => {
|
||||
this.list = res.swiper
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getSwiperList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.wrap{
|
||||
background-color: white;
|
||||
}
|
||||
.layout-fourth {
|
||||
padding: 20rpx 30rpx;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.icon {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
}
|
||||
|
||||
.text {
|
||||
margin-top: 8rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: bold;
|
||||
color: #101010;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,89 @@
|
||||
<template>
|
||||
<view class="component">
|
||||
<view class="layout-head flex justify-between align-center">
|
||||
<view class="m-left-20">
|
||||
<u-icon name="arrow-left" color="#ffffff" size="22" @click="handBack" v-if="showBack"></u-icon>
|
||||
</view>
|
||||
<view class="text flex-1 text-single p-right-20">
|
||||
{{ title }}
|
||||
</view>
|
||||
<view class="user flex justify-center align-center p-right-30">
|
||||
<view class="icon">
|
||||
<image class="full" src="/static/img/h-user.png" mode=""></image>
|
||||
</view>
|
||||
<view class="text" @click="loginLink">{{
|
||||
(userData && userData.nickname) ? userData.nickname : '未登录'
|
||||
}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isLogin: false,
|
||||
userData: null
|
||||
}
|
||||
},
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
default: '金久信'
|
||||
},
|
||||
showBack: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
|
||||
},
|
||||
methods: {
|
||||
handBack() {
|
||||
uni.navigateBack({
|
||||
delta: 1,
|
||||
})
|
||||
},
|
||||
loginLink() {
|
||||
if (this.userData && this.userData.nickname) uni.switchTab({url: '/pages/user/user'})
|
||||
else vk.navigateTo('/pages/login/login')
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.userData = vk.getStorageSync('uni_id_user_info')
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.layout-head {
|
||||
// width: 750rpx;
|
||||
height: 80rpx;
|
||||
background: #ae4f4d;
|
||||
.num {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
}
|
||||
.img {
|
||||
width: 220rpx;
|
||||
height: 58rpx;
|
||||
}
|
||||
.text {
|
||||
font-size: 28rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
.user {
|
||||
.icon {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
.text {
|
||||
padding-left: 10rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 32rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,41 @@
|
||||
<template>
|
||||
<view>
|
||||
<template v-if="['doc', 'docx'].includes(item.split('.').pop())">
|
||||
<file-word @click="openDownload" theme="outline" class="pointer" size="40" fill="#4a90e2" strokeLinecap="square"/>
|
||||
</template>
|
||||
<template v-else-if="['xls', 'xlsx'].includes(item.split('.').pop())">
|
||||
<file-excel @click="openDownload" theme="outline" class="pointer" size="40" fill="#417505" strokeLinecap="square"/>
|
||||
</template>
|
||||
<template v-else-if="['pdf'].includes(item.split('.').pop())">
|
||||
<file-pdf-one @click="openDownload" 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: {
|
||||
openDownload() {
|
||||
window.location.href = this.item
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,195 @@
|
||||
<template> <!-- 买家中心和卖家中心 -->
|
||||
<view class="component">
|
||||
<view class="layout-abc">
|
||||
<!-- 买家入门 -->
|
||||
<view class="abc-box bg-white">
|
||||
<view class="index-h3">
|
||||
<view class="big">买家入门</view>
|
||||
<view class="more" @click="$jump(`/pages/article/list?id=6573d7c3e0ec19b5047ffa8c`)">更多</view>
|
||||
</view>
|
||||
<view class="abc flex justify-between">
|
||||
<view class="abc-left">
|
||||
<image class="full" src="/static/img/abc-1.png" mode=""></image>
|
||||
</view>
|
||||
<view class="abc-right flex-1 p-left-20">
|
||||
<!-- <view class="link">买家中心</view> -->
|
||||
<view class="abc-tab flex justify-start">
|
||||
<view class="tab active">常见问题</view>
|
||||
<!-- <view class="tab">如何采购</view>-->
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="li" v-for="(item, index) in buyerArticleList" :key="index"
|
||||
@click="jump(`/pages/article/info?id=${item._id}`)">{{ item.name }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 卖家入门 -->
|
||||
<view class="abc-box bg-white mt-10">
|
||||
<view class="index-h3">
|
||||
<view class="big">卖家入门</view>
|
||||
<view class="more" @click="$jump(`/pages/article/list?id=6573d7bde0ec19b5047ff941`)">更多</view>
|
||||
</view>
|
||||
<view class="abc flex justify-between">
|
||||
<view class="abc-left">
|
||||
<image class="full" src="/static/img/abc-1.png" mode=""></image>
|
||||
</view>
|
||||
<view class="abc-right flex-1 p-left-20">
|
||||
<!-- <view class="link">卖家中心</view> -->
|
||||
<view class="abc-tab flex justify-start">
|
||||
<view class="tab active">常见问题</view>
|
||||
<!-- <view class="tab">如何采购</view>-->
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="li" v-for="(item, index) in sellerArticleList" :key="index"
|
||||
@click="jump(`/pages/article/info?id=${item._id}`)">{{ item.name }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isLogin: false,
|
||||
sellerArticleList: [],
|
||||
buyerArticleList: [],
|
||||
articleList: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
buyerLink() {
|
||||
vk.navigateTo('/pages/user/buyer')
|
||||
},
|
||||
sellerLink() {
|
||||
vk.navigateTo('/pages/user/seller')
|
||||
},
|
||||
jump(url) {
|
||||
vk.navigateTo(url)
|
||||
},
|
||||
getArticleList() {
|
||||
const otherArticleIdList = []
|
||||
this.articleList.forEach((item, index) => {
|
||||
otherArticleIdList.push(item.id)
|
||||
})
|
||||
otherArticleIdList.push('6573d7bde0ec19b5047ff941')
|
||||
otherArticleIdList.push('6573d7c3e0ec19b5047ffa8c')
|
||||
this.sellerArticleList = []
|
||||
this.buyerArticleList = []
|
||||
this.articleList.forEach((item, index) => {
|
||||
this.articleList[index].list = []
|
||||
})
|
||||
vk.callFunction({
|
||||
url: 'client/otherArticle/list/pub/getList',
|
||||
data: {
|
||||
pageIndex: 1,
|
||||
pageSize: 200,
|
||||
parentId: otherArticleIdList
|
||||
},
|
||||
success: (data) => {
|
||||
data.rows.forEach(item => {
|
||||
if (item.parentId === '6573d7bde0ec19b5047ff941') this.sellerArticleList.push(item)
|
||||
else if (item.parentId === '6573d7c3e0ec19b5047ffa8c') this.buyerArticleList.push(item)
|
||||
this.articleList.forEach((article, articleIndex) => {
|
||||
if (article.id === item.parentId) {
|
||||
this.articleList[articleIndex].list.push(item)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getArticleList()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.layout-abc {
|
||||
padding: 5rpx 30rpx;
|
||||
|
||||
.abc-box {
|
||||
padding: 10rpx 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.index-h3 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 10rpx 0rpx;
|
||||
|
||||
.big {
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
line-height: 40rpx;
|
||||
color: #A92924;
|
||||
}
|
||||
|
||||
.more {
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
color: #888888;
|
||||
}
|
||||
}
|
||||
|
||||
.abc {
|
||||
padding: 10rpx 10rpx;
|
||||
|
||||
.abc-left {
|
||||
width: 220rpx;
|
||||
height: 190rpx;
|
||||
}
|
||||
|
||||
.abc-right {
|
||||
position: relative;
|
||||
|
||||
.link {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
z-index: 9;
|
||||
font-size: 20rpx;
|
||||
line-height: 32rpx;
|
||||
color: #A92924;
|
||||
padding: 4rpx 8rpx;
|
||||
border: 1px solid #A92924;
|
||||
}
|
||||
|
||||
.abc-tab {
|
||||
width: 100%;
|
||||
height: 40rpx;
|
||||
overflow: hidden;
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
color: #666666;
|
||||
|
||||
.tab {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.active {
|
||||
color: #A92924;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.list {
|
||||
margin-top: 6rpx;
|
||||
width: 100%;
|
||||
height: 144rpx;
|
||||
overflow: hidden;
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #666666;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,37 @@
|
||||
<template>
|
||||
<view class="wrap">
|
||||
<view class="layout-advert">
|
||||
<view class="advert">
|
||||
<image class="full" src="/static/img/advert-1.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="advert">
|
||||
<image class="full" src="/static/img/advert-1.png" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isLogin: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.layout-advert {
|
||||
padding: 10rpx 30rpx;
|
||||
.advert:nth-child(n+2) {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,189 @@
|
||||
<template>
|
||||
<view class="bg-white">
|
||||
<u-collapse accordion>
|
||||
<u-collapse-item title="平台服务">
|
||||
<view class="flex justify-between items-center py-15 border-bottom" v-for="(item, index) in serviceList"
|
||||
:key="index"
|
||||
@click="$jump(`/pages/article/info?id=${item._id}`)">
|
||||
<text class="text-28">{{ item.name }}</text>
|
||||
<u-icon name="arrow-right"/>
|
||||
</view>
|
||||
</u-collapse-item>
|
||||
<u-collapse-item title="交易流程">
|
||||
<view class="flex justify-between items-center py-15 border-bottom" v-for="(item, index) in tradeList"
|
||||
:key="index"
|
||||
@click="$jump(`/pages/article/info?id=${item._id}`)">
|
||||
<text class="text-28">{{ item.name }}</text>
|
||||
<u-icon name="arrow-right"/>
|
||||
</view>
|
||||
</u-collapse-item>
|
||||
<u-collapse-item title="关于金久信">
|
||||
<view class="flex justify-between items-center py-15 border-bottom" v-for="(item, index) in aboutList"
|
||||
:key="index"
|
||||
@click="$jump(`/pages/article/info?id=${item._id}`)">
|
||||
<text class="text-28">{{ item.name }}</text>
|
||||
<u-icon name="arrow-right"/>
|
||||
</view>
|
||||
</u-collapse-item>
|
||||
<u-collapse-item title="旧货交易">
|
||||
<view class="flex justify-between items-center py-15 border-bottom" v-for="(item, index) in oldList"
|
||||
:key="index"
|
||||
@click="$jump(`/pages/article/info?id=${item._id}`)">
|
||||
<text class="text-28">{{ item.name }}</text>
|
||||
<u-icon name="arrow-right"/>
|
||||
</view>
|
||||
</u-collapse-item>
|
||||
<u-collapse-item title="找加工">
|
||||
<view class="flex justify-between items-center py-15 border-bottom" v-for="(item, index) in processList"
|
||||
:key="index"
|
||||
@click="$jump(`/pages/article/info?id=${item._id}`)">
|
||||
<text class="text-28">{{ item.name }}</text>
|
||||
<u-icon name="arrow-right"/>
|
||||
</view>
|
||||
</u-collapse-item>
|
||||
<u-collapse-item title="金久信学堂">
|
||||
<view class="flex justify-between items-center py-15 border-bottom"
|
||||
@click="$jump(`/pages/article/list?id=6574521499c62431df5b562c`)">
|
||||
<text class="text-28">行业动态</text>
|
||||
<u-icon name="arrow-right"/>
|
||||
</view>
|
||||
<view class="flex justify-between items-center py-15 border-bottom"
|
||||
@click="$jump(`/pages/article/list?id=6573d6fcf082105ea4bb5d09`)">
|
||||
<text class="text-28">技术论坛</text>
|
||||
<u-icon name="arrow-right"/>
|
||||
</view>
|
||||
<view class="flex justify-between items-center py-15 border-bottom"
|
||||
@click="$jump(`/pages/school/school`)">
|
||||
<text class="text-28">执行标准</text>
|
||||
<u-icon name="arrow-right"/>
|
||||
</view>
|
||||
<view class="flex justify-between items-center py-15 border-bottom"
|
||||
@click="$jump(`/pages/school/school`)">
|
||||
<text class="text-28">基础知识</text>
|
||||
<u-icon name="arrow-right"/>
|
||||
</view>
|
||||
|
||||
</u-collapse-item>
|
||||
<u-collapse-item title="金久信金融">
|
||||
<view class="flex justify-between items-center mb-10" v-for="(item, index) in jinRongList" :key="index"
|
||||
@click="$jump(`/pages/article/info?id=${item._id}`)">
|
||||
<text class="text-28">{{ item.name }}</text>
|
||||
<u-icon name="arrow-right"/>
|
||||
</view>
|
||||
</u-collapse-item>
|
||||
|
||||
</u-collapse>
|
||||
<div class="text-25 text-gray p-20">
|
||||
<div class="mb-20 flex justify-between items-center">
|
||||
<p class="out-link">
|
||||
<a rel="nofollow" target="_self"
|
||||
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>
|
||||
|<a rel="nofollow" target="_self"
|
||||
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>
|
||||
</p>
|
||||
<span>客服电话:400 686 5559</span>
|
||||
</div>
|
||||
<div class="wuage-copyright">
|
||||
<p>Copyright © 2020-2021 jinjiuxinzg.cn All Rights Reserved </p>
|
||||
<p>版权所有: 南宁亿利通钢管有限公司</p>
|
||||
<div class="flex justify-between items-center">
|
||||
<a href="https://beian.miit.gov.cn" rel="nofollow" target="_blank">桂ICP备19008827号-1</a>
|
||||
<a class="wuage-copyright"
|
||||
href="https://beian.mps.gov.cn/#/query/webSearch?code=45010702002145" rel="noreferrer"
|
||||
target="blank">桂公网安备45010702002145</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "collapse",
|
||||
data() {
|
||||
return {
|
||||
jinRongList: [],
|
||||
tradeList: [],
|
||||
aboutList: [],
|
||||
coopList: [],
|
||||
processList: [],
|
||||
oldList: [],
|
||||
serviceList: [],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getJinRongList()
|
||||
this.getTradeList()
|
||||
this.getAboutList()
|
||||
this.getCoopList()
|
||||
this.getProcessList()
|
||||
this.getOldList()
|
||||
this.getServiceList()
|
||||
},
|
||||
methods: {
|
||||
async getJinRongList() {
|
||||
const res = await vk.callFunction({
|
||||
url: 'client/otherArticle/list/pub/getList',
|
||||
data: {
|
||||
parentId: "65761c6a09664c4f4a325a05"
|
||||
}
|
||||
})
|
||||
this.jinRongList = res.rows
|
||||
},
|
||||
async getTradeList() {
|
||||
const res = await vk.callFunction({
|
||||
url: 'client/otherArticle/list/pub/getList',
|
||||
data: {
|
||||
parentId: "657458db9755e36c09375be8"
|
||||
}
|
||||
})
|
||||
this.tradeList = res.rows
|
||||
},
|
||||
async getAboutList() {
|
||||
const res = await vk.callFunction({
|
||||
url: 'client/otherArticle/list/pub/getList',
|
||||
data: {
|
||||
parentId: "65761c33e0ec19b504d81f90"
|
||||
}
|
||||
})
|
||||
this.aboutList = res.rows
|
||||
},
|
||||
async getCoopList() {
|
||||
const res = await vk.callFunction({
|
||||
url: 'client/otherArticle/list/pub/getList',
|
||||
data: {
|
||||
parentId: "65761c53337a9f0756a154ee"
|
||||
}
|
||||
})
|
||||
this.coopList = res.rows
|
||||
},
|
||||
async getProcessList() {
|
||||
const res = await vk.callFunction({
|
||||
url: 'client/otherArticle/list/pub/getList',
|
||||
data: {
|
||||
parentId: "65761c49a09a9b1767464f4f"
|
||||
}
|
||||
})
|
||||
this.processList = res.rows
|
||||
},
|
||||
async getOldList() {
|
||||
const res = await vk.callFunction({
|
||||
url: 'client/otherArticle/list/pub/getList',
|
||||
data: {
|
||||
parentId: "65761c40466d41a58495c9ae"
|
||||
}
|
||||
})
|
||||
this.oldList = res.rows
|
||||
},
|
||||
async getServiceList() {
|
||||
const res = await vk.callFunction({
|
||||
url: 'client/otherArticle/list/pub/getList',
|
||||
data: {
|
||||
parentId: "65761c229755e36c0976fb82"
|
||||
}
|
||||
})
|
||||
this.serviceList = res.rows
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,85 @@
|
||||
<template>
|
||||
<view class="component">
|
||||
<view class="layout-facilitator">
|
||||
<view class="index-h2">
|
||||
<view class="big">金久信服务商展示</view>
|
||||
<view class="more">更多</view>
|
||||
</view>
|
||||
<view class="facilitator-box flex justify-start flex-wrap m-top-10">
|
||||
<view class="item flex direction-column align-center justify-center" @click="jump('/pages/article/info?id=65791ccbe0ec19b504538e31')">
|
||||
<image class="img" src="/static/img/god4hover.jpg" mode=""></image>
|
||||
<view class="icon">
|
||||
<image class="full" src="/static/img/hs-1.png" mode=""></image>
|
||||
</view>
|
||||
<view class="text">交易安全</view>
|
||||
</view>
|
||||
<view class="item flex direction-column align-center justify-center" @click="jump('/pages/article/info?id=65791dc98b0da41d316435b7')">
|
||||
<image class="img" src="/static/img/feture-1.jpg" mode=""></image>
|
||||
<view class="icon">
|
||||
<image class="full" src="/static/img/hs-3.png" mode=""></image>
|
||||
</view>
|
||||
<view class="text">优势资源匹配</view>
|
||||
</view>
|
||||
<view class="item flex direction-column align-center justify-center" @click="jump('/pages/article/info?id=65791dd0f082105ea491286f')">
|
||||
<image class="img" src="/static/img/god3hover.jpg" mode=""></image>
|
||||
<view class="icon">
|
||||
<image class="full" src="/static/img/hs-4.png" mode=""></image>
|
||||
</view>
|
||||
<view class="text">交易多元化</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isLogin: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
jump(url) {
|
||||
vk.navigateTo(url)
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.layout-facilitator {
|
||||
padding: 10rpx 30rpx;
|
||||
.facilitator-box {
|
||||
.item {
|
||||
position: relative;
|
||||
width: 33%;
|
||||
height: 200rpx;
|
||||
.img {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.icon {
|
||||
position: relative;
|
||||
z-index: 9;
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
}
|
||||
.text {
|
||||
position: relative;
|
||||
z-index: 9;
|
||||
font-size: 22rpx;
|
||||
line-height: 40rpx;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,112 @@
|
||||
<template>
|
||||
<view class="component" @click="openClose">
|
||||
<view class="layout-finance bg-white">
|
||||
<view class="title">金久信·金融服务</view>
|
||||
<view class="finance-box flex m-top-20">
|
||||
<view class="finance-left flex-1 p-right-20">
|
||||
<view class="big indent">买家采购更放心</view>
|
||||
<view class="text">
|
||||
先收货后付款,账单最长<text class="red">60</text>天
|
||||
</view>
|
||||
<view class="big indent m-top-20">卖家销售无压力</view>
|
||||
<view class="text">
|
||||
账期交易未到期,资金提前收。
|
||||
</view>
|
||||
</view>
|
||||
<view class="finance-right">
|
||||
<image class="full" src="/static/img/finance-1.png" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="finance-box flex m-top-20">
|
||||
<view class="finance-left flex-1 p-right-20">
|
||||
<view class="text m-top-20">
|
||||
利率低至年化<text class="red">4.35%</text>
|
||||
</view>
|
||||
<view class="big">赊账卖钢材,回款不担心!</view>
|
||||
</view>
|
||||
<view class="finance-right">
|
||||
<image class="full" src="/static/img/finance-2.png" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isLogin: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openClose() {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '该功能暂未开放',
|
||||
showCancel: false,
|
||||
confirmText: '关闭'
|
||||
})
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.layout-finance {
|
||||
margin: 10rpx 30rpx;
|
||||
padding: 20rpx 20rpx;
|
||||
.title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
line-height: 40rpx;
|
||||
color: #A92924;
|
||||
}
|
||||
.finance-box {
|
||||
padding: 20rpx 20rpx 10rpx;
|
||||
border: 1px solid #f2f2f2;
|
||||
.finance-left {
|
||||
.big {
|
||||
padding: 6rpx 0;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
line-height: 40rpx;
|
||||
color: #101010;
|
||||
}
|
||||
.indent {
|
||||
position: relative;
|
||||
text-indent: 0.5em;
|
||||
&:before {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
z-index: 9;
|
||||
content: '';
|
||||
width: 2px;
|
||||
height: 2px;
|
||||
border-radius: 50%;
|
||||
background: #333333;
|
||||
}
|
||||
}
|
||||
.text {
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
line-height: 40rpx;
|
||||
color: #333333;
|
||||
}
|
||||
.red {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #A92924;
|
||||
}
|
||||
}
|
||||
.finance-right {
|
||||
width: 250rpx;
|
||||
height: 230rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,161 @@
|
||||
<template>
|
||||
<view class="component">
|
||||
<view class="layout-goods">
|
||||
<view class="index-h2">
|
||||
<view class="big">现货市场</view>
|
||||
<view class="more" @click="listLink">更多</view>
|
||||
</view>
|
||||
<view class="goods-box">
|
||||
<view class="item" @click="detailLink(item._id)" v-for="(item, index) in spotGoodsData" :key="index">
|
||||
<view class="top" v-if="item.isTop">特别推荐</view>
|
||||
<view class="top" v-if="!item.isTop && index < 10">最新</view>
|
||||
<!-- <view class="link">立即查看</view>-->
|
||||
<view class="title text-single">{{ item.name }}</view>
|
||||
<view class="text m-top-10 flex justify-between align-center">
|
||||
<text class="text-main w-40p">库存:约{{ parseFloat(item.stock) }}吨</text>
|
||||
</view>
|
||||
<view class="text">供货地: {{ item.addressStr }}</view>
|
||||
<view class="flex justify-between align-center">
|
||||
<view class="text" v-if="item.user && item.user.company">{{
|
||||
item.user.company.companyName
|
||||
}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="date">{{ item._add_time_str }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isLogin: false,
|
||||
spotGoodsData: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
listLink() {
|
||||
vk.navigateTo('/pages/goods/goods')
|
||||
},
|
||||
detailLink(id) {
|
||||
vk.navigateTo(`/pages/goods/detail?id=${id}`);
|
||||
},
|
||||
getSpotGoods() {
|
||||
vk.callFunction({
|
||||
url: 'client/spot/goods/pub/getList',
|
||||
loading: false,
|
||||
data: {
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
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.spotGoodsData = data.rows
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getSpotGoods()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.layout-goods {
|
||||
// width: 690rpx;
|
||||
padding: 10rpx 30rpx;
|
||||
|
||||
.item {
|
||||
position: relative;
|
||||
margin-top: 10rpx;
|
||||
padding: 10rpx 20rpx 20rpx;
|
||||
background: #ffffff;
|
||||
box-shadow: 0px 2px 7px 0px rgba(0, 0, 0, 0.12);
|
||||
|
||||
.title {
|
||||
width: 90%;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
line-height: 48rpx;
|
||||
color: #101010;
|
||||
}
|
||||
|
||||
.link, .askfor {
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
top: 16rpx;
|
||||
z-index: 9;
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #A92924;
|
||||
padding: 4rpx 8rpx;
|
||||
}
|
||||
|
||||
.link {
|
||||
border: 1px solid #A92924;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.red {
|
||||
margin-right: 20rpx;
|
||||
color: #A92924;
|
||||
}
|
||||
|
||||
.date {
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #9a9a9a;
|
||||
}
|
||||
|
||||
.company {
|
||||
height: 40rpx;
|
||||
|
||||
.icon {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
|
||||
.text {
|
||||
width: 300rpx;
|
||||
height: 40rpx;
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
color: #4f4f4f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.item:nth-child(1) {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.top {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(169, 41, 36, 1);
|
||||
padding: 2px 5px;
|
||||
border-radius: 5px 0 5px 0;
|
||||
color: #FFFFFF;
|
||||
font-size: 25rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,344 @@
|
||||
<template>
|
||||
<view class="component">
|
||||
<!-- <u-sticky offset-top="0" customNavHeight="0"></u-sticky> -->
|
||||
<view class="layout-head flex justify-between align-center" :class="{bgindex: index == 0}">
|
||||
<view class="num" @click="isPopup = true">
|
||||
<image class="full" src="/static/img/h-num.png" mode=""></image>
|
||||
</view>
|
||||
<view class="img flex justify-center items-center">
|
||||
<image class="full" v-if="!title" src="/static/img/h-center.jpg" mode="" @click="toHome"></image>
|
||||
<text class="text-white">{{ title }}</text>
|
||||
</view>
|
||||
<view class="user flex justify-center align-center">
|
||||
<view class="icon">
|
||||
<image class="full" src="/static/img/h-user.png" mode=""></image>
|
||||
</view>
|
||||
<view class="text" @click="loginLink">{{
|
||||
(userData && userData.nickname) ? userData.nickname : '未登录'
|
||||
}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-popup :show="isPopup" mode="top" @close="isPopup = false" :safe-area-inset-bottom="false">
|
||||
<view class="popup-box">
|
||||
<view class="layout-head bgindex flex justify-between align-center">
|
||||
<view class="num" @click="isPopup = false">
|
||||
<image class="full" src="/static/img/h-num.png" mode=""></image>
|
||||
</view>
|
||||
<view class="img">
|
||||
<image class="full" src="/static/img/h-center.jpg" mode=""></image>
|
||||
</view>
|
||||
<view class="user flex justify-center align-center">
|
||||
<view class="icon">
|
||||
<image class="full" src="/static/img/h-user.png" mode=""></image>
|
||||
</view>
|
||||
<view class="text" @click="loginLink">
|
||||
{{ (userData && userData.nickname) ? userData.nickname : '未登录' }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="popup-title" @click="toHome">首页</view>
|
||||
<view class="nav-box flex justify-start flex-wrap">
|
||||
<view class="item" @click="selfLink">
|
||||
<view class="icon">
|
||||
<image class="full" src="/static/img/nav-1.png" mode=""></image>
|
||||
</view>
|
||||
<view class="text">金久信自营</view>
|
||||
</view>
|
||||
<view class="item" @click="goodsLink">
|
||||
<view class="icon">
|
||||
<image class="full" src="/static/img/nav-2.png" mode=""></image>
|
||||
</view>
|
||||
<view class="text">现货市场</view>
|
||||
</view>
|
||||
<view class="item" @click="workLink">
|
||||
<view class="icon">
|
||||
<image class="full" src="/static/img/nav-3.png" mode=""></image>
|
||||
</view>
|
||||
<view class="text">找加工</view>
|
||||
</view>
|
||||
<view class="item" @click="priceLink">
|
||||
<view class="icon">
|
||||
<image class="full" src="/static/img/nav-4.png" mode=""></image>
|
||||
</view>
|
||||
<view class="text">找供应</view>
|
||||
</view>
|
||||
<view class="item mt-25" @click="junkLink">
|
||||
<view class="icon">
|
||||
<image class="full" src="/static/img/nav-5.png" mode=""></image>
|
||||
</view>
|
||||
<view class="text">旧货交易</view>
|
||||
</view>
|
||||
<view class="item mt-25" @click="yellowLink">
|
||||
<view class="icon">
|
||||
<image class="full" src="/static/img/nav-6.png" mode=""></image>
|
||||
</view>
|
||||
<view class="text">金久信黄页</view>
|
||||
</view>
|
||||
<view class="item mt-25" @click="schoolLink">
|
||||
<view class="icon">
|
||||
<image class="full" src="/static/img/nav-7.png" mode=""></image>
|
||||
</view>
|
||||
<view class="text">金久信学堂</view>
|
||||
</view>
|
||||
<view class="item mt-25" @click="shopLink">
|
||||
<view class="icon">
|
||||
<image class="full" src="/static/img/nav-8.png" mode=""></image>
|
||||
</view>
|
||||
<view class="text">特产商城</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="popup-title" @click="toUser">个人中心</view>
|
||||
<view class="nav-box flex justify-start flex-wrap">
|
||||
<view class="item" @click="buyerLink" style="width: 33%">
|
||||
<view class="icon icon-2">
|
||||
<image class="full" src="/static/img/pu-1.jpg" mode=""></image>
|
||||
</view>
|
||||
<view class="text text-2">买家中心</view>
|
||||
</view>
|
||||
<view class="item" @click="sellerLink" style="width: 33%">
|
||||
<view class="icon icon-2">
|
||||
<image class="full" src="/static/img/pu-2.png" mode=""></image>
|
||||
</view>
|
||||
<view class="text text-2">卖家中心</view>
|
||||
</view>
|
||||
<view class="item" @click="orderLink" style="width: 33%;margin-top: 0">
|
||||
<view class="icon icon-2">
|
||||
<image class="full" src="/static/img/pu-5.png" mode=""></image>
|
||||
</view>
|
||||
<view class="text text-2">订单管理</view>
|
||||
</view>
|
||||
<view class="item mt-25" @click="contractLink" style="width: 33%">
|
||||
<view class="icon icon-2">
|
||||
<image class="full" src="/static/img/pu-3.png" mode=""></image>
|
||||
</view>
|
||||
<view class="text text-2">合同管理</view>
|
||||
</view>
|
||||
<view class="item mt-25" @click="signLink" style="width: 33%">
|
||||
<view class="icon icon-2">
|
||||
<image class="full" src="/static/img/sign.png" mode=""></image>
|
||||
</view>
|
||||
<view class="text text-2">金久信签约宝</view>
|
||||
</view>
|
||||
<view class="item mt-25" @click="uploadLink" style="width: 33%">
|
||||
<view class="icon icon-2">
|
||||
<image class="full" src="/static/img/pu-4.png" mode=""></image>
|
||||
</view>
|
||||
<view class="text text-2">我的上传</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex justify-end items-center" v-if="userData && userData.nickname">
|
||||
<view class="mr-25 mt-30">
|
||||
<u-button size="small" type="primary" @click="logout">退出登录</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uinavr from '@/components/index/nav'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
uinavr,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isLogin: false,
|
||||
isPopup: false,
|
||||
userData: null
|
||||
}
|
||||
},
|
||||
props: {
|
||||
index: {
|
||||
type: Number,
|
||||
default: 1,
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
selfLink() {
|
||||
this.isPopup = false
|
||||
vk.navigateTo('/pages/self/self')
|
||||
},
|
||||
goodsLink() {
|
||||
this.isPopup = false
|
||||
vk.navigateTo('/pages/goods/goods')
|
||||
},
|
||||
workLink() {
|
||||
vk.navigateTo('/pages/work/work')
|
||||
},
|
||||
priceLink() {
|
||||
this.isPopup = false
|
||||
vk.navigateTo('/pages/price/price')
|
||||
},
|
||||
junkLink() {
|
||||
this.isPopup = false
|
||||
vk.navigateTo('/pages/junk/junk')
|
||||
},
|
||||
yellowLink() {
|
||||
this.isPopup = false
|
||||
vk.navigateTo('/pages/yellow/yellow')
|
||||
},
|
||||
schoolLink() {
|
||||
this.isPopup = false
|
||||
vk.navigateTo('/pages/school/school')
|
||||
},
|
||||
shopLink() {
|
||||
this.isPopup = false
|
||||
vk.navigateTo('/pages/shop/shop')
|
||||
},
|
||||
loginLink() {
|
||||
this.isPopup = false
|
||||
if (this.userData && this.userData.nickname) uni.switchTab({url: '/pages/user/user'})
|
||||
else vk.navigateTo('/pages/login/login')
|
||||
},
|
||||
userLink(index) {
|
||||
this.isPopup = false
|
||||
console.log('按照顺序判断跳转页面')
|
||||
},
|
||||
buyerLink() {
|
||||
this.isPopup = false
|
||||
vk.navigateTo('/pages/user/buyer')
|
||||
},
|
||||
sellerLink() {
|
||||
this.isPopup = false
|
||||
vk.navigateTo('/pages/user/seller')
|
||||
},
|
||||
contractLink() {
|
||||
this.isPopup = false
|
||||
vk.navigateTo('/pages/public/contract')
|
||||
},
|
||||
signLink() {
|
||||
this.isPopup = false
|
||||
vk.navigateTo('/pages/public/sign')
|
||||
},
|
||||
uploadLink() {
|
||||
this.isPopup = false
|
||||
vk.navigateTo('/pages/school/list')
|
||||
},
|
||||
orderLink() {
|
||||
this.isPopup = false
|
||||
vk.navigateTo('/pages/shop/order')
|
||||
},
|
||||
|
||||
logout() {
|
||||
vk.userCenter.logout({
|
||||
success: () => {
|
||||
uni.reLaunch({
|
||||
url: '/'
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
toHome() {
|
||||
uni.switchTab({url: '/pages/index/index'})
|
||||
},
|
||||
toUser() {
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.userData = vk.getStorageSync('uni_id_user_info')
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.bgindex {
|
||||
background: #A92924 !important;
|
||||
}
|
||||
|
||||
.layout-head {
|
||||
height: 80rpx;
|
||||
padding: 0 30rpx;
|
||||
background: #A92924;
|
||||
|
||||
.num {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
}
|
||||
|
||||
.img {
|
||||
width: 240rpx;
|
||||
height: 58rpx;
|
||||
}
|
||||
|
||||
.user {
|
||||
.icon {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
|
||||
.text {
|
||||
padding-left: 10rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 32rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.popup-box {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
padding-bottom: 50rpx;
|
||||
background: #ffffff;
|
||||
|
||||
.popup-title {
|
||||
padding: 30rpx 30rpx 10rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
line-height: 40rpx;
|
||||
color: #101010;
|
||||
}
|
||||
}
|
||||
|
||||
.nav-box {
|
||||
margin: 10rpx 30rpx;
|
||||
height: auto;
|
||||
padding: 30rpx 0;
|
||||
background: #F8F8F8;
|
||||
border-radius: 20rpx;
|
||||
|
||||
.item {
|
||||
width: 25%;
|
||||
height: auto;
|
||||
overflow: hidden;
|
||||
|
||||
.icon {
|
||||
margin: 0 auto;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
}
|
||||
|
||||
.icon-2 {
|
||||
width: 120rpx;
|
||||
height: 110rpx;
|
||||
}
|
||||
|
||||
.text {
|
||||
margin-top: 6rpx;
|
||||
height: 36rpx;
|
||||
overflow: hidden;
|
||||
font-size: 28rpx;
|
||||
line-height: 36rpx;
|
||||
color: #6C6C6C;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.text-2 {
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
//.item:nth-child(n+3) {
|
||||
//margin-top: 20rpx;
|
||||
//}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,174 @@
|
||||
<template>
|
||||
<view class="component">
|
||||
<view class="layout-model">
|
||||
<view class="index-h2">
|
||||
<view class="big">交易模式</view>
|
||||
<view class="more">更多</view>
|
||||
</view>
|
||||
<view class="model-box flex justify-between flex-wrap">
|
||||
<view class="w-50p">
|
||||
<view class="item" @click="jump('/pages/article/info?id=6583beb165234188b3be6732')">
|
||||
<view class="model flex justify-center align-center">
|
||||
<view class="icon">
|
||||
<image class="full" src="/static/img/abc-1.jpg" mode=""></image>
|
||||
</view>
|
||||
<view class="name">自主交易</view>
|
||||
</view>
|
||||
<view class="text">贷款直付销售商</view>
|
||||
<view class="text">双方平台保证金</view>
|
||||
<view class="link">交易流程></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="w-50p">
|
||||
<view class="item" @click="jump('/pages/article/info?id=6583bec8189f86d49ba8a58a')">
|
||||
<view class="model flex justify-center align-center">
|
||||
<view class="icon">
|
||||
<image class="full" src="/static/img/abc-2.jpg" mode=""></image>
|
||||
</view>
|
||||
<view class="name">金久信公正</view>
|
||||
</view>
|
||||
<view class="text">贷款直付销售商</view>
|
||||
<view class="text">交易成功后支付至销售商</view>
|
||||
<view class="link">交易流程></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="w-50p">
|
||||
<view class="item" @click="jump('/pages/article/info?id=6583bee1fe975f47a5931867')">
|
||||
<view class="model flex justify-center align-center">
|
||||
<view class="icon">
|
||||
<image class="full" src="/static/img/nav-8-0.png" mode=""></image>
|
||||
</view>
|
||||
<view class="name">信誉采购</view>
|
||||
</view>
|
||||
<view class="text">平台接受信誉采购的销售商</view>
|
||||
<view class="text">进行交易、到期后结算</view>
|
||||
<view class="link">交易流程></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="w-50p">
|
||||
<view class="item" @click="jump('/pages/article/info?id=6583bef3f08210d4b8a10e8a')">
|
||||
<view class="model flex justify-center align-center">
|
||||
<view class="icon">
|
||||
<image class="full" src="/static/img/nav-1-0.png" mode=""></image>
|
||||
</view>
|
||||
<view class="name">金久信自营</view>
|
||||
</view>
|
||||
<view class="text">贷款直付平台</view>
|
||||
<view class="text">交易成功后支付至销售商</view>
|
||||
<view class="link">交易流程></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isLogin: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
jump(url) {
|
||||
vk.navigateTo(url)
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.layout-model {
|
||||
// width: 690rpx;
|
||||
padding: 10rpx 30rpx;
|
||||
|
||||
.model-box {
|
||||
padding: 10rpx 0;
|
||||
|
||||
.item {
|
||||
margin: 10rpx;
|
||||
//width: 294rpx;
|
||||
// min-height: 160rpx;
|
||||
height: 270rpx;
|
||||
//padding: 20rpx;
|
||||
background: #ffffff;
|
||||
box-shadow: 0 2px 7px 0 rgba(0, 0, 0, 0.12);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
flex-direction: column;
|
||||
|
||||
&:nth-last-of-type(1) {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
&:nth-last-of-type(2) {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.ing {
|
||||
width: 120rpx;
|
||||
height: 44rpx;
|
||||
padding-left: 6rpx;
|
||||
color: #ffffff;
|
||||
background: url('~@/static/img/ing.png') center no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
color: #999999;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.link {
|
||||
margin: 10rpx auto 0;
|
||||
width: 140rpx;
|
||||
height: 44rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 44rpx;
|
||||
text-align: center;
|
||||
color: #A92924;
|
||||
border: 1px solid #A92924;
|
||||
border-radius: 3px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.model {
|
||||
padding: 6rpx 0;
|
||||
margin-bottom: 10rpx;
|
||||
|
||||
.icon {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
|
||||
.name {
|
||||
position: relative;
|
||||
padding-left: 20rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
line-height: 48rpx;
|
||||
color: #101010;
|
||||
|
||||
&::after {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
bottom: -1px;
|
||||
z-index: 9;
|
||||
margin-left: -30rpx;
|
||||
content: '';
|
||||
width: 60rpx;
|
||||
height: 2px;
|
||||
background: #A92924;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,139 @@
|
||||
<template>
|
||||
<view class="component">
|
||||
<view class="layout-nav">
|
||||
<view class="nav-box flex justify-start flex-wrap" :class="{bgindex: index != 0}">
|
||||
<view class="item" @click="selfLink">
|
||||
<view class="icon">
|
||||
<image class="full" src="/static/img/nav-1.jpg" mode=""></image>
|
||||
</view>
|
||||
<view class="text">金久信自营</view>
|
||||
</view>
|
||||
<view class="item" @click="goodsLink">
|
||||
<view class="icon">
|
||||
<image class="full" src="/static/img/nav-2.png" mode=""></image>
|
||||
</view>
|
||||
<view class="text">现货市场</view>
|
||||
</view>
|
||||
<view class="item" @click="workLink">
|
||||
<view class="icon">
|
||||
<image class="full" src="/static/img/nav-3.png" mode=""></image>
|
||||
</view>
|
||||
<view class="text">找加工</view>
|
||||
</view>
|
||||
<view class="item" @click="priceLink">
|
||||
<view class="icon">
|
||||
<image class="full" src="/static/img/nav-4.png" mode=""></image>
|
||||
</view>
|
||||
<view class="text">找供应</view>
|
||||
</view>
|
||||
<view class="item" @click="junkLink">
|
||||
<view class="icon">
|
||||
<image class="full" src="/static/img/nav-5.jpg" mode=""></image>
|
||||
</view>
|
||||
<view class="text">旧货交易</view>
|
||||
</view>
|
||||
<view class="item" @click="yellowLink">
|
||||
<view class="icon">
|
||||
<image class="full" src="/static/img/nav-6.png" mode=""></image>
|
||||
</view>
|
||||
<view class="text">金久信黄页</view>
|
||||
</view>
|
||||
<view class="item" @click="schoolLink">
|
||||
<view class="icon">
|
||||
<image class="full" src="/static/img/nav-7.png" mode=""></image>
|
||||
</view>
|
||||
<view class="text">金久信学堂</view>
|
||||
</view>
|
||||
<view class="item" @click="shopLink">
|
||||
<view class="icon">
|
||||
<image class="full" src="/static/img/nav-8.png" mode=""></image>
|
||||
</view>
|
||||
<view class="text">特产商城</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isLogin: false,
|
||||
}
|
||||
},
|
||||
props: {
|
||||
index: {
|
||||
type: Number,
|
||||
default: 1,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
selfLink() {
|
||||
vk.navigateTo('/pages/self/self')
|
||||
},
|
||||
goodsLink() {
|
||||
vk.navigateTo('/pages/goods/goods')
|
||||
},
|
||||
workLink() {
|
||||
vk.navigateTo('/pages/work/work')
|
||||
},
|
||||
priceLink() {
|
||||
vk.navigateTo('/pages/price/price')
|
||||
},
|
||||
junkLink() {
|
||||
vk.navigateTo('/pages/junk/junk')
|
||||
},
|
||||
yellowLink() {
|
||||
vk.navigateTo('/pages/yellow/yellow')
|
||||
},
|
||||
schoolLink() {
|
||||
vk.navigateTo('/pages/school/school')
|
||||
},
|
||||
shopLink() {
|
||||
vk.navigateTo('/pages/shop/shop')
|
||||
},
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.nav-box {
|
||||
padding: 20rpx 0;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
.bgindex {
|
||||
background: #F8F8F8;
|
||||
}
|
||||
.layout-nav {
|
||||
// width: 690rpx;
|
||||
height: auto;
|
||||
padding: 30rpx 30rpx;
|
||||
background: #ffffff;
|
||||
.item {
|
||||
width: 25%;
|
||||
height: auto;
|
||||
overflow: hidden;
|
||||
.icon {
|
||||
margin: 0 auto;
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
.text {
|
||||
margin-top: 6rpx;
|
||||
height: 36rpx;
|
||||
overflow: hidden;
|
||||
font-size: 28rpx;
|
||||
line-height: 36rpx;
|
||||
color: #333333;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
.item:nth-child(n+5) {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,131 @@
|
||||
<template>
|
||||
<view class="wrap">
|
||||
<view class="layout-news">
|
||||
<view class="index-h2">
|
||||
<view class="big">资讯中心</view>
|
||||
<!-- <view class="more">更多</view>-->
|
||||
</view>
|
||||
<view class="news-box flex justify-between flex-wrap">
|
||||
<view class="w-100p" v-for="(item, index) in articleList" :key="index">
|
||||
<view class="item">
|
||||
<view class="title">{{ item.title }}</view>
|
||||
<view class="text u-line-1" v-for="(article, articleIndex) in item.list" :key="articleIndex"
|
||||
@click="jump(`/pages/article/info?id=${article._id}`)">
|
||||
{{ article.name }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isLogin: false,
|
||||
articleList: [
|
||||
{
|
||||
id: '657451bb6e5d2d335ab78b3a',
|
||||
title: '市场信息',
|
||||
list: []
|
||||
},
|
||||
{
|
||||
id: '65745200337a9f07565fb08d',
|
||||
title: '期货信息',
|
||||
list: []
|
||||
},
|
||||
{
|
||||
id: '6574520a7ad52d34471a9582',
|
||||
title: '行情分析',
|
||||
list: []
|
||||
},
|
||||
{
|
||||
id: '6574521499c62431df5b562c',
|
||||
title: '行业动态',
|
||||
list: []
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
jump(url) {
|
||||
vk.navigateTo(url)
|
||||
},
|
||||
getArticleList() {
|
||||
const otherArticleIdList = []
|
||||
this.articleList.forEach((item, index) => {
|
||||
otherArticleIdList.push(item.id)
|
||||
})
|
||||
this.articleList.forEach((item, index) => {
|
||||
this.articleList[index].list = []
|
||||
})
|
||||
vk.callFunction({
|
||||
url: 'client/otherArticle/list/pub/getList',
|
||||
data: {
|
||||
pageIndex: 1,
|
||||
pageSize: 500,
|
||||
parentId: otherArticleIdList
|
||||
},
|
||||
success: (data) => {
|
||||
data.rows.forEach(item => {
|
||||
this.articleList.forEach((article, articleIndex) => {
|
||||
if (article.id === item.parentId) {
|
||||
if (this.articleList[articleIndex].list.length < 5) this.articleList[articleIndex].list.push(item)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getArticleList()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.layout-news {
|
||||
padding: 10rpx 30rpx;
|
||||
|
||||
.news-box {
|
||||
padding: 10rpx 0;
|
||||
|
||||
.item {
|
||||
margin: 5rpx 10rpx;
|
||||
//width: 296rpx;
|
||||
//height: 250rpx;
|
||||
padding: 10rpx;
|
||||
background: #ffffff;
|
||||
box-shadow: 0px 2px 7px 0px rgba(0, 0, 0, 0.12);
|
||||
|
||||
.title {
|
||||
font-size: 30rpx;
|
||||
line-height: 44rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.text {
|
||||
//margin-top: 10rpx;
|
||||
width: 100%;
|
||||
height: 40rpx;
|
||||
overflow: hidden;
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
&:nth-last-of-type(1) {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
&:nth-last-of-type(2) {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,79 @@
|
||||
<template>
|
||||
<view class="wrap">
|
||||
<view class="layout-open bg-white">
|
||||
<view class="title">最新开通</view>
|
||||
<view class="open-box flex justify-between flex-wrap">
|
||||
<view class="li" @click="toCompany(item._id)" v-for="(item, index) in latestCompanyList" :key="index">{{ item.company.companyName }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isLogin: false,
|
||||
latestCompanyList: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getLatestCompanyList() {
|
||||
const {rows} = await vk.callFunction({
|
||||
url: 'client/user/pub/getCompany',
|
||||
data: {
|
||||
pageIndex: 1,
|
||||
pageSize: 8,
|
||||
authStatus: 1
|
||||
}
|
||||
})
|
||||
this.latestCompanyList = rows
|
||||
},
|
||||
toCompany(id) {
|
||||
vk.navigateTo(`/pages/yellow/detail?id=${id}`)
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getLatestCompanyList()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.layout-open {
|
||||
margin: 10rpx 30rpx;
|
||||
padding: 20rpx 20rpx;
|
||||
.title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
line-height: 40rpx;
|
||||
color: #A92924;
|
||||
}
|
||||
.open-box {
|
||||
padding: 10rpx 0;
|
||||
min-height: 80rpx;
|
||||
.li {
|
||||
position: relative;
|
||||
width: 48%;
|
||||
height: 40rpx;
|
||||
overflow: hidden;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
line-height: 40rpx;
|
||||
color: #666666;
|
||||
text-indent: 1em;
|
||||
&:before {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
z-index: 9;
|
||||
content: '';
|
||||
width: 2px;
|
||||
height: 2px;
|
||||
border-radius: 50%;
|
||||
background: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,135 @@
|
||||
<template>
|
||||
<view class="component">
|
||||
<view class="layout-price">
|
||||
<view class="index-h2" style="padding-bottom: 0;">
|
||||
<view class="big">最新询价信息</view>
|
||||
<view class="more" @click="listLink">更多</view>
|
||||
</view>
|
||||
<view class="price-box flex justify-between flex-wrap">
|
||||
<view class="w-50p" @click="detailLink(item._id)" v-for="(item, index) in enquirySheetData"
|
||||
:key="index">
|
||||
<view class="item">
|
||||
<view class="price flex justify-start">
|
||||
<view class="ing">报价中</view>
|
||||
<view class="ed flex-1 p-left-10">{{ item.quoteNum }}家报价</view>
|
||||
</view>
|
||||
<view class="name text-single">{{ item.title.split(' -')[0] }}</view>
|
||||
<view class="name text-single" style="font-size: 24rpx">{{ item.title.split(' -')[1] }}</view>
|
||||
<view class="text-single">
|
||||
{{
|
||||
item.productList.map(product => (product.procureNumber ? product.procureNumber : '') + (product.procureUnit ? product.procureUnit : ''))[0]
|
||||
}}
|
||||
</view>
|
||||
<view class="date">{{ dayjs(item._add_time_str).format('MM/DD HH:mm') }}</view>
|
||||
<view class="company text-single">
|
||||
<template v-if="item.user">
|
||||
<template v-if="item.user.accountType === 1">{{ item.user.person.personName }}
|
||||
</template>
|
||||
<template v-if="item.user.accountType === 2">{{ item.user.company.companyName }}
|
||||
</template>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dayjs from "dayjs";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isLogin: false,
|
||||
enquirySheetData: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
dayjs,
|
||||
listLink() {
|
||||
vk.navigateTo('/pages/price/price')
|
||||
},
|
||||
detailLink(id) {
|
||||
vk.navigateTo(`/pages/price/detail?id=${id}`);
|
||||
},
|
||||
getEnquirySheetList() {
|
||||
vk.callFunction({
|
||||
url: 'client/enquiry/sheet/pub/getList',
|
||||
loading: false,
|
||||
data: {
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
latest: true
|
||||
},
|
||||
success: (data) => {
|
||||
this.enquirySheetData = data.rows.map(item => {
|
||||
item.fullAddress = ''
|
||||
item.fullAddress = (item.addressRegion && item.addressRegion.province) ? `${item.addressRegion.province.name}${item.addressRegion.city.name}${item.addressRegion.area.name}` : ''
|
||||
if (item.addressDetail) item.fullAddress += item.addressDetail
|
||||
return item
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getEnquirySheetList()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.layout-price {
|
||||
// width: 690rpx;
|
||||
padding: 10rpx 30rpx;
|
||||
|
||||
.price-box {
|
||||
padding: 0;
|
||||
height: auto;
|
||||
overflow: hidden;
|
||||
|
||||
.item {
|
||||
//width: 100%;
|
||||
// min-height: 160rpx;
|
||||
padding: 20rpx;
|
||||
height: 240rpx;
|
||||
margin: 10rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #9a9a9a;
|
||||
background: #ffffff;
|
||||
box-shadow: 0px 2px 7px 0px rgba(0, 0, 0, 0.12);
|
||||
|
||||
&:nth-last-of-type(1) {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
&:nth-last-of-type(2) {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.name {
|
||||
padding: 8rpx 0;
|
||||
font-size: 28rpx;
|
||||
line-height: 35rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.ing {
|
||||
width: 120rpx;
|
||||
height: 44rpx;
|
||||
padding-left: 6rpx;
|
||||
color: #ffffff;
|
||||
background: url('~@/static/img/ing.png') center no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.ed {
|
||||
color: #A92924;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,196 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="layout-semicircle">
|
||||
<view class="background">
|
||||
<view class="text-25 text-white text-right mb-15">客服电话:400 686 5559</view>
|
||||
<view class="title">
|
||||
<image class="title" src="/static/img/sem.jpg" mode=""></image>
|
||||
</view>
|
||||
<view class="flex justify-start items-center mt-20 type-list ml-10">
|
||||
<text class="item" :class="{active: active === 1}" @click="active = 1">现货</text>
|
||||
<text class="item" :class="{active: active === 2}" @click="active = 2">找供应</text>
|
||||
<text class="item" :class="{active: active === 3}" @click="active = 3">找加工</text>
|
||||
<text class="item" :class="{active: active === 4}" @click="active = 4">旧货</text>
|
||||
<text class="item" :class="{active: active === 0}" @click="active = 0">商品</text>
|
||||
</view>
|
||||
<view class="search-box flex justify-between align-center"
|
||||
:style="{borderTopLeftRadius: active === 0 ? '0' : '10rpx'}">
|
||||
<u-icon name="search" size="20"></u-icon>
|
||||
<input class="flex-1 search-input" type="text" placeholder="请输入关键词" v-model="keyword"/>
|
||||
<view class="search-btn" @click="search">搜索</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-white text-25 px-30 flex justify-start items-center" style="background-color: #A92924; padding-bottom: 20rpx">
|
||||
<view class="sort-text mr-10">分类 | </view>
|
||||
<view class="flex justify-start items-center flex-wrap">
|
||||
<view class="mr-10" style="flex-shrink: 0;" v-for="(item,index) in categoryData" :key="index" @click="cateSearch(item.name)">
|
||||
{{ item.name }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="tel flex justify-center align-center">-->
|
||||
<!-- <u-icon name="phone" size="16"></u-icon>-->
|
||||
<!-- <view class="text" @click="handTel">咨询热线:100-768-1458</view>-->
|
||||
<!-- </view>-->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isLogin: false,
|
||||
categoryData: [],
|
||||
active: 1,
|
||||
keyword: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handTel() {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: '100-768-1458'
|
||||
})
|
||||
},
|
||||
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
|
||||
}
|
||||
});
|
||||
},
|
||||
search() {
|
||||
if (!this.keyword) return
|
||||
this.$emit('search', {
|
||||
keyword: this.keyword,
|
||||
type: this.active
|
||||
})
|
||||
},
|
||||
cateSearch(keyword) {
|
||||
this.$emit('search', {
|
||||
keyword,
|
||||
type: 1
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getCateList()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.layout-semicircle {
|
||||
background: #ffffff;
|
||||
|
||||
.title {
|
||||
margin: 0 auto;
|
||||
width: 550rpx;
|
||||
height: 58rpx;
|
||||
}
|
||||
|
||||
.tel {
|
||||
padding: 6rpx 0;
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
color: #9A9A9A;
|
||||
}
|
||||
}
|
||||
|
||||
.background {
|
||||
padding: 30rpx 30rpx 24rpx;
|
||||
background: #A92924;
|
||||
}
|
||||
|
||||
.search-box {
|
||||
//margin-top: 30rpx;
|
||||
height: 80rpx;
|
||||
padding: 0 20rpx;
|
||||
background: #ffffff;
|
||||
border-bottom-left-radius: 10rpx;
|
||||
border-bottom-right-radius: 10rpx;
|
||||
border-top-right-radius: 10rpx;
|
||||
overflow: hidden;
|
||||
|
||||
.search-input {
|
||||
padding: 4rpx 10rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.search-btn {
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.sort-box {
|
||||
position: relative;
|
||||
height: 80rpx;
|
||||
padding: 10rpx 30rpx 0;
|
||||
//background: url(@/static/img/elliptic.png) center no-repeat;
|
||||
background-color: #A92924;
|
||||
background-size: 100% 100%;
|
||||
|
||||
.sort-text {
|
||||
position: absolute;
|
||||
left: 30rpx;
|
||||
top: 20rpx;
|
||||
z-index: 9;
|
||||
width: 80rpx;
|
||||
height: 28rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 600;
|
||||
line-height: 28rpx;
|
||||
text-align: center;
|
||||
color: #ffffff;
|
||||
border-right: 1px solid #ffffff;
|
||||
}
|
||||
}
|
||||
|
||||
.scroll-box {
|
||||
position: absolute;
|
||||
left: 110rpx;
|
||||
top: 10rpx;
|
||||
z-index: 9;
|
||||
width: 600rpx;
|
||||
height: 40rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
white-space: nowrap;
|
||||
|
||||
.item {
|
||||
display: inline-block;
|
||||
padding: 0 12rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
text-align: center;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
|
||||
.type-list {
|
||||
.item {
|
||||
color: white;
|
||||
margin-right: 10rpx;
|
||||
font-size: 25rpx;
|
||||
padding: 10rpx;
|
||||
}
|
||||
|
||||
.active {
|
||||
color: #A92924;
|
||||
background-color: white;
|
||||
border-top-right-radius: 10rpx;
|
||||
border-top-left-radius: 10rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,119 @@
|
||||
<template>
|
||||
<view class="component" v-if="list.length">
|
||||
<view :style="{padding: padding, height : height}">
|
||||
<swiper class="swiper-box" :indicator-dots="false" :autoplay="true" :interval="3000" :duration="1000">
|
||||
<swiper-item v-for="(item, index) in list" :key="index">
|
||||
<view class="swiper-item">
|
||||
<image class="full" :src="item.swiper" mode="" @click="onClick(item)"></image>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
ad: {
|
||||
type: Number,
|
||||
default: () => {
|
||||
return 0
|
||||
}
|
||||
},
|
||||
padding: {
|
||||
type: String,
|
||||
default: '10rpx 30rpx'
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: '115rpx'
|
||||
},
|
||||
categoryId: {
|
||||
type: [String, Number],
|
||||
default: null
|
||||
},
|
||||
categoryIds: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
categoryName: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
categoryNames: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
region: {
|
||||
type: [Object, Array, String, Number],
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getAd() {
|
||||
const res = await vk.callFunction({
|
||||
url: 'client/ad/pub/getList',
|
||||
data: {
|
||||
adKey: this.ad,
|
||||
categoryId: this.categoryId || null,
|
||||
categoryIds: this.categoryIds && this.categoryIds.length ? this.categoryIds : null,
|
||||
categoryName: this.categoryName || null,
|
||||
categoryNames: this.categoryNames && this.categoryNames.length ? this.categoryNames : null,
|
||||
region: this.region || null,
|
||||
}
|
||||
})
|
||||
this.list = res.data || []
|
||||
},
|
||||
onClick(item){
|
||||
if ((item.type === 'company' || !item.type) && item.companyId)
|
||||
vk.navigateTo(`/pages/yellow/detail?id=${item.companyId}`)
|
||||
else if (item.type === 'goods' && item.goodsId)
|
||||
vk.navigateTo(`/pages/shop/detail?id=${item.goodsId}`)
|
||||
// vk.navigateTo(`/pages/yellow/detail?id=${item.companyId}`)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getAd()
|
||||
},
|
||||
watch: {
|
||||
categoryId() {
|
||||
this.getAd()
|
||||
},
|
||||
categoryName() {
|
||||
this.getAd()
|
||||
},
|
||||
categoryIds: {
|
||||
handler() {
|
||||
this.getAd()
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
categoryNames: {
|
||||
handler() {
|
||||
this.getAd()
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
region: {
|
||||
handler() {
|
||||
this.getAd()
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
.swiper-box, .swiper-item {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,130 @@
|
||||
<template>
|
||||
<view class="wrap">
|
||||
<view class="layout-work">
|
||||
<view class="index-h2 p-left-30 p-right-30">
|
||||
<view class="big">合作商家</view>
|
||||
<view class="more" @click="listLink()">更多</view>
|
||||
</view>
|
||||
<view class="work-box flex justify-between flex-wrap bg-white">
|
||||
<view class="item" @click="detailLink(item._id)" v-for="(item, index) in companyList" :key="index">
|
||||
<view class="company flex justify-center align-center flex-nowrap">
|
||||
<view class="icon">
|
||||
<image class="radius" :src="item.businessCard.logo" mode=""></image>
|
||||
</view>
|
||||
<view class="text flex-1 p-left-20 text-single">{{ item.company.companyName }}</view>
|
||||
</view>
|
||||
<view class="main text-single m-top-10">
|
||||
主营:{{ item.company.mainSpotCategory.join() }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isLogin: false,
|
||||
companyList: [],
|
||||
allChildCate: [],
|
||||
}
|
||||
},
|
||||
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()
|
||||
}
|
||||
});
|
||||
},
|
||||
listLink() {
|
||||
vk.navigateTo('/pages/yellow/yellow')
|
||||
},
|
||||
detailLink(id) {
|
||||
vk.navigateTo(`/pages/yellow/detail?id=${id}`);
|
||||
},
|
||||
async getCompanyList() {
|
||||
const {rows} = await vk.callFunction({
|
||||
url: 'client/user/pub/getCompany',
|
||||
data: {
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
isCoop: 1,
|
||||
}
|
||||
})
|
||||
this.companyList = rows.map(info => {
|
||||
info.company.mainSpotCategory = []
|
||||
if (info.company && info.company.mainSpotCategoryIds) {
|
||||
this.allChildCate.forEach(child => {
|
||||
if (info.company.mainSpotCategoryIds.includes(child._id)) {
|
||||
info.company.mainSpotCategory.push(child.name)
|
||||
}
|
||||
})
|
||||
}
|
||||
return info
|
||||
})
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getCategoryTreeData()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.work-box {
|
||||
padding: 20rpx 30rpx;
|
||||
|
||||
.item {
|
||||
position: relative;
|
||||
width: 50%;
|
||||
height: 136rpx;
|
||||
padding: 10rpx;
|
||||
box-sizing: border-box;
|
||||
border-bottom: 1px solid #f2f2f2;
|
||||
|
||||
.main {
|
||||
height: 36rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.company {
|
||||
width: 100%;
|
||||
height: 64rpx;
|
||||
|
||||
.icon {
|
||||
width: 64rpx;
|
||||
height: 64rpx;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 26rpx;
|
||||
font-weight: 600;
|
||||
line-height: 48rpx;
|
||||
color: #101010;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.item:nth-child(2n+1) {
|
||||
border-right: 1px solid #f2f2f2;
|
||||
}
|
||||
|
||||
.item:nth-last-child(-n+2) {
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,189 @@
|
||||
<template>
|
||||
<view>
|
||||
<template v-if="userInfo && userInfo.userLevel < 3">
|
||||
<div class="ml-20 mt-20 text-main font-bold" v-if="!quoteExpiredAt || monthExpired">剩余报价次数:{{
|
||||
remainQuoteNum
|
||||
}}次
|
||||
</div>
|
||||
<div class="ml-20 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="100%">
|
||||
<p>请选择购买模式</p>
|
||||
<div class="flex justify-center items-center flex-col">
|
||||
<div class="p-20 rounded m-20 shadow flex flex-col justify-center items-center flex-1 w-100p"
|
||||
: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 w-100p"
|
||||
: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 flex-col justify-start items-start"
|
||||
v-if="userInfo.userLevel === 0 && buyQuoteMode !== 'single'">
|
||||
<p>您还未成为会员,仅能单次购买。</p>
|
||||
<div class="mt-25">
|
||||
<span>请</span>
|
||||
<span class="text-main font-bold pointer mx-15 text-35" style="text-decoration: underline"
|
||||
@click="toUpgrade">升级会员</span>
|
||||
<span> ,可享受优惠报价套餐。</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-20 " v-if="!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: [],
|
||||
userInfo: null
|
||||
}
|
||||
},
|
||||
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/shop/pay?id=${data}`
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
this.dialogVisible = false
|
||||
vk.navigateBack()
|
||||
},
|
||||
toUpgrade() {
|
||||
this.dialogVisible = false
|
||||
uni.setStorageSync('user_tab', 4)
|
||||
vk.navigateTo({
|
||||
url: `/pages/user/user`
|
||||
})
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
await this.getSingleQuoteAmount()
|
||||
await this.getMonthlyAmount()
|
||||
vk.userCenter.getCurrentUserInfo({
|
||||
success: async (data) => {
|
||||
this.userInfo = data.userInfo
|
||||
console.log(data.userInfo)
|
||||
if (this.amount) {
|
||||
const res = await vk.callFunction({
|
||||
url: 'client/user/kh/getUserQuoteNumList',
|
||||
data: {
|
||||
type: this.type,
|
||||
sheetId: this.id,
|
||||
},
|
||||
})
|
||||
if (!data.userInfo) this.remainQuoteNum = 0
|
||||
else this.remainQuoteNum = data.userInfo.remainQuoteNum
|
||||
} else {
|
||||
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(data.userInfo) < 3)
|
||||
&& parseInt(data.userInfo.userLevel) < 3) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您的报价次数已用完/已过期,是否立即购买?',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.dialogVisible = true
|
||||
}
|
||||
if (res.cancel) {
|
||||
vk.navigateBack()
|
||||
}
|
||||
}
|
||||
})
|
||||
// this.$confirm('您的报价次数已用完/已过期,是否立即购买?', '提示', {
|
||||
// confirmButtonText: '确定',
|
||||
// cancelButtonText: '取消',
|
||||
// type: 'warning'
|
||||
// }).then(async () => {
|
||||
// this.dialogVisible = true
|
||||
// }).catch(() => {
|
||||
// vk.navigateBack()
|
||||
// })
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
watch: {
|
||||
buyQuoteMode(val) {
|
||||
if (this.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>
|
||||
@@ -0,0 +1,168 @@
|
||||
<template>
|
||||
<view class="pdf-page">
|
||||
<view class="pdf-wrap" :style="{'height':viewHeight}">
|
||||
<view ref="pdfRef" id="pdfView"></view>
|
||||
</view>
|
||||
<view v-if="showBottom" class="pdf-btn-group">
|
||||
<slot>
|
||||
<button class="btn-readed" size="mini" @click="handleComplete"
|
||||
:disabled="btnDisabled">{{showTimer ? countTimer<=1 ? '':'('+countTimer+'s)':''}}我已阅读</button>
|
||||
</slot>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Pdfh5 from "pdfh5";
|
||||
import "pdfh5/css/pdfh5.css";
|
||||
export default {
|
||||
name: "u-pdf",
|
||||
props: {
|
||||
url: {
|
||||
type: String,
|
||||
require: true
|
||||
},
|
||||
viewHeight: {
|
||||
type: String,
|
||||
default: "100%"
|
||||
},
|
||||
showBottom: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
options: {
|
||||
type: Object,
|
||||
default: () => ({
|
||||
cMapUrl: "https://unpkg.com/pdfjs-dist@3.8.162/cmaps/",
|
||||
lazy: false,
|
||||
withCredentials: true,
|
||||
// pdfLoaded:false,
|
||||
renderType: "svg",
|
||||
maxZoom: 3, //手势缩放最大倍数 默认3
|
||||
scrollEnable: true, //是否允许pdf滚动
|
||||
zoomEnable: true //是否允许pdf手势缩放
|
||||
})
|
||||
},
|
||||
disabled:{
|
||||
type:Boolean,
|
||||
default:true
|
||||
},
|
||||
showTimer:Boolean
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
totalNum: 0,
|
||||
pdfh5: undefined,
|
||||
countTimer:10,
|
||||
timer:undefined,
|
||||
btnDisabled:true
|
||||
}
|
||||
},
|
||||
|
||||
watch:{
|
||||
disabled(n,o){
|
||||
this.btnDisabled = this.disabled
|
||||
},
|
||||
showTimer(n,o){
|
||||
console.log("showTimer ",n);
|
||||
if(this.showTimer){
|
||||
this.startCountDownTimer()
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.loadPdf()
|
||||
})
|
||||
},
|
||||
|
||||
// onPageScroll(scroll) {
|
||||
// console.log(`onPageScroll ${scroll}`,scroll);
|
||||
// },
|
||||
|
||||
// onReachBottom(scroll) {
|
||||
// console.log(`onReachBottom 滚动到底部`);
|
||||
// },
|
||||
|
||||
methods: {
|
||||
handleComplete(){
|
||||
this.$emit("onClickReader")
|
||||
},
|
||||
|
||||
startCountDownTimer(){
|
||||
this.timer= setInterval(()=>{
|
||||
if(this.countTimer<=1){
|
||||
this.btnDisabled=false
|
||||
clearInterval(this.timer)
|
||||
}else{
|
||||
this.countTimer--
|
||||
}
|
||||
},1000)
|
||||
},
|
||||
|
||||
loadPdf() {
|
||||
if (!this.url) {
|
||||
console.error("pdf url is null ");
|
||||
return;
|
||||
}
|
||||
const opts = {
|
||||
pdfurl: this.url,
|
||||
...this.options
|
||||
}
|
||||
console.log(opts);
|
||||
this.pdfh5 = new Pdfh5('#pdfView', opts);
|
||||
// 准备加载pdf
|
||||
this.pdfh5.on("ready", () => {
|
||||
this.$emit("ready")
|
||||
})
|
||||
//pdf 监听完成事件
|
||||
this.pdfh5.on("complete", (status, msg, time) => {
|
||||
console.log(`PDF complete status=${status}, msg =${msg}`);
|
||||
this.$emit("complete", { status, msg })
|
||||
});
|
||||
// pdf 滚动事件 Svg 方式不会执行此方法, 需要在page中监听 onReachBottom,onPageScroll
|
||||
this.pdfh5.on("scroll", (scrollTop, currentNum) => {
|
||||
console.log(`pdf scrollTop =${scrollTop} , currentNum =${currentNum}`);
|
||||
this.$emit("scroll", { scrollTop, currentNum })
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@import 'pdfh5/css/pdfh5.css';
|
||||
|
||||
.pdf-page {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.pdf-wrap {
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.pdf-btn-group {
|
||||
width: 100%;
|
||||
border-top: 2rpx solid #F8F9FC;
|
||||
height: 8%;
|
||||
position: fixed;
|
||||
bottom: -1rpx;
|
||||
z-index: 999;
|
||||
background: white;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.btn-readed {
|
||||
background: #4E70F6;
|
||||
color: #ffffff;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,189 @@
|
||||
<template> <!-- 账户管理 -->
|
||||
<view>
|
||||
<view class="layout layout-account">
|
||||
<view class="account-title m-top-20">用户名管理</view>
|
||||
<!-- <view class="account-head m-top-30">-->
|
||||
<!-- <view class="flex justify-center direction-column align-center">-->
|
||||
<!-- <u--image :showLoading="true" src="https://cdn.uviewui.com/uview/album/1.jpg" width="100rpx" height="100rpx" radius="10rpx"></u--image>-->
|
||||
<!-- <view class="xiu">修改头像</view>-->
|
||||
<!-- </view>-->
|
||||
<!-- <view class="tip m-top-30">选择你喜欢的图片,格式为jpg、png、jpeg,大小不超过2M。</view>-->
|
||||
<!-- </view>-->
|
||||
<view class="account-form m-top-30">
|
||||
<view class="group">
|
||||
<u-icon name="account" color="#666" size="26"></u-icon>
|
||||
<view class="lb">用户名</view>
|
||||
<view class="vl">{{ userData.nickname }}</view>
|
||||
<!-- <view class="op">修改</view>-->
|
||||
</view>
|
||||
<view class="group">
|
||||
<u-icon name="phone" color="#666" size="26"></u-icon>
|
||||
<view class="lb">绑定手机号</view>
|
||||
<view class="vl">{{ userData.mobile.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") }}</view>
|
||||
<!-- <view class="op">修改</view>-->
|
||||
</view>
|
||||
<!-- <view class="group">-->
|
||||
<!-- <u-icon name="email" color="#666" size="26"></u-icon>-->
|
||||
<!-- <view class="lb">绑定邮箱</view>-->
|
||||
<!-- <view class="vl">649077859@163.com</view>-->
|
||||
<!-- <view class="op">修改</view>-->
|
||||
<!-- </view>-->
|
||||
<view class="group">
|
||||
<u-icon name="lock" color="#666" size="26"></u-icon>
|
||||
<view class="lb">登录密码</view>
|
||||
<view class="vl">已设置</view>
|
||||
<view class="op" @click="showPopup = true">修改</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-popup closeable :show="showPopup"
|
||||
round="10"
|
||||
mode="center"
|
||||
:custom-style="{width: '80%'}"
|
||||
@close="showPopup = false">
|
||||
<view class="p-20 m-20 flex flex-center">
|
||||
<u-text text="修改登录密码" size="17" align="center"/>
|
||||
</view>
|
||||
<view class="mt-15">
|
||||
<u-cell-group :border="false">
|
||||
<u-cell title="原密码">
|
||||
<u-input v-model="formData.oldPassword" slot="value" placeholder="请输入原密码"/>
|
||||
</u-cell>
|
||||
<u-cell title="新密码">
|
||||
<u-input v-model="formData.newPassword" slot="value" placeholder="请输入新密码"/>
|
||||
</u-cell>
|
||||
<u-cell title="确认密码" :border="false">
|
||||
<u-input v-model="formData.passwordConfirmation" slot="value" placeholder="请输入确认密码"/>
|
||||
</u-cell>
|
||||
|
||||
</u-cell-group>
|
||||
</view>
|
||||
<view class="mt-15">
|
||||
<u-button type="primary" shapre="circle" @click="submit"
|
||||
:disabled="!formData.oldPassword || !formData.newPassword || !formData.passwordConfirmation">
|
||||
确定
|
||||
</u-button>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
props: {
|
||||
userData: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showPopup: false,
|
||||
formData: {
|
||||
oldPassword: null,
|
||||
newPassword: null,
|
||||
passwordConfirmation: null,
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
if (!this.formData.oldPassword) return this.$message.error('请输入原密码');
|
||||
if (!this.formData.newPassword) return this.$message.error('请输入原密码');
|
||||
if (!this.formData.passwordConfirmation) return this.$message.error('请输入原密码');
|
||||
if (this.formData.newPassword !== this.formData.passwordConfirmation) return this.$message.error('两次输入的密码不一致!');
|
||||
if (this.formData.newPassword === this.formData.oldPassword) return this.$message.error('新密码不能与原密码相同!');
|
||||
if (this.formData.newPassword.length < 6 || this.formData.newPassword.length > 20) return this.$message.error('密码长度在 6 到 20 个字符');
|
||||
const reg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]+$/
|
||||
if (!reg.test(this.formData.newPassword)) {
|
||||
return this.$message({
|
||||
message: '密码必须由数字和字母组成',
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
vk.callFunction({
|
||||
url: 'user/kh/updatePwd',
|
||||
data: this.formData
|
||||
}).then(res => {
|
||||
this.$message.success('修改成功')
|
||||
this.formData = {
|
||||
oldPassword: null,
|
||||
newPassword: null,
|
||||
passwordConfirmation: null,
|
||||
}
|
||||
this.showPopup = false
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.layout-account {
|
||||
padding: 10rpx 30rpx;
|
||||
|
||||
.account-title {
|
||||
position: relative;
|
||||
padding-left: 20rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
line-height: 48rpx;
|
||||
color: #A92924;
|
||||
|
||||
&:before {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
z-index: 9;
|
||||
margin-top: -14rpx;
|
||||
content: '';
|
||||
width: 6rpx;
|
||||
height: 28rpx;
|
||||
background: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.tip {
|
||||
font-size: 24rpx;
|
||||
line-height: 48rpx;
|
||||
color: #999999;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.xiu {
|
||||
font-size: 24rpx;
|
||||
line-height: 48rpx;
|
||||
color: #A92924;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.group {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
padding: 20rpx 0;
|
||||
border-bottom: 1px solid #f2f2f2;
|
||||
|
||||
.lb {
|
||||
width: 150rpx;
|
||||
padding: 0 20rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 48rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.vl {
|
||||
flex: 1;
|
||||
font-size: 24rpx;
|
||||
line-height: 48rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.op {
|
||||
font-size: 24rpx;
|
||||
line-height: 48rpx;
|
||||
color: #A92924;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,131 @@
|
||||
<template>
|
||||
<view class="p-30">
|
||||
<view class="flex justify-end items-center">
|
||||
<u-button type="primary" @click="isAdd = !isAdd" v-if="!isAdd">新增业务联系人</u-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">
|
||||
<view class="flex-1 px-20">
|
||||
<u-button plain @click="isAdd = !isAdd">取消</u-button>
|
||||
</view>
|
||||
<view class="flex-1 px-20">
|
||||
<u-button type="primary" @click="addContact">确定</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<view class="p-20 my-20 shadow rounded 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">
|
||||
<u-button type="primary" size="small" @click="edit(item)">编辑</u-button>
|
||||
<view class="mt-20">
|
||||
<u-button type="primary" size="small" @click="del(item._id)" plain>删除</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</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) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确认删除该业务联系人吗?',
|
||||
success: async res => {
|
||||
if (res.confirm) {
|
||||
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 one or more lines are too long
@@ -0,0 +1,309 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="layout layout-equity">
|
||||
<view class="equity-title">
|
||||
尊敬的平台商家您好,目前您是我们平台的
|
||||
<text class="vip">{{ userLevelStr }}</text>
|
||||
客户,可享受相应的会员权益~
|
||||
</view>
|
||||
<view class="equity-main m-top-30">
|
||||
<!-- <view class="rule">会员规则</view>-->
|
||||
<view class="title flex justify-start align-center">
|
||||
<view class="vip">
|
||||
{{ userLevelStr }}
|
||||
<!-- <text class="lv m-left-10 m-right-20">LV1</text>-->
|
||||
</view>
|
||||
<u-tag text="当前等级" plain size="mini" color="#999" borderColor="#999"></u-tag>
|
||||
</view>
|
||||
<view class="date m-top-30" v-if="userInfo.upgradeExpiredAt">有效期至:{{ dayjs(userInfo.upgradeExpiredAt).format('YYYY-MM-DD HH:mm:ss') }}</view>
|
||||
<view class="m-top-30">
|
||||
<u--text suffixIcon="play-right-fill" color="#bfbfbf" iconStyle="font-size: 14px;color:#bfbfbf"
|
||||
text="当前交易总额"></u--text>
|
||||
<view class="text-30 font-bold text-white mt-20">{{ userInfo.transactionAmount }}</view>
|
||||
</view>
|
||||
<view class="flex justify-between align-center m-top-20">
|
||||
<view class="custom-style" @click="jump('/pages/user/grade')">去续费</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 保证金 -->
|
||||
<view class="equity-bail m-top-30 p-top-20">
|
||||
<view class="title">
|
||||
当前缴纳保证金
|
||||
<text class="strong">{{ userInfo.paidEnsure ? userInfo.paidEnsure.toFixed(2) : '0.00' }}</text>
|
||||
元
|
||||
</view>
|
||||
<view class="text m-top-20">
|
||||
<u--text type="info"
|
||||
text="金久信携手千万采购商和供应商,承诺为买家和卖家打造更优质的服务平台,缴纳诚信保证金会冻结在平台,最低保证金额度5000.00元 。"></u--text>
|
||||
</view>
|
||||
<view class="op flex justify-center m-top-30">
|
||||
<view class="o active" @click="jump('/pages/user/grade')">升级会员 ></view>
|
||||
<!-- <view class="o active" @click="jump('/pages/user/grade')">去缴纳保证金 ></view>-->
|
||||
<!-- <view class="o" @click="jump('/pages/user/grade')">购买增值权益 ></view>-->
|
||||
</view>
|
||||
</view>
|
||||
<!-- 权益 -->
|
||||
<view class="equity-info m-top-30 p-top-30">
|
||||
<view class="divider">
|
||||
<u-divider text="可享受一下权益"></u-divider>
|
||||
</view>
|
||||
<view class="divider-box flex justify-start flex-wrap">
|
||||
<view class="item">
|
||||
<view class="icon">
|
||||
<image class="full" src="/static/img/di-1.png" mode=""></image>
|
||||
</view>
|
||||
<view class="big m-top-10">9折报价</view>
|
||||
<view class="small">精准寻找买家</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="icon">
|
||||
<image class="full" src="/static/img/di-2.png" mode=""></image>
|
||||
</view>
|
||||
<view class="big m-top-10">10次/月询价</view>
|
||||
<view class="small">每成交50万送10次</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="icon">
|
||||
<image class="full" src="/static/img/di-3.png" mode=""></image>
|
||||
</view>
|
||||
<view class="big m-top-10">可自主交易</view>
|
||||
<view class="small">交易更方便</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="icon">
|
||||
<image class="full" src="/static/img/di-1.png" mode=""></image>
|
||||
</view>
|
||||
<view class="big m-top-10">黄页展示更丰富</view>
|
||||
<view class="small">让买家快速了解我</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="icon">
|
||||
<image class="full" src="/static/img/di-2.png" mode=""></image>
|
||||
</view>
|
||||
<view class="big m-top-10">平台增值服务享9折</view>
|
||||
<view class="small">交易更划算</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="icon">
|
||||
<image class="full" src="/static/img/di-3.png" mode=""></image>
|
||||
</view>
|
||||
<view class="big m-top-10">9折购买广告位</view>
|
||||
<view class="small">平台广告位购买</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dayjs from "dayjs";
|
||||
|
||||
export default {
|
||||
props: {
|
||||
userData: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
userInfo: {
|
||||
userLevel: -1,
|
||||
userGrade: 0,
|
||||
upgradeExpiredAt: '',
|
||||
transactionAmount: 0,
|
||||
paidEnsure: 0,
|
||||
},
|
||||
userLevelList: [],
|
||||
userLevelStr: '普通用户',
|
||||
userPayEnsureList: [],
|
||||
pageSize: 10,
|
||||
total: 0
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
dayjs,
|
||||
async getUserLevelList() {
|
||||
vk.callFunction({
|
||||
url: 'client/userLevel/pub/getList',
|
||||
data: {
|
||||
pageIndex: 1,
|
||||
pageSize: 200
|
||||
},
|
||||
success: async (data) => {
|
||||
this.userLevelList = data.rows
|
||||
const {userInfo} = await vk.userCenter.getCurrentUserInfo()
|
||||
this.userInfo = userInfo
|
||||
if (this.userInfo.userLevel > -1) {
|
||||
this.userLevelStr = this.userLevelList.find(level => parseInt(level.level) === parseInt(this.userInfo.userLevel)).name
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
async getUserPayEnsureList(pageIndex = 1) {
|
||||
const {rows} = vk.callFunction({
|
||||
url: 'client/order/kh/getList',
|
||||
data: {
|
||||
pageIndex,
|
||||
pageSize: 500,
|
||||
type: [2, 3]
|
||||
},
|
||||
});
|
||||
this.userPayEnsureList = rows
|
||||
},
|
||||
jump(url) {
|
||||
vk.navigateTo({url})
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
await this.getUserLevelList()
|
||||
await this.getUserPayEnsureList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.layout-equity {
|
||||
padding: 20rpx 30rpx;
|
||||
|
||||
.equity-title {
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #101010;
|
||||
|
||||
.vip {
|
||||
font-weight: 600;
|
||||
color: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.equity-main {
|
||||
position: relative;
|
||||
height: 300rpx;
|
||||
padding: 30rpx 30rpx;
|
||||
border-radius: 10rpx;
|
||||
background: url('~@/static/img/equity.png') center no-repeat;
|
||||
background-size: 100% 100%;
|
||||
box-shadow: 0px 5px 10px 0px rgba(145, 145, 145, 1);
|
||||
|
||||
.rule {
|
||||
position: absolute;
|
||||
right: 30rpx;
|
||||
top: 20rpx;
|
||||
z-index: 9;
|
||||
font-size: 24rpx;
|
||||
line-height: 32rpx;
|
||||
color: rgba(255, 255, 255, 0.68);
|
||||
}
|
||||
|
||||
.vip {
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
line-height: 32rpx;
|
||||
color: #DFBA8B;
|
||||
|
||||
.lv {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.date {
|
||||
font-size: 26rpx;
|
||||
line-height: 32rpx;
|
||||
color: rgba(223, 186, 139, 0.5);
|
||||
}
|
||||
|
||||
.baibi {
|
||||
width: 420rpx;
|
||||
|
||||
.lv {
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
color: #bfbfbf;
|
||||
}
|
||||
|
||||
.w {
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
line-height: 44rpx;
|
||||
color: #bfbfbf;
|
||||
}
|
||||
}
|
||||
|
||||
.custom-style {
|
||||
width: 140rpx;
|
||||
height: 60rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 60rpx;
|
||||
text-align: center;
|
||||
color: #9B7341;
|
||||
border-radius: 10rpx;
|
||||
background: linear-gradient(rgba(223, 186, 139, 1), rgba(255, 243, 207, 1));
|
||||
}
|
||||
}
|
||||
|
||||
.equity-bail {
|
||||
.title {
|
||||
font-size: 30rpx;
|
||||
line-height: 44rpx;
|
||||
color: #101010;
|
||||
|
||||
.strong {
|
||||
font-weight: 600;
|
||||
color: #A92924;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.o {
|
||||
width: 210rpx;
|
||||
height: 68rpx;
|
||||
font-size: 26rpx;
|
||||
line-height: 68rpx;
|
||||
color: #A92924;
|
||||
text-align: center;
|
||||
border: 1px solid #A92924;
|
||||
}
|
||||
|
||||
.active {
|
||||
color: #ffffff;
|
||||
background: #A92924;
|
||||
}
|
||||
|
||||
.divider {
|
||||
margin: 0 auto;
|
||||
width: 60%;
|
||||
}
|
||||
|
||||
.divider-box {
|
||||
padding: 20rpx 0;
|
||||
|
||||
.item {
|
||||
width: 33.333%;
|
||||
height: auto;
|
||||
padding: 20rpx 0;
|
||||
overflow: hidden;
|
||||
|
||||
.icon {
|
||||
margin: 0 auto;
|
||||
width: 52rpx;
|
||||
height: 52rpx;
|
||||
}
|
||||
|
||||
.big {
|
||||
font-size: 26rpx;
|
||||
line-height: 44rpx;
|
||||
color: #5a5a5a;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.small {
|
||||
font-size: 24rpx;
|
||||
line-height: 32rpx;
|
||||
color: #bfbfbf;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,484 @@
|
||||
<template>
|
||||
<view class="layout layout-ident">
|
||||
<text class="text-main font-bold mb-20">加工商状态: {{
|
||||
(isNaN(factoryStatus) || factoryStatus === -1) ? '未提交审核' : (factoryStatus === 0 ? '审核中' : (factoryStatus === 1 ? '审核通过' : `审核不通过:${refuseReason}`))
|
||||
}}
|
||||
</text>
|
||||
<view class="form-box">
|
||||
<el-divider>
|
||||
<text class="text-50 text-main font-bold">工厂信息</text>
|
||||
</el-divider>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">成立年限</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
:readonly="factoryStatus === 0"
|
||||
:dis="factoryStatus === 0"
|
||||
placeholder="请输入内容"
|
||||
v-model="form.year"
|
||||
>
|
||||
<template #suffix>年</template>
|
||||
</u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">年产值</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
:readonly="factoryStatus === 0"
|
||||
placeholder="请输入内容"
|
||||
v-model="form.yearsIncome"
|
||||
>
|
||||
<template #suffix>万元</template>
|
||||
</u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">员工人数</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
:readonly="factoryStatus === 0"
|
||||
placeholder="请输入内容"
|
||||
v-model="form.employeeNum"
|
||||
>
|
||||
<template #suffix>人</template>
|
||||
</u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">流水线数量</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
:readonly="factoryStatus === 0"
|
||||
placeholder="请输入内容"
|
||||
v-model="form.flowNum"
|
||||
>
|
||||
<template #suffix>条</template>
|
||||
</u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">厂房归属</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
:readonly="factoryStatus === 0"
|
||||
placeholder="请输入内容"
|
||||
v-model="form.blongTo"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">厂房面积</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
:readonly="factoryStatus === 0"
|
||||
placeholder="请输入内容"
|
||||
v-model="form.size"
|
||||
>
|
||||
<template #suffix>平方米</template>
|
||||
</u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30" @click="showAddress">
|
||||
<view class="lb need">所在地</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
placeholder="请选择公司所在地"
|
||||
v-model="addressRegion"
|
||||
suffixIcon="arrow-down"
|
||||
suffixIconStyle="color: #909399"
|
||||
disabled
|
||||
disabledColor="#fff"
|
||||
style="pointer-events:none"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">主营工艺和业务范围</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
:readonly="factoryStatus === 0"
|
||||
placeholder="请输入内容"
|
||||
v-model="form.mainProcess"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">服务信息</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
:readonly="factoryStatus === 0"
|
||||
placeholder="请输入内容"
|
||||
v-model="form.serviceInfo"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<el-divider>
|
||||
<text class="text-50 text-main font-bold">视频</text>
|
||||
</el-divider>
|
||||
<view class="m-top-20">
|
||||
<u-upload
|
||||
accept="video"
|
||||
:fileList="form.video"
|
||||
@afterRead="afterReadVideo"
|
||||
@delete="deletePicVideo"
|
||||
:maxCount="1"
|
||||
width="70"
|
||||
height="70"
|
||||
></u-upload>
|
||||
</view>
|
||||
<el-divider>
|
||||
<text class="text-50 text-main font-bold">设备信息</text>
|
||||
</el-divider>
|
||||
<view v-for="(item, index) in form.deviceList" :key="index" class="rounded shadow p-30 mb-20">
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">设备名称</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
:readonly="factoryStatus === 0"
|
||||
placeholder="请输入内容"
|
||||
v-model="form.deviceList[index].name"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">设备数量</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
:readonly="factoryStatus === 0"
|
||||
placeholder="请输入内容"
|
||||
v-model="form.deviceList[index].num"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">设备来源</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
:readonly="factoryStatus === 0"
|
||||
placeholder="请输入内容"
|
||||
v-model="form.deviceList[index].source"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">设备类型</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
:readonly="factoryStatus === 0"
|
||||
placeholder="请输入内容"
|
||||
v-model="form.deviceList[index].type"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">品牌</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
:readonly="factoryStatus === 0"
|
||||
placeholder="请输入内容"
|
||||
v-model="form.deviceList[index].brand"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">型号</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
:readonly="factoryStatus === 0"
|
||||
placeholder="请输入内容"
|
||||
v-model="form.deviceList[index].model"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">投产年限</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
:readonly="factoryStatus === 0"
|
||||
placeholder="请输入内容"
|
||||
v-model="form.deviceList[index].year"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">特点描述</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
:readonly="factoryStatus === 0"
|
||||
placeholder="请输入内容"
|
||||
v-model="form.deviceList[index].desc"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex justify-center mt-20">
|
||||
<view class="flex-1 px-20">
|
||||
<u-button size="small" color="#A92924" :plain="true" text="删除"
|
||||
@click="remove(index)"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-button size="small" color="#A92924" text="添加设备"
|
||||
@click="addDevice"></u-button>
|
||||
<el-divider>
|
||||
<text class="text-50 text-main font-bold">工厂实景</text>
|
||||
</el-divider>
|
||||
<view class="m-top-20">
|
||||
<u-upload
|
||||
:fileList="album"
|
||||
@afterRead="afterRead"
|
||||
@delete="deletePic"
|
||||
multiple
|
||||
:maxCount="10"
|
||||
width="70"
|
||||
height="70"
|
||||
></u-upload>
|
||||
</view>
|
||||
<u-button size="small" color="#A92924" text="提交"
|
||||
@click="submit"></u-button>
|
||||
</view>
|
||||
<AddressSelect ref="AddressSelect" @confirm="regionConfirm"/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddressSelect from "@/components/AddressSelect.vue";
|
||||
import dayjs from "dayjs";
|
||||
import md5 from "js-md5";
|
||||
|
||||
export default {
|
||||
name: "factory",
|
||||
components: {AddressSelect},
|
||||
props: {
|
||||
userData: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
test: ''
|
||||
},
|
||||
form: {
|
||||
year: null,
|
||||
yearsIncome: null,
|
||||
employeeNum: null,
|
||||
flowNum: null,
|
||||
blongTo: null,
|
||||
size: null,
|
||||
addressRegion: {
|
||||
province: null,
|
||||
city: null,
|
||||
},
|
||||
mainProcess: null,
|
||||
serviceInfo: null,
|
||||
deviceList: [],
|
||||
album: [],
|
||||
video: [],
|
||||
},
|
||||
options: [],
|
||||
addressRegion: '',
|
||||
deviceSource: ['国产', '进口'],
|
||||
deviceType: ['生产设备', '维护设备'],
|
||||
userLevel: {
|
||||
factoryPicNum: 0
|
||||
},
|
||||
factoryStatus: this.userData.factoryStatus,
|
||||
refuseReason: '',
|
||||
album: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
showAddress() {
|
||||
this.$refs.AddressSelect.open(this.form.addressRegion, 2);
|
||||
},
|
||||
regionConfirm({province, city}) {
|
||||
this.form.addressRegion = {province, city}
|
||||
this.addressRegion = `${province.name}${city.name}`
|
||||
},
|
||||
addDevice() {
|
||||
this.form.deviceList.push({
|
||||
name: null,
|
||||
num: null,
|
||||
source: null,
|
||||
type: null,
|
||||
brand: null,
|
||||
model: null,
|
||||
year: null,
|
||||
desc: null
|
||||
})
|
||||
},
|
||||
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.error('请先完成认证')
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1000)
|
||||
return
|
||||
}
|
||||
}
|
||||
},
|
||||
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) return this.$message.error('请选择所在地')
|
||||
if (this.form.deviceList.length === 0) return this.$message.error('请添加设备信息')
|
||||
if (this.form.album.length === 0) return this.$message.error('请上传工厂实景图')
|
||||
if (this.form.video.length > 0) this.form.video = this.form.video.map(item => item.url)
|
||||
await vk.callFunction({
|
||||
url: "client/factory/kh/addUpdate",
|
||||
data: this.form
|
||||
})
|
||||
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.name}${res.addressRegion.city.name}`
|
||||
if (res.status === 2) this.refuseReason = res.refuseReason
|
||||
if (this.form.album && this.form.album.length > 0) {
|
||||
this.album = this.form.album.map(url => {
|
||||
return {
|
||||
url
|
||||
}
|
||||
})
|
||||
}
|
||||
if (this.form.video) this.form.video = [{url: this.form.video[0]}]
|
||||
console.log(this.form.video)
|
||||
}
|
||||
},
|
||||
afterRead({file}) {
|
||||
file.forEach(item => {
|
||||
console.log(item)
|
||||
uniCloud.uploadFile({
|
||||
filePath: item.url,
|
||||
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + item.name,
|
||||
success: ({fileID}) => {
|
||||
uniCloud.getTempFileURL({
|
||||
fileList: [fileID]
|
||||
}).then(res => {
|
||||
this.album.push({url: res.fileList[0].tempFileURL})
|
||||
this.form.album.push(res.fileList[0].tempFileURL)
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
deletePic({index}) {
|
||||
this.album.splice(index, 1)
|
||||
this.form.album.splice(index, 1)
|
||||
},
|
||||
afterReadVideo({file}) {
|
||||
console.log(file.type)
|
||||
if (file.type !== 'video/mp4' && file.type !== 'video') {
|
||||
uni.showToast({
|
||||
title: '请上传MP4文件',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
uniCloud.uploadFile({
|
||||
filePath: file.url,
|
||||
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + md5(file.name + Date.now().toString()) + '.mp4',
|
||||
success: ({fileID}) => {
|
||||
uniCloud.getTempFileURL({
|
||||
fileList: [fileID]
|
||||
}).then(res => {
|
||||
this.form.video = [{url: res.fileList[0].tempFileURL}]
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
deletePicVideo() {
|
||||
this.form.video = []
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
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>
|
||||
|
||||
|
||||
<style lang="scss">
|
||||
.layout-ident {
|
||||
padding: 20rpx 30rpx;
|
||||
|
||||
.group {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.lb, .fix {
|
||||
position: relative;
|
||||
min-width: 150rpx;
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.lbx {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.download {
|
||||
padding: 8rpx 20rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #ffffff;
|
||||
background: #A92924;
|
||||
}
|
||||
|
||||
.need::before {
|
||||
position: absolute;
|
||||
left: -16rpx;
|
||||
top: 50%;
|
||||
z-index: 9;
|
||||
margin-top: -12rpx;
|
||||
content: '*';
|
||||
color: #A92924;
|
||||
font-size: 32rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.public-btn {
|
||||
width: 100%;
|
||||
margin-top: 60rpx;
|
||||
color: #ffffff;
|
||||
background: #A92924;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,879 @@
|
||||
<template> <!-- 企业认证 -->
|
||||
<view>
|
||||
<view class="layout layout-ident">
|
||||
<!-- 企业认证 -->
|
||||
<u--text prefixIcon="calendar" iconStyle="font-size: 28px;color:#A92924" size="20" color="#A92924"
|
||||
:text="userInfo.accountType === 2 ? '企业认证' : '个人认证'"></u--text>
|
||||
<u--text prefixIcon="checkmark-circle" iconStyle="font-size: 18px;color:#A92924" size="15" color="#A92924"
|
||||
:text="statusLabel" v-if="userInfo.authStatus > -1 || userInfo.fadadaConfirm"></u--text>
|
||||
<view style="margin: 30rpx 0">
|
||||
<el-radio-group v-model="userType" @change="changeUserType">
|
||||
<el-radio :label="0">
|
||||
<text class="text-28">平台交易功能用户注册</text>
|
||||
</el-radio>
|
||||
<view class="mt-15">
|
||||
<el-radio :label="1">
|
||||
<text class="text-28">金久信签约宝用户、特产商城用户注册</text>
|
||||
</el-radio>
|
||||
</view>
|
||||
</el-radio-group>
|
||||
</view>
|
||||
<view class="mt-15 flex justify-center items-center">
|
||||
<view class="mx-15">
|
||||
<u-button @click="getCertUrl()" type="primary" size="small" v-if="!userInfo.fadadaConfirm">去认证
|
||||
</u-button>
|
||||
</view>
|
||||
<!-- <view class="mx-15">-->
|
||||
<!-- <u-button @click="getCertUrl()" type="primary" size="small" v-if="userInfo.authStatus > -1">-->
|
||||
<!-- 获取认证结果-->
|
||||
<!-- </u-button>-->
|
||||
<!-- </view>-->
|
||||
<view class="mx-15">
|
||||
<u-button @click="getCertUrl(true)" plain type="primary" size="small" v-if="userInfo.authStatus > -1">
|
||||
信息变更
|
||||
</u-button>
|
||||
</view>
|
||||
</view>
|
||||
<template v-if="userType === 0">
|
||||
<view class="form-box" v-if="userInfo.authStatus > -1 || userInfo.fadadaConfirm">
|
||||
<template v-if="userInfo.accountType === 2">
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">公司名称</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
disabled
|
||||
placeholder="请输入内容"
|
||||
v-model="userInfo.company.companyName"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">信用代码</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
placeholder="请输入内容"
|
||||
v-model="form.company.organization"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30" @click="showAddress">
|
||||
<view class="lb need">公司所在地</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
placeholder="请选择公司所在地"
|
||||
v-model="addressRegion"
|
||||
suffixIcon="arrow-down"
|
||||
suffixIconStyle="color: #909399"
|
||||
disabled
|
||||
disabledColor="#fff"
|
||||
style="pointer-events:none"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">详细地址</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
placeholder="请输入内容"
|
||||
v-model="form.company.addressDetail"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">法定代表人</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
placeholder="请输入内容"
|
||||
v-model="form.company.legalName"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">公司电话</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
placeholder="请输入内容"
|
||||
v-model="form.company.mobile"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">有效通信地址</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
placeholder="请输入内容"
|
||||
v-model="form.company.mailAddress"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">邮箱地址</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
placeholder="请输入内容"
|
||||
v-model="form.company.contactEmail"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">对公账户</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
placeholder="请输入内容"
|
||||
v-model="form.company.companyAccount"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">开户行</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
placeholder="请输入内容"
|
||||
v-model="form.company.companyBankName"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30" @click="showIndustry = true">
|
||||
<view class="lb need">行业分类</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
style="pointer-events:none"
|
||||
placeholder="请选择公司行业分类"
|
||||
v-model="form.company.businessType"
|
||||
suffixIcon="arrow-down"
|
||||
suffixIconStyle="color: #909399"
|
||||
disabled
|
||||
disabledColor="#fff"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex flex-col items-start justify-start m-top-30" style="align-items: flex-start">
|
||||
<view class="lb need mb-15">主营商品</view>
|
||||
<view class="vl flex-1">
|
||||
<!-- <u-checkbox-group v-model="form.company.mainSpotCategoryIds">-->
|
||||
<!-- <view class="u-flex u-flex-wrap justify-start items-start w-100p">-->
|
||||
<!-- <view class="w-50p" v-for="(item, index) in goodsCate" :key="index">-->
|
||||
<!-- <u-checkbox-->
|
||||
<!-- :customStyle="{marginBottom: '8px'}"-->
|
||||
<!-- :label="item.name"-->
|
||||
<!-- :name="item._id"-->
|
||||
<!-- >-->
|
||||
<!-- </u-checkbox>-->
|
||||
<!-- </view>-->
|
||||
<!-- </view>-->
|
||||
<!-- </u-checkbox-group>-->
|
||||
<view class="flex justify-start items-start flex-wrap">
|
||||
<text class="text-25 mb-25 w-33p" @click="changeMainSpot(item._id)"
|
||||
:class="{'text-main': form.company.mainSpotCategoryIds.includes(item._id)}"
|
||||
v-for="(item, index) in goodsCate" :key="index">
|
||||
{{ item.name }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group m-top-30">
|
||||
<view class="lb need">上传营业执照</view>
|
||||
</view>
|
||||
<view class="flex justify-between align-center m-top-10">
|
||||
<view class="lbx flex-1">请您上传盖章的扫描件或者复印件</view>
|
||||
</view>
|
||||
<view class="m-top-20">
|
||||
<u-upload
|
||||
:fileList="organizationPath"
|
||||
@afterRead="afterRead($event, 'organizationPath', 'company')"
|
||||
@delete="deletePic($event, 'organizationPath', 'company')"
|
||||
:maxCount="1"
|
||||
width="70"
|
||||
height="70"
|
||||
></u-upload>
|
||||
</view>
|
||||
<view class="group m-top-30">
|
||||
<view class="lb need">上传开票资料</view>
|
||||
</view>
|
||||
<view class="flex justify-between align-center m-top-10">
|
||||
<view class="lbx flex-1">加盖公章</view>
|
||||
</view>
|
||||
<view class="m-top-20">
|
||||
<u-upload
|
||||
:fileList="invoiceInfo"
|
||||
@afterRead="afterRead($event, 'invoiceInfo', 'company')"
|
||||
@delete="deletePic($event, 'invoiceInfo', 'company')"
|
||||
:maxCount="1"
|
||||
width="70"
|
||||
height="70"
|
||||
></u-upload>
|
||||
</view>
|
||||
<!-- <view class="group m-top-30">-->
|
||||
<!-- <view class="lb need">纳税资格</view>-->
|
||||
<!-- </view>-->
|
||||
<!-- <view class="m-top-20">-->
|
||||
<!-- <el-radio-group v-model="form.company.taxType">-->
|
||||
<!-- <el-radio label="一般纳税人">一般纳税人</el-radio>-->
|
||||
<!-- <el-radio label="小规模纳税人">小规模纳税人</el-radio>-->
|
||||
<!-- <el-radio label="其他">其他</el-radio>-->
|
||||
<!-- </el-radio-group>-->
|
||||
<!-- </view>-->
|
||||
<!-- <view class="group m-top-30">-->
|
||||
<!-- <view class="lb">纳税人资格</view>-->
|
||||
<!-- </view>-->
|
||||
<!-- <view class="flex justify-between align-center m-top-10">-->
|
||||
<!-- <view class="lbx flex-1">加盖公章</view>-->
|
||||
<!-- <!– <view class="download">电子版文件下载</view>–>-->
|
||||
<!-- </view>-->
|
||||
<!-- <view class="m-top-20">-->
|
||||
<!-- <u-upload-->
|
||||
<!-- :fileList="taxImage"-->
|
||||
<!-- @afterRead="afterRead($event, 'taxImage', 'company', true)"-->
|
||||
<!-- @delete="deletePic($event, 'taxImage', 'company', true)"-->
|
||||
<!-- multiple-->
|
||||
<!-- :maxCount="10"-->
|
||||
<!-- width="70"-->
|
||||
<!-- height="70"-->
|
||||
<!-- ></u-upload>-->
|
||||
<!-- </view>-->
|
||||
<view class="group m-top-30">
|
||||
<view class="lb">管理员授权委托书</view>
|
||||
</view>
|
||||
<view class="m-top-20">
|
||||
<u-upload
|
||||
:fileList="taxImage"
|
||||
@afterRead="afterRead($event, 'taxImage', 'company', true)"
|
||||
@delete="deletePic($event, 'taxImage', 'company', true)"
|
||||
multiple
|
||||
:maxCount="10"
|
||||
width="70"
|
||||
height="70"
|
||||
></u-upload>
|
||||
</view>
|
||||
<!-- 企业授权人信息 -->
|
||||
<view class="m-top-30">
|
||||
<u--text prefixIcon="calendar" iconStyle="font-size: 28px;color:#A92924" size="20" color="#A92924"
|
||||
text="企业授权人信息"></u--text>
|
||||
</view>
|
||||
|
||||
<view class="group flex align-center m-top-30" @click="showManageType = true">
|
||||
<view class="lb need">{{ `${form.manager.type === 1 ? '法人姓名' : '授权人'}` }}类型</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
placeholder="请选择授权人类型"
|
||||
v-model="managerType"
|
||||
suffixIcon="arrow-down"
|
||||
suffixIconStyle="color: #909399"
|
||||
disabled
|
||||
disabledColor="#fff"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">{{ `${form.manager.type === 1 ? '法人姓名' : '授权人'}` }}姓名</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input v-model="form.manager.personName" placeholder="请输入内容"></u--input>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="group flex align-center m-top-30" @click="showCertType = true">
|
||||
<view class="lb need">证件类型</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
placeholder="请选择证件类型"
|
||||
v-model="certType"
|
||||
suffixIcon="arrow-down"
|
||||
suffixIconStyle="color: #909399"
|
||||
disabled
|
||||
disabledColor="#fff"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">{{ `${form.manager.type === 1 ? '法人姓名' : '授权人'}` }}证件号</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input v-model="form.manager.idCard" placeholder="请输入内容"></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">{{ `${form.manager.type === 1 ? '法人姓名' : '授权人'}` }}电话</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input v-model="form.manager.mobile" placeholder="请输入内容"></u--input>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="group m-top-30">
|
||||
<view class="lb need">身份证头像面</view>
|
||||
</view>
|
||||
<view class="m-top-20">
|
||||
<u-upload
|
||||
:fileList="headPhotoPath"
|
||||
@afterRead="afterRead($event,'headPhotoPath', 'manager')"
|
||||
@delete="deletePic($event, 'headPhotoPath', 'company')"
|
||||
:maxCount="1"
|
||||
width="70"
|
||||
height="70"
|
||||
></u-upload>
|
||||
</view>
|
||||
<view class="group m-top-30">
|
||||
<view class="lb need">身份证国徽面</view>
|
||||
</view>
|
||||
<view class="m-top-20">
|
||||
<u-upload
|
||||
:fileList="backgroundIdCardPath"
|
||||
@afterRead="afterRead($event,'backgroundIdCardPath', 'manager')"
|
||||
@delete="deletePic($event, 'backgroundIdCardPath', 'company')"
|
||||
:maxCount="1"
|
||||
width="70"
|
||||
height="70"
|
||||
></u-upload>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">真实姓名</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
:disabled="userInfo.authStatus === 0"
|
||||
placeholder="请输入内容"
|
||||
v-model="userInfo.person.personName"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30" @click="showIndustry = true">
|
||||
<view class="lb need">行业分类</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
style="pointer-events:none"
|
||||
placeholder="请选择行业分类"
|
||||
v-model="form.person.businessType"
|
||||
suffixIcon="arrow-down"
|
||||
suffixIconStyle="color: #909399"
|
||||
disabled
|
||||
disabledColor="#fff"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30" @click="showAddress">
|
||||
<view class="lb need">现居住所在地</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
placeholder="请选择现居住所在地"
|
||||
v-model="addressRegion"
|
||||
suffixIcon="arrow-down"
|
||||
suffixIconStyle="color: #909399"
|
||||
disabled
|
||||
disabledColor="#fff"
|
||||
style="pointer-events:none"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">详细地址</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
:disabled="userInfo.authStatus === 0"
|
||||
placeholder="请输入内容"
|
||||
v-model="form.person.addressDetail"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">有效通信地址</view>
|
||||
<text class="ml-10 text-25">{{ form.person.address }}</text>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">个人账号</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
:disabled="userInfo.authStatus === 0"
|
||||
placeholder="请输入内容"
|
||||
v-model="form.person.personAccount"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">个人开户行</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
:disabled="userInfo.authStatus === 0"
|
||||
placeholder="请输入内容"
|
||||
v-model="form.person.personBankName"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">个人账户名</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
:disabled="userInfo.authStatus === 0"
|
||||
placeholder="请输入内容"
|
||||
v-model="form.person.accountName"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">手机号码</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
:disabled="userInfo.authStatus === 0"
|
||||
placeholder="请输入内容"
|
||||
v-model="form.person.mobile"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb">QQ号</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
:disabled="userInfo.authStatus === 0"
|
||||
placeholder="请输入内容"
|
||||
v-model="form.person.qq"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb">邮箱地址</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
:disabled="userInfo.authStatus === 0"
|
||||
placeholder="请输入内容"
|
||||
v-model="form.person.contactEmail"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">短信验证码</view>
|
||||
<view class="vl flex-1 flex justify-start items-center">
|
||||
<u--input
|
||||
:disabled="userInfo.authStatus === 0"
|
||||
placeholder="请输入内容"
|
||||
v-model="form.smsCode"
|
||||
></u--input>
|
||||
<view class="ml-20">
|
||||
<u-button type="primary" :disabled="!form.person.mobile || codeDisabled || userInfo.authStatus === 0"
|
||||
@click="sendSmsCode">
|
||||
{{ smsTips }}
|
||||
</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
<u-button class="public-btn" text="提交认证" @click="submitAuth"
|
||||
:disabled="userInfo.authStatus === 0"></u-button>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
<AddressSelect ref="AddressSelect" @confirm="regionConfirm"/>
|
||||
<u-picker :show="showIndustry" :columns="[industryList]" keyName="name"
|
||||
:default-index="defaultIndustryIndex"
|
||||
@cancel="showIndustry = false" @close="showIndustry = false" closeOnClickOverlay
|
||||
@confirm="confirmIndustry"></u-picker>
|
||||
|
||||
<u-picker :show="showManageType" :columns="[managerTypeList]" keyName="label"
|
||||
:default-index="defaultManagerTypeIndex"
|
||||
@cancel="showManageType = false" @close="showManageType = false" closeOnClickOverlay
|
||||
@confirm="confirmManagerType"></u-picker>
|
||||
|
||||
<u-picker :show="showCertType" :columns="[certTypeList]"
|
||||
:default-index="defaultCertTypeIndex"
|
||||
@cancel="showCertType = false" @close="showCertType = false" closeOnClickOverlay
|
||||
@confirm="confirmCertType"></u-picker>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddressSelect from "@/components/AddressSelect.vue";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
let timer = null
|
||||
let timeS = 60
|
||||
export default {
|
||||
components: {AddressSelect},
|
||||
props: {
|
||||
userData: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
statusLabel: '',
|
||||
|
||||
userInfo: {
|
||||
company: {
|
||||
organization: '',
|
||||
addressRegion: {},
|
||||
addressDetail: '',
|
||||
mobile: '',
|
||||
legalName: '',
|
||||
mailAddress: '',
|
||||
contactEmail: '',
|
||||
companyAccount: '',
|
||||
companyBankName: '',
|
||||
personAccount: '',
|
||||
personBankName: '',
|
||||
accountName: '',
|
||||
businessType: '',
|
||||
invoiceInfo: '',
|
||||
taxType: '',
|
||||
taxImage: [],
|
||||
mainSpotCategoryIds: [],
|
||||
},
|
||||
},
|
||||
form: {
|
||||
authType: 2,
|
||||
company: {
|
||||
organization: '',
|
||||
addressRegion: {},
|
||||
addressDetail: '',
|
||||
mobile: '',
|
||||
legalName: '',
|
||||
mailAddress: '',
|
||||
contactEmail: '',
|
||||
companyAccount: '',
|
||||
companyBankName: '',
|
||||
personAccount: '',
|
||||
personBankName: '',
|
||||
accountName: '',
|
||||
businessType: '',
|
||||
invoiceInfo: '',
|
||||
taxType: '',
|
||||
taxImage: [],
|
||||
mainSpotCategoryIds: [],
|
||||
organizationPath: ''
|
||||
},
|
||||
manager: {
|
||||
type: null,
|
||||
personName: '',
|
||||
certType: '',
|
||||
idCard: '',
|
||||
mobile: '',
|
||||
headPhotoPath: '',
|
||||
backgroundIdCardPath: '',
|
||||
},
|
||||
smsCode: null,
|
||||
},
|
||||
addressRegion: '',
|
||||
industryList: [],
|
||||
defaultIndustryIndex: [0],
|
||||
showIndustry: false,
|
||||
goodsCate: [],
|
||||
organizationPath: [],
|
||||
invoiceInfo: [],
|
||||
taxImage: [],
|
||||
checked: [],
|
||||
showManageType: false,
|
||||
managerTypeList: [
|
||||
{
|
||||
value: 1,
|
||||
label: '法人'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '授权人'
|
||||
}
|
||||
],
|
||||
defaultManagerTypeIndex: [0],
|
||||
managerType: '',
|
||||
certTypeList: ['身份证', '护照'],
|
||||
showCertType: false,
|
||||
certType: '',
|
||||
defaultCertTypeIndex: [0],
|
||||
headPhotoPath: [],
|
||||
backgroundIdCardPath: [],
|
||||
codeDisabled: false,
|
||||
smsTips: '点击获取',
|
||||
userType: 0
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
getCertUrl(reset = false) {
|
||||
vk.callFunction({
|
||||
url: 'client/fadada.getVerifyUrl',
|
||||
data: {
|
||||
reset,
|
||||
isMobile: true
|
||||
},
|
||||
success: (res) => {
|
||||
window.location.href = res.data.url
|
||||
// window.open(res.data.url)
|
||||
}
|
||||
});
|
||||
},
|
||||
async getIndustryList() {
|
||||
const {rows} = await vk.callFunction({
|
||||
url: 'client/industry/pub/getList'
|
||||
})
|
||||
this.industryList = rows
|
||||
},
|
||||
async getGoodsCate() {
|
||||
const {data} = await vk.callFunction({
|
||||
url: 'client/spot/category/pub/getList',
|
||||
data: {
|
||||
whereJson: {
|
||||
level: 2
|
||||
}
|
||||
}
|
||||
});
|
||||
this.goodsCate = data
|
||||
},
|
||||
showAddress() {
|
||||
const addressRegion = this.userInfo.accountType === 2 ? this.form.company.addressRegion : this.form.person.addressRegion
|
||||
this.$refs.AddressSelect.open(addressRegion);
|
||||
},
|
||||
regionConfirm({province, city, area}) {
|
||||
if (this.userInfo.accountType === 2) this.form.company.addressRegion = {province, city, area}
|
||||
else this.form.person.addressRegion = {province, city, area}
|
||||
this.addressRegion = `${province.name}${city.name}${area.name}`
|
||||
},
|
||||
confirmIndustry({value}) {
|
||||
if (this.userInfo.accountType === 2) {
|
||||
this.form.company.businessType = value[0].name
|
||||
} else {
|
||||
this.form.person.businessType = value[0].name
|
||||
}
|
||||
this.showIndustry = false
|
||||
},
|
||||
confirmManagerType({value}) {
|
||||
this.form.manager.type = value[0].value
|
||||
this.showManageType = false
|
||||
},
|
||||
confirmCertType({value}) {
|
||||
this.form.manager.certType = value[0]
|
||||
this.showCertType = false
|
||||
},
|
||||
afterRead({file}, field, formField, multi = false) {
|
||||
if (multi) {
|
||||
file.forEach(item => {
|
||||
uniCloud.uploadFile({
|
||||
filePath: item.url,
|
||||
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + item.name,
|
||||
success: ({fileID}) => {
|
||||
uniCloud.getTempFileURL({
|
||||
fileList: [fileID]
|
||||
}).then(res => {
|
||||
this[field].push({url: res.fileList[0].tempFileURL})
|
||||
this.form[formField][field].push(res.fileList[0].tempFileURL)
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
} else {
|
||||
uniCloud.uploadFile({
|
||||
filePath: file.url,
|
||||
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + file.name,
|
||||
success: ({fileID}) => {
|
||||
uniCloud.getTempFileURL({
|
||||
fileList: [fileID]
|
||||
}).then(res => {
|
||||
this[field].push({url: res.fileList[0].tempFileURL})
|
||||
this.form[formField][field] = res.fileList[0].tempFileURL
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
deletePic({index}, field, formFiled, multi = false) {
|
||||
if (multi) {
|
||||
this[field].splice(index, 1)
|
||||
this.form[formFiled][field].splice(index, 1)
|
||||
} else {
|
||||
this[field] = []
|
||||
this.form[formFiled][field] = null
|
||||
}
|
||||
},
|
||||
async submitAuth(authStatus = 0) {
|
||||
if (this.userInfo.accountType === 2) {
|
||||
if (!this.form.company.addressDetail) return this.$message.error('请完善公司所在地')
|
||||
if (this.form.company.mainSpotCategoryIds.length === 0) return this.$message.error('请选择主营商品')
|
||||
if (this.form.company.mainSpotCategoryIds.length > 10) return this.$message.error('主营商品最多只能选择10个')
|
||||
if (!this.form.company.mailAddress) return this.$message.error('请完善有效通信地址')
|
||||
if (!this.form.company.contactEmail) return this.$message.error('请完善联系邮箱')
|
||||
if (!this.form.company.legalName) return this.$message.error('请完善法人姓名')
|
||||
if (!this.form.company.addressRegion) this.form.company.addressRegion = {}
|
||||
} else {
|
||||
if (!this.form.person.personName) return this.$message.error('请输入真实姓名')
|
||||
if (!this.form.person.mobile) return this.$message.error('请输入联系方式')
|
||||
if (!this.form.person.personAccount) return this.$message.error('请填写个人账号')
|
||||
if (!this.form.person.personBankName) return this.$message.error('请选择个人开户行')
|
||||
if (!this.form.person.accountName) return this.$message.error('请选择个人账户名')
|
||||
if (!this.form.smsCode) return this.$message.error('请输入短信验证码')
|
||||
}
|
||||
|
||||
await vk.callFunction({
|
||||
url: 'client/user/kh/addAuth',
|
||||
title: '提交中...',
|
||||
data: {...this.form, ...{authStatus}, isBusinessCard: false},
|
||||
})
|
||||
this.$message.success('提交成功')
|
||||
this.iniData()
|
||||
// setTimeout(() => {
|
||||
// window.location.reload()
|
||||
// }, 1500)
|
||||
},
|
||||
changeMainSpot(id) {
|
||||
const index = this.form.company.mainSpotCategoryIds.findIndex(item => item === id)
|
||||
if (index > -1) this.form.company.mainSpotCategoryIds.splice(index, 1)
|
||||
else {
|
||||
if (this.form.company.mainSpotCategoryIds.length >= 10) {
|
||||
this.$message.error('主营商品最多只能选择10个')
|
||||
return
|
||||
}
|
||||
this.form.company.mainSpotCategoryIds.push(id)
|
||||
}
|
||||
},
|
||||
sendSmsCode() {
|
||||
if (timer != null) return
|
||||
this.codeDisabled = true
|
||||
vk.userCenter.sendSmsCode({
|
||||
loading: true,
|
||||
data: {
|
||||
mobile: this.form.person.mobile,
|
||||
type: 'verify',
|
||||
},
|
||||
success: (data) => {
|
||||
this.codeDisabled = false
|
||||
this.$message({
|
||||
message: "验证码已发送",
|
||||
type: 'success'
|
||||
})
|
||||
timeS = 60
|
||||
timer = setInterval(() => {
|
||||
timeS--
|
||||
if (timeS <= 0) {
|
||||
this.smsTips = "重新发送"
|
||||
this.stopTimer()
|
||||
} else {
|
||||
this.smsTips = timeS + "秒"
|
||||
}
|
||||
|
||||
}, 1000)
|
||||
},
|
||||
fail: () => {
|
||||
this.codeDisabled = false
|
||||
}
|
||||
})
|
||||
},
|
||||
stopTimer() {
|
||||
if (timer != null) {
|
||||
clearInterval(timer)
|
||||
timer = null
|
||||
}
|
||||
},
|
||||
iniData() {
|
||||
this.userInfo = JSON.parse(JSON.stringify(this.userData))
|
||||
if (this.userInfo.fadadaConfirm && (this.userInfo.authStatus === null || this.userInfo.authStatus === -1))
|
||||
this.statusLabel = '您已完成法大大认证,请在下方完善资料提交平台审核'
|
||||
if (this.userInfo.authStatus === 0) this.statusLabel = '平台审核中'
|
||||
else if (this.userInfo.authStatus === 1) this.statusLabel = '恭喜您已通过已通过金久信平台认证'
|
||||
else if (this.userInfo.authStatus === 2) this.statusLabel = `审核不通过:${this.userInfo.refuseReason}`
|
||||
if (!this.userInfo.userType) this.userType = 0
|
||||
else this.userType = parseInt(this.userInfo.userType)
|
||||
this.form = this.userData
|
||||
if (this.userInfo.accountType === 2) {
|
||||
if (this.userInfo.company.addressRegion)
|
||||
this.addressRegion = `${this.userInfo.company.addressRegion.province.name}${this.userInfo.company.addressRegion.city.name}${this.userInfo.company.addressRegion.area.name}`
|
||||
if (this.userInfo.company.businessType) {
|
||||
const defaultIndustryIndex = this.industryList.findIndex(item => item.name === this.userInfo.company.businessType)
|
||||
if (defaultIndustryIndex > -1) this.defaultIndustryIndex = [defaultIndustryIndex]
|
||||
}
|
||||
if (this.form.company.organizationPath) this.organizationPath = [{
|
||||
url: this.form.company.organizationPath,
|
||||
}]
|
||||
if (this.form.company.invoiceInfo) this.invoiceInfo = [{
|
||||
url: this.form.company.invoiceInfo,
|
||||
}]
|
||||
if (this.form.company.taxImage && this.form.company.taxImage.length > 0) {
|
||||
this.taxImage = this.form.company.taxImage.map(url => {
|
||||
return {
|
||||
url
|
||||
}
|
||||
})
|
||||
}
|
||||
if (this.form.manager.type !== null) {
|
||||
const defaultManagerTypeIndex = this.managerTypeList.findIndex(item => item.value === this.form.manager.type)
|
||||
if (defaultManagerTypeIndex > -1) {
|
||||
this.defaultManagerTypeIndex = [defaultManagerTypeIndex]
|
||||
this.managerType = this.managerTypeList[defaultManagerTypeIndex].label
|
||||
}
|
||||
}
|
||||
if (this.form.manager.certType !== null) {
|
||||
this.defaultCertTypeIndex = [this.form.manager.certType]
|
||||
this.certType = this.certTypeList[this.form.manager.certType]
|
||||
}
|
||||
if (this.form.manager.headPhotoPath) {
|
||||
this.headPhotoPath = [{url: this.form.manager.headPhotoPath}]
|
||||
}
|
||||
if (this.form.manager.backgroundIdCardPath) {
|
||||
this.backgroundIdCardPath = [{url: this.form.manager.backgroundIdCardPath}]
|
||||
}
|
||||
} else {
|
||||
if (this.userInfo.person.addressRegion)
|
||||
this.addressRegion = `${this.userInfo.person.addressRegion.province.name}${this.userInfo.person.addressRegion.city.name}${this.userInfo.person.addressRegion.area.name}`
|
||||
}
|
||||
},
|
||||
changeUserType() {
|
||||
vk.callFunction({
|
||||
url: 'client/user/kh/changeUserType',
|
||||
data: {
|
||||
userType: this.userType
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
await this.getIndustryList()
|
||||
await this.getGoodsCate()
|
||||
this.iniData()
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.layout-ident {
|
||||
padding: 20rpx 30rpx;
|
||||
|
||||
.group {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.lb, .fix {
|
||||
position: relative;
|
||||
min-width: 150rpx;
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.lbx {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.download {
|
||||
padding: 8rpx 20rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #ffffff;
|
||||
background: #A92924;
|
||||
}
|
||||
|
||||
.need::before {
|
||||
position: absolute;
|
||||
left: -16rpx;
|
||||
top: 50%;
|
||||
z-index: 9;
|
||||
margin-top: -12rpx;
|
||||
content: '*';
|
||||
color: #A92924;
|
||||
font-size: 32rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.public-btn {
|
||||
width: 100%;
|
||||
margin-top: 60rpx;
|
||||
color: #ffffff;
|
||||
background: #A92924;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,236 @@
|
||||
<template> <!-- 我的邀请 -->
|
||||
<view>
|
||||
<view class="layout layout-invite">
|
||||
<template v-if="isInvite">
|
||||
<view class="flex justify-between align-center p-top-20">
|
||||
<view class="invite-title">邀请新用户免费兑换会员</view>
|
||||
<!-- <u-button class="rule" text="活动规则"></u-button>-->
|
||||
</view>
|
||||
<view class="gong flex align-center m-top-30">
|
||||
<view class="m-right-20">共邀请
|
||||
<text class="red">{{ userData.inviteNum }}</text>
|
||||
人
|
||||
</view>
|
||||
<u-tag text="邀请列表" type="warning" size="mini"></u-tag>
|
||||
<view class="flex-1"></view>
|
||||
<view>我的邀请码:
|
||||
<text class="red">{{ userData.my_invite_code }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="invite-info flex flex-col justify-start items-start m-top-20 w-100p">
|
||||
<view class="item w-90p" v-if="item.recommendUpgrade && parseInt(item.recommendUpgrade) > 0"
|
||||
v-for="(item, index) in userLevelList" :key="index">
|
||||
<view class="b">{{ item.name }}</view>
|
||||
<view class="s">{{ item.upgradeDesc }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="invite-progress m-top-30">
|
||||
<u-line-progress :percentage="progress" activeColor="#A92924" height="16"></u-line-progress>
|
||||
<view class="flex justify-between m-top-10">
|
||||
<view class="lv red">已邀请{{ userData.inviteNum }}人</view>
|
||||
<!-- <view class="lv red">9人</view>-->
|
||||
</view>
|
||||
</view>
|
||||
<view class="invite-btn flex justify-center">
|
||||
<u-button class="btn-style" color="#A92924" :plain="true" text="复制邀请码" @click="copy"></u-button>
|
||||
<u-button class="btn-style" color="#A92924" text="兑换会员" @click="isInvite = false"></u-button>
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="!isInvite">
|
||||
<view class="flex justify-between align-center p-top-20">
|
||||
<view class="invite-title">请选择要兑换的会员!</view>
|
||||
<view class="invited text-right">
|
||||
<text>已邀请
|
||||
<text class="red">10</text>
|
||||
人
|
||||
</text>
|
||||
,
|
||||
<text>已兑换
|
||||
<text class="red">10</text>
|
||||
人
|
||||
</text>
|
||||
,
|
||||
<text>剩余
|
||||
<text class="red">10</text>
|
||||
人可兑换
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="invite-info flex justify-between m-top-20">
|
||||
<view v-for="(item, index) in userLevelList" :key="index"
|
||||
v-if="item.recommendUpgrade && parseInt(item.recommendUpgrade) > 0"
|
||||
:class="['item', {active: inviteIndex === index}]" @click="onSelect(item, index)">
|
||||
<view class="b">{{ item.name }}</view>
|
||||
<view class="s">{{ item.upgradeDesc }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="invite-btn flex justify-center">
|
||||
<u-button
|
||||
class="btn-style"
|
||||
color="#A92924"
|
||||
:plain="true"
|
||||
text="取消兑换"
|
||||
@click="isInvite = true"
|
||||
></u-button>
|
||||
<u-button
|
||||
class="btn-style"
|
||||
color="#A92924"
|
||||
text="确认"
|
||||
@click="exchangeUpgrade"
|
||||
></u-button>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
userData: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isInvite: true,
|
||||
inviteIndex: null,
|
||||
userLevelList: [],
|
||||
maxUpgradeNum: 100,
|
||||
progress: 0,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
onSelect(item, index) {
|
||||
if (parseInt(this.userData.inviteNum) >= item.recommendUpgrade && item.level > parseInt(this.userData.userLevel))
|
||||
this.inviteIndex = index
|
||||
else this.$message.error('您的邀请人数不足')
|
||||
},
|
||||
copy() {
|
||||
const url = window.location.origin + `/#/pages/auth/register/register?code=${this.userData.my_invite_code}`
|
||||
document.oncopy = function (e) {
|
||||
e.clipboardData.setData('text', url);
|
||||
e.preventDefault();
|
||||
document.oncopy = null;
|
||||
}
|
||||
document.execCommand('Copy');
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '邀请码已复制'
|
||||
})
|
||||
},
|
||||
async getUserLevelList() {
|
||||
const {rows} = await vk.callFunction({
|
||||
url: 'client/userLevel/pub/getList',
|
||||
data: {
|
||||
pageIndex: 1,
|
||||
pageSize: 200
|
||||
},
|
||||
});
|
||||
this.userLevelList = rows
|
||||
this.userLevelList.forEach(item => {
|
||||
if (item.recommendUpgrade && parseInt(item.recommendUpgrade) > 0)
|
||||
this.maxUpgradeNum = Math.max(this.maxUpgradeNum, item.recommendUpgrade)
|
||||
})
|
||||
console.log(this.userLevelList)
|
||||
this.progress = parseInt(this.userData.inviteNum) / this.maxUpgradeNum * 100
|
||||
},
|
||||
async exchangeUpgrade() {
|
||||
await vk.callFunction({
|
||||
url: 'client/user/kh/exchangeUpgrade',
|
||||
data: {
|
||||
id: this.userLevelList[this.inviteIndex]._id
|
||||
}
|
||||
});
|
||||
this.$message.success('兑换成功')
|
||||
this.isInvite = true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getUserLevelList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.layout-invite {
|
||||
padding: 20rpx 30rpx;
|
||||
|
||||
.invite-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
line-height: 48rpx;
|
||||
color: #A92924;
|
||||
}
|
||||
|
||||
.rule {
|
||||
margin: 0;
|
||||
font-size: 24rpx;
|
||||
width: 130rpx;
|
||||
height: 48rpx;
|
||||
color: #101010;
|
||||
border-radius: 8rpx;
|
||||
background: #dedede;
|
||||
}
|
||||
|
||||
.gong {
|
||||
font-size: 28rpx;
|
||||
line-height: 48rpx;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.invite-info {
|
||||
padding: 30rpx 0;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
//width: 210rpx;
|
||||
//height: 150rpx;
|
||||
line-height: 48rpx;
|
||||
color: #A92924;
|
||||
border-radius: 12rpx;
|
||||
box-shadow: 0px 2px 6px 0px rgba(169, 41, 36, 1);
|
||||
margin: 0 10rpx;
|
||||
padding: 10rpx;
|
||||
text-align: center;
|
||||
|
||||
.b {
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.s {
|
||||
font-size: 24rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.active {
|
||||
color: #ffffff;
|
||||
background: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.lv {
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
||||
.invite-btn {
|
||||
margin-top: 80rpx;
|
||||
padding: 20rpx 20rpx;
|
||||
|
||||
.btn-style {
|
||||
margin: 0 30rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.invited {
|
||||
font-size: 24rpx;
|
||||
color: #101010;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,226 @@
|
||||
<template>
|
||||
<view class="p-30">
|
||||
<view class="text-main text-30 font-bold">金久信公正银联资料</view>
|
||||
<view class="mt-20 text-main text-25" style="line-height: 42rpx;">
|
||||
<view>银联提供资料明细</view>
|
||||
<view>根据银联交易要求,为防止网络犯罪,金久信公正交易您需向银联提供以下资料:</view>
|
||||
<view>1、营业执照(原件手机拍照或复印件加盖公章);</view>
|
||||
<view>2、法人身份证正反面(原件手机拍照或复印件加盖公章);</view>
|
||||
<view>3、结算账户信息(结算账户信息需要开户许可证或银行回单等盖有银行印章的证明文件);</view>
|
||||
<view>4.店铺/办公地址照片(门头+门牌+经营场所的照片,收银台照片);</view>
|
||||
<view>5.法人手机号(用于电子签約)</view>
|
||||
<view>如由授权代理人负责,需要加收代理人身份证+代理人签约授权书,授权书我司提供模板;</view>
|
||||
<view>6、金久信平台入驻协议、授权书(请联系平台工作人员签约)</view>
|
||||
<view>7、审核时间2-3天,建议注册提前开通。</view>
|
||||
<view>8、如果您完成审核请联系平台客服开通。</view>
|
||||
</view>
|
||||
<view class="mt-20">
|
||||
<view class="flex justify-start items-center flex-wrap">
|
||||
<view v-if="extraInfo.agreementUrl" class="mr-20 mb-20">
|
||||
<u-button size="small" color="#A92924" text="金久信平台入驻协议下载" @click="openLink(extraInfo.agreementUrl)"></u-button>
|
||||
</view>
|
||||
<view v-if="extraInfo.authorizationUrl" class="mb-20">
|
||||
<u-button size="small" color="#A92924" text="授权书下载" @click="openLink(extraInfo.authorizationUrl)"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex justify-start items-start mt-20">
|
||||
<view v-if="extraInfo.unionWechat" class="mr-30">
|
||||
<view class="text-25 mb-10">银联工作人员微信</view>
|
||||
<u--image :src="extraInfo.unionWechat" width="160rpx" height="160rpx"></u--image>
|
||||
</view>
|
||||
<view v-if="extraInfo.platformWechat">
|
||||
<view class="text-25 mb-10">金久信工作人员微信</view>
|
||||
<u--image :src="extraInfo.platformWechat" width="160rpx" height="160rpx"></u--image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt-20 text-25">审核状态:{{ statusText }}</view>
|
||||
<view class="group m-top-30"><view class="lb need">营业执照</view></view>
|
||||
<u-upload class="m-top-20" :fileList="businessLicenseFile" @afterRead="afterRead($event, 'businessLicenseFile')" @delete="deletePic($event, 'businessLicenseFile')" :disabled="isLocked" :maxCount="1" width="70" height="70"></u-upload>
|
||||
<view class="group m-top-30"><view class="lb need">法人身份证正面</view></view>
|
||||
<u-upload class="m-top-20" :fileList="legalIdCardFront" @afterRead="afterRead($event, 'legalIdCardFront')" @delete="deletePic($event, 'legalIdCardFront')" :disabled="isLocked" :maxCount="1" width="70" height="70"></u-upload>
|
||||
<view class="group m-top-30"><view class="lb need">法人身份证反面</view></view>
|
||||
<u-upload class="m-top-20" :fileList="legalIdCardBack" @afterRead="afterRead($event, 'legalIdCardBack')" @delete="deletePic($event, 'legalIdCardBack')" :disabled="isLocked" :maxCount="1" width="70" height="70"></u-upload>
|
||||
<view class="group m-top-30"><view class="lb need">结算账户证明</view></view>
|
||||
<u-upload class="m-top-20" :fileList="settlementAccountFiles" @afterRead="afterRead($event, 'settlementAccountFiles', true)" @delete="deletePic($event, 'settlementAccountFiles', true)" :disabled="isLocked" multiple :maxCount="10" width="70" height="70"></u-upload>
|
||||
<view class="group m-top-30"><view class="lb need">店铺/办公照片</view></view>
|
||||
<u-upload class="m-top-20" :fileList="shopPhotos" @afterRead="afterRead($event, 'shopPhotos', true)" @delete="deletePic($event, 'shopPhotos', true)" :disabled="isLocked" multiple :maxCount="10" width="70" height="70"></u-upload>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need">法人手机号</view>
|
||||
<view class="vl flex-1"><u--input v-model="form.legalMobile" placeholder="请输入法人手机号" :disabled="isLocked"></u--input></view>
|
||||
</view>
|
||||
<view class="group m-top-30"><view class="lb">是否有代理人</view></view>
|
||||
<view class="m-top-20"><u-switch v-model="form.hasAgent" activeColor="#A92924" :disabled="isLocked"></u-switch></view>
|
||||
<template v-if="form.hasAgent">
|
||||
<view class="group m-top-30"><view class="lb need">代理人身份证正面</view></view>
|
||||
<u-upload class="m-top-20" :fileList="agentIdCardFront" @afterRead="afterRead($event, 'agentIdCardFront')" @delete="deletePic($event, 'agentIdCardFront')" :disabled="isLocked" :maxCount="1" width="70" height="70"></u-upload>
|
||||
<view class="group m-top-30"><view class="lb need">代理人身份证反面</view></view>
|
||||
<u-upload class="m-top-20" :fileList="agentIdCardBack" @afterRead="afterRead($event, 'agentIdCardBack')" @delete="deletePic($event, 'agentIdCardBack')" :disabled="isLocked" :maxCount="1" width="70" height="70"></u-upload>
|
||||
<view class="group m-top-30"><view class="lb need">代理人授权书</view></view>
|
||||
<u-upload class="m-top-20" :fileList="agentAuthorizationFiles" @afterRead="afterRead($event, 'agentAuthorizationFiles', true)" @delete="deletePic($event, 'agentAuthorizationFiles', true)" :disabled="isLocked" multiple :maxCount="10" width="70" height="70"></u-upload>
|
||||
</template>
|
||||
<view class="group m-top-30"><view class="lb need">平台入驻协议</view></view>
|
||||
<u-upload class="m-top-20" :fileList="platformAgreementFiles" @afterRead="afterRead($event, 'platformAgreementFiles', true)" @delete="deletePic($event, 'platformAgreementFiles', true)" :disabled="isLocked" multiple :maxCount="10" width="70" height="70"></u-upload>
|
||||
<view class="group m-top-30"><view class="lb need">平台授权书</view></view>
|
||||
<u-upload class="m-top-20" :fileList="platformAuthorizationFiles" @afterRead="afterRead($event, 'platformAuthorizationFiles', true)" @delete="deletePic($event, 'platformAuthorizationFiles', true)" :disabled="isLocked" multiple :maxCount="10" width="70" height="70"></u-upload>
|
||||
<u-button class="public-btn" text="提交资料" @click="submit" :disabled="isLocked"></u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dayjs from "dayjs";
|
||||
|
||||
export default {
|
||||
name: "notary-union-pay",
|
||||
props: {
|
||||
userData: Object
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
businessLicenseFile: '',
|
||||
legalIdCardFront: '',
|
||||
legalIdCardBack: '',
|
||||
settlementAccountFiles: [],
|
||||
shopPhotos: [],
|
||||
legalMobile: '',
|
||||
hasAgent: false,
|
||||
agentIdCardFront: '',
|
||||
agentIdCardBack: '',
|
||||
agentAuthorizationFiles: [],
|
||||
platformAgreementFiles: [],
|
||||
platformAuthorizationFiles: []
|
||||
},
|
||||
profile: null,
|
||||
extraInfo: {
|
||||
agreementUrl: '',
|
||||
authorizationUrl: '',
|
||||
unionWechat: '',
|
||||
platformWechat: '',
|
||||
},
|
||||
businessLicenseFile: [],
|
||||
legalIdCardFront: [],
|
||||
legalIdCardBack: [],
|
||||
settlementAccountFiles: [],
|
||||
shopPhotos: [],
|
||||
agentIdCardFront: [],
|
||||
agentIdCardBack: [],
|
||||
agentAuthorizationFiles: [],
|
||||
platformAgreementFiles: [],
|
||||
platformAuthorizationFiles: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
statusText() {
|
||||
if (!this.profile) return '未提交'
|
||||
if (this.profile.status === 1) return '已通过'
|
||||
if (this.profile.status === 2) return `已拒绝${this.profile.refuseReason ? `:${this.profile.refuseReason}` : ''}`
|
||||
if (this.profile.status === 0) return '审核中'
|
||||
return '未提交'
|
||||
},
|
||||
isLocked() {
|
||||
return this.profile && [0, 1].includes(this.profile.status)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async refresh() {
|
||||
const {data} = await vk.callFunction({
|
||||
url: 'client/user/kh/getNotaryUnionPayProfile',
|
||||
})
|
||||
this.profile = data
|
||||
const profile = data || {}
|
||||
this.form = {
|
||||
businessLicenseFile: profile.businessLicenseFile || '',
|
||||
legalIdCardFront: profile.legalIdCardFront || '',
|
||||
legalIdCardBack: profile.legalIdCardBack || '',
|
||||
settlementAccountFiles: profile.settlementAccountFiles || [],
|
||||
shopPhotos: profile.shopPhotos || [],
|
||||
legalMobile: profile.legalMobile || '',
|
||||
hasAgent: !!profile.hasAgent,
|
||||
agentIdCardFront: profile.agentIdCardFront || '',
|
||||
agentIdCardBack: profile.agentIdCardBack || '',
|
||||
agentAuthorizationFiles: profile.agentAuthorizationFiles || [],
|
||||
platformAgreementFiles: profile.platformAgreementFiles || [],
|
||||
platformAuthorizationFiles: profile.platformAuthorizationFiles || []
|
||||
}
|
||||
this.resetFileList()
|
||||
if (!this.extraInfo.agreementUrl && !this.extraInfo.authorizationUrl && !this.extraInfo.unionWechat && !this.extraInfo.platformWechat) {
|
||||
this.getExtraInfo()
|
||||
}
|
||||
},
|
||||
async getExtraInfo() {
|
||||
const dictIds = {
|
||||
agreementUrl: 'd6a300ae6a2f6d98009a50e36a4f0766',
|
||||
authorizationUrl: 'ed693ef16a2f6db00036fcd95c9dabf8',
|
||||
unionWechat: 'ed693ef16a2f6dcf0037006c1e6aec14',
|
||||
platformWechat: 'd6a300ae6a2f6dda009a81bc6b8b1fab'
|
||||
}
|
||||
const entries = await Promise.all(Object.entries(dictIds).map(async ([key, id]) => {
|
||||
const res = await vk.callFunction({
|
||||
url: 'client/dict/pub/getDetail',
|
||||
data: {id}
|
||||
})
|
||||
return [key, res.content || '']
|
||||
}))
|
||||
this.extraInfo = Object.fromEntries(entries)
|
||||
},
|
||||
resetFileList() {
|
||||
const singleFields = ['businessLicenseFile', 'legalIdCardFront', 'legalIdCardBack', 'agentIdCardFront', 'agentIdCardBack']
|
||||
const multiFields = ['settlementAccountFiles', 'shopPhotos', 'agentAuthorizationFiles', 'platformAgreementFiles', 'platformAuthorizationFiles']
|
||||
singleFields.forEach(field => {
|
||||
this[field] = this.form[field] ? [{url: this.form[field]}] : []
|
||||
})
|
||||
multiFields.forEach(field => {
|
||||
this[field] = (this.form[field] || []).map(url => ({url}))
|
||||
})
|
||||
},
|
||||
afterRead({file}, field, multi = false) {
|
||||
const list = multi ? file : [file]
|
||||
list.forEach(item => {
|
||||
uniCloud.uploadFile({
|
||||
filePath: item.url,
|
||||
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + item.name,
|
||||
success: ({fileID}) => {
|
||||
uniCloud.getTempFileURL({
|
||||
fileList: [fileID]
|
||||
}).then(res => {
|
||||
const url = res.fileList[0].tempFileURL
|
||||
if (multi) {
|
||||
this[field].push({url})
|
||||
this.form[field].push(url)
|
||||
} else {
|
||||
this[field] = [{url}]
|
||||
this.form[field] = url
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
deletePic({index}, field, multi = false) {
|
||||
if (multi) {
|
||||
this[field].splice(index, 1)
|
||||
this.form[field].splice(index, 1)
|
||||
} else {
|
||||
this[field] = []
|
||||
this.form[field] = ''
|
||||
}
|
||||
},
|
||||
async submit() {
|
||||
await vk.callFunction({
|
||||
url: 'client/user/kh/saveNotaryUnionPayProfile',
|
||||
title: '提交中...',
|
||||
data: this.form
|
||||
})
|
||||
this.$message.success('提交成功')
|
||||
await this.refresh()
|
||||
},
|
||||
openLink(url) {
|
||||
window.location.href = url
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.refresh()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,525 @@
|
||||
<template> <!-- 消息 -->
|
||||
<view>
|
||||
<view class="layout-notice">
|
||||
<template v-if="!isNotice">
|
||||
<view class="notice-head flex justify-between align-center">
|
||||
<view class="text">
|
||||
有
|
||||
<text class="red">{{ unreadNum }}</text>
|
||||
条系统通知消息未读
|
||||
</view>
|
||||
<view class="read flex justify-center align-center" @click="allRead">
|
||||
<u-icon name="eye" color="#666666" size="20"></u-icon>
|
||||
<text>全部标为已读</text>
|
||||
</view>
|
||||
<view class="push flex justify-center align-center" @click="isNotice = true">
|
||||
<u-icon name="setting" color="#666666" size="20"></u-icon>
|
||||
<text>消息推送设置</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="notice-body">
|
||||
<!-- 未读消息使用unread -->
|
||||
<view class="item" :class="{'unread': !item.hasRead}" v-for="(item, index) in noticeList"
|
||||
:key="index">
|
||||
<view class="info flex justify-between align-center">
|
||||
<view class="title text-single" @click="toDetail(item, index)">{{ item.title }}</view>
|
||||
<view class="date flex-1 m-left-20" @click="toDetail(item, index)">{{
|
||||
item._add_time_str
|
||||
}}
|
||||
</view>
|
||||
<view class="flex justify-center align-center" v-if="!item.hasRead" @click="setRead(index)">
|
||||
<u-icon name="eye" color="#A92924" size="18"></u-icon>
|
||||
<text class="read">标为已读</text>
|
||||
</view>
|
||||
<view class="flex justify-center align-center" @click="del(index)">
|
||||
<u-icon name="trash" color="#A92924" size="18"></u-icon>
|
||||
<text class="delete">删除</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="detail m-top-10" @click="toDetail(item, index)">
|
||||
{{ item.content }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="account-title m-top-20">消息推送设置</view>
|
||||
<u--text color="#626262" margin="20rpx 0 40rpx"
|
||||
text="注!我们将针对您的选择,为您精准推送询价信息"></u--text>
|
||||
<u-line color="#bbb"></u-line>
|
||||
<!-- 开关遍历容器 -->
|
||||
<view class="switch-list m-top-20">
|
||||
<view class="switch-box flex justify-between align-center" v-for="(item,index) in settingList"
|
||||
:key="index">
|
||||
<view class="text">
|
||||
<text class="red">*</text>
|
||||
{{ item.title }}
|
||||
</view>
|
||||
<u-switch v-model="item.status" activeColor="#be2a28" size="20"
|
||||
@change="handSwitchChange($event,index)"></u-switch>
|
||||
</view>
|
||||
</view>
|
||||
<view class="m-top-30">
|
||||
<u-line color="#bbb"></u-line>
|
||||
</view>
|
||||
<view class="account-title m-top-20">选择产品</view>
|
||||
<!-- 产品遍历容器 -->
|
||||
<view class="goods-list">
|
||||
<view class="goods-box flex" v-for="(item, index) in productList" :key="index">
|
||||
<view class="lb">{{ item.name }}</view>
|
||||
<view class="flex-1">
|
||||
<view class="flex justify-start flex-wrap">
|
||||
<view class="m-right-20 m-top-20" v-for="(productItem, productIndex) in item.children"
|
||||
:key="productIndex">
|
||||
<u-tag size="mini"
|
||||
:text="productItem.name"
|
||||
:plain="!productList[index].idList.includes(productItem.name)"
|
||||
type="error"
|
||||
:name="productItem.name"
|
||||
@click="handCheckboxClick"
|
||||
></u-tag>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 已选 -->
|
||||
<div class="form">
|
||||
<view class="account-title m-top-20">请选择服务地区</view>
|
||||
<view class="flex flex-col justify-start items-start">
|
||||
<view class="w-100p">
|
||||
<el-select size="small" 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>
|
||||
</view>
|
||||
<view class="my-10 w-100p">
|
||||
<el-select size="small" v-model="addressIndex[1]" placeholder="请选择市" class="w-100p"
|
||||
:disabled="!addressIndex[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>
|
||||
</view>
|
||||
<view class="my-10 w-100p">
|
||||
<el-select size="small" v-model="addressIndex[2]" placeholder="请选择区" class="w-100p"
|
||||
:disabled="!addressIndex[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>
|
||||
</view>
|
||||
</view>
|
||||
<u-button type="primary" size="mini" @click="addAddress">添加</u-button>
|
||||
</div>
|
||||
<div class="flex justify-start items-start flex-wrap mt-20 text-25">
|
||||
<div class="flex justify-start items-center pointer" @click="deleteAddress(item)"
|
||||
v-for="(item, index) in addressList"
|
||||
:key="index" style="margin: 10px 10px 0 0">
|
||||
<image src="/static/img/check.png" style="width: 12px; height: 12px; margin-right: 5px"/>
|
||||
<span style="line-height: 18px">{{ item.province.name }}-{{
|
||||
item.city ? item.city.name : '不限'
|
||||
}}-{{ item.area ? item.area.name : '不限' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<el-divider></el-divider>
|
||||
<div class="form">
|
||||
<view class="account-title m-top-20">请选择单笔交易额</view>
|
||||
<div class="flex justify-start items-center">
|
||||
<el-input size="small" v-model="tradeAmount[0]" placeholder="请输入金额" style="width: 200px">
|
||||
<template #suffix>元</template>
|
||||
</el-input>
|
||||
<span class="mx-20">~</span>
|
||||
<el-input size="small" v-model="tradeAmount[1]" placeholder="请输入金额" style="width: 200px">
|
||||
<template #suffix>元</template>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
<el-divider></el-divider>
|
||||
<div class="form text-25">
|
||||
<view class="account-title m-top-20">请选择交易方式</view>
|
||||
|
||||
<div class="flex justify-start items-center pointer" @click="changeItemCheck('tradeSelf')"
|
||||
style="margin: 10px 10px 0 0">
|
||||
<image :src="tradeSelf ? '/static/img/check.png' : '/static/img/uncheck.png'"
|
||||
style="width: 12px; height: 12px; margin-right: 5px"/>
|
||||
<span style="line-height: 18px">自主交易</span>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-start items-center pointer"
|
||||
@click="changeItemCheck('tradePlatform')"
|
||||
style="margin: 10px 10px 0 0">
|
||||
<image :src="tradePlatform ? '/static/img/check.png' : '/static/img/uncheck.png'"
|
||||
style="width: 12px; height: 12px; margin-right: 5px"/>
|
||||
<span style="line-height: 18px">金久信公证</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<el-divider></el-divider>
|
||||
<div class="form">
|
||||
<view class="account-title m-top-20">请设置免打扰时间段</view>
|
||||
<div class="flex justify-start items-center">
|
||||
<el-time-picker v-model="doNotDisturbRange" range-separator="~" is-range style="width: 200px"/>
|
||||
</div>
|
||||
</div>
|
||||
<view class="flex justify-between items-center">
|
||||
<view class="mx-15 flex-1">
|
||||
<u-button class="public-btn" text="保存设置" @click="handSubmit"></u-button>
|
||||
</view>
|
||||
<view class="mx-15 flex-1">
|
||||
<u-button class="public-btn-plain" text="取消" @click="isNotice = false"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import provinces from "@/util/address/provinces.json";
|
||||
import citys from "@/util/address/citys.json";
|
||||
import areas from "@/util/address/areas.json";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
provinceData: provinces,
|
||||
cityData: citys,
|
||||
areaData: areas,
|
||||
isNotice: false,
|
||||
settingList: {
|
||||
article: {
|
||||
title: '现货推送服务',
|
||||
status: false
|
||||
},
|
||||
process: {
|
||||
title: '找加工信息推送服务',
|
||||
status: false
|
||||
},
|
||||
old: {
|
||||
title: '旧货交易信息推送服务',
|
||||
status: false
|
||||
},
|
||||
enquiry: {
|
||||
title: '询价单和选项推送服务',
|
||||
status: false
|
||||
},
|
||||
},
|
||||
value: false,
|
||||
unreadNum: 0,
|
||||
noticeList: [],
|
||||
productList: [],
|
||||
addressRegion: {},
|
||||
tradeSelf: false,
|
||||
tradePlatform: false,
|
||||
doNotDisturbRange: [new Date(2024, 1, 1, 0, 0), new Date(2024, 1, 1, 0, 0)],
|
||||
tradeAmount: [],
|
||||
addressIndex: [null, null, null],
|
||||
addressList: []
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
handCheckboxClick(name) {
|
||||
this.checkboxs[name].checked = !this.checkboxs[name].checked
|
||||
},
|
||||
handSwitchChange(val, index) {
|
||||
this.settingList[index].status = val
|
||||
},
|
||||
async getList(pageIndex = 1) {
|
||||
const {rows, total} = await vk.callFunction({
|
||||
url: 'client/message/kh/getList',
|
||||
data: {
|
||||
pageIndex,
|
||||
pageSize: 500,
|
||||
}
|
||||
})
|
||||
this.total = total
|
||||
this.noticeList = rows
|
||||
},
|
||||
async getUnreadNum() {
|
||||
const {data} = await vk.callFunction({
|
||||
url: 'client/message/kh/getUnreadCount',
|
||||
});
|
||||
this.unreadNum = data
|
||||
},
|
||||
async setRead(index) {
|
||||
this.noticeList[index].hasRead = true
|
||||
await vk.callFunction({
|
||||
url: 'client/message/kh/setRead',
|
||||
data: {
|
||||
id: this.noticeList[index]._id
|
||||
}
|
||||
})
|
||||
},
|
||||
del(index) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定清空内容吗?',
|
||||
success: async res => {
|
||||
if (res.confirm) {
|
||||
await vk.callFunction({
|
||||
url: 'client/message/kh/delete',
|
||||
data: {
|
||||
id: this.noticeList[index]._id
|
||||
}
|
||||
})
|
||||
this.$message.success('删除成功')
|
||||
await this.getList()
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
toDetail(item, index) {
|
||||
if (!item.hasRead) this.setRead(index)
|
||||
let url = null
|
||||
if (item.type === 'old') url = `/pages/junk/detail?id=${item.pk}`
|
||||
else if (item.type === 'enquiry') url = `/pages/price/detail?id=${item.pk}`
|
||||
else if (item.type === 'process') url = `/pages/work/detail?id=${item.pk}`
|
||||
else if (item.type === 'contract') url = `/pages/public/contract?tab=1`
|
||||
else if (item.type === 'self-support') url = `/pages/self/makeQuote?id=${item.pk}`
|
||||
else if (item.type === 'self-product') url = `/pages/user/seller`
|
||||
else if (item.type === 'spot') url = `/pages/goods/detail?id=${item.pk}`
|
||||
else if (item.type === 'self-support-quote') {
|
||||
this.getQuoteDetail(item.pk)
|
||||
}
|
||||
if (url) vk.navigateTo({url})
|
||||
},
|
||||
async allRead() {
|
||||
await vk.callFunction({
|
||||
url: 'client/message/kh/setAllRead'
|
||||
})
|
||||
await this.getList(1)
|
||||
await this.getUnreadNum()
|
||||
},
|
||||
async getQuoteDetail(_id) {
|
||||
await vk.callFunction({
|
||||
url: 'client/selfSupport/kh/getQuoteDetail',
|
||||
data: {
|
||||
_id
|
||||
},
|
||||
success: ({rows}) => {
|
||||
this.sheet = rows
|
||||
this.dialogVisible = true
|
||||
}
|
||||
});
|
||||
},
|
||||
toContract() {
|
||||
this.dialogVisible = false
|
||||
vk.navigateTo({url: '/pages/public/contract?tab=1'})
|
||||
},
|
||||
async getConfig() {
|
||||
const res = await vk.callFunction({
|
||||
url: 'client/message/config/kh/getConfig'
|
||||
})
|
||||
for (let key in this.settingList) this.settingList[key].status = res[key]
|
||||
this.productList.forEach((item, index) => {
|
||||
item.children.forEach(productItem => {
|
||||
if (res.productList.includes(productItem.name)) {
|
||||
this.productList[index].idList.push(productItem.name)
|
||||
}
|
||||
})
|
||||
})
|
||||
this.tradeSelf = res.tradeSelf ?? false
|
||||
this.tradePlatform = res.tradePlatform ?? false
|
||||
if (res.addressList) this.addressList = res.addressList
|
||||
else {
|
||||
this.addressList = []
|
||||
}
|
||||
this.doNotDisturbRange = res.doNotDisturbRange ?? []
|
||||
this.tradeAmount = res.tradeAmount ?? []
|
||||
},
|
||||
async getCate() {
|
||||
const {rows} = await vk.callFunction({
|
||||
url: 'client/spot/category/pub/getTree',
|
||||
title: '请求中...',
|
||||
});
|
||||
this.productList = rows.map(item => {
|
||||
item.idList = []
|
||||
return item
|
||||
})
|
||||
},
|
||||
async handSubmit() {
|
||||
let productList = []
|
||||
this.productList.forEach(item => {
|
||||
productList = [...productList, ...item.idList]
|
||||
})
|
||||
await vk.callFunction({
|
||||
url: 'client/message/config/kh/update',
|
||||
data: {
|
||||
article: this.settingList.article.status,
|
||||
process: this.settingList.process.status,
|
||||
old: this.settingList.old.status,
|
||||
enquiry: this.settingList.enquiry.status,
|
||||
productList,
|
||||
addressList: this.addressList,
|
||||
tradeSelf: this.tradeSelf,
|
||||
tradePlatform: this.tradePlatform,
|
||||
doNotDisturbRange: this.doNotDisturbRange,
|
||||
tradeAmount: this.tradeAmount,
|
||||
}
|
||||
})
|
||||
this.$message.success('保存成功')
|
||||
this.isNotice = false
|
||||
},
|
||||
addAddress() {
|
||||
if (!this.addressIndex[0]) return
|
||||
this.addressList.push({
|
||||
province: this.provinceData[this.addressIndex[0]],
|
||||
city: this.addressIndex[1] ? this.cityData[this.addressIndex[0]][this.addressIndex[1]] : null,
|
||||
area: this.addressIndex[2] ? this.areaData[this.addressIndex[0]][this.addressIndex[1]][this.addressIndex[2]] : null
|
||||
})
|
||||
this.addressIndex = [null, null, null]
|
||||
},
|
||||
deleteAddress(index) {
|
||||
this.addressList.splice(index, 1)
|
||||
},
|
||||
changeItemCheck(field) {
|
||||
this[field] = !this[field]
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
await this.getList()
|
||||
await this.getUnreadNum()
|
||||
await this.getCate()
|
||||
await this.getConfig()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.layout-notice {
|
||||
padding: 10rpx 30rpx;
|
||||
}
|
||||
|
||||
.notice-head {
|
||||
height: 80rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 32rpx;
|
||||
color: #333333;
|
||||
border-bottom: 1px solid #f2f2f2;
|
||||
}
|
||||
|
||||
.notice-body {
|
||||
.item {
|
||||
position: relative;
|
||||
padding: 20rpx 0 40rpx 20rpx;
|
||||
border-bottom: 1px solid #f2f2f2;
|
||||
|
||||
.detail {
|
||||
font-size: 24rpx;
|
||||
line-height: 32rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.unread::before {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 30rpx;
|
||||
z-index: 9;
|
||||
content: '';
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
border-radius: 50%;
|
||||
background: #A92924;
|
||||
}
|
||||
|
||||
.title {
|
||||
max-width: 280rpx;
|
||||
font-size: 26rpx;
|
||||
line-height: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.date {
|
||||
font-size: 22rpx;
|
||||
line-height: 32rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.read, .delete {
|
||||
font-size: 24rpx;
|
||||
line-height: 32rpx;
|
||||
color: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.account-title {
|
||||
position: relative;
|
||||
padding-left: 20rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
line-height: 48rpx;
|
||||
color: #A92924;
|
||||
|
||||
&:before {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
z-index: 9;
|
||||
margin-top: -14rpx;
|
||||
content: '';
|
||||
width: 6rpx;
|
||||
height: 28rpx;
|
||||
background: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.public-btn {
|
||||
width: 100%;
|
||||
margin-top: 60rpx;
|
||||
color: #ffffff;
|
||||
background: #A92924;
|
||||
}
|
||||
|
||||
.public-btn-plain {
|
||||
width: 100%;
|
||||
margin-top: 60rpx;
|
||||
color: #A92924;
|
||||
border: 1px solid #A92924;
|
||||
}
|
||||
|
||||
.lb {
|
||||
width: 160rpx;
|
||||
height: auto;
|
||||
padding-top: 20rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 48rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.goods-box {
|
||||
padding-bottom: 20rpx;
|
||||
border-bottom: 1px dashed #f2f2f2;
|
||||
}
|
||||
|
||||
.switch-box {
|
||||
padding: 16rpx 0;
|
||||
font-size: 26rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
|
||||
/deep/ .i-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
/deep/ .el-input__suffix {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,163 @@
|
||||
<template>
|
||||
<view class="p-30">
|
||||
<view class="flex justify-end items-center">
|
||||
<u-button size="small" color="#A92924" text="新增收款账户"
|
||||
@click="showAdd" v-if="!isAdd"></u-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="userData.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="请输入开户行"
|
||||
:readonly="userData.accountType === 2 && form.type === 'company' "/>
|
||||
</el-form-item>
|
||||
<el-form-item label="账号名称" required>
|
||||
<el-input v-model="form.accountName" placeholder="请输入账号名称"
|
||||
:readonly="userData.accountType === 2 && form.type === 'company'"/>
|
||||
</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" active-color="#a92924"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<view class="mt-30 flex justify-center items-center">
|
||||
<view class="flex-1 px-20">
|
||||
<u-button plain @click="isAdd = !isAdd">取消</u-button>
|
||||
</view>
|
||||
<view class="flex-1 px-20">
|
||||
<u-button type="primary" @click="addContact">确定</u-button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt-30 text-main text-25">温馨提示:请详细、慎重核查账户信息的正确性,以免给您造成不必要损失。账户信息错误平台不承担付款错误责任。</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<view class="p-20 shadow flex justify-between items-center my-20 rounded" v-for="(item, index) in list"
|
||||
:key="index">
|
||||
<view class="flex flex-col justify-start items-start">
|
||||
<view class="flex justify-start items-center">
|
||||
<u-tag type="primary" size="mini" class="mr-25" text="默认" v-if="item.isDefault"></u-tag>
|
||||
<u-tag type="success" size="mini" class="mr-25"
|
||||
:text="item.type === 'company' ? '对公' : '个人'"></u-tag>
|
||||
<text class="font-bold text-25">{{ 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">
|
||||
<u-button type="primary" size="small" @click="edit(item)">编辑</u-button>
|
||||
<view class="mt-20">
|
||||
<u-button type="primary" size="small" @click="del(item._id)" plain>删除</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "payeeAccount",
|
||||
props: {
|
||||
userData: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
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(this.userData.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) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确认删除该账号吗?',
|
||||
success: async res => {
|
||||
if (res.confirm) {
|
||||
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() {
|
||||
if (this.userData.accountType === 2) {
|
||||
this.form.account = this.userData.company.companyAccount
|
||||
this.form.bankName = this.userData.company.companyBankName
|
||||
this.form.accountName = this.userData.company.companyName
|
||||
}
|
||||
this.isAdd = true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (parseInt(this.userData.authStatus) !== 1) {
|
||||
this.$message.error('请先完成实名认证')
|
||||
uni.navigateBack()
|
||||
return
|
||||
}
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<script>
|
||||
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
|
||||
CSS.supports('top: constant(a)'))
|
||||
document.write(
|
||||
'<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' : '') + '" />')
|
||||
</script>
|
||||
<title></title>
|
||||
<!--preload-links-->
|
||||
<!--app-context-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"><!--app-html--></div>
|
||||
<script type="module" src="/main.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue-tianditu"></script>
|
||||
<script src="http://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
+171
@@ -0,0 +1,171 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const CryptoJS = require("crypto-js");
|
||||
const request = require("request");
|
||||
var AuthorizationType;
|
||||
(function (AuthorizationType) {
|
||||
AuthorizationType[AuthorizationType["OPEN-FORM-PARAM"] = 0] = "OPEN-FORM-PARAM";
|
||||
AuthorizationType[AuthorizationType["OPEN-BODY-SIG"] = 1] = "OPEN-BODY-SIG";
|
||||
AuthorizationType[AuthorizationType["OPEN-ACCESS-TOKEN"] = 2] = "OPEN-ACCESS-TOKEN";
|
||||
})(AuthorizationType || (AuthorizationType = {}));
|
||||
/**
|
||||
* Open SDK for Node.JS
|
||||
*/
|
||||
class OpenSdk {
|
||||
/**
|
||||
* @class
|
||||
* @param {OpenSdkConfig} config 初始化 SDK 配置
|
||||
*/
|
||||
constructor(config) {
|
||||
if (!config.appId) {
|
||||
throw Error('config.appId is required');
|
||||
}
|
||||
if (!config.appKey) {
|
||||
throw Error('config.appKey is required');
|
||||
}
|
||||
this.config = config;
|
||||
}
|
||||
/**
|
||||
* 生成请求字符串
|
||||
* @param {QueryParams} params 请求参数
|
||||
* @return {string} 请求字符串
|
||||
*/
|
||||
generateSignature(params) {
|
||||
if (!AuthorizationType[params.authorization]) {
|
||||
params.authorization = AuthorizationType['OPEN-BODY-SIG'];
|
||||
}
|
||||
let content = JSON.stringify(params.content);
|
||||
if (params.authorization === AuthorizationType['OPEN-FORM-PARAM']) {
|
||||
let contentHash = CryptoJS.SHA256(content).toString();
|
||||
let signStr = this.config.appId + params.timestamp + params.nonce + contentHash;
|
||||
let signature = CryptoJS.HmacSHA256(signStr, this.config.appKey);
|
||||
let signatureStr = CryptoJS.enc.Base64.stringify(signature);
|
||||
let signatureEncode = encodeURIComponent(signatureStr);
|
||||
let str = `?authorization=${params.authorization}&appId=${this.config.appId}×tamp=${params.timestamp}&nonce=${params.nonce}&content=${content}&signature=${signatureEncode}`;
|
||||
return str;
|
||||
}
|
||||
if (params.authorization === AuthorizationType['OPEN-BODY-SIG']) {
|
||||
let contentHash = CryptoJS.SHA256(content).toString();
|
||||
let signStr = this.config.appId + params.timestamp + params.nonce + contentHash;
|
||||
let signature = CryptoJS.HmacSHA256(signStr, this.config.appKey);
|
||||
let signatureStr = CryptoJS.enc.Base64.stringify(signature);
|
||||
return signatureStr;
|
||||
}
|
||||
if (params.authorization === AuthorizationType['OPEN-ACCESS-TOKEN']) {
|
||||
let signStr = this.config.appId + params.timestamp + params.nonce + this.config.appKey;
|
||||
let signatureStr = CryptoJS.SHA256(signStr).toString();
|
||||
return signatureStr;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 发送请求
|
||||
* @param {QueryParams} params 请求参数
|
||||
* @return {Promise<OpenSdkCommonResult | string>} 请求执行结果
|
||||
*/
|
||||
exec(params) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (!params.queryUrl) {
|
||||
throw Error('params.queryUrl is required');
|
||||
}
|
||||
if (!params.nonce) {
|
||||
throw Error('params.nonce is required');
|
||||
}
|
||||
if (!params.timestamp) {
|
||||
throw Error('params.timestamp is required');
|
||||
}
|
||||
const str = this.generateSignature(params);
|
||||
const config = this.config;
|
||||
if (params.authorization === AuthorizationType['OPEN-FORM-PARAM']) {
|
||||
const Url = params.queryUrl + encodeURIComponent(str);
|
||||
return new Promise((resolve, reject) => {
|
||||
request(Url, (error, _response, body) => {
|
||||
if (!error) {
|
||||
if (typeof (body) === 'object') {
|
||||
resolve(JSON.parse(body));
|
||||
}
|
||||
else {
|
||||
resolve(body);
|
||||
}
|
||||
}
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
}
|
||||
if (params.authorization === AuthorizationType['OPEN-BODY-SIG']) {
|
||||
const Url = params.queryUrl;
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
url: Url,
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Authorization": `OPEN-BODY-SIG AppId="${config.appId}", Timestamp="${params.timestamp}", Nonce="${params.nonce}", Signature="${str}"`,
|
||||
},
|
||||
body: JSON.stringify(params.content),
|
||||
}, (error, _response, body) => {
|
||||
if (!error) {
|
||||
if (typeof (body) === 'object') {
|
||||
resolve(JSON.parse(body));
|
||||
}
|
||||
else {
|
||||
resolve(body);
|
||||
}
|
||||
}
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
}
|
||||
if (params.authorization === AuthorizationType['OPEN-ACCESS-TOKEN']) {
|
||||
const Url = params.queryUrl;
|
||||
const token = yield new Promise((resolve, reject) => {
|
||||
request({
|
||||
url: 'https://test-api-open.chinaums.com/v1/token/access',
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
appId: config.appId,
|
||||
timestamp: params.timestamp,
|
||||
nonce: params.nonce,
|
||||
signMethod: 'SHA256',
|
||||
Signature: str
|
||||
})
|
||||
}, (error, _response, body) => {
|
||||
if (!error) {
|
||||
resolve(JSON.parse(body).accessToken);
|
||||
}
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
url: Url,
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Authorization": `OPEN-ACCESS-TOKEN AccessToken="${token}"`,
|
||||
},
|
||||
body: JSON.stringify(params.content),
|
||||
}, (error, _response, body) => {
|
||||
if (!error) {
|
||||
if (typeof (body) === 'object') {
|
||||
resolve(JSON.parse(body));
|
||||
}
|
||||
else {
|
||||
resolve(body);
|
||||
}
|
||||
}
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.default = OpenSdk;
|
||||
//# sourceMappingURL=base.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"base.js","sourceRoot":"","sources":["base.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAsC;AACtC,mCAAmC;AAYnC,IAAK,iBAIJ;AAJD,WAAK,iBAAiB;IAClB,+EAAiB,CAAA;IACjB,2EAAe,CAAA;IACf,mFAAmB,CAAA;AACvB,CAAC,EAJI,iBAAiB,KAAjB,iBAAiB,QAIrB;AAyBD;;GAEG;AACH,MAAM,OAAO;IAGT;;;KAGC;IACD,YAAY,MAAqB;QAC7B,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE;YAAE,MAAM,KAAK,CAAC,0BAA0B,CAAC,CAAC;SAAE;QAC/D,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;YAAE,MAAM,KAAK,CAAC,2BAA2B,CAAC,CAAC;SAAE;QACjE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACxB,CAAC;IAED;;;;IAIA;IACO,iBAAiB,CAAC,MAAmB;QACxC,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE;YAC1C,MAAM,CAAC,aAAa,GAAG,iBAAiB,CAAC,eAAe,CAAC,CAAA;SAC5D;QACD,IAAI,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;QAC5C,IAAI,MAAM,CAAC,aAAa,KAAK,iBAAiB,CAAC,iBAAiB,CAAC,EAAE;YAC/D,IAAI,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAA;YACrD,IAAI,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,KAAK,GAAG,WAAW,CAAA;YAC/E,IAAI,SAAS,GAAG,QAAQ,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;YAChE,IAAI,YAAY,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,CAAA;YAC3D,IAAI,eAAe,GAAG,kBAAkB,CAAC,YAAY,CAAC,CAAA;YACtD,IAAI,GAAG,GAAG,kBAAkB,MAAM,CAAC,aAAa,UAAU,IAAI,CAAC,MAAM,CAAC,KAAK,cAAc,MAAM,CAAC,SAAS,UAAU,MAAM,CAAC,KAAK,YAAY,OAAO,cAAc,eAAe,EAAE,CAAA;YACjL,OAAO,GAAG,CAAA;SACb;QACD,IAAI,MAAM,CAAC,aAAa,KAAK,iBAAiB,CAAC,eAAe,CAAC,EAAE;YAC7D,IAAI,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAA;YACrD,IAAI,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,KAAK,GAAG,WAAW,CAAA;YAC/E,IAAI,SAAS,GAAG,QAAQ,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;YAChE,IAAI,YAAY,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,CAAA;YAC3D,OAAO,YAAY,CAAA;SACtB;QACD,IAAI,MAAM,CAAC,aAAa,KAAK,iBAAiB,CAAC,mBAAmB,CAAC,EAAE;YACjE,IAAI,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAA;YACtF,IAAI,YAAY,GAAG,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAA;YACtD,OAAO,YAAY,CAAA;SACtB;IACL,CAAC;IAED;;;;MAIE;IACW,IAAI,CAAC,MAAmB;;YACjC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;gBAAE,MAAM,KAAK,CAAC,6BAA6B,CAAC,CAAC;aAAE;YACrE,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE;gBAAE,MAAM,KAAK,CAAC,0BAA0B,CAAC,CAAC;aAAE;YAC/D,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE;gBAAE,MAAM,KAAK,CAAC,8BAA8B,CAAC,CAAC;aAAE;YAEvE,MAAM,GAAG,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAA;YAC1C,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;YAC3B,IAAI,MAAM,CAAC,aAAa,KAAK,iBAAiB,CAAC,iBAAiB,CAAC,EAAE;gBAC/D,MAAM,GAAG,GAAG,MAAM,CAAC,QAAQ,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAA;gBACrD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;oBACnC,OAAO,CAAC,GAAG,EAAE,CAAC,KAAa,EAAE,SAAiB,EAAE,IAAS,EAAE,EAAE;wBACzD,IAAI,CAAC,KAAK,EAAE;4BACR,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,QAAQ,EAAE;gCAC5B,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA;6BAC5B;iCAAM;gCACH,OAAO,CAAC,IAAI,CAAC,CAAA;6BAChB;yBACJ;wBACD,MAAM,CAAC,KAAK,CAAC,CAAA;oBACjB,CAAC,CAAC,CAAA;gBACN,CAAC,CAAC,CAAA;aACL;YACD,IAAI,MAAM,CAAC,aAAa,KAAK,iBAAiB,CAAC,eAAe,CAAC,EAAE;gBAC7D,MAAM,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAA;gBAC3B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;oBACnC,OAAO,CAAC;wBACJ,GAAG,EAAE,GAAG;wBACR,MAAM,EAAE,MAAM;wBACd,OAAO,EAAE;4BACL,eAAe,EAAE,wBAAwB,MAAM,CAAC,KAAK,iBAAiB,MAAM,CAAC,SAAS,aAAa,MAAM,CAAC,KAAK,iBAAiB,GAAG,GAAG;yBACzI;wBACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC;qBACvC,EAAE,CAAC,KAAa,EAAE,SAAiB,EAAE,IAAS,EAAE,EAAE;wBAC/C,IAAI,CAAC,KAAK,EAAE;4BACR,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,QAAQ,EAAE;gCAC5B,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA;6BAC5B;iCAAM;gCACH,OAAO,CAAC,IAAI,CAAC,CAAA;6BAChB;yBACJ;wBACD,MAAM,CAAC,KAAK,CAAC,CAAA;oBACjB,CAAC,CAAC,CAAA;gBACN,CAAC,CAAC,CAAA;aACL;YACD,IAAI,MAAM,CAAC,aAAa,KAAK,iBAAiB,CAAC,mBAAmB,CAAC,EAAE;gBACjE,MAAM,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAA;gBAC3B,MAAM,KAAK,GAAG,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;oBAChD,OAAO,CAAC;wBACJ,GAAG,EAAE,oDAAoD;wBACzD,MAAM,EAAE,MAAM;wBACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;4BACjB,KAAK,EAAE,MAAM,CAAC,KAAK;4BACnB,SAAS,EAAE,MAAM,CAAC,SAAS;4BAC3B,KAAK,EAAE,MAAM,CAAC,KAAK;4BACnB,UAAU,EAAE,QAAQ;4BACpB,SAAS,EAAE,GAAG;yBACjB,CAAC;qBACL,EAAE,CAAC,KAAa,EAAE,SAAiB,EAAE,IAAS,EAAE,EAAE;wBAC/C,IAAI,CAAC,KAAK,EAAE;4BACR,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,CAAA;yBACxC;wBACD,MAAM,CAAC,KAAK,CAAC,CAAA;oBACjB,CAAC,CAAC,CAAA;gBACN,CAAC,CAAC,CAAA;gBACF,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;oBACnC,OAAO,CAAC;wBACJ,GAAG,EAAE,GAAG;wBACR,MAAM,EAAE,MAAM;wBACd,OAAO,EAAE;4BACL,eAAe,EAAE,kCAAkC,KAAK,GAAG;yBAC9D;wBACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC;qBACvC,EAAE,CAAC,KAAa,EAAE,SAAiB,EAAE,IAAS,EAAE,EAAE;wBAC/C,IAAI,CAAC,KAAK,EAAE;4BACR,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,QAAQ,EAAE;gCAC5B,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA;6BAC5B;iCAAM;gCACH,OAAO,CAAC,IAAI,CAAC,CAAA;6BAChB;yBACJ;wBACD,MAAM,CAAC,KAAK,CAAC,CAAA;oBACjB,CAAC,CAAC,CAAA;gBACN,CAAC,CAAC,CAAA;aACL;QACL,CAAC;KAAA;CACJ;AAED,kBAAe,OAAO,CAAC"}
|
||||
@@ -0,0 +1,51 @@
|
||||
import App from './App'
|
||||
|
||||
import ElementUI from 'element-ui';
|
||||
import 'element-ui/lib/theme-chalk/index.css';
|
||||
|
||||
import uView from '@/uni_modules/uview-ui'
|
||||
import vk from 'uni_modules/vk-unicloud';
|
||||
|
||||
import config from '@/app.config.js'
|
||||
|
||||
Vue.use(uView).use(ElementUI).use(vk);
|
||||
|
||||
import VueTianditu from "vue-tianditu";
|
||||
Vue.use(VueTianditu, {
|
||||
v: "4.0",
|
||||
tk: "bfbc6bd9e85fcda67b62788705aa6427"
|
||||
});
|
||||
|
||||
Vue.prototype.vk.init({
|
||||
Vue, // Vue实例
|
||||
config, // 配置
|
||||
});
|
||||
|
||||
Vue.prototype.$jump = (url) => {
|
||||
uni.navigateTo({url})
|
||||
}
|
||||
|
||||
Vue.prototype.$toHome = () => {
|
||||
uni.switchTab({url: '/pages/index/index'})
|
||||
}
|
||||
|
||||
// #ifndef VUE3
|
||||
import Vue from 'vue'
|
||||
import './uni.promisify.adaptor'
|
||||
Vue.config.productionTip = false
|
||||
App.mpType = 'app'
|
||||
const app = new Vue({
|
||||
...App
|
||||
})
|
||||
app.$mount()
|
||||
// #endif
|
||||
|
||||
// #ifdef VUE3
|
||||
import { createSSRApp } from 'vue'
|
||||
export function createApp() {
|
||||
const app = createSSRApp(App)
|
||||
return {
|
||||
app
|
||||
}
|
||||
}
|
||||
// #endif
|
||||
@@ -0,0 +1,90 @@
|
||||
{
|
||||
"name" : "金久信",
|
||||
"appid" : "__UNI__EB80D26",
|
||||
"description" : "",
|
||||
"versionName" : "1.0.0",
|
||||
"versionCode" : "100",
|
||||
"transformPx" : false,
|
||||
"sassImplementationName": "node-sass",
|
||||
/* 5+App特有相关 */
|
||||
"app-plus" : {
|
||||
"usingComponents" : true,
|
||||
"nvueStyleCompiler" : "uni-app",
|
||||
"compilerVersion" : 3,
|
||||
"splashscreen" : {
|
||||
"alwaysShowBeforeRender" : true,
|
||||
"waiting" : true,
|
||||
"autoclose" : true,
|
||||
"delay" : 0
|
||||
},
|
||||
/* 模块配置 */
|
||||
"modules" : {},
|
||||
/* 应用发布信息 */
|
||||
"distribute" : {
|
||||
/* android打包配置 */
|
||||
"android" : {
|
||||
"permissions" : [
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||
]
|
||||
},
|
||||
/* ios打包配置 */
|
||||
"ios" : {},
|
||||
/* SDK配置 */
|
||||
"sdkConfigs" : {}
|
||||
}
|
||||
},
|
||||
/* 快应用特有相关 */
|
||||
"quickapp" : {},
|
||||
/* 小程序特有相关 */
|
||||
"mp-weixin" : {
|
||||
"appid" : "wxbdc125d352e2f012",
|
||||
"setting" : {
|
||||
"urlCheck" : false,
|
||||
"postcss" : true,
|
||||
"minified" : true
|
||||
},
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-alipay" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-baidu" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-toutiao" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"uniStatistics" : {
|
||||
"enable" : false
|
||||
},
|
||||
"vueVersion" : "2",
|
||||
"h5" : {
|
||||
"router" : {
|
||||
"mode" : "history",
|
||||
"base" : ""
|
||||
},
|
||||
"devServer" : {
|
||||
"https" : false
|
||||
},
|
||||
"title" : "金久信平台",
|
||||
"optimization" : {
|
||||
"treeShaking" : {
|
||||
"enable" : true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// 以下项目可以删减或更换顺序,但不能添加或更改名字
|
||||
export default {
|
||||
// 普通标签的菜单项
|
||||
node: ['大小', '颜色', '斜体', '粗体', '下划线', '居中', '缩进', '上移', '下移', '删除'],
|
||||
// 可以设置的文字颜色,此项可以添加 css 颜色
|
||||
color: ['red', 'yellow', 'blue', 'green', 'gray', 'white', 'black'],
|
||||
// 图片的菜单项
|
||||
img: ['换图', '宽度', '超链接', '预览图', '禁用预览', '上移', '下移', '删除'],
|
||||
// 链接的菜单项
|
||||
link: ['更换链接', '上移', '下移', '删除'],
|
||||
// 音视频的菜单项
|
||||
media: ['封面', '循环', '自动播放', '上移', '下移', '删除'],
|
||||
// 卡片的菜单项
|
||||
card: ['上移', '下移', '删除']
|
||||
}
|
||||
@@ -0,0 +1,553 @@
|
||||
/**
|
||||
* @fileoverview editable 插件
|
||||
*/
|
||||
import config from './config'
|
||||
import Parser from '../parser'
|
||||
|
||||
function Editable (vm) {
|
||||
this.vm = vm
|
||||
this.editHistory = [] // 历史记录
|
||||
this.editI = -1 // 历史记录指针
|
||||
vm._mask = [] // 蒙版被点击时进行的操作
|
||||
|
||||
vm._setData = function (path, val) {
|
||||
const paths = path.split('.')
|
||||
let target = vm
|
||||
for (let i = 0; i < paths.length - 1; i++) {
|
||||
target = target[paths[i]]
|
||||
}
|
||||
vm.$set(target, paths.pop(), val)
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 移动历史记录指针
|
||||
* @param {Number} num 移动距离
|
||||
*/
|
||||
const move = num => {
|
||||
setTimeout(() => {
|
||||
const item = this.editHistory[this.editI + num]
|
||||
if (item) {
|
||||
this.editI += num
|
||||
vm._setData(item.key, item.value)
|
||||
}
|
||||
}, 200)
|
||||
}
|
||||
vm.undo = () => move(-1) // 撤销
|
||||
vm.redo = () => move(1) // 重做
|
||||
|
||||
/**
|
||||
* @description 更新记录
|
||||
* @param {String} path 更新内容路径
|
||||
* @param {*} oldVal 旧值
|
||||
* @param {*} newVal 新值
|
||||
* @param {Boolean} set 是否更新到视图
|
||||
* @private
|
||||
*/
|
||||
vm._editVal = (path, oldVal, newVal, set) => {
|
||||
// 当前指针后的内容去除
|
||||
while (this.editI < this.editHistory.length - 1) {
|
||||
this.editHistory.pop()
|
||||
}
|
||||
|
||||
// 最多存储 30 条操作记录
|
||||
while (this.editHistory.length > 30) {
|
||||
this.editHistory.pop()
|
||||
this.editI--
|
||||
}
|
||||
|
||||
const last = this.editHistory[this.editHistory.length - 1]
|
||||
if (!last || last.key !== path) {
|
||||
if (last) {
|
||||
// 去掉上一次的新值
|
||||
this.editHistory.pop()
|
||||
this.editI--
|
||||
}
|
||||
// 存入这一次的旧值
|
||||
this.editHistory.push({
|
||||
key: path,
|
||||
value: oldVal
|
||||
})
|
||||
this.editI++
|
||||
}
|
||||
|
||||
// 存入本次的新值
|
||||
this.editHistory.push({
|
||||
key: path,
|
||||
value: newVal
|
||||
})
|
||||
this.editI++
|
||||
|
||||
// 更新到视图
|
||||
if (set) {
|
||||
vm._setData(path, newVal)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取菜单项
|
||||
* @private
|
||||
*/
|
||||
vm._getItem = function (node, up, down) {
|
||||
let items
|
||||
let i
|
||||
if (node === 'color') {
|
||||
return config.color
|
||||
}
|
||||
if (node.name === 'img') {
|
||||
items = config.img.slice(0)
|
||||
if (!vm.getSrc) {
|
||||
i = items.indexOf('换图')
|
||||
if (i !== -1) {
|
||||
items.splice(i, 1)
|
||||
}
|
||||
i = items.indexOf('超链接')
|
||||
if (i !== -1) {
|
||||
items.splice(i, 1)
|
||||
}
|
||||
i = items.indexOf('预览图')
|
||||
if (i !== -1) {
|
||||
items.splice(i, 1)
|
||||
}
|
||||
}
|
||||
i = items.indexOf('禁用预览')
|
||||
if (i !== -1 && node.attrs.ignore) {
|
||||
items[i] = '启用预览'
|
||||
}
|
||||
} else if (node.name === 'a') {
|
||||
items = config.link.slice(0)
|
||||
if (!vm.getSrc) {
|
||||
i = items.indexOf('更换链接')
|
||||
if (i !== -1) {
|
||||
items.splice(i, 1)
|
||||
}
|
||||
}
|
||||
} else if (node.name === 'video' || node.name === 'audio') {
|
||||
items = config.media.slice(0)
|
||||
i = items.indexOf('封面')
|
||||
if (!vm.getSrc && i !== -1) {
|
||||
items.splice(i, 1)
|
||||
}
|
||||
i = items.indexOf('循环')
|
||||
if (node.attrs.loop && i !== -1) {
|
||||
items[i] = '不循环'
|
||||
}
|
||||
i = items.indexOf('自动播放')
|
||||
if (node.attrs.autoplay && i !== -1) {
|
||||
items[i] = '不自动播放'
|
||||
}
|
||||
} else if (node.name === 'card') {
|
||||
items = config.card.slice(0)
|
||||
} else {
|
||||
items = config.node.slice(0)
|
||||
}
|
||||
if (!up) {
|
||||
i = items.indexOf('上移')
|
||||
if (i !== -1) {
|
||||
items.splice(i, 1)
|
||||
}
|
||||
}
|
||||
if (!down) {
|
||||
i = items.indexOf('下移')
|
||||
if (i !== -1) {
|
||||
items.splice(i, 1)
|
||||
}
|
||||
}
|
||||
return items
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 显示 tooltip
|
||||
* @param {object} obj
|
||||
* @private
|
||||
*/
|
||||
vm._tooltip = function (obj) {
|
||||
vm.$set(vm, 'tooltip', {
|
||||
top: obj.top,
|
||||
items: obj.items
|
||||
})
|
||||
vm._tooltipcb = obj.success
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 显示滚动条
|
||||
* @param {object} obj
|
||||
* @private
|
||||
*/
|
||||
vm._slider = function (obj) {
|
||||
vm.$set(vm, 'slider', {
|
||||
min: obj.min,
|
||||
max: obj.max,
|
||||
value: obj.value,
|
||||
top: obj.top
|
||||
})
|
||||
vm._slideringcb = obj.changing
|
||||
vm._slidercb = obj.change
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 显示颜色选择
|
||||
* @param {object} obj
|
||||
* @private
|
||||
*/
|
||||
vm._color = function (obj) {
|
||||
vm.$set(vm, 'color', {
|
||||
items: obj.items,
|
||||
top: obj.top
|
||||
})
|
||||
vm._colorcb = obj.success
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 点击蒙版
|
||||
* @private
|
||||
*/
|
||||
vm._maskTap = function () {
|
||||
// 隐藏所有悬浮窗
|
||||
while (vm._mask.length) {
|
||||
(vm._mask.pop())()
|
||||
}
|
||||
if (vm.tooltip) {
|
||||
vm.$set(vm, 'tooltip', null)
|
||||
}
|
||||
if (vm.slider) {
|
||||
vm.$set(vm, 'slider', null)
|
||||
}
|
||||
if (vm.color) {
|
||||
vm.$set(vm, 'color', null)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 插入节点
|
||||
* @param {Object} node
|
||||
*/
|
||||
function insert (node) {
|
||||
if (vm._edit) {
|
||||
vm._edit.insert(node)
|
||||
} else {
|
||||
const nodes = vm.nodes.slice(0)
|
||||
nodes.push(node)
|
||||
vm._editVal('nodes', vm.nodes, nodes, true)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 在光标处插入指定 html 内容
|
||||
* @param {String} html 内容
|
||||
*/
|
||||
vm.insertHtml = html => {
|
||||
this.inserting = true
|
||||
const arr = new Parser(vm).parse(html)
|
||||
this.inserting = undefined
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
insert(arr[i])
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 在光标处插入图片
|
||||
*/
|
||||
vm.insertImg = function () {
|
||||
vm.getSrc && vm.getSrc('img').then(src => {
|
||||
if (typeof src === 'string') {
|
||||
src = [src]
|
||||
}
|
||||
const parser = new Parser(vm)
|
||||
for (let i = 0; i < src.length; i++) {
|
||||
insert({
|
||||
name: 'img',
|
||||
attrs: {
|
||||
src: parser.getUrl(src[i])
|
||||
}
|
||||
})
|
||||
}
|
||||
}).catch(() => { })
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 在光标处插入一个链接
|
||||
*/
|
||||
vm.insertLink = function () {
|
||||
vm.getSrc && vm.getSrc('link').then(url => {
|
||||
insert({
|
||||
name: 'a',
|
||||
attrs: {
|
||||
href: url
|
||||
},
|
||||
children: [{
|
||||
type: 'text',
|
||||
text: url
|
||||
}]
|
||||
})
|
||||
}).catch(() => { })
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 在光标处插入一个表格
|
||||
* @param {Number} rows 行数
|
||||
* @param {Number} cols 列数
|
||||
*/
|
||||
vm.insertTable = function (rows, cols) {
|
||||
const table = {
|
||||
name: 'table',
|
||||
attrs: {
|
||||
style: 'display:table;width:100%;margin:10px 0;text-align:center;border-spacing:0;border-collapse:collapse;border:1px solid gray'
|
||||
},
|
||||
children: []
|
||||
}
|
||||
for (let i = 0; i < rows; i++) {
|
||||
const tr = {
|
||||
name: 'tr',
|
||||
attrs: {},
|
||||
children: []
|
||||
}
|
||||
for (let j = 0; j < cols; j++) {
|
||||
tr.children.push({
|
||||
name: 'td',
|
||||
attrs: {
|
||||
style: 'padding:2px;border:1px solid gray'
|
||||
},
|
||||
children: [{
|
||||
type: 'text',
|
||||
text: ''
|
||||
}]
|
||||
})
|
||||
}
|
||||
table.children.push(tr)
|
||||
}
|
||||
insert(table)
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 插入视频/音频
|
||||
* @param {Object} node
|
||||
*/
|
||||
function insertMedia (node) {
|
||||
if (typeof node.src === 'string') {
|
||||
node.src = [node.src]
|
||||
}
|
||||
const parser = new Parser(vm)
|
||||
// 拼接主域名
|
||||
for (let i = 0; i < node.src.length; i++) {
|
||||
node.src[i] = parser.getUrl(node.src[i])
|
||||
}
|
||||
insert({
|
||||
name: 'div',
|
||||
attrs: {
|
||||
style: 'text-align:center'
|
||||
},
|
||||
children: [node]
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 在光标处插入一个视频
|
||||
*/
|
||||
vm.insertVideo = function () {
|
||||
vm.getSrc && vm.getSrc('video').then(src => {
|
||||
insertMedia({
|
||||
name: 'video',
|
||||
attrs: {
|
||||
controls: 'T'
|
||||
},
|
||||
children: [],
|
||||
src,
|
||||
// #ifdef APP-PLUS
|
||||
html: `<video src="${src}" style="width:100%;height:100%"></video>`
|
||||
// #endif
|
||||
})
|
||||
}).catch(() => { })
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 在光标处插入一个音频
|
||||
*/
|
||||
vm.insertAudio = function () {
|
||||
vm.getSrc && vm.getSrc('audio').then(attrs => {
|
||||
let src
|
||||
if (attrs.src) {
|
||||
src = attrs.src
|
||||
attrs.src = undefined
|
||||
} else {
|
||||
src = attrs
|
||||
attrs = {}
|
||||
}
|
||||
attrs.controls = 'T'
|
||||
insertMedia({
|
||||
name: 'audio',
|
||||
attrs,
|
||||
children: [],
|
||||
src
|
||||
})
|
||||
}).catch(() => { })
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 在光标处插入一段文本
|
||||
*/
|
||||
vm.insertText = function () {
|
||||
insert({
|
||||
name: 'p',
|
||||
attrs: {},
|
||||
children: [{
|
||||
type: 'text',
|
||||
text: ''
|
||||
}]
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 清空内容
|
||||
*/
|
||||
vm.clear = function () {
|
||||
vm._maskTap()
|
||||
vm._edit = undefined
|
||||
vm.$set(vm, 'nodes', [{
|
||||
name: 'p',
|
||||
attrs: {},
|
||||
children: [{
|
||||
type: 'text',
|
||||
text: ''
|
||||
}]
|
||||
}])
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取编辑后的 html
|
||||
*/
|
||||
vm.getContent = function () {
|
||||
let html = '';
|
||||
// 递归遍历获取
|
||||
(function traversal (nodes, table) {
|
||||
for (let i = 0; i < nodes.length; i++) {
|
||||
let item = nodes[i]
|
||||
if (item.type === 'text') {
|
||||
html += item.text.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/\n/g, '<br>').replace(/\xa0/g, ' ') // 编码实体
|
||||
} else {
|
||||
if (item.name === 'img') {
|
||||
item.attrs.i = ''
|
||||
// 还原被转换的 svg
|
||||
if ((item.attrs.src || '').includes('data:image/svg+xml;utf8,')) {
|
||||
html += item.attrs.src.substr(24).replace(/%23/g, '#').replace('<svg', '<svg style="' + (item.attrs.style || '') + '"')
|
||||
continue
|
||||
}
|
||||
} else if (item.name === 'video' || item.name === 'audio') {
|
||||
// 还原 video 和 audio 的 source
|
||||
item = JSON.parse(JSON.stringify(item))
|
||||
if (item.src.length > 1) {
|
||||
item.children = []
|
||||
for (let j = 0; j < item.src.length; j++) {
|
||||
item.children.push({
|
||||
name: 'source',
|
||||
attrs: {
|
||||
src: item.src[j]
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
item.attrs.src = item.src[0]
|
||||
}
|
||||
} else if (item.name === 'div' && (item.attrs.style || '').includes('overflow:auto') && (item.children[0] || {}).name === 'table') {
|
||||
// 还原滚动层
|
||||
item = item.children[0]
|
||||
}
|
||||
// 还原 table
|
||||
if (item.name === 'table') {
|
||||
item = JSON.parse(JSON.stringify(item))
|
||||
table = item.attrs
|
||||
if ((item.attrs.style || '').includes('display:grid')) {
|
||||
item.attrs.style = item.attrs.style.split('display:grid')[0]
|
||||
const children = [{
|
||||
name: 'tr',
|
||||
attrs: {},
|
||||
children: []
|
||||
}]
|
||||
for (let j = 0; j < item.children.length; j++) {
|
||||
item.children[j].attrs.style = item.children[j].attrs.style.replace(/grid-[^;]+;*/g, '')
|
||||
if (item.children[j].r !== children.length) {
|
||||
children.push({
|
||||
name: 'tr',
|
||||
attrs: {},
|
||||
children: [item.children[j]]
|
||||
})
|
||||
} else {
|
||||
children[children.length - 1].children.push(item.children[j])
|
||||
}
|
||||
}
|
||||
item.children = children
|
||||
}
|
||||
}
|
||||
html += '<' + item.name
|
||||
for (const attr in item.attrs) {
|
||||
let val = item.attrs[attr]
|
||||
if (!val) continue
|
||||
if (val === 'T' || val === true) {
|
||||
// bool 型省略值
|
||||
html += ' ' + attr
|
||||
continue
|
||||
} else if (item.name[0] === 't' && attr === 'style' && table) {
|
||||
// 取消为了显示 table 添加的 style
|
||||
val = val.replace(/;*display:table[^;]*/, '')
|
||||
if (table.border) {
|
||||
val = val.replace(/border[^;]+;*/g, $ => $.includes('collapse') ? $ : '')
|
||||
}
|
||||
if (table.cellpadding) {
|
||||
val = val.replace(/padding[^;]+;*/g, '')
|
||||
}
|
||||
if (!val) continue
|
||||
}
|
||||
html += ' ' + attr + '="' + val.replace(/"/g, '"') + '"'
|
||||
}
|
||||
html += '>'
|
||||
if (item.children) {
|
||||
traversal(item.children, table)
|
||||
html += '</' + item.name + '>'
|
||||
}
|
||||
}
|
||||
}
|
||||
})(vm.nodes)
|
||||
|
||||
// 其他插件处理
|
||||
for (let i = vm.plugins.length; i--;) {
|
||||
if (vm.plugins[i].onGetContent) {
|
||||
html = vm.plugins[i].onGetContent(html) || html
|
||||
}
|
||||
}
|
||||
|
||||
return html
|
||||
}
|
||||
}
|
||||
|
||||
Editable.prototype.onUpdate = function (content, config) {
|
||||
if (this.vm.editable) {
|
||||
this.vm._maskTap()
|
||||
config.entities.amp = '&'
|
||||
if (!this.inserting) {
|
||||
this.vm._edit = undefined
|
||||
if (!content) {
|
||||
setTimeout(() => {
|
||||
this.vm.$set(this.vm, 'nodes', [{
|
||||
name: 'p',
|
||||
attrs: {},
|
||||
children: [{
|
||||
type: 'text',
|
||||
text: ''
|
||||
}]
|
||||
}])
|
||||
}, 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Editable.prototype.onParse = function (node) {
|
||||
// 空白单元格可编辑
|
||||
if (this.vm.editable && (node.name === 'td' || node.name === 'th') && !this.vm.getText(node.children)) {
|
||||
node.children.push({
|
||||
type: 'text',
|
||||
text: ''
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export default Editable
|
||||
@@ -0,0 +1,596 @@
|
||||
<template>
|
||||
<view id="_root" :class="(selectable?'_select ':'')+'_root'" :style="(editable?'min-height:200px;':'')+containerStyle" @tap="_containTap">
|
||||
<slot v-if="!nodes[0]" />
|
||||
<!-- #ifndef APP-PLUS-NVUE -->
|
||||
<node v-else :childs="nodes" :opts="[lazyLoad,loadingImg,errorImg,showImgMenu,selectable,editable,placeholder,'nodes']" name="span" />
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef APP-PLUS-NVUE -->
|
||||
<web-view ref="web" src="/static/app-plus/mp-html/local.html" :style="'margin-top:-2px;height:' + height + 'px'" @onPostMessage="_onMessage" />
|
||||
<!-- #endif -->
|
||||
<view v-if="tooltip" class="_tooltip_contain" :style="'top:'+tooltip.top+'px'">
|
||||
<view class="_tooltip">
|
||||
<view v-for="(item, index) in tooltip.items" v-bind:key="index" class="_tooltip_item" :data-i="index" @tap="_tooltipTap">{{item}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="slider" class="_slider" :style="'top:'+slider.top+'px'">
|
||||
<slider :value="slider.value" :min="slider.min" :max="slider.max" handle-size="14" block-size="14" show-value activeColor="white" style="padding:3px" @changing="_sliderChanging" @change="_sliderChange" />
|
||||
</view>
|
||||
<view v-if="color" class="_tooltip_contain" :style="'top:'+color.top+'px'">
|
||||
<view class="_tooltip" style="overflow-y: hidden;">
|
||||
<view v-for="(item, index) in color.items" v-bind:key="index" class="_color_item" :style="'background-color:'+item" :data-i="index" @tap="_colorTap"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* mp-html v2.4.3
|
||||
* @description 富文本组件
|
||||
* @tutorial https://github.com/jin-yufeng/mp-html
|
||||
* @property {String} container-style 容器的样式
|
||||
* @property {String} content 用于渲染的 html 字符串
|
||||
* @property {Boolean} copy-link 是否允许外部链接被点击时自动复制
|
||||
* @property {String} domain 主域名,用于拼接链接
|
||||
* @property {String} error-img 图片出错时的占位图链接
|
||||
* @property {Boolean} lazy-load 是否开启图片懒加载
|
||||
* @property {string} loading-img 图片加载过程中的占位图链接
|
||||
* @property {Boolean} pause-video 是否在播放一个视频时自动暂停其他视频
|
||||
* @property {Boolean} preview-img 是否允许图片被点击时自动预览
|
||||
* @property {Boolean} scroll-table 是否给每个表格添加一个滚动层使其能单独横向滚动
|
||||
* @property {Boolean | String} selectable 是否开启长按复制
|
||||
* @property {Boolean} set-title 是否将 title 标签的内容设置到页面标题
|
||||
* @property {Boolean} show-img-menu 是否允许图片被长按时显示菜单
|
||||
* @property {Object} tag-style 标签的默认样式
|
||||
* @property {Boolean | Number} use-anchor 是否使用锚点链接
|
||||
* @event {Function} load dom 结构加载完毕时触发
|
||||
* @event {Function} ready 所有图片加载完毕时触发
|
||||
* @event {Function} imgtap 图片被点击时触发
|
||||
* @event {Function} linktap 链接被点击时触发
|
||||
* @event {Function} play 音视频播放时触发
|
||||
* @event {Function} error 媒体加载出错时触发
|
||||
*/
|
||||
// #ifndef APP-PLUS-NVUE
|
||||
import node from './node/node'
|
||||
// #endif
|
||||
import Parser from './parser'
|
||||
import style from './style/index.js'
|
||||
import editable from './editable/index.js'
|
||||
const plugins=[style,editable,]
|
||||
// #ifdef APP-PLUS-NVUE
|
||||
const dom = weex.requireModule('dom')
|
||||
// #endif
|
||||
export default {
|
||||
name: 'mp-html',
|
||||
data() {
|
||||
return {
|
||||
tooltip: null,
|
||||
slider: null,
|
||||
color: null,
|
||||
nodes: [],
|
||||
// #ifdef APP-PLUS-NVUE
|
||||
height: 3
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
props: {
|
||||
editable: Boolean,
|
||||
placeholder: String,
|
||||
containerStyle: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
content: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
copyLink: {
|
||||
type: [Boolean, String],
|
||||
default: true
|
||||
},
|
||||
domain: String,
|
||||
errorImg: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
lazyLoad: {
|
||||
type: [Boolean, String],
|
||||
default: false
|
||||
},
|
||||
loadingImg: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
pauseVideo: {
|
||||
type: [Boolean, String],
|
||||
default: true
|
||||
},
|
||||
previewImg: {
|
||||
type: [Boolean, String],
|
||||
default: true
|
||||
},
|
||||
scrollTable: [Boolean, String],
|
||||
selectable: [Boolean, String],
|
||||
setTitle: {
|
||||
type: [Boolean, String],
|
||||
default: true
|
||||
},
|
||||
showImgMenu: {
|
||||
type: [Boolean, String],
|
||||
default: true
|
||||
},
|
||||
tagStyle: Object,
|
||||
useAnchor: [Boolean, Number]
|
||||
},
|
||||
// #ifdef VUE3
|
||||
emits: ['load', 'ready', 'imgtap', 'linktap', 'play', 'error'],
|
||||
// #endif
|
||||
// #ifndef APP-PLUS-NVUE
|
||||
components: {
|
||||
node
|
||||
},
|
||||
// #endif
|
||||
watch: {
|
||||
editable(val) {
|
||||
this.setContent(val ? this.content : this.getContent())
|
||||
if (!val)
|
||||
this._maskTap()
|
||||
},
|
||||
content (content) {
|
||||
this.setContent(content)
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.plugins = []
|
||||
for (let i = plugins.length; i--;) {
|
||||
this.plugins.push(new plugins[i](this))
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
if ((this.content || this.editable) && !this.nodes.length) {
|
||||
this.setContent(this.content)
|
||||
}
|
||||
},
|
||||
beforeDestroy () {
|
||||
this._hook('onDetached')
|
||||
},
|
||||
methods: {
|
||||
_containTap() {
|
||||
if (!this._lock && !this.slider && !this.color) {
|
||||
this._edit = undefined
|
||||
this._maskTap()
|
||||
}
|
||||
},
|
||||
_tooltipTap(e) {
|
||||
this._tooltipcb(e.currentTarget.dataset.i)
|
||||
this.$set(this, 'tooltip', null)
|
||||
},
|
||||
_sliderChanging(e) {
|
||||
this._slideringcb(e.detail.value)
|
||||
},
|
||||
_sliderChange(e) {
|
||||
this._slidercb(e.detail.value)
|
||||
},
|
||||
_colorTap(e) {
|
||||
this._colorcb(e.currentTarget.dataset.i)
|
||||
this.$set(this, 'color', null)
|
||||
},
|
||||
/**
|
||||
* @description 将锚点跳转的范围限定在一个 scroll-view 内
|
||||
* @param {Object} page scroll-view 所在页面的示例
|
||||
* @param {String} selector scroll-view 的选择器
|
||||
* @param {String} scrollTop scroll-view scroll-top 属性绑定的变量名
|
||||
*/
|
||||
in (page, selector, scrollTop) {
|
||||
// #ifndef APP-PLUS-NVUE
|
||||
if (page && selector && scrollTop) {
|
||||
this._in = {
|
||||
page,
|
||||
selector,
|
||||
scrollTop
|
||||
}
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
|
||||
/**
|
||||
* @description 锚点跳转
|
||||
* @param {String} id 要跳转的锚点 id
|
||||
* @param {Number} offset 跳转位置的偏移量
|
||||
* @returns {Promise}
|
||||
*/
|
||||
navigateTo (id, offset) {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!this.useAnchor) {
|
||||
reject(Error('Anchor is disabled'))
|
||||
return
|
||||
}
|
||||
offset = offset || parseInt(this.useAnchor) || 0
|
||||
// #ifdef APP-PLUS-NVUE
|
||||
if (!id) {
|
||||
dom.scrollToElement(this.$refs.web, {
|
||||
offset
|
||||
})
|
||||
resolve()
|
||||
} else {
|
||||
this._navigateTo = {
|
||||
resolve,
|
||||
reject,
|
||||
offset
|
||||
}
|
||||
this.$refs.web.evalJs('uni.postMessage({data:{action:"getOffset",offset:(document.getElementById(' + id + ')||{}).offsetTop}})')
|
||||
}
|
||||
// #endif
|
||||
// #ifndef APP-PLUS-NVUE
|
||||
let deep = ' '
|
||||
// #ifdef MP-WEIXIN || MP-QQ || MP-TOUTIAO
|
||||
deep = '>>>'
|
||||
// #endif
|
||||
const selector = uni.createSelectorQuery()
|
||||
// #ifndef MP-ALIPAY
|
||||
.in(this._in ? this._in.page : this)
|
||||
// #endif
|
||||
.select((this._in ? this._in.selector : '._root') + (id ? `${deep}#${id}` : '')).boundingClientRect()
|
||||
if (this._in) {
|
||||
selector.select(this._in.selector).scrollOffset()
|
||||
.select(this._in.selector).boundingClientRect()
|
||||
} else {
|
||||
// 获取 scroll-view 的位置和滚动距离
|
||||
selector.selectViewport().scrollOffset() // 获取窗口的滚动距离
|
||||
}
|
||||
selector.exec(res => {
|
||||
if (!res[0]) {
|
||||
reject(Error('Label not found'))
|
||||
return
|
||||
}
|
||||
const scrollTop = res[1].scrollTop + res[0].top - (res[2] ? res[2].top : 0) + offset
|
||||
if (this._in) {
|
||||
// scroll-view 跳转
|
||||
this._in.page[this._in.scrollTop] = scrollTop
|
||||
} else {
|
||||
// 页面跳转
|
||||
uni.pageScrollTo({
|
||||
scrollTop,
|
||||
duration: 300
|
||||
})
|
||||
}
|
||||
resolve()
|
||||
})
|
||||
// #endif
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* @description 获取文本内容
|
||||
* @return {String}
|
||||
*/
|
||||
getText (nodes) {
|
||||
let text = '';
|
||||
(function traversal (nodes) {
|
||||
for (let i = 0; i < nodes.length; i++) {
|
||||
const node = nodes[i]
|
||||
if (node.type === 'text') {
|
||||
text += node.text.replace(/&/g, '&')
|
||||
} else if (node.name === 'br') {
|
||||
text += '\n'
|
||||
} else {
|
||||
// 块级标签前后加换行
|
||||
const isBlock = node.name === 'p' || node.name === 'div' || node.name === 'tr' || node.name === 'li' || (node.name[0] === 'h' && node.name[1] > '0' && node.name[1] < '7')
|
||||
if (isBlock && text && text[text.length - 1] !== '\n') {
|
||||
text += '\n'
|
||||
}
|
||||
// 递归获取子节点的文本
|
||||
if (node.children) {
|
||||
traversal(node.children)
|
||||
}
|
||||
if (isBlock && text[text.length - 1] !== '\n') {
|
||||
text += '\n'
|
||||
} else if (node.name === 'td' || node.name === 'th') {
|
||||
text += '\t'
|
||||
}
|
||||
}
|
||||
}
|
||||
})(nodes || this.nodes)
|
||||
return text
|
||||
},
|
||||
|
||||
/**
|
||||
* @description 获取内容大小和位置
|
||||
* @return {Promise}
|
||||
*/
|
||||
getRect () {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.createSelectorQuery()
|
||||
// #ifndef MP-ALIPAY
|
||||
.in(this)
|
||||
// #endif
|
||||
.select('#_root').boundingClientRect().exec(res => res[0] ? resolve(res[0]) : reject(Error('Root label not found')))
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* @description 暂停播放媒体
|
||||
*/
|
||||
pauseMedia () {
|
||||
for (let i = (this._videos || []).length; i--;) {
|
||||
this._videos[i].pause()
|
||||
}
|
||||
// #ifdef APP-PLUS
|
||||
const command = 'for(var e=document.getElementsByTagName("video"),i=e.length;i--;)e[i].pause()'
|
||||
// #ifndef APP-PLUS-NVUE
|
||||
let page = this.$parent
|
||||
while (!page.$scope) page = page.$parent
|
||||
page.$scope.$getAppWebview().evalJS(command)
|
||||
// #endif
|
||||
// #ifdef APP-PLUS-NVUE
|
||||
this.$refs.web.evalJs(command)
|
||||
// #endif
|
||||
// #endif
|
||||
},
|
||||
|
||||
/**
|
||||
* @description 设置媒体播放速率
|
||||
* @param {Number} rate 播放速率
|
||||
*/
|
||||
setPlaybackRate (rate) {
|
||||
this.playbackRate = rate
|
||||
for (let i = (this._videos || []).length; i--;) {
|
||||
this._videos[i].playbackRate(rate)
|
||||
}
|
||||
// #ifdef APP-PLUS
|
||||
const command = 'for(var e=document.getElementsByTagName("video"),i=e.length;i--;)e[i].playbackRate=' + rate
|
||||
// #ifndef APP-PLUS-NVUE
|
||||
let page = this.$parent
|
||||
while (!page.$scope) page = page.$parent
|
||||
page.$scope.$getAppWebview().evalJS(command)
|
||||
// #endif
|
||||
// #ifdef APP-PLUS-NVUE
|
||||
this.$refs.web.evalJs(command)
|
||||
// #endif
|
||||
// #endif
|
||||
},
|
||||
|
||||
/**
|
||||
* @description 设置内容
|
||||
* @param {String} content html 内容
|
||||
* @param {Boolean} append 是否在尾部追加
|
||||
*/
|
||||
setContent (content, append) {
|
||||
if (!append || !this.imgList) {
|
||||
this.imgList = []
|
||||
}
|
||||
const nodes = new Parser(this).parse(content)
|
||||
// #ifdef APP-PLUS-NVUE
|
||||
if (this._ready) {
|
||||
this._set(nodes, append)
|
||||
}
|
||||
// #endif
|
||||
this.$set(this, 'nodes', append ? (this.nodes || []).concat(nodes) : nodes)
|
||||
|
||||
// #ifndef APP-PLUS-NVUE
|
||||
this._videos = []
|
||||
this.$nextTick(() => {
|
||||
this._hook('onLoad')
|
||||
this.$emit('load')
|
||||
})
|
||||
|
||||
if (this.lazyLoad || this.imgList._unloadimgs < this.imgList.length / 2) {
|
||||
// 设置懒加载,每 350ms 获取高度,不变则认为加载完毕
|
||||
let height = 0
|
||||
const callback = rect => {
|
||||
if (!rect || !rect.height) rect = {}
|
||||
// 350ms 总高度无变化就触发 ready 事件
|
||||
if (rect.height === height) {
|
||||
this.$emit('ready', rect)
|
||||
} else {
|
||||
height = rect.height
|
||||
setTimeout(() => {
|
||||
this.getRect().then(callback).catch(callback)
|
||||
}, 350)
|
||||
}
|
||||
}
|
||||
this.getRect().then(callback).catch(callback)
|
||||
} else {
|
||||
// 未设置懒加载,等待所有图片加载完毕
|
||||
if (!this.imgList._unloadimgs) {
|
||||
this.getRect().then(rect => {
|
||||
this.$emit('ready', rect)
|
||||
}).catch(() => {
|
||||
this.$emit('ready', {})
|
||||
})
|
||||
}
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
|
||||
/**
|
||||
* @description 调用插件钩子函数
|
||||
*/
|
||||
_hook (name) {
|
||||
for (let i = plugins.length; i--;) {
|
||||
if (this.plugins[i][name]) {
|
||||
this.plugins[i][name]()
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// #ifdef APP-PLUS-NVUE
|
||||
/**
|
||||
* @description 设置内容
|
||||
*/
|
||||
_set (nodes, append) {
|
||||
this.$refs.web.evalJs('setContent(' + JSON.stringify(nodes).replace(/%22/g, '') + ',' + JSON.stringify([this.containerStyle.replace(/(?:margin|padding)[^;]+/g, ''), this.errorImg, this.loadingImg, this.pauseVideo, this.scrollTable, this.selectable]) + ',' + append + ')')
|
||||
},
|
||||
|
||||
/**
|
||||
* @description 接收到 web-view 消息
|
||||
*/
|
||||
_onMessage (e) {
|
||||
const message = e.detail.data[0]
|
||||
switch (message.action) {
|
||||
// web-view 初始化完毕
|
||||
case 'onJSBridgeReady':
|
||||
this._ready = true
|
||||
if (this.nodes) {
|
||||
this._set(this.nodes)
|
||||
}
|
||||
break
|
||||
// 内容 dom 加载完毕
|
||||
case 'onLoad':
|
||||
this.height = message.height
|
||||
this._hook('onLoad')
|
||||
this.$emit('load')
|
||||
break
|
||||
// 所有图片加载完毕
|
||||
case 'onReady':
|
||||
this.getRect().then(res => {
|
||||
this.$emit('ready', res)
|
||||
}).catch(() => {
|
||||
this.$emit('ready', {})
|
||||
})
|
||||
break
|
||||
// 总高度发生变化
|
||||
case 'onHeightChange':
|
||||
this.height = message.height
|
||||
break
|
||||
// 图片点击
|
||||
case 'onImgTap':
|
||||
this.$emit('imgtap', message.attrs)
|
||||
if (this.previewImg) {
|
||||
uni.previewImage({
|
||||
current: parseInt(message.attrs.i),
|
||||
urls: this.imgList
|
||||
})
|
||||
}
|
||||
break
|
||||
// 链接点击
|
||||
case 'onLinkTap': {
|
||||
const href = message.attrs.href
|
||||
this.$emit('linktap', message.attrs)
|
||||
if (href) {
|
||||
// 锚点跳转
|
||||
if (href[0] === '#') {
|
||||
if (this.useAnchor) {
|
||||
dom.scrollToElement(this.$refs.web, {
|
||||
offset: message.offset
|
||||
})
|
||||
}
|
||||
} else if (href.includes('://')) {
|
||||
// 打开外链
|
||||
if (this.copyLink) {
|
||||
plus.runtime.openWeb(href)
|
||||
}
|
||||
} else {
|
||||
vk.navigateTo({
|
||||
url: href,
|
||||
fail () {
|
||||
uni.switchTab({
|
||||
url: href
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
break
|
||||
}
|
||||
case 'onPlay':
|
||||
this.$emit('play')
|
||||
break
|
||||
// 获取到锚点的偏移量
|
||||
case 'getOffset':
|
||||
if (typeof message.offset === 'number') {
|
||||
dom.scrollToElement(this.$refs.web, {
|
||||
offset: message.offset + this._navigateTo.offset
|
||||
})
|
||||
this._navigateTo.resolve()
|
||||
} else {
|
||||
this._navigateTo.reject(Error('Label not found'))
|
||||
}
|
||||
break
|
||||
// 点击
|
||||
case 'onClick':
|
||||
this.$emit('tap')
|
||||
this.$emit('click')
|
||||
break
|
||||
// 出错
|
||||
case 'onError':
|
||||
this.$emit('error', {
|
||||
source: message.source,
|
||||
attrs: message.attrs
|
||||
})
|
||||
}
|
||||
}
|
||||
// #endif
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/* #ifndef APP-PLUS-NVUE */
|
||||
/* 根节点样式 */
|
||||
._root {
|
||||
padding: 1px 0;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
/* 长按复制 */
|
||||
._select {
|
||||
user-select: text;
|
||||
}
|
||||
/* #endif */
|
||||
|
||||
/* 提示条 */
|
||||
._tooltip_contain {
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
left: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
._tooltip {
|
||||
box-sizing: border-box;
|
||||
display: inline-block;
|
||||
width: auto;
|
||||
max-width: 100%;
|
||||
height: 30px;
|
||||
padding: 0 3px;
|
||||
overflow: scroll;
|
||||
font-size: 14px;
|
||||
line-height: 30px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
._tooltip_item {
|
||||
display: inline-block;
|
||||
width: auto;
|
||||
padding: 0 2vw;
|
||||
line-height: 30px;
|
||||
background-color: black;
|
||||
color: white;
|
||||
}
|
||||
|
||||
._color_item {
|
||||
display: inline-block;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
margin: 5px 2vw;
|
||||
border:1px solid #dfe2e5;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
/* 图片宽度滚动条 */
|
||||
._slider {
|
||||
position: absolute;
|
||||
left: 20px;
|
||||
width: 220px;
|
||||
}
|
||||
|
||||
._tooltip,
|
||||
._slider {
|
||||
background-color: black;
|
||||
border-radius: 3px;
|
||||
opacity: 0.75;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,129 @@
|
||||
/**
|
||||
* @fileoverview style 插件
|
||||
*/
|
||||
// #ifndef APP-PLUS-NVUE
|
||||
import Parser from './parser'
|
||||
// #endif
|
||||
|
||||
function Style () {
|
||||
this.styles = []
|
||||
}
|
||||
|
||||
// #ifndef APP-PLUS-NVUE
|
||||
Style.prototype.onParse = function (node, vm) {
|
||||
// 获取样式
|
||||
if (node.name === 'style' && node.children.length && node.children[0].type === 'text') {
|
||||
this.styles = this.styles.concat(new Parser().parse(node.children[0].text))
|
||||
} else if (node.name) {
|
||||
// 匹配样式(对非文本标签)
|
||||
// 存储不同优先级的样式 name < class < id < 后代
|
||||
let matched = ['', '', '', '']
|
||||
for (let i = 0, len = this.styles.length; i < len; i++) {
|
||||
const item = this.styles[i]
|
||||
let res = match(node, item.key || item.list[item.list.length - 1])
|
||||
let j
|
||||
if (res) {
|
||||
// 后代选择器
|
||||
if (!item.key) {
|
||||
j = item.list.length - 2
|
||||
for (let k = vm.stack.length; j >= 0 && k--;) {
|
||||
// 子选择器
|
||||
if (item.list[j] === '>') {
|
||||
// 错误情况
|
||||
if (j < 1 || j > item.list.length - 2) break
|
||||
if (match(vm.stack[k], item.list[j - 1])) {
|
||||
j -= 2
|
||||
} else {
|
||||
j++
|
||||
}
|
||||
} else if (match(vm.stack[k], item.list[j])) {
|
||||
j--
|
||||
}
|
||||
}
|
||||
res = 4
|
||||
}
|
||||
if (item.key || j < 0) {
|
||||
// 添加伪类
|
||||
if (item.pseudo && node.children) {
|
||||
let text
|
||||
item.style = item.style.replace(/content:([^;]+)/, (_, $1) => {
|
||||
text = $1.replace(/['"]/g, '')
|
||||
// 处理 attr 函数
|
||||
.replace(/attr\((.+?)\)/, (_, $1) => node.attrs[$1.trim()] || '')
|
||||
// 编码 \xxx
|
||||
.replace(/\\(\w{4})/, (_, $1) => String.fromCharCode(parseInt($1, 16)))
|
||||
return ''
|
||||
})
|
||||
const pseudo = {
|
||||
name: 'span',
|
||||
attrs: {
|
||||
style: item.style
|
||||
},
|
||||
children: [{
|
||||
type: 'text',
|
||||
text
|
||||
}]
|
||||
}
|
||||
if (item.pseudo === 'before') {
|
||||
node.children.unshift(pseudo)
|
||||
} else {
|
||||
node.children.push(pseudo)
|
||||
}
|
||||
} else {
|
||||
matched[res - 1] += item.style + (item.style[item.style.length - 1] === ';' ? '' : ';')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
matched = matched.join('')
|
||||
if (matched.length > 2) {
|
||||
node.attrs.style = matched + (node.attrs.style || '')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 匹配样式
|
||||
* @param {object} node 要匹配的标签
|
||||
* @param {string|string[]} keys 选择器
|
||||
* @returns {number} 0:不匹配;1:name 匹配;2:class 匹配;3:id 匹配
|
||||
*/
|
||||
function match (node, keys) {
|
||||
function matchItem (key) {
|
||||
if (key[0] === '#') {
|
||||
// 匹配 id
|
||||
if (node.attrs.id && node.attrs.id.trim() === key.substr(1)) return 3
|
||||
} else if (key[0] === '.') {
|
||||
// 匹配 class
|
||||
key = key.substr(1)
|
||||
const selectors = (node.attrs.class || '').split(' ')
|
||||
for (let i = 0; i < selectors.length; i++) {
|
||||
if (selectors[i].trim() === key) return 2
|
||||
}
|
||||
} else if (node.name === key) {
|
||||
// 匹配 name
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// 多选择器交集
|
||||
if (keys instanceof Array) {
|
||||
let res = 0
|
||||
for (let j = 0; j < keys.length; j++) {
|
||||
const tmp = matchItem(keys[j])
|
||||
// 任意一个不匹配就失败
|
||||
if (!tmp) return 0
|
||||
// 优先级最大的一个作为最终优先级
|
||||
if (tmp > res) {
|
||||
res = tmp
|
||||
}
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
return matchItem(keys)
|
||||
}
|
||||
// #endif
|
||||
|
||||
export default Style
|
||||
@@ -0,0 +1,175 @@
|
||||
const blank = {
|
||||
' ': true,
|
||||
'\n': true,
|
||||
'\t': true,
|
||||
'\r': true,
|
||||
'\f': true
|
||||
}
|
||||
|
||||
function Parser () {
|
||||
this.styles = []
|
||||
this.selectors = []
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 解析 css 字符串
|
||||
* @param {string} content css 内容
|
||||
*/
|
||||
Parser.prototype.parse = function (content) {
|
||||
new Lexer(this).parse(content)
|
||||
return this.styles
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 解析到一个选择器
|
||||
* @param {string} name 名称
|
||||
*/
|
||||
Parser.prototype.onSelector = function (name) {
|
||||
// 不支持的选择器
|
||||
if (name.includes('[') || name.includes('*') || name.includes('@')) return
|
||||
const selector = {}
|
||||
// 伪类
|
||||
if (name.includes(':')) {
|
||||
const info = name.split(':')
|
||||
const pseudo = info.pop()
|
||||
if (pseudo === 'before' || pseudo === 'after') {
|
||||
selector.pseudo = pseudo
|
||||
name = info[0]
|
||||
} else return
|
||||
}
|
||||
|
||||
// 分割交集选择器
|
||||
function splitItem (str) {
|
||||
const arr = []
|
||||
let i, start
|
||||
for (i = 1, start = 0; i < str.length; i++) {
|
||||
if (str[i] === '.' || str[i] === '#') {
|
||||
arr.push(str.substring(start, i))
|
||||
start = i
|
||||
}
|
||||
}
|
||||
if (!arr.length) {
|
||||
return str
|
||||
} else {
|
||||
arr.push(str.substring(start, i))
|
||||
return arr
|
||||
}
|
||||
}
|
||||
|
||||
// 后代选择器
|
||||
if (name.includes(' ')) {
|
||||
selector.list = []
|
||||
const list = name.split(' ')
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
if (list[i].length) {
|
||||
// 拆分子选择器
|
||||
const arr = list[i].split('>')
|
||||
for (let j = 0; j < arr.length; j++) {
|
||||
selector.list.push(splitItem(arr[j]))
|
||||
if (j < arr.length - 1) {
|
||||
selector.list.push('>')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
selector.key = splitItem(name)
|
||||
}
|
||||
|
||||
this.selectors.push(selector)
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 解析到选择器内容
|
||||
* @param {string} content 内容
|
||||
*/
|
||||
Parser.prototype.onContent = function (content) {
|
||||
// 并集选择器
|
||||
for (let i = 0; i < this.selectors.length; i++) {
|
||||
this.selectors[i].style = content
|
||||
}
|
||||
this.styles = this.styles.concat(this.selectors)
|
||||
this.selectors = []
|
||||
}
|
||||
|
||||
/**
|
||||
* @description css 词法分析器
|
||||
* @param {object} handler 高层处理器
|
||||
*/
|
||||
function Lexer (handler) {
|
||||
this.selector = ''
|
||||
this.style = ''
|
||||
this.handler = handler
|
||||
}
|
||||
|
||||
Lexer.prototype.parse = function (content) {
|
||||
this.i = 0
|
||||
this.content = content
|
||||
this.state = this.blank
|
||||
for (let len = content.length; this.i < len; this.i++) {
|
||||
this.state(content[this.i])
|
||||
}
|
||||
}
|
||||
|
||||
Lexer.prototype.comment = function () {
|
||||
this.i = this.content.indexOf('*/', this.i) + 1
|
||||
if (!this.i) {
|
||||
this.i = this.content.length
|
||||
}
|
||||
}
|
||||
|
||||
Lexer.prototype.blank = function (c) {
|
||||
if (!blank[c]) {
|
||||
if (c === '/' && this.content[this.i + 1] === '*') {
|
||||
this.comment()
|
||||
return
|
||||
}
|
||||
this.selector += c
|
||||
this.state = this.name
|
||||
}
|
||||
}
|
||||
|
||||
Lexer.prototype.name = function (c) {
|
||||
if (c === '/' && this.content[this.i + 1] === '*') {
|
||||
this.comment()
|
||||
return
|
||||
}
|
||||
if (c === '{' || c === ',' || c === ';') {
|
||||
this.handler.onSelector(this.selector.trimEnd())
|
||||
this.selector = ''
|
||||
if (c !== '{') {
|
||||
while (blank[this.content[++this.i]]);
|
||||
}
|
||||
if (this.content[this.i] === '{') {
|
||||
this.floor = 1
|
||||
this.state = this.val
|
||||
} else {
|
||||
this.selector += this.content[this.i]
|
||||
}
|
||||
} else if (blank[c]) {
|
||||
this.selector += ' '
|
||||
} else {
|
||||
this.selector += c
|
||||
}
|
||||
}
|
||||
|
||||
Lexer.prototype.val = function (c) {
|
||||
if (c === '/' && this.content[this.i + 1] === '*') {
|
||||
this.comment()
|
||||
return
|
||||
}
|
||||
if (c === '{') {
|
||||
this.floor++
|
||||
} else if (c === '}') {
|
||||
this.floor--
|
||||
if (!this.floor) {
|
||||
this.handler.onContent(this.style)
|
||||
this.style = ''
|
||||
this.state = this.blank
|
||||
return
|
||||
}
|
||||
}
|
||||
this.style += c
|
||||
}
|
||||
|
||||
export default Parser
|
||||
@@ -0,0 +1 @@
|
||||
"use strict";function t(t){for(var e=Object.create(null),n=t.attributes.length;n--;)e[t.attributes[n].name]=t.attributes[n].value;return e}function e(){a[1]&&(this.src=a[1],this.onerror=null),this.onclick=null,this.ontouchstart=null,uni.postMessage({data:{action:"onError",source:"img",attrs:t(this)}})}function n(){window.unloadimgs-=1,0===window.unloadimgs&&uni.postMessage({data:{action:"onReady"}})}function o(r,s,c){for(var d=0;d<r.length;d++)!function(){var u,l=r[d];if(l.type&&"node"!==l.type)u=document.createTextNode(l.text.replace(/&/g,"&"));else{var g=l.name;"svg"===g&&(c="http://www.w3.org/2000/svg"),"html"!==g&&"body"!==g||(g="div"),u=c?document.createElementNS(c,g):document.createElement(g);for(var p in l.attrs)u.setAttribute(p,l.attrs[p]);if(l.children&&o(l.children,u,c),"img"===g){if(window.unloadimgs+=1,u.onload=n,u.onerror=n,!u.src&&u.getAttribute("data-src")&&(u.src=u.getAttribute("data-src")),l.attrs.ignore||(u.onclick=function(e){e.stopPropagation(),uni.postMessage({data:{action:"onImgTap",attrs:t(this)}})}),a[2]){var h=new Image;h.src=u.src,u.src=a[2],h.onload=function(){u.src=this.src},h.onerror=function(){u.onerror()}}u.onerror=e}else if("a"===g)u.addEventListener("click",function(e){e.stopPropagation(),e.preventDefault();var n,o=this.getAttribute("href");o&&"#"===o[0]&&(n=(document.getElementById(o.substr(1))||{}).offsetTop),uni.postMessage({data:{action:"onLinkTap",attrs:t(this),offset:n}})},!0);else if("video"===g||"audio"===g)i.push(u),l.attrs.autoplay||l.attrs.controls||u.setAttribute("controls","true"),u.onplay=function(){if(uni.postMessage({data:{action:"onPlay"}}),a[3])for(var t=0;t<i.length;t++)i[t]!==this&&i[t].pause()},u.onerror=function(){uni.postMessage({data:{action:"onError",source:g,attrs:t(this)}})};else if("table"===g&&a[4]&&!u.style.cssText.includes("inline")){var f=document.createElement("div");f.style.overflow="auto",f.appendChild(u),u=f}else"svg"===g&&(c=void 0)}s.appendChild(u)}()}document.addEventListener("UniAppJSBridgeReady",function(){document.body.onclick=function(){return uni.postMessage({data:{action:"onClick"}})},uni.postMessage({data:{action:"onJSBridgeReady"}})});var a,i=[];window.setContent=function(t,e,n){var r=document.getElementById("content");e[0]&&(document.body.style.cssText=e[0]),e[5]||(r.style.userSelect="none"),n||(r.innerHTML="",i=[]),a=e,window.unloadimgs=0;var s=document.createDocumentFragment();o(t,s),r.appendChild(s);var c=r.scrollHeight;uni.postMessage({data:{action:"onLoad",height:c}}),window.unloadimgs||uni.postMessage({data:{action:"onReady",height:c}}),clearInterval(window.timer),window.timer=setInterval(function(){r.scrollHeight!==c&&(c=r.scrollHeight,uni.postMessage({data:{action:"onHeightChange",height:c}}))},350)},window.onunload=function(){clearInterval(window.timer)};
|
||||
@@ -0,0 +1 @@
|
||||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e=e||self).uni=n()}(this,(function(){"use strict";try{var e={};Object.defineProperty(e,"passive",{get:function(){!0}}),window.addEventListener("test-passive",null,e)}catch(e){}var n=Object.prototype.hasOwnProperty;function t(e,t){return n.call(e,t)}var i=[],a=function(e,n){var t={options:{timestamp:+new Date},name:e,arg:n};if(window.__dcloud_weex_postMessage||window.__dcloud_weex_){if("postMessage"===e){var a={data:[n]};return window.__dcloud_weex_postMessage?window.__dcloud_weex_postMessage(a):window.__dcloud_weex_.postMessage(JSON.stringify(a))}var o={type:"WEB_INVOKE_APPSERVICE",args:{data:t,webviewIds:i}};window.__dcloud_weex_postMessage?window.__dcloud_weex_postMessageToService(o):window.__dcloud_weex_.postMessageToService(JSON.stringify(o))}if(!window.plus)return window.parent.postMessage({type:"WEB_INVOKE_APPSERVICE",data:t,pageId:""},"*");if(0===i.length){var r=plus.webview.currentWebview();if(!r)throw new Error("plus.webview.currentWebview() is undefined");var d=r.parent(),s="";s=d?d.id:r.id,i.push(s)}if(plus.webview.getWebviewById("__uniapp__service"))plus.webview.postMessageToUniNView({type:"WEB_INVOKE_APPSERVICE",args:{data:t,webviewIds:i}},"__uniapp__service");else{var w=JSON.stringify(t);plus.webview.getLaunchWebview().evalJS('UniPlusBridge.subscribeHandler("'.concat("WEB_INVOKE_APPSERVICE",'",').concat(w,",").concat(JSON.stringify(i),");"))}},o={navigateTo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.url;a("navigateTo",{url:encodeURI(n)})},navigateBack:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.delta;a("navigateBack",{delta:parseInt(n)||1})},switchTab:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.url;a("switchTab",{url:encodeURI(n)})},reLaunch:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.url;a("reLaunch",{url:encodeURI(n)})},redirectTo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.url;a("redirectTo",{url:encodeURI(n)})},getEnv:function(e){window.plus?e({plus:!0}):e({h5:!0})},postMessage:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a("postMessage",e.data||{})}},r=/uni-app/i.test(navigator.userAgent),d=/Html5Plus/i.test(navigator.userAgent),s=/complete|loaded|interactive/;var w=window.my&&navigator.userAgent.indexOf("AlipayClient")>-1;var u=window.swan&&window.swan.webView&&/swan/i.test(navigator.userAgent);var c=window.qq&&window.qq.miniProgram&&/QQ/i.test(navigator.userAgent)&&/miniProgram/i.test(navigator.userAgent);var g=window.tt&&window.tt.miniProgram&&/toutiaomicroapp/i.test(navigator.userAgent);var v=window.wx&&window.wx.miniProgram&&/micromessenger/i.test(navigator.userAgent)&&/miniProgram/i.test(navigator.userAgent);var p=window.qa&&/quickapp/i.test(navigator.userAgent);for(var l,_=function(){window.UniAppJSBridge=!0,document.dispatchEvent(new CustomEvent("UniAppJSBridgeReady",{bubbles:!0,cancelable:!0}))},f=[function(e){if(r||d)return window.__dcloud_weex_postMessage||window.__dcloud_weex_?document.addEventListener("DOMContentLoaded",e):window.plus&&s.test(document.readyState)?setTimeout(e,0):document.addEventListener("plusready",e),o},function(e){if(v)return window.WeixinJSBridge&&window.WeixinJSBridge.invoke?setTimeout(e,0):document.addEventListener("WeixinJSBridgeReady",e),window.wx.miniProgram},function(e){if(c)return window.QQJSBridge&&window.QQJSBridge.invoke?setTimeout(e,0):document.addEventListener("QQJSBridgeReady",e),window.qq.miniProgram},function(e){if(w){document.addEventListener("DOMContentLoaded",e);var n=window.my;return{navigateTo:n.navigateTo,navigateBack:n.navigateBack,switchTab:n.switchTab,reLaunch:n.reLaunch,redirectTo:n.redirectTo,postMessage:n.postMessage,getEnv:n.getEnv}}},function(e){if(u)return document.addEventListener("DOMContentLoaded",e),window.swan.webView},function(e){if(g)return document.addEventListener("DOMContentLoaded",e),window.tt.miniProgram},function(e){if(p){window.QaJSBridge&&window.QaJSBridge.invoke?setTimeout(e,0):document.addEventListener("QaJSBridgeReady",e);var n=window.qa;return{navigateTo:n.navigateTo,navigateBack:n.navigateBack,switchTab:n.switchTab,reLaunch:n.reLaunch,redirectTo:n.redirectTo,postMessage:n.postMessage,getEnv:n.getEnv}}},function(e){return document.addEventListener("DOMContentLoaded",e),o}],m=0;m<f.length&&!(l=f[m](_));m++);l||(l={});var E="undefined"!=typeof uni?uni:{};if(!E.navigateTo)for(var b in l)t(l,b)&&(E[b]=l[b]);return E.webView=l,E}));
|
||||
@@ -0,0 +1 @@
|
||||
<style>._address,._article,._aside,._body,._caption,._center,._cite,._footer,._header,._html,._nav,._pre,._section{display:block}._video{width:300px;height:225px;display:inline-block;background-color:#000}</style><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"><style>body,html{width:100%;height:100%;overflow-x:scroll;overflow-y:hidden}body{margin:0}video{width:300px;height:225px}img{max-width:100%;-webkit-touch-callout:none}</style></head><body><div id="content" style="overflow:hidden"></div><script type="text/javascript" src="./js/uni.webview.min.js"></script><script type="text/javascript" src="./js/handler.js"></script></body>
|
||||
+119
@@ -0,0 +1,119 @@
|
||||
{
|
||||
"id": "vk-unicloud-admin",
|
||||
"name": "vk-unicloud-admin",
|
||||
"version": "1.17.3",
|
||||
"displayName": "【开箱即用】vk-unicloud-admin-快速开发框架-打造unicloud最好用的admin",
|
||||
"description": "vk-unicloud-admin是基于uniapp+unicloud+uni-id+vk-router+element的一套快速PC admin企业级开发框架。小白几分钟即完成一个页面CRUD。",
|
||||
"keywords": [
|
||||
"vk-unicloud-admin",
|
||||
"支持表单可视化拖拽生成代码",
|
||||
"vk云开发",
|
||||
"uniapp、uni-id、vk-unicloud-router、vk-admin、element",
|
||||
"内置众多API、工具包"
|
||||
],
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": "https://gitee.com/vk-uni/vk-unicloud-admin",
|
||||
"author": "VK",
|
||||
"license": "MIT",
|
||||
"homepage": "https://vkdoc.fsq.pub/admin/",
|
||||
"dependencies": {
|
||||
"@icon-park/vue": "^1.4.2",
|
||||
"@wangeditor/editor": "^5.1.23",
|
||||
"@wangeditor/editor-for-vue": "^1.0.2",
|
||||
"async-validator": "^4.2.5",
|
||||
"babel-helper-vue-jsx-merge-props": "^2.0.3",
|
||||
"crypto-js": "^4.2.0",
|
||||
"dayjs": "^1.11.13",
|
||||
"element-ui": "2.15.13",
|
||||
"js-md5": "^0.8.3",
|
||||
"mp-html": "^2.5.1",
|
||||
"normalize-wheel": "^1.0.1",
|
||||
"pdfjs-dist": "2.5.207",
|
||||
"request": "^2.88.2",
|
||||
"resize-observer-polyfill": "^1.5.1",
|
||||
"sortablejs": "^1.15.6",
|
||||
"throttle-debounce": "^1.1.0",
|
||||
"umy-table": "^1.1.9",
|
||||
"umy-ui": "1.1.6",
|
||||
"vk-unicloud-admin-ui": "^1.20.11",
|
||||
"vue": "^2.7.16",
|
||||
"vue-drag-verify2": "^1.2.0",
|
||||
"vue-pdf": "^4.3.0",
|
||||
"vue-resize-sensor": "^2.0.0",
|
||||
"vue-tianditu": "1.2.11",
|
||||
"vuedraggable": "^2.24.3",
|
||||
"xe-utils": "^3.7.4"
|
||||
},
|
||||
"engines": {
|
||||
"HBuilderX": "^3.1.10"
|
||||
},
|
||||
"dcloudext": {
|
||||
"sale": {
|
||||
"regular": {
|
||||
"price": "0.00"
|
||||
},
|
||||
"sourcecode": {
|
||||
"price": "0.00"
|
||||
}
|
||||
},
|
||||
"contact": {
|
||||
"qq": "370725567"
|
||||
},
|
||||
"declaration": {
|
||||
"ads": "无",
|
||||
"data": "插件不采集任何数据",
|
||||
"permissions": "无"
|
||||
},
|
||||
"npmurl": "https://vkdoc.fsq.pub/admin/",
|
||||
"type": "unicloud-template-project"
|
||||
},
|
||||
"uni_modules": {
|
||||
"platforms": {
|
||||
"cloud": {
|
||||
"tcb": "y",
|
||||
"aliyun": "y"
|
||||
},
|
||||
"client": {
|
||||
"App": {
|
||||
"app-vue": "n",
|
||||
"app-nvue": "n"
|
||||
},
|
||||
"H5-mobile": {
|
||||
"Safari": "y",
|
||||
"Android Browser": "y",
|
||||
"微信浏览器(Android)": "y",
|
||||
"QQ浏览器(Android)": "y"
|
||||
},
|
||||
"H5-pc": {
|
||||
"Chrome": "y",
|
||||
"IE": "n",
|
||||
"Edge": "y",
|
||||
"Firefox": "y",
|
||||
"Safari": "y"
|
||||
},
|
||||
"小程序": {
|
||||
"微信": "n",
|
||||
"阿里": "n",
|
||||
"百度": "n",
|
||||
"字节跳动": "n",
|
||||
"QQ": "n",
|
||||
"钉钉": "u",
|
||||
"快手": "u",
|
||||
"飞书": "u",
|
||||
"京东": "u"
|
||||
},
|
||||
"快应用": {
|
||||
"华为": "n",
|
||||
"联盟": "n"
|
||||
},
|
||||
"Vue": {
|
||||
"vue2": "y",
|
||||
"vue3": "n"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+483
@@ -0,0 +1,483 @@
|
||||
{
|
||||
"pages": [
|
||||
{
|
||||
"path": "pages/index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "金久信",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index/notice",
|
||||
"style": {
|
||||
"navigationBarTitleText": "消息",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/user/user",
|
||||
"style": {
|
||||
"navigationBarTitleText": "个人中心",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/user/buyer",
|
||||
"style": {
|
||||
"navigationBarTitleText": "买家中心",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/user/seller",
|
||||
"style": {
|
||||
"navigationBarTitleText": "卖家中心",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/user/grade",
|
||||
"style": {
|
||||
"navigationBarTitleText": "升级会员",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/login/login",
|
||||
"style": {
|
||||
"navigationBarTitleText": "登录",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/login/wechat",
|
||||
"style": {
|
||||
"navigationBarTitleText": "微信登录",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/login/register",
|
||||
"style": {
|
||||
"navigationBarTitleText": "注册",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/login/forget",
|
||||
"style": {
|
||||
"navigationBarTitleText": "找回密码",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/self/self",
|
||||
"style": {
|
||||
"navigationBarTitleText": "金久信自营",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/self/make",
|
||||
"style": {
|
||||
"navigationBarTitleText": "下询价单",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/self/list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的询价",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/self/companyQuote",
|
||||
"style": {
|
||||
"navigationBarTitleText": "考察公司",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/self/productQuote",
|
||||
"style": {
|
||||
"navigationBarTitleText": "监督检测化验服务",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/self/costQuote",
|
||||
"style": {
|
||||
"navigationBarTitleText": "造价询价服务",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/self/makeQuote",
|
||||
"style": {
|
||||
"navigationBarTitleText": "金久信自营报价",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/self/supportIndex",
|
||||
"style": {
|
||||
"navigationBarTitleText": "平台服务",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/goods/goods",
|
||||
"style": {
|
||||
"navigationBarTitleText": "现货市场",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/goods/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "现货详情",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/goods/publish",
|
||||
"style": {
|
||||
"navigationBarTitleText": "发布现货",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/goods/apply",
|
||||
"style": {
|
||||
"navigationBarTitleText": "申请合作",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/goods/my",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的现货",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/work/work",
|
||||
"style": {
|
||||
"navigationBarTitleText": "找加工",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/work/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "加工单详情",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/work/publish",
|
||||
"style": {
|
||||
"navigationBarTitleText": "发布加工单",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/work/apply",
|
||||
"style": {
|
||||
"navigationBarTitleText": "申请加工",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/work/factoryList",
|
||||
"style": {
|
||||
"navigationBarTitleText": "加工厂列表",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/work/factory",
|
||||
"style": {
|
||||
"navigationBarTitleText": "加工厂信息",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/work/myQuote",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的报价",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/work/my",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的报加工价",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/price/price",
|
||||
"style": {
|
||||
"navigationBarTitleText": "下询价单",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/price/publish",
|
||||
"style": {
|
||||
"navigationBarTitleText": "发布询价单",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/price/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "询价单详情",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/price/apply1",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我要报价-批量上传",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/price/apply2",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我要报价-手动填写",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/price/my",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的找供应",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/price/myQuote",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的报价",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/junk/junk",
|
||||
"style": {
|
||||
"navigationBarTitleText": "旧货交易",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/junk/list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "旧货交易",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/junk/publish",
|
||||
"style": {
|
||||
"navigationBarTitleText": "旧货发布",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/junk/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "旧货详情",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/junk/apply",
|
||||
"style": {
|
||||
"navigationBarTitleText": "旧货报价",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/junk/my",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的旧货",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/junk/myQuote",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的旧货报价",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/yellow/yellow",
|
||||
"style": {
|
||||
"navigationBarTitleText": "金久信黄页",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/yellow/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "金久信黄页详情",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/school/school",
|
||||
"style": {
|
||||
"navigationBarTitleText": "金久信学堂",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/school/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "金久信学堂",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/school/list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "金久信学堂",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/school/add",
|
||||
"style": {
|
||||
"navigationBarTitleText": "金久信学堂",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/shop/shop",
|
||||
"style": {
|
||||
"navigationBarTitleText": "特产商城",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/shop/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "商品详情",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/shop/cart",
|
||||
"style": {
|
||||
"navigationBarTitleText": "购物车",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/shop/order",
|
||||
"style": {
|
||||
"navigationBarTitleText": "订单",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/shop/pay",
|
||||
"style": {
|
||||
"navigationBarTitleText": "支付",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/public/sign",
|
||||
"style": {
|
||||
"navigationBarTitleText": "签约宝",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/public/contract",
|
||||
"style": {
|
||||
"navigationBarTitleText": "合同管理",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/public/create",
|
||||
"style": {
|
||||
"navigationBarTitleText": "创建合同",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/public/certificate",
|
||||
"style": {
|
||||
"navigationBarTitleText": "出证申请",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/article/info",
|
||||
"style": {
|
||||
"navigationBarTitleText": "文章详情",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/article/list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "文章列表",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tabBar": {
|
||||
"color": "#c8c8c8",
|
||||
"selectedColor": "#2664AC",
|
||||
"borderStyle": "white",
|
||||
"backgroundColor": "#ffffff",
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/index/index",
|
||||
"iconPath": "static/tabBar/tabBar_1.png",
|
||||
"selectedIconPath": "static/tabBar/tabBar_active_1.png",
|
||||
"text": "首页"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/index/notice",
|
||||
"iconPath": "static/tabBar/message.png",
|
||||
"selectedIconPath": "static/tabBar/message-selected.png",
|
||||
"text": "消息"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/user/user",
|
||||
"iconPath": "static/tabBar/tabBar_2.png",
|
||||
"selectedIconPath": "static/tabBar/tabBar_active_2.png",
|
||||
"text": "我的"
|
||||
}
|
||||
]
|
||||
},
|
||||
"globalStyle": {
|
||||
"navigationBarTextStyle": "white",
|
||||
"navigationBarTitleText": "金久信",
|
||||
"navigationBarBackgroundColor": "#A92924",
|
||||
"backgroundColor": "#A92924",
|
||||
"rpxCalcMaxDeviceWidth": 750,
|
||||
"rpxCalcBaseDeviceWidth": 375,
|
||||
"rpxCalcIncludeWidth": 750,
|
||||
"maxWidth": 750
|
||||
},
|
||||
"uniIdRouter": {}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<template>
|
||||
<view>
|
||||
<u-sticky offset-top="0" customNavHeight="0">
|
||||
<!-- 顶部 -->
|
||||
<uititle title="文章详情"></uititle>
|
||||
</u-sticky>
|
||||
<view class="m-a bg-white p-30">
|
||||
<view class="text-50 font-bold">{{ info.name }}</view>
|
||||
<view class="mt-20 text-gray text-28 pb-20 border-bottom">{{ info._add_time_str }}</view>
|
||||
<view v-html="info.content" class="mt-20"></view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uititle from "@/components/common/title.vue";
|
||||
|
||||
export default {
|
||||
name: "detail",
|
||||
components: {uititle},
|
||||
data() {
|
||||
return {
|
||||
info: {
|
||||
name: '',
|
||||
content: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.id) this.getInfo(option.id);
|
||||
},
|
||||
methods: {
|
||||
async getInfo(id) {
|
||||
const res = await vk.callFunction({
|
||||
url: `client/otherArticle/list/pub/getDetail`,
|
||||
data: {id}
|
||||
});
|
||||
this.info = res
|
||||
const regex = new RegExp('img','gi')
|
||||
this.info.content = this.info.content.replace(regex,`img style="max-width:100%;"`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
img {
|
||||
width: 100% !important;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,65 @@
|
||||
<template>
|
||||
<view>
|
||||
<u-sticky offset-top="0" customNavHeight="0">
|
||||
<!-- 顶部 -->
|
||||
<uititle title="文章列表"></uititle>
|
||||
</u-sticky>
|
||||
<view class="p-40">
|
||||
<view v-for="(item, index) in list" :key="index"
|
||||
@click="navTo(item._id)"
|
||||
class="p-30 border-bottom flex justify-start flex-col items-start bg-white">
|
||||
<text class="font-bold">{{ item.name }}</text>
|
||||
<text class="text-gray">{{ item._add_time_str }}</text>
|
||||
</view>
|
||||
<!-- <view class="text-center">-->
|
||||
<!-- <el-pagination-->
|
||||
<!-- :page-size="pageSize"-->
|
||||
<!-- @current-change="getList"-->
|
||||
<!-- background-->
|
||||
<!-- layout="prev, pager, next"-->
|
||||
<!-- :total="total">-->
|
||||
<!-- </el-pagination>-->
|
||||
<!-- </view>-->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uititle from "@/components/common/title.vue";
|
||||
|
||||
export default {
|
||||
name: "list",
|
||||
components: {uititle},
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
parentId: null,
|
||||
pageSize: 500,
|
||||
total: 0,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getList(pageIndex) {
|
||||
vk.callFunction({
|
||||
url: 'client/otherArticle/list/pub/getList',
|
||||
pageSize: this.pageSize,
|
||||
pageIndex,
|
||||
data: {
|
||||
parentId: this.parentId
|
||||
},
|
||||
success: res => {
|
||||
this.list = res.rows;
|
||||
this.total = res.total;
|
||||
}
|
||||
})
|
||||
},
|
||||
navTo(id) {
|
||||
vk.navigateTo(`/pages/article/info?id=${id}`)
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
if (options) this.parentId = options.id;
|
||||
this.getList();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,193 @@
|
||||
<template> <!-- 现货市场-申请合作(企业和个人可共用页面) -->
|
||||
<view class="wrap">
|
||||
<!-- 吸顶 -->
|
||||
<u-sticky offset-top="0" customNavHeight="0">
|
||||
<!-- 顶部 -->
|
||||
<uititle title="申请合作"></uititle>
|
||||
</u-sticky>
|
||||
<view class="layout layout-title m-top-20">填写合作信息</view>
|
||||
<view class="layout layout-apply m-top-10 bg-white">
|
||||
<view class="group flex align-center" v-if="userInfo.accountType === 2">
|
||||
<view class="lb need m-right-30">企业名称:</view>
|
||||
<view class="vl flex-1">
|
||||
<input class="input" type="text" placeholder="请输入内容" v-model="formData.companyName"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center">
|
||||
<view class="lb need m-right-30">联系人姓名:</view>
|
||||
<view class="vl flex-1">
|
||||
<input class="input" type="text" placeholder="请输入内容" v-model="formData.name"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center">
|
||||
<view class="lb need m-right-30">联系人电话:</view>
|
||||
<view class="vl flex-1">
|
||||
<input class="input" type="text" placeholder="请输入内容" v-model="formData.mobile"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center">
|
||||
<view class="lb need m-right-30">合作留言:</view>
|
||||
<view class="vl flex-1">
|
||||
<input class="input" type="text" placeholder="请输入内容" v-model="formData.remark"/>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="flex justify-between align-center m-top-20">-->
|
||||
<!-- <view class="before">是否对以上信息进行详细核实</view>-->
|
||||
<!-- <radio-group class="flex justify-between align-center" @change="radioChange">-->
|
||||
<!-- <label class="m-left-30" v-for="(item, index) in radioEnum" :key="item.value">-->
|
||||
<!-- <radio :value="item.value" color="#A92924" :checked="index === current"-->
|
||||
<!-- style="transform:scale(0.7)"/>-->
|
||||
<!-- <text class="before">{{ item.name }}</text>-->
|
||||
<!-- </label>-->
|
||||
<!-- </radio-group>-->
|
||||
<!-- </view>-->
|
||||
<view class="group flex align-center">
|
||||
<view class="lb need m-right-30">附件:</view>
|
||||
<view class="flex-1">
|
||||
<u-upload
|
||||
:fileList="formData.files"
|
||||
@afterRead="afterRead"
|
||||
@delete="deletePic"
|
||||
accept="file"
|
||||
:maxCount="10"
|
||||
multiple
|
||||
>
|
||||
</u-upload>
|
||||
</view>
|
||||
</view>
|
||||
<u-button class="public-btn" text="提交" @click="addCoop"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uititle from '@/components/common/title'
|
||||
import dayjs from "dayjs";
|
||||
import md5 from "js-md5";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
uititle,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
current: 0,
|
||||
radioEnum: [
|
||||
{value: 0, name: '是',},
|
||||
{value: 0, name: '否',}
|
||||
],
|
||||
formData: {
|
||||
goodsId: null,
|
||||
goodsUserId: null,
|
||||
companyName: '',
|
||||
name: '',
|
||||
mobile: '',
|
||||
remark: '',
|
||||
files: []
|
||||
},
|
||||
userInfo: null
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
afterRead({file}) {
|
||||
for (let i = 0; i < file.length; i++) {
|
||||
const item = file[i]
|
||||
const suffix = item.name.split('.').pop()
|
||||
uniCloud.uploadFile({
|
||||
filePath: item.url,
|
||||
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + md5(item.name + Date.now().toString()) + `.${suffix}`,
|
||||
success: ({fileID}) => {
|
||||
uniCloud.getTempFileURL({
|
||||
fileList: [fileID]
|
||||
}).then(res => {
|
||||
this.formData.files.push({url: res.fileList[0].tempFileURL})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
deletePic({index}) {
|
||||
this.formData.files.splice(index, 1)
|
||||
},
|
||||
addCoop() {
|
||||
if (!this.formData.name) return this.$message.error('请填写联系人姓名')
|
||||
if (!this.formData.mobile) return this.$message.error('请填写联系方式')
|
||||
if (this.formData.files) this.formData.files = this.formData.files.map(item => item.url)
|
||||
vk.callFunction({
|
||||
url: 'client/spot/goods/kh/addCooperate',
|
||||
data: this.formData
|
||||
})
|
||||
this.$message.success('提交成功')
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1500)
|
||||
},
|
||||
},
|
||||
onLoad({id, userId}) {
|
||||
this.formData.goodsId = id
|
||||
this.formData.goodsUserId = userId
|
||||
this.userInfo = vk.getStorageSync('uni_id_user_info')
|
||||
if (this.userInfo.accountType === 1) {
|
||||
this.formData.name = this.userInfo.person.personName
|
||||
this.formData.mobile = this.userInfo.person.mobile
|
||||
} else {
|
||||
this.formData.companyName = this.userInfo.company.companyName
|
||||
this.formData.mobile = this.userInfo.company.mobile
|
||||
if (this.userInfo.manager) this.formData.name = this.userInfo.manager.personName
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.public-btn {
|
||||
width: 95%;
|
||||
margin-top: 60rpx;
|
||||
color: #ffffff;
|
||||
background: #A92924;
|
||||
}
|
||||
|
||||
.layout-title {
|
||||
padding: 20rpx 30rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
line-height: 44rpx;
|
||||
color: #A92924;
|
||||
}
|
||||
|
||||
.layout-apply {
|
||||
margin: 20rpx 30rpx;
|
||||
padding: 50rpx 20rpx;
|
||||
border-radius: 18rpx;
|
||||
}
|
||||
|
||||
.group {
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
|
||||
.lb {
|
||||
position: relative;
|
||||
width: 180rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
color: #666666;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.vl {
|
||||
padding: 12rpx 20rpx;
|
||||
border: 1px solid #f2f2f2;
|
||||
}
|
||||
|
||||
.input {
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
color: #101010;
|
||||
}
|
||||
|
||||
.before {
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
color: #333333;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,405 @@
|
||||
<template> <!-- 现货详情 -->
|
||||
<view class="wrap">
|
||||
<!-- 吸顶 -->
|
||||
<u-sticky offset-top="0" customNavHeight="0">
|
||||
<!-- 顶部 -->
|
||||
<uiheader></uiheader>
|
||||
</u-sticky>
|
||||
<!-- 内容 -->
|
||||
<view class="layout layout-detail" v-if="product">
|
||||
<view class="company flex m-top-20" v-if="product.user">
|
||||
<view class="logo">
|
||||
<image class="full" v-if="product.user.businessCard && product.user.businessCard.logo"
|
||||
:src="product.user.businessCard.logo" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="info flex-1 p-left-20">
|
||||
<view class="name flex justify-start align-center">
|
||||
<view class="name-text">
|
||||
{{ product.user.accountType === 2 ? product.user.company.companyName : product.user.person.personName }}
|
||||
</view>
|
||||
<!-- 认证图标 -->
|
||||
<!-- <view class="name-icon m-left-20">-->
|
||||
<!-- <image class="full" src="/static/img/idente.png" mode=""></image>-->
|
||||
<!-- </view>-->
|
||||
</view>
|
||||
<view class="zhu" v-if="product.user.accountType === 2">
|
||||
主营业务:{{
|
||||
(product.user.company.mainSpotCategory && product.user.company.mainSpotCategory.length > 0) ? product.user.company.mainSpotCategory.join() : ''
|
||||
}}
|
||||
</view>
|
||||
<view class="flex justify-between items-center">
|
||||
<view class="zhu">
|
||||
{{ product._add_time_str }} 发布
|
||||
</view>
|
||||
<view class="ml-20">
|
||||
<u-button size="mini" plain type="primary" @click="$jump(`/pages/yellow/detail?id=${product.user._id}`)">
|
||||
查看主页
|
||||
</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-title m-top-30">现货详情</view>
|
||||
<view class="detail m-top-20">
|
||||
<view class="detail-title">{{ product.name }}</view>
|
||||
<view class="detail-text">库存 :{{ parseInt(product.stock) }}吨</view>
|
||||
<view class="detail-text">供货地:{{
|
||||
product.address.province.name + "-" + product.address.city.name + "-" + product.address.area.name
|
||||
}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-body">
|
||||
<view class="card-title m-top-30">报价有效期</view>
|
||||
<view class="detail-text">截止: {{
|
||||
dayjs(product.answerEndTime).format('YYYY-MM-DD HH:mm:ss')
|
||||
}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-title m-top-30">产品规格单价</view>
|
||||
<view class="m-top-20">
|
||||
<file-type v-for="(item, index) in product.files" :key="index" :item="item"/>
|
||||
</view>
|
||||
<view class="card-title m-top-30">产品现场图片</view>
|
||||
<view class="m-top-20">
|
||||
<file-type v-for="(item, index) in product.images" :key="index" :item="item"/>
|
||||
</view>
|
||||
<view class="card-title m-top-30">已收到的合作申请</view>
|
||||
<view class="table-box m-top-30">
|
||||
<!-- <view class="thead">-->
|
||||
<!-- <view class="tr">-->
|
||||
<!-- <view class="th">企业</view>-->
|
||||
<!-- <view class="th">申请人</view>-->
|
||||
<!-- <view class="th">联系方式</view>-->
|
||||
<!-- <view class="th">合作留言</view>-->
|
||||
<!-- <view class="th">申请时间</view>-->
|
||||
<!-- </view>-->
|
||||
<!-- </view>-->
|
||||
<!-- <view class="tbody">-->
|
||||
<!-- <view class="flex" v-for="(item, index) in product.cooperateList" :key="index">-->
|
||||
<!-- <view class="w-25p td-n">{{-->
|
||||
<!-- item.user.accountType === 2 ? item.user.company.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6") : item.user.person.personName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6")-->
|
||||
<!-- }}-->
|
||||
<!-- </view>-->
|
||||
<!-- <view class="w-25p td-n">{{ item.name }}</view>-->
|
||||
<!-- <view class="w-25p td-n">-->
|
||||
<!-- <text class="u-line-2">{{ item.mobile }}</text>-->
|
||||
<!-- </view>-->
|
||||
<!-- <view class="w-25p td-n u-line-2">{{ item.remark }}</view>-->
|
||||
<!-- <view class="w-25p td-n">{{ item._add_time_str }}</view>-->
|
||||
<!-- </view>-->
|
||||
<!-- </view>-->
|
||||
<view class="flex justify-start items-start flex-col mb-25 border rounded p-20 "
|
||||
style="border-style: dashed" v-for="(item, index) in product.cooperateList" :key="index">
|
||||
<p class="mb-10" v-if="item.user.accountType === 2">企业: {{
|
||||
item.user.accountType === 2 ? item.user.company.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6") : item.user.person.personName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6")
|
||||
}}</p>
|
||||
<p class="mb-10">申请人: {{ item.name }}</p>
|
||||
<!-- <p class="mb-10">联系方式: {{ item.mobile }}</p>-->
|
||||
<p class="mb-10">联系方式: ********</p>
|
||||
<p class="mb-10">合作留言: {{ item.remark }}</p>
|
||||
<view class="mb-10 flex justify-start " v-if="product.isMine">
|
||||
<text>附件:</text>
|
||||
<file-type v-for="(file, fileIndex) in item.files" class="mx-15" :item="file" :key="fileIndex"/>
|
||||
</view>
|
||||
<p class="mb-10">申请时间: {{ item._add_time_str }}</p>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 底部 -->
|
||||
<view class="fiexd-bottom flex justify-between align-center bg-white">
|
||||
<u-icon name="integral" color="#A92924" size="26"></u-icon>
|
||||
<view class="text red flex-1 m-left-20">{{ product.cooperateList.length }}家已经申请合作</view>
|
||||
<view class="apply-btn" @click="toCooperate" v-if="userInfo._id !== product.userId">申请合作</view>
|
||||
</view>
|
||||
<!-- 弹出窗 -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uiheader from '@/components/index/header'
|
||||
import FileType from "@/components/file-type/file-type.vue";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
FileType,
|
||||
uiheader,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isPopup: false,
|
||||
product: null,
|
||||
allChildCate: [],
|
||||
userInfo: null
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
dayjs,
|
||||
getCategoryTreeData(id) {
|
||||
vk.callFunction({
|
||||
url: 'client/spot/category/pub/getTree',
|
||||
title: '请求中...',
|
||||
data: {},
|
||||
success: (data) => {
|
||||
this.allChildCate = []
|
||||
data.rows.forEach(item => {
|
||||
item.children.forEach(child => {
|
||||
this.allChildCate.push(child)
|
||||
})
|
||||
})
|
||||
this.getInfo(id)
|
||||
}
|
||||
});
|
||||
},
|
||||
applyLink() {
|
||||
uni.$u.route('/pages/goods/apply', {
|
||||
id: 0,
|
||||
});
|
||||
},
|
||||
getInfo(_id) {
|
||||
vk.callFunction({
|
||||
url: 'client/spot/goods/pub/getDetail',
|
||||
title: '请求中...',
|
||||
data: {
|
||||
_id,
|
||||
},
|
||||
success: (data) => {
|
||||
this.product = data.data
|
||||
this.product.user.company.mainSpotCategory = []
|
||||
if (this.product.user.company && this.product.user.company.mainSpotCategoryIds) {
|
||||
this.allChildCate.forEach(child => {
|
||||
if (this.product.user.company.mainSpotCategoryIds.includes(child._id)) {
|
||||
this.product.user.company.mainSpotCategory.push(child.name)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
async toCooperate() {
|
||||
const {userInfo, accountNum} = await vk.callFunction({
|
||||
url: 'user/kh/getMyUserInfo'
|
||||
})
|
||||
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您尚未认证, 是否前往认证?',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 0)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请完善名片信息',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 1)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else if (accountNum === 0) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请先到个人中心添加收款账户',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 7)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
vk.navigateTo({url: `/pages/goods/apply?id=${this.product._id}&userId=${this.product.userId}`});
|
||||
}
|
||||
},
|
||||
},
|
||||
onLoad({id}) {
|
||||
this.userInfo = vk.getStorageSync('uni_id_user_info')
|
||||
this.getCategoryTreeData(id)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
padding-bottom: 150rpx;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
position: relative;
|
||||
padding-left: 20rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
line-height: 48rpx;
|
||||
color: #A92924;
|
||||
|
||||
&:before {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
z-index: 9;
|
||||
margin-top: -14rpx;
|
||||
content: '';
|
||||
width: 6rpx;
|
||||
height: 28rpx;
|
||||
background: #A92924;
|
||||
}
|
||||
|
||||
.more {
|
||||
font-size: 24rpx;
|
||||
font-weight: normal;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.layout-detail {
|
||||
padding: 20rpx 30rpx;
|
||||
}
|
||||
|
||||
.company {
|
||||
padding-bottom: 40rpx;
|
||||
border-bottom: 1px solid #f2f2f2;
|
||||
|
||||
.logo {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
}
|
||||
|
||||
.name-text {
|
||||
//max-width: 380rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
line-height: 40rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.name-icon {
|
||||
width: 80rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
|
||||
.zhu {
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 32rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.detail-title {
|
||||
font-size: 26rpx;
|
||||
font-weight: 600;
|
||||
line-height: 40rpx;
|
||||
color: #101010;
|
||||
}
|
||||
|
||||
.detail-text {
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.fiexd-bottom {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
z-index: 99;
|
||||
width: 100%;
|
||||
height: 130rpx;
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
border-top: 1px solid #f2f2f2;
|
||||
|
||||
.text {
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
||||
.apply-btn {
|
||||
width: 220rpx;
|
||||
height: 70rpx;
|
||||
font-size: 26rpx;
|
||||
line-height: 70rpx;
|
||||
text-align: center;
|
||||
color: #ffffff;
|
||||
background: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.table-box {
|
||||
font-size: 24rpx;
|
||||
line-height: 28rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.tr {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.th {
|
||||
color: #666 !important;
|
||||
background: #FFF8F2;
|
||||
}
|
||||
|
||||
.th, .td {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 50%;
|
||||
height: 76rpx;
|
||||
color: #999;
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
border-left: 1px solid #f2f2f2;
|
||||
border-right: 1px solid #f2f2f2;
|
||||
border-bottom: 1px solid #f2f2f2;
|
||||
}
|
||||
|
||||
.td-n {
|
||||
//height: 70rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-right: 1px solid #f2f2f2;
|
||||
border-bottom: 1px solid #f2f2f2;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.td-3 {
|
||||
width: 33.33%;
|
||||
}
|
||||
|
||||
.popup-box {
|
||||
padding: 20rpx 20rpx;
|
||||
}
|
||||
|
||||
.popup-title {
|
||||
padding: 18rpx 0;
|
||||
border-bottom: 1px solid #A92924;
|
||||
|
||||
.title {
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
color: #A92924;
|
||||
}
|
||||
|
||||
.close {
|
||||
width: 80rpx;
|
||||
height: 40rpx;
|
||||
font-size: 22rpx;
|
||||
line-height: 40rpx;
|
||||
text-align: center;
|
||||
color: #ffffff;
|
||||
background: #A92924;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,423 @@
|
||||
<template> <!-- 现货市场 -->
|
||||
<view class="wrap">
|
||||
<!-- 吸顶 -->
|
||||
<u-sticky offset-top="0" customNavHeight="0">
|
||||
<!-- 顶部 -->
|
||||
<uiheader title="现货市场"></uiheader>
|
||||
<!-- 搜索栏 -->
|
||||
<cmsearch :k="keyword" @search="afterSearch"></cmsearch>
|
||||
<!-- 轮播图-传值:list="数组" -->
|
||||
<cmswiper page="spot" height="320rpx"></cmswiper>
|
||||
<!-- 选择器 -->
|
||||
<view class="bg-white p-20 flex justify-center items-center">
|
||||
<view class="flex-1 mx-20">
|
||||
<u-button type="primary" shape="circle" size="mini" @click="toRelease">发布现货</u-button>
|
||||
</view>
|
||||
<view class="flex-1 mx-20">
|
||||
<u-button type="primary" shape="circle" size="mini" plain @click="toMy">我的现货</u-button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="layout-pick flex justify-between align-center bg-white">
|
||||
<view class="ip down" @click="isPick=true">现货类型:{{ pickValue }}</view>
|
||||
<view class="ip down" @click="showAddress">供货地:{{ locationValue }}</view>
|
||||
</view>
|
||||
</u-sticky>
|
||||
<!-- 列表数据 -->
|
||||
<view class="layout-goods">
|
||||
<view class="goods-box p-top-10">
|
||||
<uiswiper :ad="9" :category-id="cateId" :category-ids="cateId ? [cateId] : []" :region="region"
|
||||
padding="10rpx 0"></uiswiper>
|
||||
<uiswiper :ad="10" :category-id="cateId" :category-ids="cateId ? [cateId] : []" :region="region"
|
||||
padding="10rpx 0"></uiswiper>
|
||||
<view class="item bg-white" @click="detailLink(item._id)" v-for="(item, index) in goodsData.rows"
|
||||
:key="index">
|
||||
<view class="top" v-if="item.isTop">特别推荐</view>
|
||||
<view class="top" v-if="!item.isTop && index < 10">最新</view>
|
||||
<view class="askfor">立即查看</view>
|
||||
<view class="title text-single">{{ item.name }}</view>
|
||||
<view class="text m-top-10">
|
||||
<text class="red">库存:{{ parseInt(item.stock) }}吨</text>
|
||||
</view>
|
||||
<view class="text">供货地:{{ item.address.province.name }}-{{
|
||||
item.address.city.name
|
||||
}}-{{ item.address.area.name }}
|
||||
</view>
|
||||
<view class="flex justify-between align-center">
|
||||
<view class="company flex justify-center align-center flex-nowrap">
|
||||
<view class="text flex-1 text-single" v-if="item.user && item.user.company">
|
||||
<template v-if="item.user">
|
||||
<text v-if="item.user.accountType === 1">{{
|
||||
item.user.person.personName.replace(/^(.).*$/, "$1**")
|
||||
}}
|
||||
</text>
|
||||
<text v-if="item.user.accountType === 2">{{
|
||||
item.user.company.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6")
|
||||
}}
|
||||
</text>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="date">{{ item._add_time_str }} 更新</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 没有数据 -->
|
||||
<cmempty></cmempty>
|
||||
<!-- 按钮 -->
|
||||
<!-- <view class="issue" @click="toRelease">-->
|
||||
<!-- <u-icon name="plus" color="#fff" size="24"></u-icon>-->
|
||||
<!-- </view>-->
|
||||
<!-- <view class="my" @click="toMy">-->
|
||||
<!-- <u-icon name="account" color="#A92924" size="24"></u-icon>-->
|
||||
<!-- </view>-->
|
||||
<!-- 选择器 -->
|
||||
<u-picker v-if="isPick" :show="isPick" :columns="[categoryTreeData, categoryTreeData[cateIndex[0]].children]"
|
||||
key-name="name" @confirm="handConfirmPick" @change="handleChangeCate" @cancel="isPick = false">
|
||||
<template #more>
|
||||
<text @click="resetCate">重置</text>
|
||||
</template>
|
||||
</u-picker>
|
||||
<AddressSelect ref="AddressSelect" @confirm="regionConfirm"/>
|
||||
<collapse></collapse>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uiheader from '@/components/index/header'
|
||||
import cmsearch from '@/components/common/search'
|
||||
import cmempty from '@/components/common/empty'
|
||||
import cmswiper from '@/components/common/swiper'
|
||||
import AddressSelect from "@/components/AddressSelect.vue";
|
||||
import Collapse from "@/components/index/collapse.vue";
|
||||
import uiswiper from "@/components/index/swiper.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
uiswiper,
|
||||
Collapse,
|
||||
AddressSelect,
|
||||
uiheader,
|
||||
cmsearch,
|
||||
cmempty,
|
||||
cmswiper,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isLogin: false,
|
||||
sex: '',
|
||||
isPick: false,
|
||||
pickValue: '全部',
|
||||
isLocation: false,
|
||||
locationValue: '全国',
|
||||
region: {
|
||||
province: {
|
||||
code: null,
|
||||
name: null,
|
||||
}
|
||||
},
|
||||
pageSize: 500,
|
||||
goodsData: {
|
||||
rows: []
|
||||
},
|
||||
keyword: '',
|
||||
categoryTreeData: [],
|
||||
cateIndex: [0, 0],
|
||||
cateId: null,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
getCategoryTreeData() {
|
||||
vk.callFunction({
|
||||
url: 'client/spot/category/pub/getTree',
|
||||
data: {},
|
||||
success: (data) => {
|
||||
this.categoryTreeData = data.rows
|
||||
}
|
||||
});
|
||||
},
|
||||
showAddress() {
|
||||
this.$refs.AddressSelect.open(this.region, 1, true);
|
||||
},
|
||||
regionConfirm({province}) {
|
||||
this.region = {province}
|
||||
this.locationValue = `${province.name}`
|
||||
this.search(1)
|
||||
},
|
||||
detailLink(id) {
|
||||
vk.navigateTo(`/pages/goods/detail?id=${id}`);
|
||||
},
|
||||
handleChangeCate({indexs}) {
|
||||
this.cateIndex = indexs
|
||||
},
|
||||
handConfirmPick({value}) {
|
||||
this.pickValue = value[1].name
|
||||
this.cateId = value[1]._id
|
||||
this.isPick = false
|
||||
this.search(1)
|
||||
},
|
||||
resetCate() {
|
||||
this.cateIndex = [0, 0]
|
||||
this.pickValue = '全部'
|
||||
this.cateId = null
|
||||
this.isPick = false
|
||||
this.search(1)
|
||||
},
|
||||
async toRelease() {
|
||||
const {userInfo, accountNum} = await vk.callFunction({
|
||||
url: 'user/kh/getMyUserInfo'
|
||||
})
|
||||
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您尚未认证, 是否前往认证?',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 0)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请完善名片信息',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 1)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else if (accountNum === 0) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请先到个人中心添加收款账户',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 7)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
vk.navigateTo({
|
||||
url: '/pages/goods/publish'
|
||||
})
|
||||
}
|
||||
},
|
||||
async toMy() {
|
||||
const {userInfo} = await vk.callFunction({
|
||||
url: 'user/kh/getMyUserInfo'
|
||||
})
|
||||
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您尚未认证, 是否前往认证?',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 0)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请完善名片信息',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 1)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else this.$jump('/pages/goods/my')
|
||||
},
|
||||
afterSearch(keyword) {
|
||||
this.keyword = keyword
|
||||
this.search(1)
|
||||
},
|
||||
search(pageIndex) {
|
||||
this.loading = true
|
||||
vk.callFunction({
|
||||
url: 'client/spot/goods/pub/getList',
|
||||
title: '请求中...',
|
||||
data: {
|
||||
pageIndex: pageIndex,
|
||||
pageSize: this.pageSize,
|
||||
keyword: this.keyword,
|
||||
categoryIds: this.cateId ? [this.cateId] : null,
|
||||
// categoryIds: this.checkCategoryList,
|
||||
provinceCodes: this.region.province.code ? [this.region.province.code] : null
|
||||
},
|
||||
success: (data) => {
|
||||
this.loading = false
|
||||
data.rows.forEach(item => {
|
||||
try {
|
||||
item.addressStr = item.address.province.name + "-" + item.address.city.name + "-" + item.address.area.name
|
||||
} catch (err) {
|
||||
item.addressStr = ""
|
||||
}
|
||||
})
|
||||
this.goodsData = data
|
||||
}
|
||||
});
|
||||
},
|
||||
getCertUrl() {
|
||||
vk.callFunction({
|
||||
url: 'client/fadada.getVerifyUrl',
|
||||
success: (res) => {
|
||||
location.href = res.data.url
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.keyword) this.keyword = option.keyword
|
||||
this.getCategoryTreeData()
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
|
||||
}
|
||||
|
||||
.layout-pick {
|
||||
// width: 690rpx;
|
||||
height: 68rpx;
|
||||
padding: 0 30rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
color: #4F4F4F;
|
||||
|
||||
.ip {
|
||||
position: relative;
|
||||
max-width: 50%;
|
||||
height: 40rpx;
|
||||
padding-right: 30rpx;
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.down::after {
|
||||
position: absolute;
|
||||
right: 10rpx;
|
||||
top: 50%;
|
||||
z-index: 9;
|
||||
content: '';
|
||||
margin-top: -6rpx;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-left: 10rpx solid transparent;
|
||||
border-right: 10rpx solid transparent;
|
||||
border-top: 12rpx solid #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.layout-goods {
|
||||
// width: 690rpx;
|
||||
padding: 10rpx 30rpx;
|
||||
|
||||
.item {
|
||||
position: relative;
|
||||
margin-top: 10rpx;
|
||||
padding: 10rpx 20rpx 20rpx;
|
||||
border-radius: 12rpx;
|
||||
|
||||
.title {
|
||||
width: 80%;
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
line-height: 48rpx;
|
||||
color: #101010;
|
||||
}
|
||||
|
||||
.link, .askfor {
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
top: 16rpx;
|
||||
z-index: 9;
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #A92924;
|
||||
padding: 4rpx 8rpx;
|
||||
}
|
||||
|
||||
.link {
|
||||
border: 1px solid #A92924;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.red {
|
||||
margin-right: 20rpx;
|
||||
color: #A92924;
|
||||
}
|
||||
|
||||
.date {
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #9a9a9a;
|
||||
}
|
||||
|
||||
.company {
|
||||
height: 40rpx;
|
||||
|
||||
.icon {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
|
||||
.text {
|
||||
//width: 300rpx;
|
||||
height: 40rpx;
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
color: #4f4f4f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.item:nth-child(1) {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.red {
|
||||
color: #A92924 !important;
|
||||
}
|
||||
|
||||
.my {
|
||||
position: fixed;
|
||||
right: 30rpx;
|
||||
bottom: 220rpx;
|
||||
z-index: 99;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
border-radius: 50%;
|
||||
background: white;
|
||||
border: 1px solid #A92924;
|
||||
}
|
||||
|
||||
.top {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(169, 41, 36, 1);
|
||||
padding: 2px 5px;
|
||||
border-radius: 5px 0 5px 0;
|
||||
color: #FFFFFF;
|
||||
font-size: 25rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,183 @@
|
||||
<template>
|
||||
<view class="wrap">
|
||||
<u-sticky offset-top="0" customNavHeight="0">
|
||||
<uititle title="我发布的现货"></uititle>
|
||||
</u-sticky>
|
||||
<view class="issue" @click="toRelease">
|
||||
<u-icon name="plus" color="#fff" size="24"></u-icon>
|
||||
</view>
|
||||
<view class="layout-goods">
|
||||
<view class="goods-box p-top-10" v-if="list.length">
|
||||
<view class="item bg-white" @click="detailLink(item._id)" v-for="(item, index) in list"
|
||||
:key="index">
|
||||
<view class="askfor">查看详情</view>
|
||||
<view class="title text-single">{{ item.name }}</view>
|
||||
<view class="text m-top-10">
|
||||
<text class="red">库存:{{ parseInt(item.stock) }}吨</text>
|
||||
<text>供货地:{{ item.address.province.name }}-{{ item.address.city.name }}</text>
|
||||
</view>
|
||||
<view class="flex justify-between align-center m-top-10">
|
||||
<view class="company flex justify-center align-center flex-nowrap">
|
||||
<view class="text flex-1 text-single" v-if="userInfo && userInfo.company">
|
||||
{{ userInfo.company.companyName }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="date">{{ item._add_time_str }} 更新</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-empty v-else text="您未发布现货"></u-empty>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uititle from '@/components/common/title'
|
||||
|
||||
export default {
|
||||
name: "my",
|
||||
components: {uititle},
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
userInfo: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
detailLink(id) {
|
||||
vk.navigateTo(`/pages/goods/detail?id=${id}`, {
|
||||
id
|
||||
});
|
||||
},
|
||||
async getList() {
|
||||
const {rows} = await vk.callFunction({
|
||||
url: 'client/spot/goods/kh/getSelfOne'
|
||||
})
|
||||
this.list = rows
|
||||
},
|
||||
async toRelease() {
|
||||
const {userInfo, accountNum} = await vk.callFunction({
|
||||
url: 'user/kh/getMyUserInfo'
|
||||
})
|
||||
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您尚未认证, 是否前往认证?',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 0)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请完善名片信息',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 1)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else if (accountNum === 0) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请先到个人中心添加收款账户',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 7)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
vk.navigateTo({
|
||||
url: '/pages/goods/publish'
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
onShow() {
|
||||
this.userInfo = vk.getStorageSync('uni_id_user_info')
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.layout-goods {
|
||||
// width: 690rpx;
|
||||
padding: 10rpx 30rpx;
|
||||
|
||||
.item {
|
||||
position: relative;
|
||||
margin-top: 30rpx;
|
||||
padding: 10rpx 20rpx 20rpx;
|
||||
border-radius: 12rpx;
|
||||
|
||||
.title {
|
||||
width: 90%;
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
line-height: 48rpx;
|
||||
color: #101010;
|
||||
}
|
||||
|
||||
.link, .askfor {
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
top: 16rpx;
|
||||
z-index: 9;
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #A92924;
|
||||
padding: 4rpx 8rpx;
|
||||
}
|
||||
|
||||
.link {
|
||||
border: 1px solid #A92924;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.red {
|
||||
margin-right: 20rpx;
|
||||
color: #A92924;
|
||||
}
|
||||
|
||||
.date {
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #9a9a9a;
|
||||
}
|
||||
|
||||
.company {
|
||||
height: 40rpx;
|
||||
|
||||
.icon {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
|
||||
.text {
|
||||
//width: 300rpx;
|
||||
height: 40rpx;
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
color: #4f4f4f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.item:nth-child(1) {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,372 @@
|
||||
<template>
|
||||
<view class="wrap">
|
||||
<!-- 吸顶 -->
|
||||
<u-sticky offset-top="0" customNavHeight="0">
|
||||
<!-- 顶部 -->
|
||||
<uititle title="发布现货"></uititle>
|
||||
</u-sticky>
|
||||
<view class="layout layout-publish m-top-20">
|
||||
<view class="group flex align-center">
|
||||
<view class="lb need m-right-20">现货名称:</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
disabled
|
||||
placeholder="请输入内容"
|
||||
border="surround"
|
||||
v-model="formData.name"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tag-title m-top-30">
|
||||
点击添加现货
|
||||
<text class="limit">(至少选择1个现货,最多可选择5个现货)</text>
|
||||
</view>
|
||||
<view class="tag-box flex justify-start flex-wrap">
|
||||
<view :class="['item', formData.categoryIds.includes(item._id) ? 'active' : '']"
|
||||
style="flex: 0 0 30%"
|
||||
v-for="(item,index) in goodsCate" :key="index"
|
||||
@click="handTag(item)">{{ item.name }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center">
|
||||
<view class="lb need m-right-20">库存约:</view>
|
||||
<view class="vl" style="width: 300rpx;">
|
||||
<u--input
|
||||
placeholder="请输入内容"
|
||||
border="surround"
|
||||
v-model="formData.stock"
|
||||
></u--input>
|
||||
</view>
|
||||
<view class="fix m-left-20">吨</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need m-right-20">供货地:</view>
|
||||
<view class="vl flex-1" @click="showAddress">
|
||||
<u--input
|
||||
readonly
|
||||
placeholder="请选择"
|
||||
border="surround"
|
||||
v-model="address"
|
||||
suffixIcon="arrow-down"
|
||||
style="pointer-events:none"
|
||||
>
|
||||
</u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group m-top-30">
|
||||
<view class="lb m-right-20">产品规格单价:</view>
|
||||
<view class="m-top-30">
|
||||
<u-upload
|
||||
accept="file"
|
||||
:fileList="formData.files"
|
||||
@afterRead="afterRead"
|
||||
@delete="deletePic"
|
||||
multiple
|
||||
:maxCount="10"
|
||||
></u-upload>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb m-right-20">报价有效期:</view>
|
||||
<view class="vl flex-1" @click.native="isPickDate = true">
|
||||
<u--input
|
||||
style="pointer-events:none"
|
||||
readonly
|
||||
placeholder="请输入内容"
|
||||
suffixIcon="calendar"
|
||||
v-model="formData.answerEndTime"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group m-top-30">
|
||||
<view class="lb m-right-20">产品现场图片:</view>
|
||||
<view class="m-top-30">
|
||||
<u-upload
|
||||
accept="image"
|
||||
:fileList="formData.images"
|
||||
@afterRead="afterReadImages"
|
||||
@delete="deletePicImages"
|
||||
multiple
|
||||
:maxCount="10"
|
||||
></u-upload>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need m-right-20">是否购买全国广告位:</view>
|
||||
<view class="vl flex-1">
|
||||
<u-switch v-model="formData.buyAll" @change="getAmount(true)"></u-switch>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need m-right-20">是否购买省份广告位:</view>
|
||||
<view class="vl flex-1">
|
||||
<u-switch v-model="formData.buyTop"
|
||||
:disabled="address === '' || totalAmount === 0"
|
||||
@change="getAmount()"></u-switch>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need m-right-20">购买广告位时长(月):</view>
|
||||
<view class="vl flex-1">
|
||||
<u-number-box v-model="formData.buyTopNum"></u-number-box>
|
||||
</view>
|
||||
</view>
|
||||
<p class="text-main text-25 my-20" v-if="formData.buyAll">您已选择购买全国广告位,无法继续购买省份广告位</p>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need m-right-20">广告位价格:</view>
|
||||
<view class="vl flex-1">
|
||||
{{ totalAmount }}元
|
||||
</view>
|
||||
</view>
|
||||
<u-button class="public-btn" text="提交" @click.native="add"></u-button>
|
||||
</view>
|
||||
<AddressSelect ref="AddressSelect" @confirm="regionConfirm"/>
|
||||
<u-datetime-picker :show="isPickDate" v-model="answerEndTime" mode="date"
|
||||
:minDate="minDate" @cancel="isPickDate = false"
|
||||
@confirm="handConfirmDate"></u-datetime-picker>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uititle from '@/components/common/title'
|
||||
import AddressSelect from "@/components/AddressSelect.vue";
|
||||
import dayjs from 'dayjs'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
AddressSelect,
|
||||
uititle,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tagIndex: -1,
|
||||
fileList1: [],
|
||||
formData: {
|
||||
name: '',
|
||||
stock: '',
|
||||
answerEndTime: '',
|
||||
buyTop: false,
|
||||
buyAll: false,
|
||||
buyTopNum: 1,
|
||||
categoryIds: [],
|
||||
files: [],
|
||||
images: [],
|
||||
address: {}
|
||||
},
|
||||
address: '',
|
||||
amount: '',
|
||||
answerEndTime: '',
|
||||
goodsCate: [],
|
||||
isPickDate: false,
|
||||
minDate: Number(new Date()),
|
||||
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
handConfirmDate({value}) {
|
||||
this.formData.answerEndTime = dayjs(value).format('YYYY-MM-DD')
|
||||
this.isPickDate = false
|
||||
},
|
||||
changeBuyAll(val) {
|
||||
if (val && this.formData.buyTop) this.formData.buyTop = false
|
||||
},
|
||||
handTag(val) {
|
||||
const index = this.formData.categoryIds.findIndex(item => item === val._id)
|
||||
if (index === -1 && this.formData.categoryIds.length === 5) return this.$message.error('最多选择五个分类')
|
||||
if (index === -1) this.formData.categoryIds.push(val._id)
|
||||
else this.formData.categoryIds.splice(index, 1)
|
||||
this.formData.name = this.formData.categoryIds.map(item => this.goodsCate.find(val => val._id === item).name).join('、')
|
||||
},
|
||||
afterRead({file}) {
|
||||
file.forEach(item => {
|
||||
uniCloud.uploadFile({
|
||||
filePath: item.url,
|
||||
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + item.name,
|
||||
success: ({fileID}) => {
|
||||
uniCloud.getTempFileURL({
|
||||
fileList: [fileID]
|
||||
}).then(res => {
|
||||
this.formData.files.push({
|
||||
url: res.fileList[0].tempFileURL,
|
||||
name: item.name
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
deletePic({index}) {
|
||||
this.formData.files.splice(index, 1)
|
||||
},
|
||||
afterReadImages({file}) {
|
||||
file.forEach(item => {
|
||||
uniCloud.uploadFile({
|
||||
filePath: item.url,
|
||||
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + item.name,
|
||||
success: ({fileID}) => {
|
||||
uniCloud.getTempFileURL({
|
||||
fileList: [fileID]
|
||||
}).then(res => {
|
||||
this.formData.images.push({
|
||||
url: res.fileList[0].tempFileURL,
|
||||
name: item.name
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
deletePicImages({index}) {
|
||||
this.formData.images.splice(index, 1)
|
||||
},
|
||||
async getGoodsCate() {
|
||||
const {data} = await vk.callFunction({
|
||||
url: 'client/spot/category/pub/getList',
|
||||
data: {
|
||||
whereJson: {
|
||||
level: 2
|
||||
}
|
||||
}
|
||||
});
|
||||
this.goodsCate = data
|
||||
},
|
||||
showAddress() {
|
||||
this.$refs.AddressSelect.open(this.address);
|
||||
},
|
||||
regionConfirm({province, city, area}) {
|
||||
this.formData.address = {province, city, area}
|
||||
this.address = `${province.name} ${city.name} ${area.name}`
|
||||
this.getAmount()
|
||||
},
|
||||
async add() {
|
||||
if (this.formData.categoryIds.length === 0) return this.$message.error('请选择分类')
|
||||
if (!this.formData.stock) return this.$message.error('请填写库存')
|
||||
if (JSON.stringify(this.formData.address) === '{}') return this.$message.error('请选择供货地')
|
||||
this.formData.files = this.formData.files.map(i => i.url)
|
||||
this.formData.images = this.formData.images.map(i => i.url)
|
||||
const res = await vk.callFunction({
|
||||
title: '请求中...',
|
||||
url: 'client/spot/goods/kh/addUpdate',
|
||||
data: this.formData
|
||||
})
|
||||
if (this.formData.buyTop || this.formData.buyAll) {
|
||||
vk.navigateTo({
|
||||
url: `/pages/shop/pay?id=${res.data}`
|
||||
})
|
||||
} else uni.redirectTo({url: '/pages/goods/goods'});
|
||||
},
|
||||
onFormSuccess(res) {
|
||||
if (this.formData.buyTop) {
|
||||
vk.navigateTo({
|
||||
url: `/pages/shop/pay?id=${res.data.data}`
|
||||
})
|
||||
} else uni.redirectTo({url: '/pages/goods/goods'});
|
||||
},
|
||||
getAmount(isAll = false) {
|
||||
this.amount = 0
|
||||
if (!isAll && JSON.stringify(this.form1.data.address) === '{}') return
|
||||
if (isAll) {
|
||||
this.formData.buyTop = !this.formData.buyAll
|
||||
}else {
|
||||
this.formData.buyAll = !this.formData.buyTop
|
||||
}
|
||||
vk.callFunction({
|
||||
url: 'client/spot/amount/pub/getDetail',
|
||||
data: {
|
||||
province: isAll ? -1 : this.form1.data.address.province.code,
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.data) {
|
||||
this.amount = parseFloat(res.data.amount)
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
onLoad() {
|
||||
this.getGoodsCate()
|
||||
},
|
||||
computed: {
|
||||
totalAmount() {
|
||||
let amount = 0
|
||||
if (this.amount) amount = this.amount * this.formData.buyTopNum
|
||||
return amount
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.public-btn {
|
||||
width: 95%;
|
||||
margin-top: 60rpx;
|
||||
color: #ffffff;
|
||||
background: #A92924;
|
||||
}
|
||||
|
||||
.layout-publish {
|
||||
padding: 20rpx 30rpx;
|
||||
}
|
||||
|
||||
.tag-title {
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
color: #000000;
|
||||
|
||||
.limit {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.tag-box {
|
||||
padding: 20rpx 0;
|
||||
|
||||
.item {
|
||||
padding: 6rpx 10rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 32rpx;
|
||||
color: #555555;
|
||||
}
|
||||
|
||||
.active {
|
||||
color: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.lb, .fix {
|
||||
position: relative;
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.lbx {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.download {
|
||||
padding: 8rpx 20rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #A92924;
|
||||
border: 1px solid #A92924;
|
||||
}
|
||||
|
||||
.need::before {
|
||||
position: absolute;
|
||||
left: -16rpx;
|
||||
top: 50%;
|
||||
z-index: 9;
|
||||
margin-top: -12rpx;
|
||||
content: '*';
|
||||
color: #A92924;
|
||||
font-size: 32rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,136 @@
|
||||
<template>
|
||||
<view class="wrap">
|
||||
<!-- 顶部-吸顶 -->
|
||||
<u-sticky offset-top="0" customNavHeight="0">
|
||||
<uiheader :index='index'></uiheader>
|
||||
</u-sticky>
|
||||
<!-- 半圆区 -->
|
||||
<uisemicircle @search="search"></uisemicircle>
|
||||
<!-- 导航栏 -->
|
||||
<common-swiper height="14" class="mt-15"/>
|
||||
<div class="flex justify-around items-center">
|
||||
<div @click="$jump('/pages/self/self')" style="width: 30%; margin: 1%">
|
||||
<image src="/static/img/home1.jpg" alt="" style="width: 100%;" mode="widthFix"/>
|
||||
</div>
|
||||
<div @click="$jump('/pages/goods/goods')" style="width: 30%; margin: 1%">
|
||||
<image src="/static/img/home2.jpg" alt="" style="width: 100%;" mode="widthFix"/>
|
||||
</div>
|
||||
<div @click="$jump('/pages/price/price')" style="width: 30%; margin: 1%">
|
||||
<image src="/static/img/home3.jpg" alt="" style="width: 100%;" mode="widthFix"/>
|
||||
</div>
|
||||
</div>
|
||||
<view>
|
||||
<uinavr :index='index'></uinavr>
|
||||
</view>
|
||||
<!-- 轮播图 -->
|
||||
<uiswiper :ad="3"></uiswiper>
|
||||
<uiswiper :ad="4"></uiswiper>
|
||||
<!-- 最新询价 -->
|
||||
<uiprice></uiprice>
|
||||
<!-- 现货市场 -->
|
||||
<uigoods></uigoods>
|
||||
<!-- 合作商家 -->
|
||||
<uiwork></uiwork>
|
||||
<!-- 服务商 -->
|
||||
<uifacilitator></uifacilitator>
|
||||
<!-- 交易模式 -->
|
||||
<uimodel></uimodel>
|
||||
<!-- 金融服务 -->
|
||||
<uifinance></uifinance>
|
||||
<!-- 最新开通 -->
|
||||
<uiopen></uiopen>
|
||||
<!-- 入门 -->
|
||||
<uiabc></uiabc>
|
||||
<!-- 资讯中心 -->
|
||||
<uinews></uinews>
|
||||
<uiswiper :ad="5"></uiswiper>
|
||||
<uiswiper :ad="6"></uiswiper>
|
||||
<uiswiper :ad="7"></uiswiper>
|
||||
<uiswiper :ad="8"></uiswiper>
|
||||
<collapse></collapse>
|
||||
|
||||
<!-- 广告图 -->
|
||||
<!-- <uiadvert></uiadvert>-->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uiheader from '@/components/index/header'
|
||||
import uisemicircle from '@/components/index/semicircle'
|
||||
import uinavr from '@/components/index/nav'
|
||||
import uiswiper from '@/components/index/swiper'
|
||||
import uiprice from '@/components/index/price'
|
||||
import uigoods from '@/components/index/goods'
|
||||
import uiwork from '@/components/index/work'
|
||||
import uifacilitator from '@/components/index/facilitator'
|
||||
import uimodel from '@/components/index/model'
|
||||
import uifinance from '@/components/index/finance'
|
||||
import uiopen from '@/components/index/open'
|
||||
import uiabc from '@/components/index/abc'
|
||||
import uinews from '@/components/index/news'
|
||||
import uiadvert from '@/components/index/advert'
|
||||
import Collapse from "@/components/index/collapse.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Collapse,
|
||||
uiheader,
|
||||
uisemicircle,
|
||||
uinavr,
|
||||
uiswiper,
|
||||
uinews,
|
||||
uiabc,
|
||||
uiadvert,
|
||||
uiopen,
|
||||
uifinance,
|
||||
uifacilitator,
|
||||
uiwork,
|
||||
uigoods,
|
||||
uiprice,
|
||||
uimodel,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
index: 0,
|
||||
isLogin: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
search({keyword, type}) {
|
||||
let url = ''
|
||||
switch (type) {
|
||||
case 0 : {
|
||||
url = '/pages/shop/shop'
|
||||
}
|
||||
break;
|
||||
case 1 : {
|
||||
url = '/pages/goods/goods'
|
||||
}
|
||||
break;
|
||||
case 2 : {
|
||||
url = '/pages/price/price'
|
||||
}
|
||||
break;
|
||||
case 3 : {
|
||||
url = '/pages/work/work'
|
||||
}
|
||||
break;
|
||||
case 4 : {
|
||||
url = '/pages/junk/junk'
|
||||
}
|
||||
break;
|
||||
}
|
||||
this.$jump(`${url}?keyword=${keyword}`)
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
// padding-top: 80rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,260 @@
|
||||
<template>
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="flex justify-between items-start">
|
||||
<div class="flex flex-col justify-start items-start">
|
||||
<span>您有<em style="color: #bf2b28;padding: 0 3px;font-weight: 500">{{
|
||||
unreadNum
|
||||
}}</em>条未读消息</span>
|
||||
<span class="text-main pointer" @click="allRead">全部已读</span>
|
||||
</div>
|
||||
<el-button style="float: right; padding: 3px 0; color: #666" type="text" @click="onSetting"
|
||||
v-if="userInfo && parseInt(userInfo.userLevel) > 0"><i
|
||||
class="el-icon-setting"></i> 消息推送设置
|
||||
</el-button>
|
||||
</div>
|
||||
<!-- 消息列表 -->
|
||||
<div class="notice-list">
|
||||
<div class="item" v-for="(item,index) in noticeList" :key="index">
|
||||
<div class="notice-main">
|
||||
<div class="title-box" @click="toDetail(item, index)">
|
||||
<div class="flex justify-start items-start">
|
||||
<el-badge is-dot class="badge" v-if="!item.hasRead"></el-badge>
|
||||
<div class="title">{{ item.title }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="meta-row">
|
||||
<div class="time">{{ item._add_time_str }}</div>
|
||||
<div class="right">
|
||||
<div class="btn" @click="setRead(index)" v-if="!item.hasRead">
|
||||
<i class="el-icon-sunset"></i>已读
|
||||
</div>
|
||||
<div class="btn" @click="del(index)">
|
||||
<i class="el-icon-delete"></i>删除
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="desc pointer" @click="toDetail(item, index)">
|
||||
{{ item.content }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center mt-20">
|
||||
<el-pagination @current-change="getList" background layout="prev, pager, next"
|
||||
:total="total"></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog title="提示" :visible.sync="dialogVisible" width="70%">
|
||||
<el-descriptions title="报价详情" v-if="sheet && dialogVisible" border :column="1">
|
||||
<el-descriptions-item label="公司">{{ sheet.user.company.companyName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系人">{{ sheet.user.manager.personName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系方式">{{
|
||||
sheet.user.businessCard.companyMobile
|
||||
}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="价格">{{ sheet.amount }}元</el-descriptions-item>
|
||||
<el-descriptions-item label="附件">
|
||||
<p v-for="(item, index) in sheet.files" :key="index">
|
||||
<a :href="item" target="_blank">预览:文件{{ index + 1 }}</a>
|
||||
</p>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="备注">{{ sheet.remark }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="toContract" type="primary">去签合同</el-button>
|
||||
<el-button @click="dialogVisible = false">关闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
let that;
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
unreadNum: 0,
|
||||
noticeList: [],
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
dialogVisible: false,
|
||||
sheet: null,
|
||||
userInfo: null,
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.getUserInfo()
|
||||
this.getList()
|
||||
this.getUnreadNum()
|
||||
},
|
||||
methods: {
|
||||
async getUserInfo() {
|
||||
const {userInfo} = await vk.callFunction({
|
||||
url: 'user/kh/getMyUserInfo'
|
||||
})
|
||||
this.userInfo = userInfo
|
||||
},
|
||||
async getList(pageIndex = 1) {
|
||||
const {rows, total} = await vk.callFunction({
|
||||
url: 'client/message/kh/getList',
|
||||
data: {
|
||||
pageIndex,
|
||||
pageSize: this.pageSize,
|
||||
}
|
||||
})
|
||||
this.total = total
|
||||
this.noticeList = rows
|
||||
},
|
||||
async getUnreadNum() {
|
||||
const {data} = await vk.callFunction({
|
||||
url: 'client/message/kh/getUnreadCount',
|
||||
});
|
||||
this.unreadNum = data
|
||||
},
|
||||
async setRead(index) {
|
||||
this.noticeList[index].hasRead = true
|
||||
await vk.callFunction({
|
||||
url: 'client/message/kh/setRead',
|
||||
data: {
|
||||
id: this.noticeList[index]._id
|
||||
}
|
||||
})
|
||||
},
|
||||
del(index) {
|
||||
this.$confirm('确认删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
await vk.callFunction({
|
||||
url: 'client/message/kh/delete',
|
||||
data: {
|
||||
id: this.noticeList[index]._id
|
||||
}
|
||||
})
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功'
|
||||
})
|
||||
await this.getList()
|
||||
await this.getUnreadNum()
|
||||
})
|
||||
|
||||
},
|
||||
onSetting() {
|
||||
uni.setStorageSync('user_tab', 3)
|
||||
vk.navigateTo('/pages/user/user')
|
||||
},
|
||||
toDetail(item, index) {
|
||||
if (!item.hasRead) this.setRead(index)
|
||||
let url = null
|
||||
if (item.type === 'old') url = `/pages/junk/detail?id=${item.pk}`
|
||||
else if (item.type === 'enquiry') url = `/pages/price/detail?id=${item.pk}`
|
||||
else if (item.type === 'process') url = `/pages/work/detail?id=${item.pk}`
|
||||
else if (item.type === 'contract') url = `/pages/public/contract?tab=1`
|
||||
else if (item.type === 'self-support') url = `/pages/self/makeQuote?id=${item.pk}`
|
||||
else if (item.type === 'self-product') url = `/pages/user/seller`
|
||||
else if (item.type === 'spot') url = `/pages/goods/detail?id=${item.pk}`
|
||||
else if (item.type === 'self-support-quote') {
|
||||
this.getQuoteDetail(item.pk)
|
||||
}
|
||||
if (url) vk.navigateTo({url})
|
||||
},
|
||||
async allRead() {
|
||||
await vk.callFunction({
|
||||
url: 'client/message/kh/setAllRead'
|
||||
})
|
||||
await this.getList(1)
|
||||
await this.getUnreadNum()
|
||||
},
|
||||
async getQuoteDetail(_id) {
|
||||
await vk.callFunction({
|
||||
url: 'client/selfSupport/kh/getQuoteDetail',
|
||||
data: {
|
||||
_id
|
||||
},
|
||||
success: ({rows}) => {
|
||||
this.sheet = rows
|
||||
this.dialogVisible = true
|
||||
}
|
||||
});
|
||||
},
|
||||
toContract() {
|
||||
this.dialogVisible = false
|
||||
vk.navigateTo({url: '/pages/public/contract?tab=1'})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.el-icon-setting {
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
.notice-list {
|
||||
.item {
|
||||
font-size: 25rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 10rpx 0;
|
||||
border-bottom: 1px solid #ddd;
|
||||
|
||||
.notice-main {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.title-box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
justify-content: flex-start;
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.badge {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-top: 12rpx;
|
||||
//margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.meta-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: 8rpx;
|
||||
|
||||
.time {
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.desc {
|
||||
color: #999999;
|
||||
line-height: 2em;
|
||||
}
|
||||
|
||||
.right {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
|
||||
.btn {
|
||||
color: #bf2b28;
|
||||
cursor: pointer;
|
||||
|
||||
i {
|
||||
padding: 0 5px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.active {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,65 @@
|
||||
<template>
|
||||
<u-popup :show="show" @close="close" @open="handlePopupOpen" mode="center" round="15">
|
||||
<view style="height: 80vh; overflow-y: auto;width: 80vw" class="p-20">
|
||||
<u-parse :content="agreement"/>
|
||||
</view>
|
||||
<u-button shape="circle" @click="close">关闭</u-button>
|
||||
</u-popup>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "agreement",
|
||||
data() {
|
||||
return {
|
||||
agreement: '',
|
||||
show: false,
|
||||
readTimer: null,
|
||||
readCompleted: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
this.getAgreement()
|
||||
},
|
||||
handlePopupOpen() {
|
||||
this.startReadTimer()
|
||||
},
|
||||
startReadTimer() {
|
||||
this.clearReadTimer()
|
||||
if (this.readCompleted) return
|
||||
this.readTimer = setTimeout(() => {
|
||||
this.readTimer = null
|
||||
this.readCompleted = true
|
||||
this.$emit('read-complete')
|
||||
}, 5000)
|
||||
},
|
||||
clearReadTimer() {
|
||||
if (this.readTimer) {
|
||||
clearTimeout(this.readTimer)
|
||||
this.readTimer = null
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.clearReadTimer()
|
||||
this.show = false
|
||||
},
|
||||
async getAgreement() {
|
||||
const res = await vk.callFunction({
|
||||
url: 'client/dict/pub/getDetail',
|
||||
data: {
|
||||
id: '65885d5b862066f18a4e4a36'
|
||||
},
|
||||
})
|
||||
this.agreement = res.content
|
||||
this.show = true
|
||||
},
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.clearReadTimer()
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,262 @@
|
||||
<template>
|
||||
<view class="wrap">
|
||||
<!-- 吸顶 -->
|
||||
<u-sticky offset-top="0" customNavHeight="0">
|
||||
<!-- 顶部 -->
|
||||
<uititle title="提交报价"></uititle>
|
||||
</u-sticky>
|
||||
<quote-remain-num v-if="reloaded" :amount="sheet.quoteAmount" type="old" :id="formData.sheetId"/>
|
||||
<view class="layout layout-title m-top-20">填写报价信息</view>
|
||||
<view class="layout layout-publish m-top-20 bg-white">
|
||||
<view class="card-title m-top-30">报价信息</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need m-right-20">总价(人民币:元):</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
placeholder="请输入内容"
|
||||
border="surround"
|
||||
v-model="formData.totalPrice"
|
||||
suffixIcon="元"
|
||||
suffixIconStyle="font-size: 24rpx;color: #909399"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb m-right-20">报价单详情:</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
placeholder="请输入报价单详情"
|
||||
border="surround"
|
||||
v-model="formData.remark"
|
||||
suffixIconStyle="font-size: 24rpx;color: #909399"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-title m-top-30">附件信息</view>
|
||||
<view class="group m-top-20">
|
||||
<view class="lb need m-right-20">附件内容:</view>
|
||||
<view class="flex justify-between align-center m-top-20">
|
||||
<view class="lbx flex-1">仅支持纵向PDF文档,报价附件将生成标准合同附件,请认真审阅。</view>
|
||||
<!-- <view class="download">报价单样板下载</view>-->
|
||||
</view>
|
||||
<view class="m-top-30">
|
||||
<u-upload
|
||||
accept="file"
|
||||
:fileList="formData.files"
|
||||
@afterRead="afterRead"
|
||||
@delete="deletePic"
|
||||
name="1"
|
||||
multiple
|
||||
:maxCount="10"
|
||||
></u-upload>
|
||||
</view>
|
||||
</view>
|
||||
<u-button class="public-btn m-top-30" text="提交报价" @click="addCoop"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uititle from '@/components/common/title'
|
||||
import dayjs from "dayjs";
|
||||
import QuoteRemainNum from "@/components/quote-remain-num/quote-remain-num.vue";
|
||||
import md5 from "js-md5";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
QuoteRemainNum,
|
||||
uititle,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
current: 0,
|
||||
radioEnum: [
|
||||
{value: 0, name: '是',},
|
||||
{value: 0, name: '否',}
|
||||
],
|
||||
formData: {
|
||||
sheetId: null,
|
||||
totalPrice: null,
|
||||
files: [],
|
||||
remark: '',
|
||||
},
|
||||
reloaded: false,
|
||||
sheet: null,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
getDetail() {
|
||||
this.reloaded = false
|
||||
vk.callFunction({
|
||||
url: 'client/old/pub/getDetail',
|
||||
title: '请求中...',
|
||||
data: {
|
||||
id: this.formData.sheetId
|
||||
},
|
||||
success: (res) => {
|
||||
this.sheet = res
|
||||
this.reloaded = true
|
||||
}
|
||||
}).catch(err => {
|
||||
if (err.code === -1) {
|
||||
setTimeout(() => {
|
||||
vk.navigateBack()
|
||||
}, 1500)
|
||||
}
|
||||
})
|
||||
},
|
||||
addCoop() {
|
||||
if (!this.formData.totalPrice) return this.$message.error('请填写金额')
|
||||
if (this.formData.files.length === 0) return this.$message.error('请上传报价附件')
|
||||
if (this.formData.files.length > 0) this.formData.files = this.formData.files.map(item => item.url)
|
||||
vk.callFunction({
|
||||
url: 'client/old/kh/addQuote',
|
||||
data: this.formData
|
||||
})
|
||||
this.$message.success('提交成功')
|
||||
uni.navigateBack()
|
||||
},
|
||||
afterRead({file}) {
|
||||
for (let i = 0; i < file.length; i++) {
|
||||
const item = file[i]
|
||||
if (item.type !== 'application/pdf') {
|
||||
uni.showToast({
|
||||
title: '请上传PDF文件',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
uniCloud.uploadFile({
|
||||
filePath: item.url,
|
||||
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + md5(item.name + Date.now().toString()) + '.pdf',
|
||||
success: ({fileID}) => {
|
||||
uniCloud.getTempFileURL({
|
||||
fileList: [fileID]
|
||||
}).then(res => {
|
||||
this.formData.files.push({
|
||||
url: res.fileList[0].tempFileURL,
|
||||
name: item.name
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
deletePic({index}) {
|
||||
this.formData.files.splice(index, 1)
|
||||
},
|
||||
},
|
||||
onLoad({id}) {
|
||||
this.formData.sheetId = id
|
||||
this.getDetail()
|
||||
},
|
||||
onShow() {
|
||||
this.reloaded = false
|
||||
setTimeout(() => {
|
||||
this.reloaded = true
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.layout-title {
|
||||
padding: 20rpx 30rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
line-height: 44rpx;
|
||||
color: #A92924;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
position: relative;
|
||||
padding-left: 20rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 600;
|
||||
line-height: 48rpx;
|
||||
color: #A92924;
|
||||
|
||||
&:before {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
z-index: 9;
|
||||
margin-top: -14rpx;
|
||||
content: '';
|
||||
width: 4rpx;
|
||||
height: 28rpx;
|
||||
background: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.public-btn {
|
||||
width: 80%;
|
||||
margin-top: 60rpx;
|
||||
color: #ffffff;
|
||||
background: #A92924;
|
||||
}
|
||||
|
||||
.layout-publish {
|
||||
margin: 20rpx 30rpx;
|
||||
padding: 50rpx 30rpx;
|
||||
border-radius: 18rpx;
|
||||
}
|
||||
|
||||
.tag-title {
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
color: #000000;
|
||||
|
||||
.limit {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.tag-box {
|
||||
padding: 20rpx 0;
|
||||
|
||||
.item {
|
||||
padding: 6rpx 10rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 32rpx;
|
||||
color: #555555;
|
||||
}
|
||||
|
||||
.active {
|
||||
color: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.lb, .fix {
|
||||
position: relative;
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.lbx {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.download {
|
||||
padding: 8rpx 20rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #A92924;
|
||||
border: 1px solid #A92924;
|
||||
}
|
||||
|
||||
.need::before {
|
||||
position: absolute;
|
||||
left: -16rpx;
|
||||
top: 50%;
|
||||
z-index: 9;
|
||||
margin-top: -12rpx;
|
||||
content: '*';
|
||||
color: #A92924;
|
||||
font-size: 32rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,659 @@
|
||||
<template> <!-- 现货详情 -->
|
||||
<view class="wrap">
|
||||
<!-- 吸顶 -->
|
||||
<u-sticky offset-top="0" customNavHeight="0">
|
||||
<!-- 顶部 -->
|
||||
<uiheader></uiheader>
|
||||
</u-sticky>
|
||||
<!-- 内容 -->
|
||||
<view class="layout layout-detail" v-if="sheet">
|
||||
<view class="company flex m-top-20">
|
||||
<view class="info flex-1 p-left-20">
|
||||
<view class="font-bold">
|
||||
{{ sheet.supplier.companyName ? sheet.supplier.companyName : sheet.supplier.personalName }}
|
||||
</view>
|
||||
<view class="zhu">
|
||||
{{ sheet._add_time_str }} 发布
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-title m-top-30">物资信息</view>
|
||||
<view class="detail m-top-20">
|
||||
<view class="detail-title">
|
||||
<text>{{ sheet.title }}</text>
|
||||
<text class="text-main" v-if="sheet.isUrgent">[加急]</text>
|
||||
</view>
|
||||
<view class="m-top-20">
|
||||
<file-type v-for="(item, index) in sheet.files" :key="index" :item="item"/>
|
||||
</view>
|
||||
<view class="detail-text">物资分类:{{ sheet.category[1] }}</view>
|
||||
<view class="detail-text" v-if="sheet.addressRegion && sheet.addressRegion.city">
|
||||
物资所在地:{{ sheet.addressRegion.province.name }}{{
|
||||
sheet.addressRegion.city.name
|
||||
}}{{ sheet.addressRegion.area.name }}{{ sheet.addressDetail }}
|
||||
</view>
|
||||
<view class="detail-text" v-if="[1, 2].includes(sheet.type) && sheet.deliverAddressRegion.city">
|
||||
{{
|
||||
sheet.type === 2 ? (sheet.rentType === 0 ? '物资交货地' : '物资装货地') : '物资交货地'
|
||||
}}:{{ sheet.deliverAddressRegion.province.name }}{{
|
||||
sheet.deliverAddressRegion.city.name
|
||||
}}{{ sheet.deliverAddressRegion.area.name }}{{ sheet.deliverAddressDetail }}
|
||||
</view>
|
||||
<view class="detail-text">详情:{{ sheet.desc ? sheet.desc : '无' }}</view>
|
||||
<template v-if="sheet.type === 0">
|
||||
<view class="detail-text">起拍计价单位:{{
|
||||
sheet.startNum ? sheet.startNum : ''
|
||||
}}{{ sheet.unit ? sheet.unit : '' }}
|
||||
</view>
|
||||
<view class="detail-text">起拍人民币单价:{{
|
||||
sheet.startAmount ? `${sheet.startAmount}元` : ''
|
||||
}}
|
||||
</view>
|
||||
<view class="detail-text">拍卖信息失效时间:{{ sheet.expiredTime ? sheet.expiredTime : '' }}</view>
|
||||
</template>
|
||||
</view>
|
||||
|
||||
<view v-if="[0, 1, 2].includes(sheet.type)">
|
||||
<view class="card-title m-top-30">合同条款</view>
|
||||
<view class="detail m-top-20">
|
||||
<view class="detail-text">是否含税:{{ sheet.invoice ? '含税' : '不含税' }}</view>
|
||||
<template v-if="sheet.invoice">
|
||||
<view class="detail-text" v-if="sheet.invoiceOther">税票要求:{{ sheet.invoiceOther }}</view>
|
||||
<template v-else>
|
||||
<view class="detail-text">
|
||||
开票时间:{{ sheet.writeInvoiceTime ? sheet.writeInvoiceTime : '无' }}
|
||||
</view>
|
||||
<view class="detail-text">
|
||||
纳税人身份:{{ sheet.taxType ? sheet.taxType : '无' }}
|
||||
</view>
|
||||
<view class="detail-text">
|
||||
发票种类:{{ sheet.invoiceType ? sheet.invoiceType : '无' }}
|
||||
</view>
|
||||
<view class="detail-text">
|
||||
税率:{{ sheet.taxRate ? sheet.taxRate : '无' }}
|
||||
</view>
|
||||
</template>
|
||||
</template>
|
||||
<view class="detail-text">报价明细:{{ sheet.invoiceDetail ? sheet.invoiceDetail : '无' }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<template v-if="sheet.type !== 3">
|
||||
<view class="card-title m-top-30">交易说明</view>
|
||||
<view class="detail m-top-20">
|
||||
<view class="mt-15 detail-text">报价区域:{{
|
||||
sheet.offerAddressNoLimit ? '不限区域' :
|
||||
(sheet.offerAddressRegion && sheet.offerAddressRegion.province) ? `${sheet.offerAddressRegion.province.name} ${sheet.offerAddressRegion.city ? sheet.offerAddressRegion.city.name : ''} ${sheet.offerAddressRegion.area ? sheet.offerAddressRegion.area.name : '无'}` : '无'
|
||||
}}
|
||||
</view>
|
||||
<view class="mt-15 detail-text" v-if="sheet.payMethod">付款方式:{{ sheet.payMethod }}{{
|
||||
sheet.payMethod === '预付' ? `${sheet.prePayRate}%,货到付全款` : ''
|
||||
}}
|
||||
</view>
|
||||
<view class="mt-15 detail-text" v-if="sheet.payMethod === '其他付款方式描述'">{{
|
||||
sheet.otherPayMethodDesc
|
||||
}}
|
||||
</view>
|
||||
|
||||
<!-- <view class="mt-15">报价形式:{{ sheet.offerType === 0 ? '整单报价' : '可分项报价' }}</view>-->
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="sheet.type === 1">
|
||||
<view class="item-wrap">
|
||||
<view class="card-title m-top-30">采购商信息</view>
|
||||
<template v-if="sheet.isMine || sheet.hasQuote || userInfo.userLevel > 0">
|
||||
<template v-if="sheet.user && sheet.user.accountType === 2">
|
||||
<view class="mt-15" v-if="sheet.buyer.companyName">公司信息:{{
|
||||
sheet.buyer.companyName ? sheet.buyer.companyName : ''
|
||||
}}
|
||||
</view>
|
||||
<view class="mt-15" v-if="sheet.buyer.contract">公司联系方式:{{
|
||||
sheet.buyer.contract ? sheet.buyer.contract : ''
|
||||
}}
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="mt-15" v-if="sheet.buyer.personalName">个人信息:{{
|
||||
sheet.buyer.personalName ? sheet.buyer.personalName : ''
|
||||
}}
|
||||
</view>
|
||||
<view class="mt-15" v-if="sheet.buyer.personalContract">个人联系方式:{{
|
||||
sheet.buyer.personalContract ? sheet.buyer.personalContract : ''
|
||||
}}
|
||||
</view>
|
||||
</template>
|
||||
<view class="mt-15" v-if="sheet.buyer.managerName">授权人姓名:{{
|
||||
sheet.buyer.managerName ? sheet.buyer.managerName : ''
|
||||
}}
|
||||
</view>
|
||||
<view class="mt-15" v-if="sheet.buyer.managerContract">授权联系方式:{{
|
||||
sheet.buyer.managerContract ? sheet.buyer.managerContract : ''
|
||||
}}
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<template v-if="sheet.user && sheet.user.accountType === 2">
|
||||
<view class="mt-15" v-if="sheet.buyer.companyName">公司信息:{{
|
||||
sheet.buyer.companyName ? sheet.buyer.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6") : ''
|
||||
}}
|
||||
</view>
|
||||
<view class="mt-15" v-if="sheet.buyer.contract">公司联系方式:{{
|
||||
sheet.buyer.contract ? sheet.buyer.contract.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : ''
|
||||
}}
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="mt-15" v-if="sheet.buyer.personalName">个人信息:{{
|
||||
sheet.buyer.personalName ? sheet.buyer.personalName.replace(/^(.).*(.)$/, "$1***$2") : ''
|
||||
}}
|
||||
</view>
|
||||
<view class="mt-15" v-if="sheet.buyer.personalContract">个人联系方式:{{
|
||||
sheet.buyer.personalContract ? sheet.buyer.personalContract.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : ''
|
||||
}}
|
||||
</view>
|
||||
</template>
|
||||
<view class="mt-15" v-if="sheet.buyer.managerName">授权人姓名:{{
|
||||
sheet.buyer.managerName ? sheet.buyer.managerName.replace(/^(.).*(.)$/, "$1***$2") : ''
|
||||
}}
|
||||
</view>
|
||||
<view class="mt-15" v-if="sheet.buyer.managerContract">授权联系方式:{{
|
||||
sheet.buyer.managerContract ? sheet.buyer.managerContract.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : ''
|
||||
}}
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="item-wrap">
|
||||
<view class="card-title m-top-30">{{ sheet.type === 3 ? '回收单位信息' : '供货商信息' }}</view>
|
||||
<template v-if="sheet.isMine || sheet.hasQuote || userInfo.userLevel > 0">
|
||||
<template v-if="sheet.user && sheet.user.accountType === 2">
|
||||
<view class="mt-15" v-if="sheet.supplier.companyName">公司信息:{{
|
||||
sheet.supplier.companyName ? sheet.supplier.companyName : ''
|
||||
}}
|
||||
</view>
|
||||
<view class="mt-15" v-if="sheet.supplier.contract">公司联系方式:{{
|
||||
sheet.supplier.contract ? sheet.supplier.contract : ''
|
||||
}}
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="mt-15" v-if="sheet.supplier.personalName">个人信息:{{
|
||||
sheet.supplier.personalName ? sheet.supplier.personalName : ''
|
||||
}}
|
||||
</view>
|
||||
<view class="mt-15" v-if="sheet.supplier.personalContract">
|
||||
个人联系方式:{{
|
||||
sheet.supplier.personalContract ? sheet.supplier.personalContract : ''
|
||||
}}
|
||||
</view>
|
||||
</template>
|
||||
<view class="mt-15" v-if="sheet.supplier.managerName">授权人姓名:{{
|
||||
sheet.supplier.managerName ? sheet.supplier.managerName : ''
|
||||
}}
|
||||
</view>
|
||||
<view class="mt-15" v-if="sheet.supplier.managerContract">授权联系方式:{{
|
||||
sheet.supplier.managerContract ? sheet.supplier.managerContract : ''
|
||||
}}
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<template v-if="sheet.user && sheet.user.accountType === 2">
|
||||
<view class="mt-15" v-if="sheet.supplier.companyName">公司信息:{{
|
||||
sheet.supplier.companyName ? sheet.supplier.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6") : ''
|
||||
}}
|
||||
</view>
|
||||
<view class="mt-15" v-if="sheet.supplier.contract">公司联系方式:{{
|
||||
sheet.supplier.contract ? sheet.supplier.contract.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : ''
|
||||
}}
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="mt-15" v-if="sheet.supplier.personalName">个人信息:{{
|
||||
sheet.supplier.personalName ? sheet.supplier.personalName.replace(/^(.).*(.)$/, "$1***$2") : ''
|
||||
}}
|
||||
</view>
|
||||
<view class="mt-15" v-if="sheet.supplier.personalContract">
|
||||
个人联系方式:{{
|
||||
sheet.supplier.personalContract ? sheet.supplier.personalContract.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : ''
|
||||
}}
|
||||
</view>
|
||||
</template>
|
||||
<view class="mt-15" v-if="sheet.supplier.managerName">授权人姓名:{{
|
||||
sheet.supplier.managerName ? sheet.supplier.managerName.replace(/^(.).*(.)$/, "$1***$2") : ''
|
||||
}}
|
||||
</view>
|
||||
<view class="mt-15" v-if="sheet.supplier.managerContract">授权联系方式:{{
|
||||
sheet.supplier.managerContract ? sheet.supplier.managerContract.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : ''
|
||||
}}
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</template>
|
||||
<view v-if="sheet.signMethod === 0" style="line-height: 32rpx">
|
||||
<view class="card-title m-top-30">合同条款</view>
|
||||
<view class="detail m-top-20 text-25">
|
||||
<view class="mt-15">违约责任:</view>
|
||||
<view class="mt-15">
|
||||
1.乙方所交产品品种、型号、规格、质量不符合规定的,如果甲方同意利用,应当按质论价;如果甲方不能利用的,应根据产品的具体情况,由乙方负责包换或包修,并承担修理、调换或退货而支付的实际费用;2.乙方不予供货违约责任为甲方的实际损失+违约金,如乙方材料符合订货标准,甲方不能退货和不收货,甲方无条件应按实际本合同订货数量支付100%货款,并支付乙方因此产生的实际费用。带有甲乙双方单位相关收货人和发货人签字的本合同的发货清单事项和内容均视为本合同的补充合同,与本合同有相同的法律效力,双方应共同遵照执行。
|
||||
</view>
|
||||
<view class="mt-15">解决纠纷的方法:</view>
|
||||
<view class="mt-15">
|
||||
1、凡因本合同引起的或与本合同有关的任何争议,均可友好协商或仲裁解决,协商或仲裁不成的,双方协商同意在合同签订地人民法院管辖地起诉,违约一方或对合同争议承担主要责任的一方,应承担对方因仲裁和起诉而产生的全部律师代理费、鉴定(检验)费、诉讼保全费、诉讼保险费、公告费、差旅费、执行费、误工費和获取证据产生费用等其他相关费用。2、双方本合同相关权利放弃均应有双方书面作出并加盖公章或授权委托人签字后生效。
|
||||
</view>
|
||||
<view class="mt-15">不可抗力:</view>
|
||||
<view class="mt-15">
|
||||
甲乙双方的任何一方由于不可抗力或突发公共事件的原因不能履行合同时,应及时向对方通报不能履行或不能完全履行的理由,以减轻可能给对方造成的损失,在取得有关机构证明以后,允许延期履行、部分履行或者不履行合同,并根据情况可部分或全部免予承担违约责任。
|
||||
</view>
|
||||
<view class="mt-15">其他:</view>
|
||||
<view class="mt-15">
|
||||
本合同的全部内容由双方平等共同协商一致,共同起草制定,非一方事先拟定,不属于格式条款。本合同自双方签字盖章后生效(包括电子签字、盖章),按本合同内容地址、联系方式寄送的一切文书、函件送达与否,均为视为送达有法律效力,通知途径和本合同内联系方式或地址送达文件双方均予以验证。
|
||||
</view>
|
||||
<view class="mt-15">采购方补充条款: {{ sheet.supplementary }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="card-title m-top-30">已收到的合作申请</view>-->
|
||||
<!-- <view class="table-box m-top-30">-->
|
||||
<!-- <view class="thead">-->
|
||||
<!-- <view class="tr">-->
|
||||
<!-- <view class="th">企业</view>-->
|
||||
<!-- <view class="th">申请人</view>-->
|
||||
<!-- <view class="th">联系方式</view>-->
|
||||
<!-- <view class="th">合作留言</view>-->
|
||||
<!-- <view class="th">申请时间</view>-->
|
||||
<!-- </view>-->
|
||||
<!-- </view>-->
|
||||
<!-- <view class="tbody" v-if="sheet">-->
|
||||
<!-- <view class="tr" v-for="(item, index) in sheet.quoteList" :key="index">-->
|
||||
<!-- <view class="td">-->
|
||||
<!-- <text v-if="item.user">{{-->
|
||||
<!-- item.user.accountType === 2 ? item.user.company.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6") : item.user.person.personName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6")-->
|
||||
<!-- }}-->
|
||||
<!-- </text>-->
|
||||
<!-- </view>-->
|
||||
<!-- <view class="td">{{ item.name }}</view>-->
|
||||
<!-- <view class="td">{{ item.mobile }}</view>-->
|
||||
<!-- <view class="td">{{ item.remark }}</view>-->
|
||||
<!-- <view class="td">{{ item._add_time_str }}</view>-->
|
||||
<!-- </view>-->
|
||||
<!-- </view>-->
|
||||
<!-- </view>-->
|
||||
</view>
|
||||
<!-- 底部 -->
|
||||
<view class="fiexd-bottom flex justify-between align-center bg-white" v-if="sheet && sheet.type < 3">
|
||||
<u-icon name="integral" color="#A92924" size="26"></u-icon>
|
||||
<view class="text red flex-1 m-left-20">{{ sheet.quoteList.length }}家已报价</view>
|
||||
<view class="apply-btn" @click="toCooperate" v-if="userInfo._id !== sheet.uid && sheet.status === 0 ">
|
||||
{{ sheet.type === 3 ? '我要询价' : '我要报价' }}
|
||||
</view>
|
||||
<view class="apply-btn" @click="isPopup = true" v-else-if="userInfo._id === sheet.uid">收到的报价申请
|
||||
</view>
|
||||
</view>
|
||||
<!-- 弹出窗 -->
|
||||
<u-popup :show="isPopup" mode="center" @close="isPopup = false" @open="open" :custom-style="{width: '100%'}">
|
||||
<view class="popup-box" v-if="isPopup">
|
||||
<view class="popup-title flex justify-between align-center">
|
||||
<view class="title">收到的合作申请列表</view>
|
||||
<view class="close" @click="isPopup = false">关闭</view>
|
||||
</view>
|
||||
<view class="py-20 border-bottom text-25" v-for="(item, index) in sheet.quoteList" :key="index">
|
||||
<view class="flex justify-start items-center mb-20">
|
||||
<text class="mr-10">报价方:</text>
|
||||
<text>{{ item.subjectName }}</text>
|
||||
</view>
|
||||
<view class="flex justify-start items-center mb-20">
|
||||
<text class="mr-10">报价时间:</text>
|
||||
<text>{{ item._add_time_str }}</text>
|
||||
</view>
|
||||
<view class="flex justify-start items-center mb-20">
|
||||
<text class="mr-10">联系方式:</text>
|
||||
<text>{{ item.user.mobile }}</text>
|
||||
</view>
|
||||
<view class="flex justify-start items-center mb-20">
|
||||
<text class="mr-10">报价:</text>
|
||||
<text>{{ item.totalPrice }}元</text>
|
||||
</view>
|
||||
<view class="flex justify-start items-center mb-20">
|
||||
<text class="mr-10">详情:</text>
|
||||
<text>{{ item.remark }}</text>
|
||||
</view>
|
||||
<view class="flex justify-start items-center mb-20">
|
||||
<text class="mr-10">附件:</text>
|
||||
<template v-if="item.files.length > 0">
|
||||
<file-type v-for="(file, fileIndex) in item.files" :key="fileIndex" :item="file"
|
||||
@click.native="openDownload(file)"/>
|
||||
</template>
|
||||
<text v-else>无</text>
|
||||
</view>
|
||||
<u-button v-if="sheet.status === 0 && sheet.type !== 3"
|
||||
size="mini" type="error" text="选择" style="width: 60rpx;"
|
||||
@click="confirmQuote(item._id)"
|
||||
></u-button>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uiheader from '@/components/index/header'
|
||||
import dayjs from 'dayjs';
|
||||
import {INVOICE_TYPE, WRITE_INVOICE_TIME} from "../../util";
|
||||
import FileType from "@/components/file-type/file-type.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
FileType,
|
||||
uiheader,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isPopup: false,
|
||||
sheet: null,
|
||||
allChildCate: [],
|
||||
userInfo: null
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
INVOICE_TYPE() {
|
||||
return INVOICE_TYPE
|
||||
},
|
||||
WRITE_INVOICE_TIME() {
|
||||
return WRITE_INVOICE_TIME
|
||||
},
|
||||
getCategoryTreeData(id) {
|
||||
vk.callFunction({
|
||||
url: 'client/spot/category/pub/getTree',
|
||||
title: '请求中...',
|
||||
data: {},
|
||||
success: (data) => {
|
||||
this.allChildCate = []
|
||||
data.rows.forEach(item => {
|
||||
item.children.forEach(child => {
|
||||
this.allChildCate.push(child)
|
||||
})
|
||||
})
|
||||
this.getInfo(id)
|
||||
}
|
||||
});
|
||||
},
|
||||
applyLink() {
|
||||
uni.$u.route('/pages/goods/apply', {
|
||||
id: 0,
|
||||
});
|
||||
},
|
||||
getDetail() {
|
||||
vk.callFunction({
|
||||
url: 'client/old/pub/getDetail',
|
||||
title: '请求中...',
|
||||
data: {
|
||||
id: this.id
|
||||
},
|
||||
success: (res) => {
|
||||
this.sheet = res
|
||||
this.sheet.address = ''
|
||||
this.sheet.deliverAddress = ''
|
||||
this.sheet.offerAddress = ''
|
||||
if (this.sheet.addressRegion && this.sheet.addressRegion.length > 0)
|
||||
this.sheet.address = this.sheet?.addressRegion[0]?.name + this.sheet?.addressRegion[1]?.name + this.sheet?.addressRegion[2]?.name + this.sheet.addressDetail
|
||||
if (this.sheet.deliverAddress && this.sheet.deliverAddress.length > 0)
|
||||
this.sheet.deliverAddress = this.sheet?.deliverAddressRegion[0]?.name + this.sheet?.deliverAddressRegion[1]?.name + this.sheet?.deliverAddressRegion[2]?.name + this.sheet.addressDetail
|
||||
if (this.sheet.offerAddress && this.sheet.offerAddress.length > 0)
|
||||
this.sheet.offerAddress = !this.sheet.offerAddressNoLimit ? (this.sheet?.offerAddressRegion[0]?.name + this.sheet?.offerAddressRegion[1]?.name + this.sheet?.offerAddressRegion[2]?.name) : '无限制'
|
||||
this.sheet.expiredTime = dayjs(this.sheet.expiredTime).format('YYYY-MM-DD')
|
||||
}
|
||||
});
|
||||
},
|
||||
async toCooperate() {
|
||||
const {userInfo, accountNum} = await vk.callFunction({
|
||||
url: 'user/kh/getMyUserInfo'
|
||||
})
|
||||
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您尚未认证, 是否前往认证?',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 0)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请完善名片信息',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 1)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else if (accountNum === 0) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请先到个人中心添加收款账户',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 7)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
vk.navigateTo({url: `/pages/junk/apply?id=${this.sheet._id}&userId=${this.sheet.userId}`});
|
||||
}
|
||||
},
|
||||
async confirmQuote(quoteId) {
|
||||
await vk.callFunction({
|
||||
url: 'client/old/kh/confirmQuote',
|
||||
title: '请求中...',
|
||||
data: {
|
||||
quoteId,
|
||||
}
|
||||
});
|
||||
this.showDialog = false
|
||||
this.$message({
|
||||
message: "选择成功",
|
||||
type: 'success'
|
||||
})
|
||||
if (this.sheet.signMethod === 0) vk.navigateTo('/pages/public/contract?tab=1')
|
||||
else {
|
||||
if (this.sheet.signMethod === 1) vk.navigateTo('/pages/user/seller?menuIndex=2')
|
||||
else vk.navigateTo('/pages/public/contract')
|
||||
}
|
||||
},
|
||||
openDownload(url) {
|
||||
window.location.href = url
|
||||
// window.open(url)
|
||||
}
|
||||
},
|
||||
onLoad({id}) {
|
||||
this.id = id
|
||||
this.userInfo = vk.getStorageSync('uni_id_user_info')
|
||||
this.getDetail()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
padding-bottom: 150rpx;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
position: relative;
|
||||
padding-left: 20rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
line-height: 48rpx;
|
||||
color: #A92924;
|
||||
|
||||
&:before {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
z-index: 9;
|
||||
margin-top: -14rpx;
|
||||
content: '';
|
||||
width: 6rpx;
|
||||
height: 28rpx;
|
||||
background: #A92924;
|
||||
}
|
||||
|
||||
.more {
|
||||
font-size: 24rpx;
|
||||
font-weight: normal;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.layout-detail {
|
||||
padding: 20rpx 30rpx;
|
||||
}
|
||||
|
||||
.company {
|
||||
padding-bottom: 40rpx;
|
||||
border-bottom: 1px solid #f2f2f2;
|
||||
|
||||
.logo {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
}
|
||||
|
||||
.name-text {
|
||||
max-width: 380rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
line-height: 40rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.name-icon {
|
||||
width: 80rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
|
||||
.zhu {
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 32rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.detail-title {
|
||||
font-size: 26rpx;
|
||||
font-weight: 600;
|
||||
line-height: 40rpx;
|
||||
color: #101010;
|
||||
}
|
||||
|
||||
.detail-text {
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.fiexd-bottom {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
z-index: 99;
|
||||
width: 100%;
|
||||
height: 130rpx;
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
border-top: 1px solid #f2f2f2;
|
||||
|
||||
.text {
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
||||
.apply-btn {
|
||||
width: 220rpx;
|
||||
height: 70rpx;
|
||||
font-size: 26rpx;
|
||||
line-height: 70rpx;
|
||||
text-align: center;
|
||||
color: #ffffff;
|
||||
background: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.table-box {
|
||||
font-size: 24rpx;
|
||||
line-height: 28rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.tr {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.th {
|
||||
color: #666 !important;
|
||||
background: #FFF8F2;
|
||||
}
|
||||
|
||||
.th, .td {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 50%;
|
||||
height: 76rpx;
|
||||
color: #999;
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
border-left: 1px solid #f2f2f2;
|
||||
border-right: 1px solid #f2f2f2;
|
||||
border-bottom: 1px solid #f2f2f2;
|
||||
}
|
||||
|
||||
.td {
|
||||
border-right: 1px solid #f2f2f2;
|
||||
border-bottom: 1px solid #f2f2f2;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.td-3 {
|
||||
width: 33.33%;
|
||||
}
|
||||
|
||||
.popup-box {
|
||||
padding: 20rpx 20rpx;
|
||||
}
|
||||
|
||||
.popup-title {
|
||||
padding: 18rpx 0;
|
||||
border-bottom: 1px solid #A92924;
|
||||
|
||||
.title {
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
color: #A92924;
|
||||
}
|
||||
|
||||
.close {
|
||||
width: 80rpx;
|
||||
height: 40rpx;
|
||||
font-size: 22rpx;
|
||||
line-height: 40rpx;
|
||||
text-align: center;
|
||||
color: #ffffff;
|
||||
background: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.item-wrap {
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
color: #999999;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,523 @@
|
||||
<template> <!-- 旧货交易 -->
|
||||
<view class="wrap">
|
||||
<!-- 吸顶 -->
|
||||
<u-sticky offset-top="0" customNavHeight="0">
|
||||
<!-- 顶部 -->
|
||||
<uiheader title="旧货交易"></uiheader>
|
||||
<!-- 搜索栏 -->
|
||||
<cmsearch :k="keyword" @search="afterSearch"></cmsearch>
|
||||
</u-sticky>
|
||||
<!-- 轮播图-传值:list="数组" -->
|
||||
<cmswiper page="old" height="320rpx"></cmswiper>
|
||||
<!-- 四个入口 -->
|
||||
<view class="bg-white p-20 flex justify-center items-center">
|
||||
<view class="flex-1 mx-20">
|
||||
<u-button type="primary" shape="circle" size="mini" @click="toRelease">发布旧货</u-button>
|
||||
</view>
|
||||
<view class="flex-1 mx-20">
|
||||
<u-button type="primary" shape="circle" size="mini" plain @click="toMyEnquiry">我发布的</u-button>
|
||||
</view>
|
||||
<view class="flex-1 mx-20">
|
||||
<u-button type="primary" shape="circle" size="mini" plain @click="toMyQuote">我的报价</u-button>
|
||||
</view>
|
||||
</view>
|
||||
<cmfourth></cmfourth>
|
||||
<!-- 加急公告 -->
|
||||
<view class="layout layout-notice bg-white flex justify-start align-center">
|
||||
<view class="notice-left">
|
||||
<view>加急</view>
|
||||
<view>公告</view>
|
||||
</view>
|
||||
<view class="notice-right m-left-30">
|
||||
<swiper class="swiper-box" vertical="true" :autoplay="true" :interval="3000" :duration="1000"
|
||||
next-margin="48rpx">
|
||||
<swiper-item class="swiper-item" v-for="(item, index) in urgentList" :key="index"
|
||||
@click="$jump(`/pages/junk/detail?id=${item._id}`)">
|
||||
<view class="swiper-item">
|
||||
<view class="city" v-if="item.addressRegion && item.addressRegion.city">[{{
|
||||
item.addressRegion.city.name
|
||||
}}]
|
||||
</view>
|
||||
<template v-else>
|
||||
<view class="city" v-if="item.deliverAddressRegion && item.deliverAddressRegion.city">[{{
|
||||
item.deliverAddressRegion.city.name
|
||||
}}]
|
||||
</view>
|
||||
</template>
|
||||
<view class="text text-single">{{ item.title }}</view>
|
||||
<view class="date">{{ dayjs(item._add_time_str).format('MM-DD') }}</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 最新拍卖消息 -->
|
||||
<view class="layout layout-list">
|
||||
<view class="list-h2">
|
||||
<view class="big">最新拍卖消息</view>
|
||||
<view class="more" @click="listLink(0)">更多></view>
|
||||
</view>
|
||||
<view class="list-box m-top-10">
|
||||
<view class="li text-single" v-for="(item, index) in dataList[0]" :key="index"
|
||||
v-if="item.addressRegion && item.addressRegion.city "
|
||||
@click="$jump(`/pages/junk/detail?id=${item._id}`)">
|
||||
<text>【{{ item.addressRegion.city.name }}】</text>
|
||||
<text class="text-main" v-if="item.isUrgent">[加急]</text>
|
||||
{{ item.title }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 最新采购消息 -->
|
||||
<view class="layout layout-list">
|
||||
<view class="list-h2">
|
||||
<view class="big">最新采购消息</view>
|
||||
<view class="more" @click="listLink(1)">更多></view>
|
||||
</view>
|
||||
<view class="list-box m-top-10">
|
||||
<view class="li text-single" v-for="(item, index) in dataList[1]" :key="index"
|
||||
v-if="item.deliverAddressRegion && item.deliverAddressRegion.city "
|
||||
@click="$jump(`/pages/junk/detail?id=${item._id}`)">
|
||||
<text>【{{ item.deliverAddressRegion.city.name }}】</text>
|
||||
<text class="text-main" v-if="item.isUrgent">[加急]</text>
|
||||
{{ item.title }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 列表-最新租赁消息 -->
|
||||
<view class="layout layout-list">
|
||||
<view class="list-h2">
|
||||
<view class="big red">最新租赁消息</view>
|
||||
<view class="more" @click="listLink(2)">更多></view>
|
||||
</view>
|
||||
<view class="list-box m-top-10">
|
||||
<view class="li text-single" v-for="(item, index) in dataList[2]" :key="index"
|
||||
@click="$jump(`/pages/junk/detail?id=${item._id}`)">
|
||||
<text v-if="item.addressRegion && item.addressRegion.city">【{{ item.addressRegion.city.name }}】</text>
|
||||
<template v-else>
|
||||
<text v-if="item.deliverAddressRegion && item.deliverAddressRegion.city">【{{ item.deliverAddressRegion.city.name }}】</text>
|
||||
</template>
|
||||
<text class="text-main" v-if="item.isUrgent">[加急]</text>
|
||||
{{ item.title }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 列表-最新物资回收消息 -->
|
||||
<view class="layout layout-list">
|
||||
<view class="list-h2">
|
||||
<view class="big red">最新物资回收消息</view>
|
||||
<view class="more" @click="listLink(3)">更多></view>
|
||||
</view>
|
||||
<view class="list-box m-top-10">
|
||||
<view class="li text-single" v-for="(item, index) in dataList[3]" :key="index"
|
||||
v-if="item.addressRegion && item.addressRegion.city "
|
||||
@click="$jump(`/pages/junk/detail?id=${item._id}`)">
|
||||
<text>【{{ item.addressRegion.city.name }}】</text>
|
||||
<text class="text-main" v-if="item.isUrgent">[加急]</text>
|
||||
{{ item.title }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 品牌推荐 -->
|
||||
<view class="layout layout-brand bg-white">
|
||||
<view class="brand-img flex justify-center p-top-20">
|
||||
<image class="img" src="/static/img/brand.png" mode=""></image>
|
||||
</view>
|
||||
<view class="brand-box flex justify-between flex-wrap">
|
||||
<view class="item" v-for="(item, index) in companyList" :key="index"
|
||||
@click="$jump(`/pages/yellow/detail?id=${item.uid}`)">
|
||||
<view class="flex flex-col justify-start items-start ml-10" style="width: 290rpx">
|
||||
<view class="text text-24 flex-1 u-line-1">{{ item.company.companyName }}</view>
|
||||
<view class="main m-top-10 u-line-1">
|
||||
主营:{{
|
||||
(item.mainSpotCategory && item.mainSpotCategory.length > 0) ? item.mainSpotCategory.join() : (item.company.mainSpotCategorySelf || '')
|
||||
}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view v-if="showMore" class="more-btns">-->
|
||||
<!-- <view class="item" @click="toMyQuote">-->
|
||||
<!-- <u-icon name="order" color="#A92924" size="24"></u-icon>-->
|
||||
<!-- </view>-->
|
||||
<!-- <view class="item" @click="toMyEnquiry">-->
|
||||
<!-- <u-icon name="account" color="#A92924" size="24"></u-icon>-->
|
||||
<!-- </view>-->
|
||||
<!-- <view class="item" @click="toRelease">-->
|
||||
<!-- <u-icon name="plus" color="#A92924" size="24"></u-icon>-->
|
||||
<!-- </view>-->
|
||||
<!-- </view>-->
|
||||
<!-- <view class="issue" @click="showMore = !showMore">-->
|
||||
<!-- <u-icon :name="showMore ? 'close' : 'plus'" color="#fff" size="24"></u-icon>-->
|
||||
<!-- </view>-->
|
||||
<collapse></collapse>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uiheader from '@/components/index/header'
|
||||
import cmsearch from '@/components/common/search'
|
||||
import cmempty from '@/components/common/empty'
|
||||
import cmfourth from '@/components/common/fourth'
|
||||
import cmswiper from '@/components/common/swiper'
|
||||
import dayjs from 'dayjs'
|
||||
import Collapse from "@/components/index/collapse.vue";
|
||||
import {FactoryBuilding} from "@icon-park/vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
FactoryBuilding,
|
||||
Collapse,
|
||||
uiheader,
|
||||
cmsearch,
|
||||
cmempty,
|
||||
cmfourth,
|
||||
cmswiper,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
companyList: [],
|
||||
dataList: [],
|
||||
urgentList: [],
|
||||
allChildCate: [],
|
||||
keyword: '',
|
||||
showMore: false
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
dayjs,
|
||||
toMyEnquiry() {
|
||||
vk.navigateTo({
|
||||
url: '/pages/junk/my'
|
||||
})
|
||||
},
|
||||
toMyQuote() {
|
||||
vk.navigateTo({
|
||||
url: '/pages/junk/myQuote'
|
||||
})
|
||||
},
|
||||
listLink(type) {
|
||||
vk.navigateTo(`/pages/junk/list?type=${type}`);
|
||||
},
|
||||
async toRelease() {
|
||||
const {userInfo, accountNum} = await vk.callFunction({
|
||||
url: 'user/kh/getMyUserInfo'
|
||||
})
|
||||
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您尚未认证, 是否前往认证?',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 0)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请完善名片信息',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 1)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else if (accountNum === 0) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请先到个人中心添加收款账户',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 7)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
vk.navigateTo({
|
||||
url: '/pages/junk/publish'
|
||||
})
|
||||
}
|
||||
},
|
||||
async getInfo(id) {
|
||||
this.info = await vk.callFunction({
|
||||
url: 'client/goods/list/pub/getDetail',
|
||||
data: {
|
||||
id
|
||||
}
|
||||
})
|
||||
},
|
||||
getCategoryTreeData() {
|
||||
vk.callFunction({
|
||||
url: 'client/spot/category/pub/getTree',
|
||||
title: '请求中...',
|
||||
data: {},
|
||||
success: (data) => {
|
||||
this.allChildCate = []
|
||||
data.rows.forEach(item => {
|
||||
item.children.forEach(child => {
|
||||
this.allChildCate.push(child)
|
||||
})
|
||||
})
|
||||
this.getCompanyList()
|
||||
}
|
||||
});
|
||||
},
|
||||
async getCompanyList() {
|
||||
const {rows} = await vk.callFunction({
|
||||
url: 'client/user/pub/getCompany',
|
||||
data: {isCoop: 1}
|
||||
})
|
||||
this.companyList = rows.map(item => {
|
||||
item.name = item.company.companyName
|
||||
item.mainSpotCategory = []
|
||||
if (item.company && item.company.mainSpotCategoryIds) {
|
||||
this.allChildCate.forEach(child => {
|
||||
if (item.company.mainSpotCategoryIds.includes(child._id)) {
|
||||
item.mainSpotCategory.push(child.name)
|
||||
}
|
||||
})
|
||||
}
|
||||
return item
|
||||
})
|
||||
},
|
||||
afterSearch(keyword) {
|
||||
this.keyword = keyword
|
||||
this.getDataList()
|
||||
},
|
||||
async getDataList() {
|
||||
for (let i = 0; i < 4; i++) {
|
||||
const {rows} = await vk.callFunction({
|
||||
url: 'client/old/pub/getList',
|
||||
data: {
|
||||
type: i,
|
||||
keyword: this.keyword
|
||||
}
|
||||
})
|
||||
this.dataList[i] = rows.map(item => {
|
||||
item.addDate = dayjs(item._add_time).format('MM-DD')
|
||||
return item
|
||||
})
|
||||
this.$forceUpdate()
|
||||
}
|
||||
},
|
||||
async getUrgentList() {
|
||||
const {rows} = await vk.callFunction({
|
||||
url: 'client/old/pub/getList',
|
||||
data: {
|
||||
isUrgent: true
|
||||
}
|
||||
})
|
||||
this.urgentList = rows.map(item => {
|
||||
item.addDate = dayjs(item._add_time).format('MM-DD')
|
||||
return item
|
||||
})
|
||||
console.log(this.urgentList)
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.keyword) this.keyword = option.keyword
|
||||
this.getCategoryTreeData()
|
||||
this.getDataList()
|
||||
this.getUrgentList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #F8F8F8;
|
||||
}
|
||||
|
||||
.layout-notice {
|
||||
margin: 20rpx 30rpx;
|
||||
padding: 20rpx 20rpx;
|
||||
|
||||
.notice-left {
|
||||
width: 80rpx;
|
||||
height: 100%;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
line-height: 32rpx;
|
||||
color: #A92924;
|
||||
border-right: 1px solid #f2f2f2;
|
||||
}
|
||||
|
||||
.notice-right {
|
||||
width: 550rpx;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.swiper-box {
|
||||
width: 100%;
|
||||
height: 96rpx;
|
||||
}
|
||||
|
||||
.swiper-item {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 48rpx !important;
|
||||
overflow: hidden;
|
||||
font-size: 24rpx;
|
||||
line-height: 48rpx;
|
||||
color: #999999;
|
||||
|
||||
.text {
|
||||
margin: 0 10rpx;
|
||||
max-width: 300rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.layout-banner {
|
||||
padding: 0rpx 30rpx;
|
||||
|
||||
.banner {
|
||||
margin-top: 20rpx;
|
||||
width: 100%;
|
||||
height: 126rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.layout-brand {
|
||||
margin: 30rpx 30rpx 10rpx;
|
||||
|
||||
.brand-img {
|
||||
.img {
|
||||
width: 174rpx;
|
||||
height: 58rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.brand-box {
|
||||
padding: 10rpx;
|
||||
|
||||
.item {
|
||||
position: relative;
|
||||
width: 50%;
|
||||
height: 136rpx;
|
||||
//padding: 10rpx;
|
||||
box-sizing: border-box;
|
||||
border-bottom: 1px solid #f2f2f2;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.main {
|
||||
height: 36rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.company {
|
||||
width: 64rpx;
|
||||
//height: 64rpx;
|
||||
|
||||
.icon {
|
||||
width: 64rpx;
|
||||
height: 64rpx;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 25rpx;
|
||||
font-weight: 600;
|
||||
line-height: 48rpx;
|
||||
color: #101010;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.item:nth-child(2n+1) {
|
||||
border-right: 1px solid #f2f2f2;
|
||||
}
|
||||
|
||||
.item:nth-last-child(-n+2) {
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
|
||||
.layout-list {
|
||||
margin: 20rpx 30rpx 10rpx;
|
||||
border-radius: 12rpx;
|
||||
|
||||
.list-h2 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 10rpx 0rpx;
|
||||
|
||||
.big {
|
||||
font-size: 28rpx;
|
||||
line-height: 48rpx;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.more {
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
color: #A92924;
|
||||
}
|
||||
|
||||
.red {
|
||||
color: #A92924 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.list-box {
|
||||
padding: 20rpx 20rpx;
|
||||
background: #FFFDFD;
|
||||
border-radius: 20rpx;
|
||||
|
||||
.li {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 48rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 48rpx;
|
||||
color: #6c6c6c;
|
||||
text-indent: 1em;
|
||||
|
||||
&:before {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
z-index: 9;
|
||||
content: '';
|
||||
margin-top: -2px;
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
background: #A92924;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.more-btns {
|
||||
position: fixed;
|
||||
right: 30rpx;
|
||||
bottom: 220rpx;
|
||||
z-index: 99;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 90rpx;
|
||||
border-radius: 999rpx;
|
||||
background: white;
|
||||
border: 1px solid #A92924;
|
||||
|
||||
.item {
|
||||
margin: 20rpx 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,506 @@
|
||||
<template> <!-- 旧货详情 -->
|
||||
<view class="wrap">
|
||||
<!-- 吸顶 -->
|
||||
<u-sticky offset-top="0" customNavHeight="0">
|
||||
<!-- 顶部 -->
|
||||
<uiheader></uiheader>
|
||||
<!-- 搜索栏 -->
|
||||
<cmsearch></cmsearch>
|
||||
</u-sticky>
|
||||
<!-- 四个入口 -->
|
||||
<view class="bg-white">
|
||||
<cmfourth :type="type"/>
|
||||
</view>
|
||||
<!-- 选择器 -->
|
||||
<view class="layout-pick flex justify-between align-center bg-white">
|
||||
<view class="flex justify-start">
|
||||
<view class="ip down" @click="isPick = true">分类:{{ pickValue }}</view>
|
||||
<view class="ip down ml-35" @click="showRentType = true" v-if="type === 2">{{ rentTypeStr }}</view>
|
||||
</view>
|
||||
<view class="ip down" @click="showAddress">省份:{{ locationValue }}</view>
|
||||
</view>
|
||||
<view class="layout layout-detail">
|
||||
<template v-if="type === 0">
|
||||
<uiswiper :ad="15" padding="10rpx 0"></uiswiper>
|
||||
<uiswiper :ad="16" padding="10rpx 0"></uiswiper>
|
||||
</template>
|
||||
<template v-if="type === 1">
|
||||
<uiswiper :ad="17" padding="10rpx 0"></uiswiper>
|
||||
<uiswiper :ad="18" padding="10rpx 0"></uiswiper>
|
||||
</template>
|
||||
<template v-if="type === 2">
|
||||
<uiswiper :ad="19" padding="10rpx 0"></uiswiper>
|
||||
<uiswiper :ad="20" padding="10rpx 0"></uiswiper>
|
||||
</template>
|
||||
<template v-if="type === 3">
|
||||
<uiswiper :ad="21" padding="10rpx 0"></uiswiper>
|
||||
<uiswiper :ad="22" padding="10rpx 0"></uiswiper>
|
||||
</template>
|
||||
<view class="item flex flex-col " v-for="(item, index) in goodsData.rows" :key="index">
|
||||
<!-- <view class="img">-->
|
||||
<!-- <image class="full" src="/static/img/abc-1.png" mode=""></image>-->
|
||||
<!-- </view>-->
|
||||
<view class="info flex-1 p-left-30" @click="$jump(`/pages/junk/detail?id=${item._id}`)">
|
||||
<view class="title text-single">
|
||||
<text>{{ item.title }}</text>
|
||||
<text class="text-main" v-if="item.isUrgent">[加急]</text>
|
||||
</view>
|
||||
<view class="flex justify-start items-start flex-col">
|
||||
<view class="p half">
|
||||
<text class="lb">企业</text>
|
||||
<text v-if="![0, 2, 3].includes(item.type) ">
|
||||
{{ item.buyer.companyName ? item.buyer.companyName : '无' }}
|
||||
</text>
|
||||
<text v-else>{{ item.supplier.companyName ? item.supplier.companyName : '无' }}</text>
|
||||
</view>
|
||||
<view class="p half">
|
||||
<text class="lb">所属分类</text>
|
||||
{{ item.category[1] }}
|
||||
</view>
|
||||
<view class="p">
|
||||
<text class="lb">所在区域</text>
|
||||
{{ item.addressStr }}
|
||||
</view>
|
||||
<view class="flex justify-between items-center">
|
||||
<view class="p half">
|
||||
<text class="lb">发布时间</text>
|
||||
{{ item._add_time_str }}
|
||||
</view>
|
||||
<view class="p half">
|
||||
<text class="lb">有效期至</text>
|
||||
{{ item.expiredTime }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="buttons">
|
||||
<button class="btn" plain @click="doShowContract(index)">查看电话
|
||||
</button>
|
||||
<button class="btn green" plain @click="doShowWechat(index)">添加微信
|
||||
</button>
|
||||
<button class="btn" plain @click="$jump(`/pages/junk/detail?id=${item._id}`)"
|
||||
v-if="item.type !== 2">
|
||||
{{ item.uid === userInfo._id ? '查看报价' : '我要报价' }}
|
||||
</button>
|
||||
<button class="btn" plain @click="$jump(`/pages/junk/detail?id=${item._id}`)"
|
||||
v-else-if="item.type === 2 && item.rentType === 0">
|
||||
{{ item.uid === userInfo._id ? '查看报价' : '我要报价' }}
|
||||
</button>
|
||||
<view class="wechat"
|
||||
v-if="item.user && parseInt(item.user.accountType) === 2 && item.user.businessCard && item.user.businessCard.companyWechat && item.showWechat">
|
||||
<el-image :src="item.user.businessCard.companyWechat" style="width: 100%; height: 100%"/>
|
||||
</view>
|
||||
<view class="wechat"
|
||||
v-if="item.user && parseInt(item.user.accountType) === 1 && item.user.businessCard && item.user.businessCard.personalWechat && item.showWechat">
|
||||
<el-image :src="item.user.businessCard.personalWechat" style="width: 100%; height: 100%"/>
|
||||
</view>
|
||||
<view class="mobile" v-if="item.user && item.showContract && item.user.businessCard">
|
||||
<i class="el-icon-phone"></i>
|
||||
<text class="ml-20" v-if="item.buyer && item.buyer.managerContract">{{ item.buyer.managerContract }}</text>
|
||||
<text class="ml-20" v-else-if="item.supplier && item.supplier.managerContract">
|
||||
{{ item.supplier.managerContract }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-empty mode="list" text="暂无更多内容~" v-if="goodsData.rows.length === 0"></u-empty>
|
||||
<!-- 悬浮按钮 -->
|
||||
<view class="issue" @click="toRelease">
|
||||
<u-icon name="plus" color="#fff" size="24"></u-icon>
|
||||
</view>
|
||||
<AddressSelect ref="AddressSelect" @confirm="regionConfirm"/>
|
||||
<u-picker v-if="isPick" :show="isPick" :columns="[categoryTreeData, categoryTreeData[cateIndex[0]].children]"
|
||||
key-name="name" @confirm="handConfirmPick" @change="handleChangeCate" @cancel="isPick = false">
|
||||
<template #more>
|
||||
<text @click="resetCate">重置</text>
|
||||
<text @click="otherCate" class="ml-20">其他</text>
|
||||
</template>
|
||||
</u-picker>
|
||||
<u-picker v-if="showRentType" :show="showRentType"
|
||||
:columns="[[{name: '承租信息', value: 0}, {name: '出租信息', value: 1}], ]"
|
||||
key-name="name" @confirm="handConfirmRentType" @cancel="showRentType = false">
|
||||
</u-picker>
|
||||
<collapse></collapse>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uiheader from '@/components/index/header'
|
||||
import cmsearch from '@/components/common/search'
|
||||
import cmempty from '@/components/common/empty'
|
||||
import cmfourth from '@/components/common/fourth'
|
||||
import dayjs from 'dayjs'
|
||||
import Collapse from "@/components/index/collapse.vue";
|
||||
import AddressSelect from "@/components/AddressSelect.vue";
|
||||
import uiswiper from "@/components/index/swiper.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
uiswiper,
|
||||
AddressSelect, Collapse,
|
||||
uiheader,
|
||||
cmsearch,
|
||||
cmempty,
|
||||
cmfourth,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
type: 1,
|
||||
pageSize: 500,
|
||||
keyword: '',
|
||||
checkProvinceList: [],
|
||||
checkCategoryList: [],
|
||||
goodsData: {
|
||||
total: 0,
|
||||
rows: []
|
||||
},
|
||||
oldType: [
|
||||
'拍卖信息',
|
||||
'采购信息',
|
||||
'承租信息',
|
||||
'物资回收信息',
|
||||
],
|
||||
categoryTreeData: [],
|
||||
allChildCate: [],
|
||||
locationValue: '全国',
|
||||
pickValue: '全部',
|
||||
isPick: false,
|
||||
cateId: null,
|
||||
cateIndex: [0, 0],
|
||||
region: {
|
||||
province: {
|
||||
code: null,
|
||||
name: null,
|
||||
}
|
||||
},
|
||||
userInfo: null,
|
||||
rentType: 0,
|
||||
rentTypeStr: '承租信息',
|
||||
showRentType: false
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
handleChangeCate({indexs}) {
|
||||
this.cateIndex = indexs
|
||||
},
|
||||
handConfirmPick({value}) {
|
||||
this.pickValue = value[1].name
|
||||
this.cateId = value[1]._id
|
||||
this.isPick = false
|
||||
this.search(1)
|
||||
},
|
||||
handConfirmRentType({value}) {
|
||||
this.rentType = value[0].value
|
||||
this.rentTypeStr = value[0].name
|
||||
this.showRentType = false
|
||||
this.search(1)
|
||||
},
|
||||
resetCate() {
|
||||
this.cateIndex = [0, 0]
|
||||
this.pickValue = '全部'
|
||||
this.cateId = null
|
||||
this.isPick = false
|
||||
this.search(1)
|
||||
},
|
||||
otherCate() {
|
||||
this.cateIndex = [0]
|
||||
this.pickValue = '其他'
|
||||
this.cateId = 0
|
||||
this.isPick = false
|
||||
this.search(1)
|
||||
},
|
||||
|
||||
showAddress() {
|
||||
this.$refs.AddressSelect.open(this.region, 1, true);
|
||||
},
|
||||
regionConfirm({province}) {
|
||||
this.region = {province}
|
||||
this.locationValue = `${province.name}`
|
||||
this.search(1)
|
||||
},
|
||||
async toRelease() {
|
||||
const {
|
||||
userInfo, accountNum
|
||||
} = await vk.callFunction({
|
||||
url: 'user/kh/getMyUserInfo'
|
||||
})
|
||||
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您尚未认证, 是否前往认证?',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 0)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请完善名片信息',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 1)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else if (accountNum === 0) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请先到个人中心添加收款账户',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 7)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
if (userInfo.businessCard.status !== 1) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您的名片信息未审核,请耐心等待',
|
||||
})
|
||||
return
|
||||
}
|
||||
vk.navigateTo({
|
||||
url: '/pages/junk/publish'
|
||||
})
|
||||
}
|
||||
},
|
||||
async toMy() {
|
||||
const {
|
||||
userInfo
|
||||
} = await vk.callFunction({
|
||||
url: 'user/kh/getMyUserInfo'
|
||||
})
|
||||
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您尚未认证, 是否前往认证?',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 0)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请完善名片信息',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 1)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
vk.navigateTo({
|
||||
url: '/pages/junk/my'
|
||||
})
|
||||
}
|
||||
},
|
||||
search(pageIndex) {
|
||||
// const categoryIds = []
|
||||
// this.allChildCate.map(item => {
|
||||
// if (this.checkCategoryList.indexOf(item._id) > -1) categoryIds.push(item.name)
|
||||
// })
|
||||
vk.callFunction({
|
||||
url: 'client/old/pub/getList',
|
||||
title: '加载中...',
|
||||
data: {
|
||||
pageIndex,
|
||||
pageSize: this.pageSize,
|
||||
keyword: this.keyword,
|
||||
type: this.type,
|
||||
categoryIds: this.cateId !== null ? [this.cateId] : null,
|
||||
provinceCodes: this.region.province.code ? [this.region.province.code] : null,
|
||||
rentType: this.rentType
|
||||
},
|
||||
success: (data) => {
|
||||
data.rows.map(item => {
|
||||
if (item.type === 1) item.addressStr = (item.deliverAddressRegion && item.deliverAddressRegion.city) ? (item.deliverAddressRegion.province.name + "-" + item.deliverAddressRegion.city.name) : ''
|
||||
else {
|
||||
if (item.type === 2) {
|
||||
if (item.addressRegion && item.addressRegion.city) {
|
||||
item.addressStr = (item.addressRegion && item.addressRegion.city) ? (item.addressRegion.province.name + "-" + item.addressRegion.city.name) : ''
|
||||
} else {
|
||||
if (item.deliverAddressRegion && item.deliverAddressRegion.city) {
|
||||
item.addressStr = (item.deliverAddressRegion && item.deliverAddressRegion.city) ? (item.deliverAddressRegion.province.name + "-" + item.deliverAddressRegion.city.name) : ''
|
||||
}
|
||||
}
|
||||
}else {
|
||||
item.addressStr = (item.addressRegion && item.addressRegion.city) ? (item.addressRegion.province.name + "-" + item.addressRegion.city.name) : (item.deliverAddressRegion.province.name + "-" + item.deliverAddressRegion.city.name)
|
||||
}
|
||||
}
|
||||
item.expiredTime = item.expiredTime ? dayjs(item.expiredTime).format('YYYY-MM-DD') : ''
|
||||
item.showWechat = false
|
||||
item.showContract = false
|
||||
return item
|
||||
})
|
||||
this.goodsData = data
|
||||
}
|
||||
});
|
||||
},
|
||||
doShowWechat(index) {
|
||||
if (parseInt(this.goodsData.rows[index].user.accountType) === 2 && !this.goodsData.rows[index].user.businessCard.companyWechat)
|
||||
return vk.toast('用户暂未上传')
|
||||
else if (parseInt(this.goodsData.rows[index].user.accountType) === 1 && !this.goodsData.rows[index].user.businessCard.personalWechat)
|
||||
return vk.toast('用户暂未上传')
|
||||
this.goodsData.rows[index].showContract = false
|
||||
this.goodsData.rows[index].showWechat = !this.goodsData.rows[index].showWechat
|
||||
},
|
||||
doShowContract(index) {
|
||||
this.goodsData.rows[index].showWechat = false
|
||||
this.goodsData.rows[index].showContract = !this.goodsData.rows[index].showContract
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.userInfo = vk.getStorageSync('uni_id_user_info')
|
||||
if (option.type) {
|
||||
this.type = parseInt(option.type)
|
||||
this.search(1)
|
||||
vk.callFunction({
|
||||
url: 'client/old/pub/getTree',
|
||||
title: '请求中...',
|
||||
data: {type: parseInt(this.type)},
|
||||
success: (data) => {
|
||||
this.categoryTreeData = data.rows
|
||||
this.allChildCate = []
|
||||
this.categoryTreeData.forEach(item => {
|
||||
item.children.forEach(child => {
|
||||
this.allChildCate.push(child)
|
||||
})
|
||||
})
|
||||
}
|
||||
});
|
||||
} else uni.navigateBack()
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.layout-pick {
|
||||
width: 690rpx;
|
||||
height: 68rpx;
|
||||
padding: 0 30rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
color: #4F4F4F;
|
||||
|
||||
.ip {
|
||||
position: relative;
|
||||
//max-width: 33.333%;
|
||||
height: 40rpx;
|
||||
padding-right: 30rpx;
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.down::after {
|
||||
position: absolute;
|
||||
right: 10rpx;
|
||||
top: 50%;
|
||||
z-index: 9;
|
||||
content: '';
|
||||
margin-top: -6rpx;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-left: 10rpx solid transparent;
|
||||
border-right: 10rpx solid transparent;
|
||||
border-top: 12rpx solid #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.layout-detail {
|
||||
padding: 30rpx 30rpx;
|
||||
|
||||
.item {
|
||||
margin-top: 30rpx;
|
||||
padding: 30rpx 30rpx;
|
||||
background: #ffffff;
|
||||
|
||||
&:nth-child(1) {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.img {
|
||||
width: 160rpx;
|
||||
height: 130rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
line-height: 40rpx;
|
||||
color: #4b4b4b;
|
||||
}
|
||||
|
||||
.p {
|
||||
padding: 5rpx 0;
|
||||
height: 40rpx;
|
||||
overflow: hidden;
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
color: #4b4b4b;
|
||||
}
|
||||
|
||||
.lb {
|
||||
padding-right: 6rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.buttons {
|
||||
margin-top: 20rpx;
|
||||
padding: 0 20rpx;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
|
||||
.btn {
|
||||
height: 60rpx;
|
||||
font-size: 25rpx;
|
||||
width: 220rpx;
|
||||
margin: 0 10rpx;
|
||||
}
|
||||
|
||||
.green {
|
||||
background-color: #7ec050 !important;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.wechat {
|
||||
position: absolute;
|
||||
left: 240rpx;
|
||||
top: -200rpx;
|
||||
width: 150rpx;
|
||||
height: 150rpx;
|
||||
background-color: white;
|
||||
border-radius: 10rpx;
|
||||
padding: 5rpx;
|
||||
box-shadow: 0 1px 10px 0 #eee
|
||||
}
|
||||
|
||||
.mobile {
|
||||
position: absolute;
|
||||
left: -12rpx;
|
||||
top: -60rpx;
|
||||
background-color: white;
|
||||
border-radius: 10rpx;
|
||||
padding: 5rpx;
|
||||
box-shadow: 0 1px 10rpx 0 #aaa;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,208 @@
|
||||
<template>
|
||||
<view class="wrap">
|
||||
<u-sticky offset-top="0" customNavHeight="0">
|
||||
<uititle title="我发布的旧货"></uititle>
|
||||
</u-sticky>
|
||||
<view class="issue" @click="toRelease">
|
||||
<u-icon name="plus" color="#fff" size="24"></u-icon>
|
||||
</view>
|
||||
<view class="layout-goods">
|
||||
<view class="goods-box p-top-10" v-if="list.length">
|
||||
<view class="item bg-white" v-for="(item, index) in list"
|
||||
:key="index">
|
||||
<view @click="detailLink(item._id)" class="askfor">查看详情</view>
|
||||
<view @click="detailLink(item._id)" class="title text-single">{{ item.title }}</view>
|
||||
<view class="text m-top-10">{{ typeList[item.type].label }}</view>
|
||||
<view @click="detailLink(item._id)" class="text m-top-10">
|
||||
<text class="red" v-if="item.addressRegion && item.addressRegion.province">
|
||||
所在地:{{ item.addressRegion.province.name }} {{ item.addressRegion.city.name }} {{
|
||||
item.addressRegion.area.name
|
||||
}}
|
||||
</text>
|
||||
<text class="red">{{ item.quoteNum }}家已报价</text>
|
||||
</view>
|
||||
<text @click="detailLink(item._id)" class="text-25 text-gray" v-if="item.remark">备注:{{ item.remark }}</text>
|
||||
<view @click="detailLink(item._id)" class="date">{{ item._add_time_str }} 发布</view>
|
||||
<view>
|
||||
<u-button type="primary" plain size="mini" @click="del(item._id)">删除</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-empty v-else text="您未发布旧货"></u-empty>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uititle from '@/components/common/title'
|
||||
|
||||
export default {
|
||||
name: "my",
|
||||
components: {uititle},
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
userInfo: null,
|
||||
typeList: [
|
||||
{value: 0, label: '拍卖'},
|
||||
{value: 1, label: '采购'},
|
||||
{value: 2, label: '租赁'},
|
||||
{value: 3, label: '物资回收'},
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
detailLink(id) {
|
||||
vk.navigateTo(`/pages/junk/detail?id=${id}`);
|
||||
},
|
||||
async getList() {
|
||||
const {rows} = await vk.callFunction({
|
||||
url: 'client/old/kh/getList'
|
||||
})
|
||||
this.list = rows
|
||||
},
|
||||
async toRelease() {
|
||||
const {userInfo, accountNum} = await vk.callFunction({
|
||||
url: 'user/kh/getMyUserInfo'
|
||||
})
|
||||
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您尚未认证, 是否前往认证?',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 0)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请完善名片信息',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 1)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else if (accountNum === 0) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请先到个人中心添加收款账户',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 7)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
vk.navigateTo({
|
||||
url: '/pages/junk/publish'
|
||||
})
|
||||
}
|
||||
},
|
||||
del(_id) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '如果你要删除此条信息,之前其他客户填写的留言将无法查看',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
vk.callFunction({
|
||||
url: 'client/old/kh/delete',
|
||||
title: '请求中...',
|
||||
data: {
|
||||
_id
|
||||
},
|
||||
}).then(res => {
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.userInfo = vk.getStorageSync('uni_id_user_info')
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.layout-goods {
|
||||
// width: 690rpx;
|
||||
padding: 10rpx 30rpx;
|
||||
|
||||
.item {
|
||||
position: relative;
|
||||
margin-top: 30rpx;
|
||||
padding: 10rpx 20rpx 20rpx;
|
||||
border-radius: 12rpx;
|
||||
|
||||
.title {
|
||||
width: 90%;
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
line-height: 48rpx;
|
||||
color: #101010;
|
||||
}
|
||||
|
||||
.link, .askfor {
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
top: 16rpx;
|
||||
z-index: 9;
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #A92924;
|
||||
padding: 4rpx 8rpx;
|
||||
}
|
||||
|
||||
.link {
|
||||
border: 1px solid #A92924;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.red {
|
||||
margin-right: 20rpx;
|
||||
color: #A92924;
|
||||
}
|
||||
|
||||
.date {
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #9a9a9a;
|
||||
}
|
||||
|
||||
.company {
|
||||
height: 40rpx;
|
||||
|
||||
.icon {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
|
||||
.text {
|
||||
//width: 300rpx;
|
||||
height: 40rpx;
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
color: #4f4f4f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.item:nth-child(1) {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,182 @@
|
||||
<template>
|
||||
<view class="wrap">
|
||||
<u-sticky offset-top="0" customNavHeight="0">
|
||||
<uititle title="我的报价"></uititle>
|
||||
</u-sticky>
|
||||
<view class="issue" @click="toRelease">
|
||||
<u-icon name="plus" color="#fff" size="24"></u-icon>
|
||||
</view>
|
||||
<view class="layout-goods">
|
||||
<view class="goods-box p-top-10" v-if="list.length">
|
||||
<view class="item bg-white" @click="detailLink(item.sheetId)" v-for="(item, index) in list"
|
||||
:key="index">
|
||||
<view class="askfor">查看详情</view>
|
||||
<view class="title text-single">{{ item.sheet.title }}</view>
|
||||
<view class="text m-top-10">
|
||||
<text class="red">{{ typeList[item.sheet.type].label }}</text>
|
||||
<text class="red">金额:{{ parseInt(item.totalPrice) }}元</text>
|
||||
</view>
|
||||
<view class="my-10 text-25 red font-bold">{{ item.status === 0 ? '待选商' : '已被选商' }}</view>
|
||||
<view class="my-10 text-25 text-gray" v-if="item.remark">备注:{{ item.remark }}</view>
|
||||
<view class="date">{{ item._add_time_str }} 发布</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-empty v-else text="您未报价"></u-empty>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uititle from '@/components/common/title'
|
||||
|
||||
export default {
|
||||
name: "my",
|
||||
components: {uititle},
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
userInfo: null,
|
||||
typeList: [
|
||||
{value: 0, label: '拍卖'},
|
||||
{value: 1, label: '采购'},
|
||||
{value: 2, label: '租赁'},
|
||||
{value: 3, label: '物资回收'},
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
detailLink(sheetId) {
|
||||
vk.navigateTo(`/pages/junk/detail?id=${sheetId}`);
|
||||
},
|
||||
async getList() {
|
||||
const {rows} = await vk.callFunction({
|
||||
url: 'client/old/kh/getMyQuoteList'
|
||||
})
|
||||
this.list = rows
|
||||
},
|
||||
async toRelease() {
|
||||
const {userInfo, accountNum} = await vk.callFunction({
|
||||
url: 'user/kh/getMyUserInfo'
|
||||
})
|
||||
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您尚未认证, 是否前往认证?',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 0)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请完善名片信息',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 1)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else if (accountNum === 0) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请先到个人中心添加收款账户',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 7)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
vk.navigateTo({
|
||||
url: '/pages/old/publish'
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
onShow() {
|
||||
this.userInfo = vk.getStorageSync('uni_id_user_info')
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.layout-goods {
|
||||
// width: 690rpx;
|
||||
padding: 10rpx 30rpx;
|
||||
|
||||
.item {
|
||||
position: relative;
|
||||
margin-top: 10rpx;
|
||||
padding: 10rpx 20rpx 20rpx;
|
||||
border-radius: 12rpx;
|
||||
|
||||
.title {
|
||||
width: 90%;
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
line-height: 48rpx;
|
||||
color: #101010;
|
||||
}
|
||||
|
||||
.link, .askfor {
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
top: 16rpx;
|
||||
z-index: 9;
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #A92924;
|
||||
padding: 4rpx 8rpx;
|
||||
}
|
||||
|
||||
.link {
|
||||
border: 1px solid #A92924;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.red {
|
||||
margin-right: 20rpx;
|
||||
color: #A92924;
|
||||
}
|
||||
|
||||
.date {
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #9a9a9a;
|
||||
}
|
||||
|
||||
.company {
|
||||
height: 40rpx;
|
||||
|
||||
.icon {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
|
||||
.text {
|
||||
//width: 300rpx;
|
||||
height: 40rpx;
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
color: #4f4f4f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.item:nth-child(1) {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,147 @@
|
||||
<template>
|
||||
<view class="wrap">
|
||||
<!-- 吸顶 -->
|
||||
<u-sticky offset-top="0" customNavHeight="0">
|
||||
<uititle title="发布旧货信息"></uititle>
|
||||
</u-sticky>
|
||||
<u-tabs :list="tabList" @click="click"></u-tabs>
|
||||
<view class="layout layout-publish m-top-10 bg-white p-30" v-if="user && pass">
|
||||
<type_0 :urgentAmount="urgentAmount" :remainOldNum="remainOldNum" v-if="activeIndex === 0"
|
||||
:buyOldNumAmount="buyOldNumAmount" :user="user" :unit-list="unitList"
|
||||
:commonContractUrl="commonContractUrl" :contactList="contactList"/>
|
||||
<type_1 :urgentAmount="urgentAmount" :remainOldNum="remainOldNum" v-if="activeIndex === 1"
|
||||
:buyOldNumAmount="buyOldNumAmount" :user="user"
|
||||
:commonContractUrl="commonContractUrl" :contactList="contactList"/>
|
||||
<type_2 :urgentAmount="urgentAmount" :remainOldNum="remainOldNum" v-if="activeIndex === 2"
|
||||
:buyOldNumAmount="buyOldNumAmount" :user="user"
|
||||
:commonContractUrl="commonContractUrl" :contactList="contactList"/>
|
||||
<type_3 :urgentAmount="urgentAmount" :remainOldNum="remainOldNum" :user="user" v-if="activeIndex === 3"
|
||||
:buyOldNumAmount="buyOldNumAmount" :contactList="contactList"/>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uititle from "@/components/common/title.vue";
|
||||
import Type_0 from "./release/type_0.vue";
|
||||
import Type_1 from "./release/type_1.vue";
|
||||
import Type_2 from "./release/type_2.vue";
|
||||
import Type_3 from "./release/type_3.vue";
|
||||
import {getUserLevelLabel} from "@/util";
|
||||
|
||||
export default {
|
||||
name: "publish",
|
||||
components: {uititle, Type_3, Type_2, Type_1, Type_0},
|
||||
data() {
|
||||
return {
|
||||
tabList: [{
|
||||
name: '拍卖信息发布',
|
||||
}, {
|
||||
name: '采购信息发布',
|
||||
}, {
|
||||
name: '租赁信息发布'
|
||||
}, {
|
||||
name: '物资回收信息发布'
|
||||
}],
|
||||
activeIndex: 0,
|
||||
urgentAmount: 1,
|
||||
remainOldNum: 0,
|
||||
buyOldNumAmount: 5,
|
||||
agreement: '',
|
||||
commonContractUrl: '',
|
||||
contactList: [],
|
||||
unitList: [],
|
||||
user: null,
|
||||
pass: false,
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
click({index}) {
|
||||
this.activeIndex = index
|
||||
},
|
||||
async getContactList() {
|
||||
const {rows} = await vk.callFunction({
|
||||
url: 'client/businessContact/kh/getList',
|
||||
})
|
||||
this.contactList = rows
|
||||
if (!this.contactList.length) {
|
||||
return uni.showModal({
|
||||
title: '提示',
|
||||
content: '您还未添加联系人,请先添加联系人',
|
||||
showCancel: false,
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 8)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
this.pass = true
|
||||
},
|
||||
async getUrgentAmount() {
|
||||
const res = await vk.callFunction({
|
||||
url: 'client/dict/pub/getDetail',
|
||||
data: {
|
||||
id: '6587dd2fe0ec19027452c5b5'
|
||||
},
|
||||
})
|
||||
this.urgentAmount = res.content
|
||||
},
|
||||
async getBuyOldAmount() {
|
||||
const res = await vk.callFunction({
|
||||
url: 'client/dict/pub/getDetail',
|
||||
data: {
|
||||
id: '6587dd54189f86d49b3d5ff5'
|
||||
},
|
||||
})
|
||||
this.buyOldNumAmount = res.content
|
||||
},
|
||||
async getUserInfo() {
|
||||
const {userInfo} = await vk.userCenter.getCurrentUserInfo()
|
||||
this.remainOldNum = userInfo.remainOldNum ? parseInt(userInfo.remainOldNum) : 0
|
||||
this.user = userInfo
|
||||
console.log(this.user)
|
||||
},
|
||||
async getUnitList() {
|
||||
const res = await vk.callFunction({
|
||||
url: 'client/dict/pub/getDetail',
|
||||
data: {
|
||||
id: 'a45325976635f10600341a7f2f472cd1'
|
||||
},
|
||||
})
|
||||
this.unitList = res.content.split(',')
|
||||
},
|
||||
},
|
||||
async onShow() {
|
||||
vk.userCenter.getCurrentUserInfo({
|
||||
success: (data) => {
|
||||
this.remainOldNum = data.userInfo.remainOldNum ? parseInt(data.userInfo.remainOldNum) : 0
|
||||
if (this.remainOldNum === 0) {
|
||||
this.$confirm('您的旧货发布次数已用完,是否立即购买?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const {data} = await vk.callFunction({
|
||||
url: 'client/old/kh/buyNum',
|
||||
})
|
||||
vk.navigateTo({
|
||||
url: `/pages/shop/pay?id=${data}`
|
||||
})
|
||||
}).catch(() => {
|
||||
vk.navigateBack()
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
await this.getUserInfo()
|
||||
await this.getContactList()
|
||||
await this.getUrgentAmount()
|
||||
await this.getBuyOldAmount()
|
||||
// await this.getAgreement()
|
||||
await this.getUnitList()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,950 @@
|
||||
<template>
|
||||
<view class="flex flex-col justify-start items-start">
|
||||
<text class="text-50">发布我的拍卖信息</text>
|
||||
<text class="text-gray">拍卖信息越完整,成功交易越容易</text>
|
||||
<view class="layout w-100p m-top-10">
|
||||
<view class="goods-item half flex align-center flex-wrap w-100p">
|
||||
<text class="need text-red">*</text>
|
||||
<view class="lb">物资分类:</view>
|
||||
<view class="vl flex-1 p-right-20" @click="openPicker">
|
||||
<u--input
|
||||
style="pointer-events:none"
|
||||
placeholder="请选择"
|
||||
v-model="cateName"
|
||||
fontSize="24rpx"
|
||||
suffixIcon="arrow-down-fill"
|
||||
suffixIconStyle="font-size: 10px;color: #d5d5d5"
|
||||
:disabled="true"
|
||||
disabledColor="#fff"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
|
||||
<el-checkbox label="其他分类" v-model="form.otherCate" class="mx-20"></el-checkbox>
|
||||
<u--input
|
||||
placeholder="请选择"
|
||||
v-model="form.otherCateName"
|
||||
fontSize="24rpx"
|
||||
:disabled="!form.otherCate"
|
||||
@change="setOther"
|
||||
></u--input>
|
||||
</view>
|
||||
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
|
||||
<text class="need text-red">*</text>
|
||||
<view class="lb">信息标题:</view>
|
||||
<view class="vl flex-1 p-right-20">
|
||||
<u--input
|
||||
placeholder="一句话简介物资,如拍卖直缝钢管200吨等"
|
||||
v-model="form.title"
|
||||
fontSize="24rpx"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
|
||||
<view class="lb">采购物资详情:</view>
|
||||
<view class="vl flex-1 p-right-20">
|
||||
<u--textarea
|
||||
placeholder="请详细描述物资信息,描述内容:材料名称、材质......(限300字以内)"
|
||||
v-model="form.desc"
|
||||
fontSize="24rpx"
|
||||
></u--textarea>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
|
||||
<view class="lb">拍卖实物:</view>
|
||||
<view class="vl flex-1 p-right-20">
|
||||
<u-upload
|
||||
multiple
|
||||
:fileList="files"
|
||||
@afterRead="afterRead"
|
||||
@delete="deletePic"
|
||||
width="120rpx"
|
||||
height="120rpx"
|
||||
></u-upload>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
|
||||
<text class="need text-red">*</text>
|
||||
<view class="lb">物资所在地:</view>
|
||||
<view class="vl flex-1 p-right-20" @click="showAddress">
|
||||
<u--input
|
||||
style="pointer-events:none"
|
||||
placeholder="请选择"
|
||||
v-model="region"
|
||||
fontSize="24rpx"
|
||||
suffixIcon="arrow-down-fill"
|
||||
suffixIconStyle="font-size: 10px;color: #d5d5d5"
|
||||
:disabled="true"
|
||||
disabledColor="#fff"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
|
||||
<view class="lb">物资详细地址:</view>
|
||||
<view class="vl flex-1 p-right-20">
|
||||
<u--input placeholder="请输入物资详细地址" v-model="form.addressDetail"></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="goods-item half flex align-center flex-wrap mt-20 w-100p">-->
|
||||
<!-- <view class="lb">起拍数:</view>-->
|
||||
<!-- <view class="vl flex-1 p-right-20">-->
|
||||
<!-- <u--input placeholder="请选择" v-model="form.startNum"></u--input>-->
|
||||
<!-- </view>-->
|
||||
<!-- </view>-->
|
||||
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
|
||||
<view class="lb">起拍计价单位:</view>
|
||||
<view class="vl flex-1 p-right-20" @click="showUnit = true">
|
||||
<u--input placeholder="请输入起拍计价单位" v-model="form.unit" style="pointer-events:none"
|
||||
fontSize="24rpx"
|
||||
suffixIcon="arrow-down-fill"
|
||||
suffixIconStyle="font-size: 10px;color: #d5d5d5"
|
||||
:disabled="true"
|
||||
disabledColor="#fff"></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
|
||||
<view class="lb">起拍人民币单价:</view>
|
||||
<view class="vl flex-1 p-right-20">
|
||||
<u--input placeholder="请输入内容" v-model="form.startAmount"></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
|
||||
<text class="need text-red">*</text>
|
||||
<view class="lb">拍卖信息失效时间:</view>
|
||||
<view class="vl flex-1 p-right-20" @click="showExpire = true">
|
||||
<u--input placeholder="请选择" v-model="form.expiredTime" style="pointer-events:none"
|
||||
fontSize="24rpx"
|
||||
suffixIcon="arrow-down-fill"
|
||||
suffixIconStyle="font-size: 10px;color: #d5d5d5"
|
||||
:disabled="true"
|
||||
disabledColor="#fff"></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="expire-tip">温馨提示:为保证信息有效性发布最长时限为1年(12个月)到期后需重新发布。</view>
|
||||
<view class="card-title m-top-30">发票要求</view>
|
||||
<view class="flex justify-start align-center m-top-30">
|
||||
<u-radio-group v-model="form.invoice" placement="row">
|
||||
<u-radio activeColor="red" :name='true' label="含税" :customStyle="{marginRight: '30px'}"></u-radio>
|
||||
<u-radio activeColor="red" :name='false' label="不含税"></u-radio>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
<template v-if="form.invoice">
|
||||
<view class="group flex m-top-30">
|
||||
<view class="lb m-right-20">开票时间:</view>
|
||||
<view class="vl flex-1">
|
||||
<u-radio-group v-model="form.writeInvoiceTime" placement="column">
|
||||
<u-radio activeColor="red" :name='0' label="付款当月(限20号之后付款次月开票)"
|
||||
:customStyle="{marginBottom: '10px'}"></u-radio>
|
||||
<u-radio activeColor="red" :name='1' label="付款后次月"
|
||||
:customStyle="{marginBottom: '10px'}"></u-radio>
|
||||
<u-radio activeColor="red" :name='2' label="付款前"></u-radio>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex m-top-30">
|
||||
<view class="lb m-right-20">纳税人身份:</view>
|
||||
<view class="vl flex-1">
|
||||
<u-radio-group v-model="form.taxType" placement="column">
|
||||
<u-radio activeColor="red" name='一般纳税人' label="一般纳税人"
|
||||
:customStyle="{marginBottom: '10px'}"></u-radio>
|
||||
<u-radio activeColor="red" name='小规模公司' label="小规模公司"
|
||||
:customStyle="{marginBottom: '10px'}"></u-radio>
|
||||
<u-radio activeColor="red" name='个体工商户' label="个体工商户"></u-radio>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex m-top-30">
|
||||
<view class="lb m-right-20">发票种类:</view>
|
||||
<view class="vl flex-1">
|
||||
<u-radio-group v-model="form.invoiceType" placement="column">
|
||||
<u-radio activeColor="red" name='专用发票' label="专用发票"
|
||||
:customStyle="{marginBottom: '10px'}"></u-radio>
|
||||
<u-radio activeColor="red" name='普通发票' label="普通发票"
|
||||
:customStyle="{marginBottom: '10px'}"></u-radio>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex m-top-30">
|
||||
<view class="lb m-right-20">税率:</view>
|
||||
<view class="vl flex-1">
|
||||
<u-radio-group v-model="form.taxRate" placement="column">
|
||||
<u-radio activeColor="red" v-for="(item, index) in ['13%', '9%', '6%', '4%', '3%', '1%']"
|
||||
:key="index" :name='item' :label="item"
|
||||
:customStyle="{marginBottom: '10px'}"/>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb m-right-20">手动填写税票要求:</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
placeholder="如:一般纳税人 专用发票 税率13%"
|
||||
border="surround"
|
||||
v-model="form.invoiceOther"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<view class="card-title m-top-30">交易说明</view>
|
||||
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
|
||||
<view class="lb">报价区域:</view>
|
||||
<view class="vl flex-1 p-right-20" @click="showOfferAddress">
|
||||
<u--input
|
||||
style="pointer-events:none"
|
||||
placeholder="请选择"
|
||||
v-model="offerRegion"
|
||||
fontSize="24rpx"
|
||||
suffixIcon="arrow-down-fill"
|
||||
suffixIconStyle="font-size: 10px;color: #d5d5d5"
|
||||
:disabled="true"
|
||||
disabledColor="#fff"
|
||||
></u--input>
|
||||
</view>
|
||||
<el-checkbox v-model="form.offerAddressNoLimit" @change="changeOfferAddressNoLimit">不限区域
|
||||
</el-checkbox>
|
||||
</view>
|
||||
<view class="group flex m-top-30">
|
||||
<view class="lb m-right-20">付款方式:</view>
|
||||
<view class="vl flex-1">
|
||||
<u-radio-group v-model="form.payMethod" placement="column">
|
||||
<!-- <u-radio activeColor="red" name='预付' label="预付N%,货到付全款"-->
|
||||
<!-- :customStyle="{marginBottom: '10px'}"></u-radio>-->
|
||||
<u-radio activeColor="red" name='预付'
|
||||
:customStyle="{marginBottom: '10px'}">
|
||||
<view class="text-25 flex justify-start items-center">
|
||||
<text>预付</text>
|
||||
<u-input v-model="form.prePayRate" :disabled="form.payMethod !== '预付'"
|
||||
:custom-style="{width: '100rpx'}"></u-input>
|
||||
<text>%,货到付全款</text>
|
||||
</view>
|
||||
</u-radio>
|
||||
<u-radio activeColor="red" name='提货付全款' label="提货付全款"
|
||||
:customStyle="{marginBottom: '10px'}"></u-radio>
|
||||
<u-radio activeColor="red" name='其他付款方式描述'
|
||||
:customStyle="{marginBottom: '10px'}">
|
||||
<view class="flex justify-start items-start flex-col w-100p">
|
||||
<text style="color: rgb(96, 98, 102);
|
||||
font-size: 15px;
|
||||
line-height: 15px;">其他付款方式描述
|
||||
</text>
|
||||
<u--textarea v-model="form.otherPayMethodDesc" :disabled="form.payMethod !== '其他付款方式描述'"
|
||||
placeholder="请输入内容" :custom-style="{width: '400rpx'}"/>
|
||||
</view>
|
||||
</u-radio>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="group flex align-center m-top-30" v-if="form.payMethod === '预付'">-->
|
||||
<!-- <view class="lb m-right-20">预付(%):</view>-->
|
||||
<!-- <view class="vl flex-1">-->
|
||||
<!-- <u--input-->
|
||||
<!-- placeholder="请输入内容"-->
|
||||
<!-- v-model="form.prePayRate"-->
|
||||
<!-- ></u--input>-->
|
||||
<!-- </view>-->
|
||||
<!-- </view>-->
|
||||
|
||||
<view class="card-title m-top-30">合同条款</view>
|
||||
<view class="flex justify-start align-center m-top-30">
|
||||
<u-radio-group v-model="form.signMethod" placement="column">
|
||||
<u-radio activeColor="red" :name='0' label="线上签约-标准合同"
|
||||
:customStyle="{marginBottom: '30rpx'}"></u-radio>
|
||||
<u-radio activeColor="red" :name='2' label="线上签约-双方协商合同"
|
||||
:customStyle="{marginBottom: '30rpx'}"></u-radio>
|
||||
<u-radio activeColor="red" :name='1' label="线下签约"
|
||||
:customStyle="{marginBottom: '30rpx'}"></u-radio>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
<template v-if="form.signMethod === 2">
|
||||
<view class="card-title m-top-30">合同附件</view>
|
||||
<u-upload
|
||||
accept="file"
|
||||
:fileList="contractAttachment"
|
||||
@afterRead="afterReadAttachment($event, 'contractAttachment')"
|
||||
@delete="deletePicAttachment($event, 'contractAttachment')"
|
||||
name="contractAttachment"
|
||||
multiple
|
||||
:maxCount="10"
|
||||
></u-upload>
|
||||
</template>
|
||||
<view v-if="form.signMethod === 0" class="text-25" style="line-height: 32rpx">
|
||||
<view v-if="form.signMethod === 0" class="mb-15">补充条款</view>
|
||||
<view class="flex justify-start items-start flex-col">
|
||||
<view class="m-10">违约责任:</view>
|
||||
<view class="pl-20 flex-1 py-20">
|
||||
1.
|
||||
乙方所交产品品种、型号、规格、质量不符合规定的,如果甲方同意利用,应当按质论价;如果甲方不能利用的,应根据产品的具体情况,由乙方负责包换或包修,并承担修理、调换或退货而支付的实际费用;
|
||||
2.乙方不予供货违约责任为甲方的实际损失+违约金,如乙方材料符合订货标准,甲方不能退货和不收货,甲方无条件应按实际本合同订货数量支付100%货款,并支付乙方因此产生的实际费用。带有甲乙双方单位相关收货人和发货人签字的本合同的发货清单事项和内容均视为本合同的补充合同,与本合同有相同的法律效力,双方应共同遵照执行。
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex justify-start items-start flex-col">
|
||||
<view class="m-10">解决纠纷的方法:</view>
|
||||
<view class="pl-20 flex-1 py-20">
|
||||
1、凡因本合同引起的或与本合同有关的任何争议,均可友好协商或仲裁解决,协商或仲裁不成的,双方协商同意在合同签订地人民法院管辖地起诉,违约一方或对合同争议承担主要责任的一方,应承担对方因仲裁和起诉而产生的全部律师代理费、鉴定(检验)费、诉讼保全费、诉讼保险费、公告费、差旅费、执行费、误工费和获取证据产生费用等其他相关费用。
|
||||
2、双方本合同相关权利放弃均应有双方书面作出并加盖公章或授权委托人签字后生效。
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex justify-start items-start flex-col">
|
||||
<view class="m-10">不可抗力:</view>
|
||||
<view class="pl-20 flex-1 py-20">
|
||||
甲乙双方的任何一方由于不可抗力或突发公共事件的原因不能履行合同时,应及时向对方通报不能履行或不能完全履行的理由,以减轻可能给对方造成的损失,在取得有关机构证明以后,允许延期履行、部分履行或者不履行合同,并根据情况可部分或全部免予承担违约责任。
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex justify-start items-start flex-col">
|
||||
<view class="m-10">其他:</view>
|
||||
<view class="pl-20 flex-1 py-20">
|
||||
本合同的全部内容由双方平等共同协商一致,共同起草制定,非一方事先拟定,不属于格式条款。本合同自双方签字盖章后生效(包括电子签字、盖章),按本合同内容地址、联系方式寄送的一切文书、函件送达与否,均为视为送达有法律效力,通知途径和本合同内联系方式或地址送达文件双方均予以验证。
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="flex justify-start items-start flex-col">
|
||||
<view class="lb m-right-20">销售方补充条款:</view>
|
||||
<view class="vl w-100p">
|
||||
<u--textarea
|
||||
placeholder="请输入内容"
|
||||
v-model="form.supplementary"
|
||||
></u--textarea>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-title m-top-30">供货商信息</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb m-right-20">{{ user.accountType === 2 ? '公司信息' : '个人信息' }}:</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
placeholder="请输入内容"
|
||||
v-model="form.supplier.companyName"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb m-right-20">{{ user.accountType === 2 ? '公司联系方式' : '个人联系方式' }}:</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
placeholder="请输入内容"
|
||||
v-model="form.supplier.contract"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb m-right-20">联系人:</view>
|
||||
<view class="vl flex-1" @click="showContactPicker = true">
|
||||
<u--input
|
||||
style="pointer-events:none"
|
||||
readonly
|
||||
placeholder="点击选择联系人"
|
||||
v-model="form.supplier.managerName"
|
||||
suffixIcon="arrow-right"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb m-right-20">联系方式:</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
disabled
|
||||
placeholder="请输入内容"
|
||||
v-model="form.supplier.managerContract"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt-20 flex justify-start items-center">
|
||||
<text class="mr-25">您是否对以上信息进行了详细核实:</text>
|
||||
<el-radio label="是" v-model="checked">
|
||||
<text>是</text>
|
||||
</el-radio>
|
||||
<el-radio label="否" v-model="checked">
|
||||
<text>否</text>
|
||||
</el-radio>
|
||||
</view>
|
||||
<view class="mt-20 flex justify-start items-center">
|
||||
<text class="mr-25">是否加急({{ urgentAmount }}元/次):</text>
|
||||
<el-radio :label="true" v-model="form.isUrgent">
|
||||
<text>是</text>
|
||||
</el-radio>
|
||||
<el-radio :label="false" v-model="form.isUrgent">
|
||||
<text>否</text>
|
||||
</el-radio>
|
||||
</view>
|
||||
<view class="my-25 text-main font-bold">本月剩余旧货发布次数:{{ remainOldNum }}</view>
|
||||
<view class="flex justify-start items-center text-25">
|
||||
<el-checkbox :value="agree" active-color="#A92924" @change="handleAgreementCheck">我已阅读并同意</el-checkbox>
|
||||
<span class="text-main pointer font-bold" @click="showAgreement">《金久信旧货交易协议》</span>
|
||||
</view>
|
||||
<view class="flex justify-center items-center mt-30 m-a w-100p">
|
||||
<view class="flex-1 mx-15">
|
||||
<u-button type="primary" @click="save" plain="">暂存</u-button>
|
||||
</view>
|
||||
<view class="flex-1 mx-15">
|
||||
<u-button type="primary" :disabled="checked === '否' || !agree" @click="publish">立即发布</u-button>
|
||||
</view>
|
||||
</view>
|
||||
<u-picker v-if="showPicker" :show="showPicker" :columns="[cateData, cateData[cateDataIndex].children]"
|
||||
keyName="name" @change="changeCate"
|
||||
@cancel="showPicker = false" @close="showPicker = false" closeOnClickOverlay
|
||||
@confirm="confirmCate"></u-picker>
|
||||
<AddressSelect ref="AddressSelect" @confirm="regionConfirm"/>
|
||||
<AddressSelect ref="OfferAddressSelect" @confirm="offerRegionConfirm"/>
|
||||
<u-picker :show="showUnit" :columns="[unitList]"
|
||||
@cancel="showUnit = false" @close="showUnit = false" closeOnClickOverlay
|
||||
@confirm="confirmUnit"></u-picker>
|
||||
<u-datetime-picker :show="showExpire" v-model="expireTime" mode="date" @cancel="showExpire = false"
|
||||
:minDate="minDate" :maxDate="maxDate"
|
||||
@confirm="handConfirmDate"></u-datetime-picker>
|
||||
<u-picker :show="showContactPicker" :columns="[contactList]" keyName="name"
|
||||
@cancel="showContactPicker = false" @close="showContactPicker = false" closeOnClickOverlay
|
||||
@confirm="confirmContact"></u-picker>
|
||||
<agreement ref="agreementRef" @read-complete="onAgreementReadComplete"/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import AddressSelect from "@/components/AddressSelect.vue";
|
||||
import dayjs from "dayjs";
|
||||
import md5 from "js-md5";
|
||||
import Agreement from "@/pages/junk/agreement.vue";
|
||||
|
||||
export default {
|
||||
name: "type_0",
|
||||
components: {Agreement, AddressSelect},
|
||||
props: {
|
||||
urgentAmount: {
|
||||
type: Number,
|
||||
default: 10
|
||||
},
|
||||
remainOldNum: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
commonContractUrl: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
contactList: {
|
||||
type: Array,
|
||||
default: ''
|
||||
},
|
||||
unitList: {
|
||||
type: Array,
|
||||
default: ''
|
||||
},
|
||||
user: {
|
||||
type: Object,
|
||||
default: null
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pickerOptions: {
|
||||
disabledDate(time) {
|
||||
return time.getTime() < Date.now();
|
||||
},
|
||||
},
|
||||
agree: false,
|
||||
agreementReadCompleted: false,
|
||||
allChildCate: [],
|
||||
cateData: [],
|
||||
cateDataIndex: 0,
|
||||
form: {
|
||||
type: 0,
|
||||
category: 0,
|
||||
files: [],
|
||||
otherCate: false,
|
||||
otherCateName: '',
|
||||
title: '',
|
||||
desc: '',
|
||||
addressRegion: {},
|
||||
addressDetail: '',
|
||||
startNum: '',
|
||||
unit: '吨',
|
||||
startAmount: '',
|
||||
expiredTime: '',
|
||||
offerAddressRegion: {},
|
||||
offerAddressNoLimit: false,
|
||||
payMethod: '预付',
|
||||
prePayRate: '',
|
||||
otherPayMethodDesc: '',
|
||||
signMethod: 0,
|
||||
buyer: {
|
||||
companyName: '',
|
||||
contract: '',
|
||||
personalName: '',
|
||||
personalContract: '',
|
||||
managerName: '',
|
||||
managerContract: '',
|
||||
},
|
||||
supplier: {
|
||||
companyName: '',
|
||||
contract: '',
|
||||
personalName: '',
|
||||
personalContract: '',
|
||||
managerName: '',
|
||||
managerContract: '',
|
||||
},
|
||||
contractAttachment: [],
|
||||
isUrgent: false,
|
||||
supplementary: '',
|
||||
invoice: false,
|
||||
writeInvoiceTime: 0,
|
||||
taxType: '一般纳税人',
|
||||
invoiceType: '专用发票',
|
||||
taxRate: '13%',
|
||||
invoiceOther: '',
|
||||
},
|
||||
provinceIndex: null,
|
||||
cityIndex: null,
|
||||
areaIndex: null,
|
||||
offerProvinceIndex: null,
|
||||
offerCityIndex: null,
|
||||
offerAreaIndex: null,
|
||||
checked: '否',
|
||||
showPicker: false,
|
||||
cateName: '',
|
||||
region: '',
|
||||
offerRegion: '',
|
||||
showUnit: false,
|
||||
showExpire: false,
|
||||
expireTime: '',
|
||||
showContactPicker: false,
|
||||
minDate: Number(new Date()),
|
||||
maxDate: dayjs().add(1, 'year').valueOf(),
|
||||
contractAttachment: [],
|
||||
files: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
showAddress() {
|
||||
this.$refs.AddressSelect.open(this.form.addressRegion);
|
||||
},
|
||||
regionConfirm({province, city, area}) {
|
||||
this.form.addressRegion = {province, city, area}
|
||||
this.region = `${province.name} ${city.name} ${area.name}`
|
||||
},
|
||||
showOfferAddress() {
|
||||
this.$refs.OfferAddressSelect.open(this.form.offerAddressRegion);
|
||||
},
|
||||
offerRegionConfirm({province, city, area}) {
|
||||
this.form.offerAddressRegion = {province, city, area}
|
||||
this.offerRegion = `${province.name} ${city.name} ${area.name}`
|
||||
},
|
||||
async publish() {
|
||||
if (this.remainOldNum === 0) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您的旧货发布次数已用完,是否立即购买?',
|
||||
success: async res => {
|
||||
if (res.confirm) {
|
||||
const {data} = await vk.callFunction({
|
||||
url: 'client/old/kh/buyNum',
|
||||
})
|
||||
vk.navigateTo({
|
||||
url: `/pages/shop/pay?id=${data}`
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!this.form.addressRegion) return this.$message({
|
||||
message: "请选择完整的物资所在地",
|
||||
type: 'warning'
|
||||
})
|
||||
if (!this.form.addressDetail) return this.$message({
|
||||
message: "请填写详细物资所在地",
|
||||
type: 'warning'
|
||||
})
|
||||
if (!this.form.title) return this.$message({
|
||||
message: "请填写标题",
|
||||
type: 'warning'
|
||||
})
|
||||
if (!this.form.otherCate) {
|
||||
if (!this.form.category) return this.$message({
|
||||
message: "请选择分类",
|
||||
type: 'warning'
|
||||
})
|
||||
} else {
|
||||
if (!this.form.otherCateName) return this.$message({
|
||||
message: "请输入其他分类",
|
||||
type: 'warning'
|
||||
})
|
||||
this.form.category = ['', this.form.otherCateName]
|
||||
}
|
||||
if (!this.form.expiredTime) return this.$message({
|
||||
message: "请选择失效时间",
|
||||
type: 'warning'
|
||||
})
|
||||
if (dayjs(this.form.expiredTime).valueOf() > this.maxDate) return this.$message({
|
||||
message: "为保证信息有效性发布最长时限为1年(12个月)",
|
||||
type: 'warning'
|
||||
})
|
||||
if (this.form.payMethod === '预付' && String(this.form.prePayRate).trim() === '') return this.$message({
|
||||
message: "请填写预付比例",
|
||||
type: 'warning'
|
||||
})
|
||||
const res = await vk.callFunction({
|
||||
url: 'client/old/kh/add',
|
||||
data: this.form
|
||||
})
|
||||
localStorage.removeItem("old_0")
|
||||
this.$message({
|
||||
message: "您的信息已经提交,等待管理员审核,请您耐心等待!",
|
||||
type: 'success'
|
||||
})
|
||||
setTimeout(() => {
|
||||
if (this.form.isUrgent) {
|
||||
vk.navigateTo({
|
||||
url: `/pages/shop/pay?id=${res.data}`
|
||||
})
|
||||
} else {
|
||||
vk.redirectTo({url: '/pages/junk/junk'});
|
||||
}
|
||||
}, 1500)
|
||||
},
|
||||
handleAgreementCheck(value) {
|
||||
if (!value) {
|
||||
this.agree = false
|
||||
return
|
||||
}
|
||||
if (!this.agreementReadCompleted) {
|
||||
this.agree = false
|
||||
uni.showToast({
|
||||
title: '请先查看《金久信旧货交易协议》5秒以上',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
this.agree = true
|
||||
},
|
||||
onAgreementReadComplete() {
|
||||
this.agreementReadCompleted = true
|
||||
},
|
||||
showAgreement() {
|
||||
// this.$confirm(this.agreement, '金久信旧货交易协议', {
|
||||
// cancelButtonText: '关闭',
|
||||
// showConfirmButton: false,
|
||||
// dangerouslyUseHTMLString: true,
|
||||
// })
|
||||
this.$refs.agreementRef.open()
|
||||
},
|
||||
openDownload() {
|
||||
window.location.href = this.commonContractUrl
|
||||
// window.open(this.commonContractUrl)
|
||||
},
|
||||
navTo() {
|
||||
vk.navigateTo({url: '/pages/user/user?menu=business-contact'})
|
||||
},
|
||||
confirmCate({value}) {
|
||||
this.form.category = value.map(i => i.name)
|
||||
this.cateName = `${value[0].name} / ${value[1].name}`
|
||||
this.showPicker = false
|
||||
},
|
||||
changeCate({columnIndex, index}) {
|
||||
if (columnIndex === 0) {
|
||||
this.cateDataIndex = index
|
||||
}
|
||||
},
|
||||
confirmUnit({value}) {
|
||||
this.form.unit = value[0]
|
||||
this.showUnit = false
|
||||
},
|
||||
afterRead({file}) {
|
||||
file.forEach(item => {
|
||||
const suffix = item.name.split('.').pop()
|
||||
uniCloud.uploadFile({
|
||||
filePath: item.url,
|
||||
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + md5(item.name + Date.now().toString()) + `.${suffix}`,
|
||||
success: ({fileID}) => {
|
||||
uniCloud.getTempFileURL({
|
||||
fileList: [fileID]
|
||||
}).then(res => {
|
||||
this.form.files.push(res.fileList[0].tempFileURL)
|
||||
this.files.push({url: res.fileList[0].tempFileURL})
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
deletePic({index}) {
|
||||
this.form.files.splice(index, 1)
|
||||
},
|
||||
handConfirmDate({value}) {
|
||||
this.form.expiredTime = dayjs(value).format('YYYY-MM-DD')
|
||||
this.showExpire = false
|
||||
},
|
||||
confirmContact({value}) {
|
||||
this.form.supplier.managerName = value[0].name
|
||||
this.form.supplier.managerContract = value[0].phone
|
||||
this.showContactPicker = false
|
||||
},
|
||||
changeOfferAddressNoLimit(val) {
|
||||
if (val) {
|
||||
this.form.offerAddressRegion = {}
|
||||
this.offerRegion = ''
|
||||
this.offerProvinceIndex = this.offerCityIndex = this.offerAreaIndex = null
|
||||
}
|
||||
},
|
||||
afterReadAttachment({file}, field) {
|
||||
for (let i = 0; i < file.length; i++) {
|
||||
const item = file[i]
|
||||
const suffix = item.name.split('.').pop()
|
||||
if (field === 'files' || field === 'contractAttachment') {
|
||||
if (item.type !== 'application/pdf') {
|
||||
uni.showToast({
|
||||
title: '请上传PDF文件',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
uniCloud.uploadFile({
|
||||
filePath: item.url,
|
||||
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + md5(item.name + Date.now().toString()) + `.${suffix}`,
|
||||
success: ({fileID}) => {
|
||||
uniCloud.getTempFileURL({
|
||||
fileList: [fileID]
|
||||
}).then(res => {
|
||||
this[field].push({url: res.fileList[0].tempFileURL})
|
||||
this.form[field].push(res.fileList[0].tempFileURL)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
deletePicAttachment({index}, field) {
|
||||
this[field].splice(index, 1)
|
||||
this.form[field].splice(index, 1)
|
||||
},
|
||||
save() {
|
||||
localStorage.setItem("old_0", JSON.stringify({
|
||||
form: this.form,
|
||||
cateName: this.cateName,
|
||||
files: this.files,
|
||||
region: this.region,
|
||||
}))
|
||||
this.$message({
|
||||
message: "已保存",
|
||||
type: 'success'
|
||||
})
|
||||
},
|
||||
setOther(){
|
||||
this.cateName = ''
|
||||
},
|
||||
openPicker(){
|
||||
if(this.form.otherCate) return
|
||||
this.showPicker = true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
vk.callFunction({
|
||||
url: 'client/old/pub/getTree',
|
||||
title: '请求中...',
|
||||
data: {type: 0},
|
||||
success: (data) => {
|
||||
this.cateData = data.rows.map(item => {
|
||||
item.children.forEach(child => {
|
||||
delete child.children
|
||||
})
|
||||
return item
|
||||
})
|
||||
}
|
||||
});
|
||||
if (this.user.accountType === 2) {
|
||||
this.form.supplier.companyName = this.user.company.companyName
|
||||
this.form.supplier.contract = this.user.company.mobile
|
||||
} else {
|
||||
this.form.supplier.companyName = this.user.person.personName
|
||||
this.form.supplier.contract = this.user.person.mobile
|
||||
}
|
||||
if (!!localStorage.getItem("old_0")) {
|
||||
this.$confirm('您有一份暂存数据,是否恢复?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const savedData = JSON.parse(localStorage.getItem("old_0"))
|
||||
this.form = savedData.form
|
||||
this.cateName = savedData.cateName
|
||||
this.files = savedData.files
|
||||
this.offerRegion = savedData.offerRegion
|
||||
this.region = savedData.region
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.layout-header {
|
||||
margin: 0rpx 30rpx;
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1px solid rgba(169, 41, 36, 0.34);
|
||||
|
||||
.big {
|
||||
font-size: 32rpx;
|
||||
line-height: 48rpx;
|
||||
color: #000000;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.small {
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
color: #9a9a9a;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.ptb {
|
||||
margin-right: 20rpx;
|
||||
padding: 6rpx 14rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
color: #333333;
|
||||
border: 1px solid #f2f2f2;
|
||||
|
||||
&:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.active {
|
||||
color: #ffffff;
|
||||
border-color: #A92924;
|
||||
background: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.public-btn {
|
||||
width: 95%;
|
||||
margin-top: 60rpx;
|
||||
color: #ffffff;
|
||||
background: #A92924;
|
||||
}
|
||||
|
||||
.layout-publish {
|
||||
padding: 20rpx 30rpx;
|
||||
}
|
||||
|
||||
.tag-title {
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
color: #000000;
|
||||
|
||||
.limit {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.tag-box {
|
||||
padding: 20rpx 0;
|
||||
|
||||
.item {
|
||||
padding: 6rpx 10rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 32rpx;
|
||||
color: #555555;
|
||||
}
|
||||
|
||||
.active {
|
||||
color: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.lb, .fix {
|
||||
position: relative;
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.lbx {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.download {
|
||||
padding: 8rpx 20rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #A92924;
|
||||
border: 1px solid #A92924;
|
||||
}
|
||||
|
||||
.need::before {
|
||||
position: absolute;
|
||||
left: -16rpx;
|
||||
top: 50%;
|
||||
z-index: 9;
|
||||
margin-top: -12rpx;
|
||||
content: '*';
|
||||
color: #A92924;
|
||||
font-size: 32rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
position: relative;
|
||||
padding-left: 20rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
line-height: 48rpx;
|
||||
color: #A92924;
|
||||
|
||||
&:before {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
z-index: 9;
|
||||
margin-top: -14rpx;
|
||||
content: '';
|
||||
width: 6rpx;
|
||||
height: 28rpx;
|
||||
background: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.template-tab {
|
||||
.ttb {
|
||||
margin-right: 30rpx;
|
||||
padding: 6rpx 20rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
color: #333333;
|
||||
border: 1px solid #f2f2f2;
|
||||
}
|
||||
|
||||
.active {
|
||||
color: #A92924;
|
||||
border-color: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.template-content {
|
||||
padding: 30rpx 0;
|
||||
}
|
||||
|
||||
.goods-item {
|
||||
padding: 18rpx 0;
|
||||
}
|
||||
|
||||
.expire-tip {
|
||||
padding: 0 20rpx 18rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #A92924;
|
||||
}
|
||||
|
||||
.add-btn {
|
||||
margin-left: 0;
|
||||
width: 180rpx;
|
||||
height: 60rpx;
|
||||
color: #A92924;
|
||||
border-color: #A92924;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,995 @@
|
||||
<template>
|
||||
<view class="flex flex-col justify-start items-start">
|
||||
<text class="text-50">发布我的采购信息</text>
|
||||
<text class="text-gray">采购信息越完整,成功交易越容易</text>
|
||||
<view class="layout w-100p m-top-10">
|
||||
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
|
||||
<view class="lb">信息失效时间:</view>
|
||||
<view class="vl flex-1 p-right-20" @click="showExpire = true">
|
||||
<u--input placeholder="请选择" v-model="form.expiredTime" style="pointer-events:none"
|
||||
fontSize="24rpx"
|
||||
suffixIcon="arrow-down-fill"
|
||||
suffixIconStyle="font-size: 10px;color: #d5d5d5"
|
||||
:disabled="true"
|
||||
disabledColor="#fff"></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="expire-tip">温馨提示:为保证信息有效性发布最长时限为1年(12个月)到期后需重新发布。</view>
|
||||
<view class="goods-item half flex align-center flex-wrap w-100p">
|
||||
<text class="need text-red">*</text>
|
||||
<view class="lb">物资分类:</view>
|
||||
<view class="vl flex-1 p-right-20" @click="openPicker">
|
||||
<u--input
|
||||
style="pointer-events:none"
|
||||
placeholder="请选择"
|
||||
v-model="cateName"
|
||||
fontSize="24rpx"
|
||||
suffixIcon="arrow-down-fill"
|
||||
suffixIconStyle="font-size: 10px;color: #d5d5d5"
|
||||
:disabled="true"
|
||||
disabledColor="#fff"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
|
||||
<el-checkbox label="其他分类" v-model="form.otherCate" class="mx-20"></el-checkbox>
|
||||
<u--input
|
||||
placeholder="请选择"
|
||||
v-model="form.otherCateName"
|
||||
fontSize="24rpx"
|
||||
:disabled="!form.otherCate"
|
||||
@change="setOther"
|
||||
></u--input>
|
||||
</view>
|
||||
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
|
||||
<text class="need text-red">*</text>
|
||||
<view class="lb">信息标题:</view>
|
||||
<view class="vl flex-1 p-right-20">
|
||||
<u--input
|
||||
placeholder="一句话简介物资,如拍卖直缝钢管200吨等"
|
||||
v-model="form.title"
|
||||
fontSize="24rpx"
|
||||
></u--input>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
|
||||
<text class="need text-red">*</text>
|
||||
<view class="lb">采购物资详情:</view>
|
||||
<view class="vl flex-1 p-right-20">
|
||||
<u--textarea
|
||||
placeholder="请详细描述物资信息,描述内容:材料名称、材质......(限300字以内)"
|
||||
v-model="form.desc"
|
||||
fontSize="24rpx"
|
||||
></u--textarea>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="goods-item half flex align-center flex-wrap mt-20 w-100p">-->
|
||||
<!-- <view class="lb">物资装货所在地:</view>-->
|
||||
<!-- <view class="vl flex-1 p-right-20" @click="showAddress">-->
|
||||
<!-- <u--input-->
|
||||
<!-- style="pointer-events:none"-->
|
||||
<!-- placeholder="请选择"-->
|
||||
<!-- v-model="region"-->
|
||||
<!-- fontSize="24rpx"-->
|
||||
<!-- suffixIcon="arrow-down-fill"-->
|
||||
<!-- suffixIconStyle="font-size: 10px;color: #d5d5d5"-->
|
||||
<!-- :disabled="true"-->
|
||||
<!-- disabledColor="#fff"-->
|
||||
<!-- ></u--input>-->
|
||||
<!-- </view>-->
|
||||
<!-- </view>-->
|
||||
<!-- <view class="goods-item half flex align-center flex-wrap mt-20 w-100p">-->
|
||||
<!-- <view class="lb">物资装货详细地址:</view>-->
|
||||
<!-- <view class="vl flex-1 p-right-20">-->
|
||||
<!-- <u--input placeholder="请选择" v-model="form.addressDetail"></u--input>-->
|
||||
<!-- </view>-->
|
||||
<!-- </view>-->
|
||||
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
|
||||
<text class="need text-red">*</text>
|
||||
<view class="lb">物资交货所在地:</view>
|
||||
<view class="vl flex-1 p-right-20" @click="deliverShowAddress">
|
||||
<u--input
|
||||
style="pointer-events:none"
|
||||
placeholder="请选择"
|
||||
v-model="deliverRegion"
|
||||
fontSize="24rpx"
|
||||
suffixIcon="arrow-down-fill"
|
||||
suffixIconStyle="font-size: 10px;color: #d5d5d5"
|
||||
:disabled="true"
|
||||
disabledColor="#fff"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
|
||||
<text class="need text-red">*</text>
|
||||
<view class="lb">物资交货详细地址:</view>
|
||||
<view class="vl flex-1 p-right-20">
|
||||
<u--input placeholder="请选择" v-model="form.deliverAddressDetail"></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-title m-top-30">税票要求</view>
|
||||
<view class="flex justify-start align-center m-top-30">
|
||||
<u-radio-group
|
||||
v-model="form.invoice"
|
||||
placement="row"
|
||||
>
|
||||
<u-radio activeColor="red" :name='true' label="含税" :customStyle="{marginRight: '30px'}"></u-radio>
|
||||
<u-radio activeColor="red" :name='false' label="不含税"></u-radio>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
<template v-if="form.invoice">
|
||||
<view class="group flex m-top-30">
|
||||
<view class="lb m-right-20">开票时间:</view>
|
||||
<view class="vl flex-1">
|
||||
<u-radio-group v-model="form.writeInvoiceTime" placement="column">
|
||||
<u-radio activeColor="red" :name='0' label="付款当月(限20号之后付款次月开票)"
|
||||
:customStyle="{marginBottom: '10px'}"></u-radio>
|
||||
<u-radio activeColor="red" :name='1' label="付款后次月"
|
||||
:customStyle="{marginBottom: '10px'}"></u-radio>
|
||||
<u-radio activeColor="red" :name='2' label="付款前"></u-radio>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex m-top-30">
|
||||
<view class="lb m-right-20">纳税人身份:</view>
|
||||
<view class="vl flex-1">
|
||||
<u-radio-group v-model="form.taxType" placement="column">
|
||||
<u-radio activeColor="red" name='一般纳税人' label="一般纳税人"
|
||||
:customStyle="{marginBottom: '10px'}"></u-radio>
|
||||
<u-radio activeColor="red" name='小规模公司' label="小规模公司"
|
||||
:customStyle="{marginBottom: '10px'}"></u-radio>
|
||||
<u-radio activeColor="red" name='个体工商户' label="个体工商户"></u-radio>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex m-top-30">
|
||||
<view class="lb m-right-20">发票种类:</view>
|
||||
<view class="vl flex-1">
|
||||
<u-radio-group v-model="form.invoiceType" placement="column">
|
||||
<u-radio activeColor="red" name='专用发票' label="专用发票"
|
||||
:customStyle="{marginBottom: '10px'}"></u-radio>
|
||||
<u-radio activeColor="red" name='普通发票' label="普通发票"
|
||||
:customStyle="{marginBottom: '10px'}"></u-radio>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex m-top-30">
|
||||
<view class="lb m-right-20">税率:</view>
|
||||
<view class="vl flex-1">
|
||||
<u-radio-group v-model="form.taxRate" placement="column">
|
||||
<u-radio activeColor="red" v-for="(item, index) in ['13%', '9%', '6%', '4%', '3%', '1%']"
|
||||
:key="index" :name='item' :label="item"
|
||||
:customStyle="{marginBottom: '10px'}"/>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb m-right-20">手动填写税票要求:</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
placeholder="如:一般纳税人 专用发票 税率13%"
|
||||
border="surround"
|
||||
v-model="form.invoiceOther"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<view class="card-title m-top-30">交易说明</view>
|
||||
<!-- <view class="group flex align-center m-top-30">-->
|
||||
<!-- <view class="lb m-right-20">报价明细:</view>-->
|
||||
<!-- <view class="vl flex-1">-->
|
||||
<!-- <u--input-->
|
||||
<!-- placeholder="请输入内容"-->
|
||||
<!-- border="surround"-->
|
||||
<!-- v-model="form.invoiceDetail"-->
|
||||
<!-- ></u--input>-->
|
||||
<!-- </view>-->
|
||||
<!-- </view>-->
|
||||
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
|
||||
<view class="lb">报价区域:</view>
|
||||
<view class="vl flex-1 p-right-20" @click="offerShowAddress">
|
||||
<u--input
|
||||
style="pointer-events:none"
|
||||
placeholder="请选择"
|
||||
v-model="offerRegion"
|
||||
fontSize="24rpx"
|
||||
suffixIcon="arrow-down-fill"
|
||||
suffixIconStyle="font-size: 10px;color: #d5d5d5"
|
||||
:disabled="true"
|
||||
disabledColor="#fff"
|
||||
></u--input>
|
||||
</view>
|
||||
<el-checkbox v-model="form.offerAddressNoLimit" @change="changeOfferAddressNoLimit">不限区域
|
||||
</el-checkbox>
|
||||
</view>
|
||||
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
|
||||
<view class="lb">报价截止时间:</view>
|
||||
<view class="vl flex-1 p-right-20" @click="showOfferExpire = true">
|
||||
<u--input placeholder="请选择" v-model="form.offerExpiredTime" style="pointer-events:none"
|
||||
fontSize="24rpx"
|
||||
suffixIcon="arrow-down-fill"
|
||||
suffixIconStyle="font-size: 10px;color: #d5d5d5"
|
||||
:disabled="true"
|
||||
disabledColor="#fff"></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex m-top-30">
|
||||
<view class="lb m-right-20">付款方式:</view>
|
||||
<view class="vl flex-1">
|
||||
<u-radio-group v-model="form.payMethod" placement="column">
|
||||
<!-- <u-radio activeColor="red" name='预付' label="预付N%,货到付全款"-->
|
||||
<!-- :customStyle="{marginBottom: '10px'}"></u-radio>-->
|
||||
<u-radio activeColor="red" name='预付'
|
||||
:customStyle="{marginBottom: '10px'}">
|
||||
<view class="text-25 flex justify-start items-center">
|
||||
<text>预付</text>
|
||||
<u-input v-model="form.prePayRate" :disabled="form.payMethod !== '预付'"
|
||||
:custom-style="{width: '100rpx'}"></u-input>
|
||||
<text>%,货到付全款</text>
|
||||
</view>
|
||||
</u-radio>
|
||||
<u-radio activeColor="red" name='提货付全款' label="提货付全款"
|
||||
:customStyle="{marginBottom: '10px'}"></u-radio>
|
||||
<u-radio activeColor="red" name='其他付款方式描述'
|
||||
:customStyle="{marginBottom: '10px'}">
|
||||
<view class="flex justify-start items-start flex-col w-100p">
|
||||
<text style="color: rgb(96, 98, 102);
|
||||
font-size: 15px;
|
||||
line-height: 15px;">其他付款方式描述
|
||||
</text>
|
||||
<u--textarea v-model="form.otherPayMethodDesc" :disabled="form.payMethod !== '其他付款方式描述'"
|
||||
placeholder="请输入内容" :custom-style="{width: '400rpx'}"/>
|
||||
</view>
|
||||
</u-radio>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex justify-start align-center m-top-30">
|
||||
<view class="lb m-right-20">报价形式:</view>
|
||||
<view class="vl flex-1">
|
||||
<u-radio-group
|
||||
v-model="form.offerType"
|
||||
placement="row"
|
||||
>
|
||||
<u-radio activeColor="red" name='整单报价' label="整单报价"
|
||||
:customStyle="{marginRight: '30px'}"></u-radio>
|
||||
<u-radio activeColor="red" name='可分项报价' label="可分项报价"></u-radio>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-title m-top-30">合同条款</view>
|
||||
<view class="flex justify-start align-center m-top-30">
|
||||
<u-radio-group v-model="form.signMethod" placement="column">
|
||||
<u-radio activeColor="red" :name='0' label="线上签约-标准合同"
|
||||
:customStyle="{marginBottom: '30rpx'}"></u-radio>
|
||||
<u-radio activeColor="red" :name='2' label="线上签约-双方协商合同"
|
||||
:customStyle="{marginBottom: '30rpx'}"></u-radio>
|
||||
<u-radio activeColor="red" :name='1' label="线下签约"
|
||||
:customStyle="{marginBottom: '30rpx'}"></u-radio>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
<template v-if="form.signMethod === 2">
|
||||
<view class="card-title m-top-30">合同附件</view>
|
||||
<u-upload
|
||||
accept="file"
|
||||
:fileList="contractAttachment"
|
||||
@afterRead="afterReadAttachment($event, 'contractAttachment')"
|
||||
@delete="deletePicAttachment($event, 'contractAttachment')"
|
||||
name="contractAttachment"
|
||||
multiple
|
||||
:maxCount="10"
|
||||
></u-upload>
|
||||
</template>
|
||||
<view v-if="form.signMethod === 0" class="text-25" style="line-height: 32rpx">
|
||||
<view v-if="form.signMethod === 0" class="mb-15">补充条款</view>
|
||||
<view class="flex justify-start items-start flex-col">
|
||||
<view class="m-10">违约责任:</view>
|
||||
<view class="pl-20 flex-1 py-20">
|
||||
1.
|
||||
乙方所交产品品种、型号、规格、质量不符合规定的,如果甲方同意利用,应当按质论价;如果甲方不能利用的,应根据产品的具体情况,由乙方负责包换或包修,并承担修理、调换或退货而支付的实际费用;
|
||||
2.乙方不予供货违约责任为甲方的实际损失+违约金,如乙方材料符合订货标准,甲方不能退货和不收货,甲方无条件应按实际本合同订货数量支付100%货款,并支付乙方因此产生的实际费用。带有甲乙双方单位相关收货人和发货人签字的本合同的发货清单事项和内容均视为本合同的补充合同,与本合同有相同的法律效力,双方应共同遵照执行。
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex justify-start items-start flex-col">
|
||||
<view class="m-10">解决纠纷的方法:</view>
|
||||
<view class="pl-20 flex-1 py-20">
|
||||
1、凡因本合同引起的或与本合同有关的任何争议,均可友好协商或仲裁解决,协商或仲裁不成的,双方协商同意在合同签订地人民法院管辖地起诉,违约一方或对合同争议承担主要责任的一方,应承担对方因仲裁和起诉而产生的全部律师代理费、鉴定(检验)费、诉讼保全费、诉讼保险费、公告费、差旅费、执行费、误工费和获取证据产生费用等其他相关费用。
|
||||
2、双方本合同相关权利放弃均应有双方书面作出并加盖公章或授权委托人签字后生效。
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex justify-start items-start flex-col">
|
||||
<view class="m-10">不可抗力:</view>
|
||||
<view class="pl-20 flex-1 py-20">
|
||||
甲乙双方的任何一方由于不可抗力或突发公共事件的原因不能履行合同时,应及时向对方通报不能履行或不能完全履行的理由,以减轻可能给对方造成的损失,在取得有关机构证明以后,允许延期履行、部分履行或者不履行合同,并根据情况可部分或全部免予承担违约责任。
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex justify-start items-start flex-col">
|
||||
<view class="m-10">其他:</view>
|
||||
<view class="pl-20 flex-1 py-20">
|
||||
本合同的全部内容由双方平等共同协商一致,共同起草制定,非一方事先拟定,不属于格式条款。本合同自双方签字盖章后生效(包括电子签字、盖章),按本合同内容地址、联系方式寄送的一切文书、函件送达与否,均为视为送达有法律效力,通知途径和本合同内联系方式或地址送达文件双方均予以验证。
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="flex justify-start items-start flex-col">
|
||||
<view class="lb m-right-20">采购方补充条款:</view>
|
||||
<view class="vl w-100p">
|
||||
<u--textarea
|
||||
placeholder="请输入内容"
|
||||
v-model="form.supplementary"
|
||||
></u--textarea>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-title m-top-30">采购商信息</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb m-right-20">采购商:</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
placeholder="请输入内容"
|
||||
v-model="form.buyer.companyName"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb m-right-20">联系方式:</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
placeholder="请输入内容"
|
||||
v-model="form.buyer.contract"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb m-right-20">联系人:</view>
|
||||
<view class="vl flex-1" @click="showContactPicker = true">
|
||||
<u--input
|
||||
style="pointer-events:none"
|
||||
readonly
|
||||
placeholder="点击选择联系人"
|
||||
v-model="form.buyer.managerName"
|
||||
suffixIcon="arrow-right"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb m-right-20">联系方式:</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
disabled
|
||||
placeholder="请输入内容"
|
||||
v-model="form.buyer.managerContract"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt-20 flex justify-start items-center">
|
||||
<text class="mr-25">您是否对以上信息进行了详细核实:</text>
|
||||
<el-radio label="是" v-model="checked">
|
||||
<text>是</text>
|
||||
</el-radio>
|
||||
<el-radio label="否" v-model="checked">
|
||||
<text>否</text>
|
||||
</el-radio>
|
||||
</view>
|
||||
<view class="mt-20 flex justify-start items-center">
|
||||
<text class="mr-25">是否加急({{ urgentAmount }}元/次):</text>
|
||||
<el-radio :label="true" v-model="form.isUrgent">
|
||||
<text>是</text>
|
||||
</el-radio>
|
||||
<el-radio :label="false" v-model="form.isUrgent">
|
||||
<text>否</text>
|
||||
</el-radio>
|
||||
</view>
|
||||
<view class="my-25 text-main font-bold">本月剩余旧货发布次数:{{ remainOldNum }}</view>
|
||||
<view class="flex justify-start items-center">
|
||||
<el-checkbox :value="agree" active-color="#A92924" @change="handleAgreementCheck">我已阅读并同意</el-checkbox>
|
||||
<span class="text-main pointer font-bold" @click="showAgreement">《金久信旧货交易协议》</span>
|
||||
</view>
|
||||
<view class="flex justify-center items-center mt-30 m-a w-100p">
|
||||
<view class="flex-1 mx-15">
|
||||
<u-button type="primary" @click="save" plain="">暂存</u-button>
|
||||
</view>
|
||||
<view class="flex-1 mx-15">
|
||||
<u-button type="primary" :disabled="checked === '否' || !agree" @click="publish">立即发布</u-button>
|
||||
</view>
|
||||
</view>
|
||||
<u-picker v-if="showPicker" :show="showPicker" :columns="[cateData, cateData[cateDataIndex].children]"
|
||||
keyName="name" @change="changeCate"
|
||||
@cancel="showPicker = false" @close="showPicker = false" closeOnClickOverlay
|
||||
@confirm="confirmCate"></u-picker>
|
||||
<AddressSelect ref="AddressSelect" @confirm="regionConfirm"/>
|
||||
<AddressSelect ref="DeliverAddressSelect" @confirm="deliverRegionConfirm"/>
|
||||
<AddressSelect ref="OfferAddressSelect" @confirm="offerRegionConfirm"/>
|
||||
<u-picker :show="showUnit" :columns="[unitList]"
|
||||
@cancel="showUnit = false" @close="showUnit = false" closeOnClickOverlay
|
||||
@confirm="confirmUnit"></u-picker>
|
||||
<u-datetime-picker :show="showExpire" v-model="expireTime" mode="date" @cancel="showExpire = false"
|
||||
:minDate="minDate" :maxDate="maxDate"
|
||||
@confirm="handConfirmDate"></u-datetime-picker>
|
||||
<u-datetime-picker :show="showOfferExpire" v-model="offerExpiredTime" mode="date"
|
||||
@cancel="showOfferExpire = false" :minDate="minDate"
|
||||
@confirm="handOfferConfirmDate"></u-datetime-picker>
|
||||
<u-picker :show="showContactPicker" :columns="[contactList]" keyName="name"
|
||||
@cancel="showContactPicker = false" @close="showContactPicker = false" closeOnClickOverlay
|
||||
@confirm="confirmContact"></u-picker>
|
||||
<agreement ref="agreementRef" @read-complete="onAgreementReadComplete"/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import AddressSelect from "@/components/AddressSelect.vue";
|
||||
import dayjs from "dayjs";
|
||||
import {INVOICE_TYPE, WRITE_INVOICE_TIME} from "@/util";
|
||||
import md5 from "js-md5";
|
||||
import Agreement from "@/pages/junk/agreement.vue";
|
||||
|
||||
export default {
|
||||
name: "type_0",
|
||||
components: {Agreement, AddressSelect},
|
||||
props: {
|
||||
urgentAmount: {
|
||||
type: Number,
|
||||
default: 10
|
||||
},
|
||||
remainOldNum: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
agreement: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
commonContractUrl: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
contactList: {
|
||||
type: Array,
|
||||
default: ''
|
||||
},
|
||||
user: {
|
||||
type: Object,
|
||||
default: null
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pickerOptions: {
|
||||
disabledDate(time) {
|
||||
return time.getTime() < Date.now();
|
||||
},
|
||||
},
|
||||
agree: false,
|
||||
agreementReadCompleted: false,
|
||||
unitList: ['吨', '万吨'],
|
||||
allChildCate: [],
|
||||
cateData: [],
|
||||
cateDataIndex: 0,
|
||||
form: {
|
||||
otherCate: false,
|
||||
otherCateName: '',
|
||||
type: 1,
|
||||
category: 0,
|
||||
files: [],
|
||||
title: '',
|
||||
desc: '',
|
||||
addressRegion: {},
|
||||
addressDetail: '',
|
||||
deliverAddressRegion: {},
|
||||
deliverAddressDetail: '',
|
||||
invoiceDetail: '',
|
||||
expiredTime: '',
|
||||
offerExpiredTime: '',
|
||||
offerAddressRegion: {},
|
||||
offerAddressNoLimit: false,
|
||||
payMethod: '预付',
|
||||
offerType: '整单报价',
|
||||
prePayRate: '',
|
||||
otherPayMethodDesc: '',
|
||||
signMethod: 0,
|
||||
buyer: {
|
||||
companyName: '',
|
||||
contract: '',
|
||||
personalName: '',
|
||||
personalContract: '',
|
||||
managerName: '',
|
||||
managerContract: '',
|
||||
},
|
||||
supplier: {
|
||||
companyName: '',
|
||||
contract: '',
|
||||
personalName: '',
|
||||
personalContract: '',
|
||||
managerName: '',
|
||||
managerContract: '',
|
||||
},
|
||||
contractAttachment: [],
|
||||
isUrgent: false,
|
||||
supplementary: '',
|
||||
invoice: false,
|
||||
writeInvoiceTime: 0,
|
||||
taxType: '一般纳税人',
|
||||
invoiceType: '专用发票',
|
||||
taxRate: '13%',
|
||||
invoiceOther: '',
|
||||
},
|
||||
provinceIndex: null,
|
||||
cityIndex: null,
|
||||
areaIndex: null,
|
||||
offerProvinceIndex: null,
|
||||
offerCityIndex: null,
|
||||
offerAreaIndex: null,
|
||||
checked: '否',
|
||||
showPicker: false,
|
||||
cateName: '',
|
||||
region: '',
|
||||
deliverRegion: '',
|
||||
offerRegion: '',
|
||||
showUnit: false,
|
||||
showExpire: false,
|
||||
showOfferExpire: false,
|
||||
expireTime: '',
|
||||
offerExpiredTime: '',
|
||||
showContactPicker: false,
|
||||
minDate: Number(new Date()),
|
||||
maxDate: dayjs().add(1, 'year').valueOf()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
INVOICE_TYPE() {
|
||||
return INVOICE_TYPE
|
||||
},
|
||||
WRITE_INVOICE_TIME() {
|
||||
return WRITE_INVOICE_TIME
|
||||
},
|
||||
showAddress() {
|
||||
this.$refs.AddressSelect.open(this.form.addressRegion);
|
||||
},
|
||||
regionConfirm({province, city, area}) {
|
||||
this.form.addressRegion = {province, city, area}
|
||||
this.region = `${province.name} ${city.name} ${area.name}`
|
||||
},
|
||||
deliverShowAddress() {
|
||||
this.$refs.DeliverAddressSelect.open(this.form.deliverAddressRegion);
|
||||
},
|
||||
deliverRegionConfirm({province, city, area}) {
|
||||
this.form.deliverAddressRegion = {province, city, area}
|
||||
this.deliverRegion = `${province.name} ${city.name} ${area.name}`
|
||||
},
|
||||
offerShowAddress() {
|
||||
this.$refs.OfferAddressSelect.open(this.form.offerAddressRegion);
|
||||
},
|
||||
offerRegionConfirm({province, city, area}) {
|
||||
this.form.offerAddressRegion = {province, city, area}
|
||||
this.offerRegion = `${province.name} ${city.name} ${area.name}`
|
||||
},
|
||||
async publish() {
|
||||
if (this.remainOldNum === 0) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您的旧货发布次数已用完,是否立即购买?',
|
||||
success: async res => {
|
||||
if (res.confirm) {
|
||||
const {data} = await vk.callFunction({
|
||||
url: 'client/old/kh/buyNum',
|
||||
})
|
||||
vk.navigateTo({
|
||||
url: `/pages/shop/pay?id=${data}`
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!this.form.deliverAddressRegion) return this.$message({
|
||||
message: "请选择完整的物资所在地",
|
||||
type: 'warning'
|
||||
})
|
||||
if (!this.form.deliverAddressDetail) return this.$message({
|
||||
message: "请填写详细物资所在地",
|
||||
type: 'warning'
|
||||
})
|
||||
if (!this.form.title) return this.$message({
|
||||
message: "请填写标题",
|
||||
type: 'warning'
|
||||
})
|
||||
if (!this.form.otherCate) {
|
||||
if (!this.form.category) return this.$message({
|
||||
message: "请选择分类",
|
||||
type: 'warning'
|
||||
})
|
||||
} else {
|
||||
if (!this.form.otherCateName) return this.$message({
|
||||
message: "请输入其他分类",
|
||||
type: 'warning'
|
||||
})
|
||||
this.form.category = ['', this.form.otherCateName]
|
||||
}
|
||||
if (!this.form.expiredTime) return this.$message({
|
||||
message: "请选择失效时间",
|
||||
type: 'warning'
|
||||
})
|
||||
if (dayjs(this.form.expiredTime).valueOf() > this.maxDate) return this.$message({
|
||||
message: "为保证信息有效性发布最长时限为1年(12个月)",
|
||||
type: 'warning'
|
||||
})
|
||||
if (this.form.payMethod === '预付' && String(this.form.prePayRate).trim() === '') return this.$message({
|
||||
message: "请填写预付比例",
|
||||
type: 'warning'
|
||||
})
|
||||
|
||||
this.form.files = this.form.files.map(i => i.url)
|
||||
const res = await vk.callFunction({
|
||||
url: 'client/old/kh/add',
|
||||
data: this.form
|
||||
})
|
||||
localStorage.removeItem("old_1")
|
||||
this.$message({
|
||||
message: "您的信息已经提交,等待管理员审核,请您耐心等待!",
|
||||
type: 'success'
|
||||
})
|
||||
setTimeout(() => {
|
||||
if (this.form.isUrgent) {
|
||||
vk.navigateTo({
|
||||
url: `/pages/shop/pay?id=${res.data}`
|
||||
})
|
||||
} else {
|
||||
vk.redirectTo({url: '/pages/junk/junk'});
|
||||
}
|
||||
}, 1500)
|
||||
},
|
||||
handleAgreementCheck(value) {
|
||||
if (!value) {
|
||||
this.agree = false
|
||||
return
|
||||
}
|
||||
if (!this.agreementReadCompleted) {
|
||||
this.agree = false
|
||||
uni.showToast({
|
||||
title: '请先查看《金久信旧货交易协议》5秒以上',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
this.agree = true
|
||||
},
|
||||
onAgreementReadComplete() {
|
||||
this.agreementReadCompleted = true
|
||||
},
|
||||
showAgreement() {
|
||||
|
||||
// this.$confirm(this.agreement, '金久信旧货交易协议', {
|
||||
// cancelButtonText: '关闭',
|
||||
// showConfirmButton: false,
|
||||
// dangerouslyUseHTMLString: true,
|
||||
// })
|
||||
this.$refs.agreementRef.open()
|
||||
},
|
||||
openDownload() {
|
||||
// window.open(this.commonContractUrl)
|
||||
window.location.href = this.commonContractUrl
|
||||
},
|
||||
navTo() {
|
||||
vk.navigateTo({url: '/pages/user/user?menu=business-contact'})
|
||||
},
|
||||
confirmCate({value}) {
|
||||
this.form.category = value.map(i => i.name)
|
||||
this.cateName = `${value[0].name}${value[1].name}`
|
||||
this.showPicker = false
|
||||
},
|
||||
confirmUnit({value}) {
|
||||
this.form.unit = value
|
||||
this.showUnit = false
|
||||
},
|
||||
afterRead({file}) {
|
||||
file.forEach(item => {
|
||||
const suffix = item.name.split('.').pop()
|
||||
uniCloud.uploadFile({
|
||||
filePath: item.url,
|
||||
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + md5(item.name + Date.now().toString()) + `.${suffix}`,
|
||||
success: ({fileID}) => {
|
||||
uniCloud.getTempFileURL({
|
||||
fileList: [fileID]
|
||||
}).then(res => {
|
||||
this.form.files.push({url: res.fileList[0].tempFileURL})
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
deletePic({index}) {
|
||||
this.form.files.splice(index, 1)
|
||||
},
|
||||
handConfirmDate({value}) {
|
||||
this.form.expiredTime = dayjs(value).format('YYYY-MM-DD')
|
||||
this.showExpire = false
|
||||
},
|
||||
handOfferConfirmDate({value}) {
|
||||
this.form.offerExpiredTime = dayjs(value).format('YYYY-MM-DD')
|
||||
this.showOfferExpire = false
|
||||
},
|
||||
confirmContact({value}) {
|
||||
this.form.buyer.managerName = value[0].name
|
||||
this.form.buyer.managerContract = value[0].phone
|
||||
this.showContactPicker = false
|
||||
},
|
||||
changeOfferAddressNoLimit(val) {
|
||||
if (val) {
|
||||
this.form.offerAddressRegion = {}
|
||||
this.offerRegion = ''
|
||||
this.offerProvinceIndex = this.offerCityIndex = this.offerAreaIndex = null
|
||||
}
|
||||
},
|
||||
changeCate({columnIndex, index}) {
|
||||
if (columnIndex === 0) {
|
||||
this.cateDataIndex = index
|
||||
}
|
||||
},
|
||||
save() {
|
||||
localStorage.setItem("old_1", JSON.stringify({
|
||||
form: this.form,
|
||||
cateName: this.cateName,
|
||||
files: this.files,
|
||||
region: this.region,
|
||||
deliverRegion: this.deliverRegion,
|
||||
offerRegion: this.offerRegion,
|
||||
}))
|
||||
this.$message({
|
||||
message: "已保存",
|
||||
type: 'success'
|
||||
})
|
||||
},
|
||||
afterReadAttachment({file}, field) {
|
||||
for (let i = 0; i < file.length; i++) {
|
||||
const item = file[i]
|
||||
const suffix = item.name.split('.').pop()
|
||||
if (field === 'files' || field === 'contractAttachment') {
|
||||
if (item.type !== 'application/pdf') {
|
||||
uni.showToast({
|
||||
title: '请上传PDF文件',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
uniCloud.uploadFile({
|
||||
filePath: item.url,
|
||||
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + md5(item.name + Date.now().toString()) + `.${suffix}`,
|
||||
success: ({fileID}) => {
|
||||
uniCloud.getTempFileURL({
|
||||
fileList: [fileID]
|
||||
}).then(res => {
|
||||
this[field].push({url: res.fileList[0].tempFileURL})
|
||||
this.form[field].push(res.fileList[0].tempFileURL)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
deletePicAttachment({index}, field) {
|
||||
this[field].splice(index, 1)
|
||||
this.form[field].splice(index, 1)
|
||||
},
|
||||
setOther() {
|
||||
this.cateName = ''
|
||||
},
|
||||
openPicker() {
|
||||
if (this.form.otherCate) return
|
||||
this.showPicker = true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
vk.callFunction({
|
||||
url: 'client/old/pub/getTree',
|
||||
title: '请求中...',
|
||||
data: {type: 1},
|
||||
success: (data) => {
|
||||
this.cateData = data.rows.map(item => {
|
||||
item.children.forEach(child => {
|
||||
delete child.children
|
||||
})
|
||||
return item
|
||||
})
|
||||
}
|
||||
});
|
||||
if (this.user.accountType === 2) {
|
||||
this.form.buyer.companyName = this.user.company.companyName
|
||||
this.form.buyer.contract = this.user.company.mobile
|
||||
} else {
|
||||
this.form.buyer.companyName = this.user.person.personName
|
||||
this.form.buyer.contract = this.user.person.mobile
|
||||
}
|
||||
if (!!localStorage.getItem("old_1")) {
|
||||
this.$confirm('您有一份暂存数据,是否恢复?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const savedData = JSON.parse(localStorage.getItem("old_1"))
|
||||
this.form = savedData.form
|
||||
this.cateName = savedData.cateName
|
||||
this.files = savedData.files
|
||||
this.deliverRegion = savedData.deliverRegion
|
||||
this.offerRegion = savedData.offerRegion
|
||||
this.region = savedData.region
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.layout-header {
|
||||
margin: 0rpx 30rpx;
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1px solid rgba(169, 41, 36, 0.34);
|
||||
|
||||
.big {
|
||||
font-size: 32rpx;
|
||||
line-height: 48rpx;
|
||||
color: #000000;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.small {
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
color: #9a9a9a;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.ptb {
|
||||
margin-right: 20rpx;
|
||||
padding: 6rpx 14rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
color: #333333;
|
||||
border: 1px solid #f2f2f2;
|
||||
|
||||
&:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.active {
|
||||
color: #ffffff;
|
||||
border-color: #A92924;
|
||||
background: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.public-btn {
|
||||
width: 95%;
|
||||
margin-top: 60rpx;
|
||||
color: #ffffff;
|
||||
background: #A92924;
|
||||
}
|
||||
|
||||
.layout-publish {
|
||||
padding: 20rpx 30rpx;
|
||||
}
|
||||
|
||||
.tag-title {
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
color: #000000;
|
||||
|
||||
.limit {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.tag-box {
|
||||
padding: 20rpx 0;
|
||||
|
||||
.item {
|
||||
padding: 6rpx 10rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 32rpx;
|
||||
color: #555555;
|
||||
}
|
||||
|
||||
.active {
|
||||
color: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.lb, .fix {
|
||||
position: relative;
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.lbx {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.download {
|
||||
padding: 8rpx 20rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #A92924;
|
||||
border: 1px solid #A92924;
|
||||
}
|
||||
|
||||
.need::before {
|
||||
position: absolute;
|
||||
left: -16rpx;
|
||||
top: 50%;
|
||||
z-index: 9;
|
||||
margin-top: -12rpx;
|
||||
content: '*';
|
||||
color: #A92924;
|
||||
font-size: 32rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
position: relative;
|
||||
padding-left: 20rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
line-height: 48rpx;
|
||||
color: #A92924;
|
||||
|
||||
&:before {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
z-index: 9;
|
||||
margin-top: -14rpx;
|
||||
content: '';
|
||||
width: 6rpx;
|
||||
height: 28rpx;
|
||||
background: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.template-tab {
|
||||
.ttb {
|
||||
margin-right: 30rpx;
|
||||
padding: 6rpx 20rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
color: #333333;
|
||||
border: 1px solid #f2f2f2;
|
||||
}
|
||||
|
||||
.active {
|
||||
color: #A92924;
|
||||
border-color: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.template-content {
|
||||
padding: 30rpx 0;
|
||||
}
|
||||
|
||||
.goods-item {
|
||||
padding: 18rpx 0;
|
||||
}
|
||||
|
||||
.expire-tip {
|
||||
padding: 0 20rpx 18rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #A92924;
|
||||
}
|
||||
|
||||
.add-btn {
|
||||
margin-left: 0;
|
||||
width: 180rpx;
|
||||
height: 60rpx;
|
||||
color: #A92924;
|
||||
border-color: #A92924;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,683 @@
|
||||
<template>
|
||||
<view class="flex flex-col justify-start items-start">
|
||||
<text class="text-50">发布我的回收信息</text>
|
||||
<text class="text-gray">回收信息越完整,成功交易越容易</text>
|
||||
<view class="layout w-100p m-top-10">
|
||||
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
|
||||
<text class="need text-red">*</text>
|
||||
<view class="lb">信息失效时间:</view>
|
||||
<view class="vl flex-1 p-right-20" @click="showExpire = true">
|
||||
<u--input placeholder="请选择" v-model="form.expiredTime" style="pointer-events:none"
|
||||
fontSize="24rpx"
|
||||
suffixIcon="arrow-down-fill"
|
||||
suffixIconStyle="font-size: 10px;color: #d5d5d5"
|
||||
:disabled="true"
|
||||
disabledColor="#fff"></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="expire-tip">温馨提示:为保证信息有效性发布最长时限为1年(12个月)到期后需重新发布。</view>
|
||||
<view class="goods-item half flex align-center flex-wrap w-100p">
|
||||
<text class="need text-red">*</text>
|
||||
<view class="lb">物资分类:</view>
|
||||
<view class="vl flex-1 p-right-20" @click="openPicker">
|
||||
<u--input
|
||||
style="pointer-events:none"
|
||||
placeholder="请选择"
|
||||
v-model="cateName"
|
||||
fontSize="24rpx"
|
||||
suffixIcon="arrow-down-fill"
|
||||
suffixIconStyle="font-size: 10px;color: #d5d5d5"
|
||||
:disabled="true"
|
||||
disabledColor="#fff"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
|
||||
<el-checkbox label="其他分类" v-model="form.otherCate" class="mx-20"></el-checkbox>
|
||||
<u--input
|
||||
placeholder="请选择"
|
||||
v-model="form.otherCateName"
|
||||
fontSize="24rpx"
|
||||
:disabled="!form.otherCate" @change="setOther"
|
||||
></u--input>
|
||||
</view>
|
||||
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
|
||||
<text class="need text-red">*</text>
|
||||
<view class="lb">信息标题:</view>
|
||||
<view class="vl flex-1 p-right-20">
|
||||
<u--input
|
||||
placeholder="一句话简介物资,如拍卖直缝钢管200吨等"
|
||||
v-model="form.title"
|
||||
fontSize="24rpx"
|
||||
></u--input>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
|
||||
<view class="lb">回收方简述:</view>
|
||||
<view class="vl flex-1 p-right-20">
|
||||
<u--textarea
|
||||
placeholder="请详细描述物资信息,描述内容:材料名称、材质......(限300字以内)"
|
||||
v-model="form.desc"
|
||||
fontSize="24rpx"
|
||||
></u--textarea>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
|
||||
<view class="lb">回收物实景照片:</view>
|
||||
<view class="vl flex-1 p-right-20">
|
||||
<u-upload
|
||||
multiple
|
||||
:fileList="form.files"
|
||||
@afterRead="afterRead"
|
||||
@delete="deletePic"
|
||||
width="120rpx"
|
||||
height="120rpx"
|
||||
></u-upload>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
|
||||
<text class="need text-red">*</text>
|
||||
<view class="lb">回收单位所在地:</view>
|
||||
<view class="vl flex-1 p-right-20" @click="showAddress">
|
||||
<u--input
|
||||
style="pointer-events:none"
|
||||
placeholder="请选择"
|
||||
v-model="region"
|
||||
fontSize="24rpx"
|
||||
suffixIcon="arrow-down-fill"
|
||||
suffixIconStyle="font-size: 10px;color: #d5d5d5"
|
||||
:disabled="true"
|
||||
disabledColor="#fff"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
|
||||
<text class="need text-red">*</text>
|
||||
<view class="lb">回收单位地址:</view>
|
||||
<view class="vl flex-1 p-right-20">
|
||||
<u--input placeholder="请选择" v-model="form.addressDetail"></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-title m-top-30">回收单位信息</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb m-right-20">{{ user.accountType === 2 ? '公司信息' : '个人信息' }} :</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
placeholder="请输入内容"
|
||||
v-model="form.supplier.companyName"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb m-right-20">{{ user.accountType === 2 ? '公司联系方式' : '个人联系方式' }} :</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
placeholder="请输入内容"
|
||||
v-model="form.supplier.contract"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb m-right-20">联系人:</view>
|
||||
<view class="vl flex-1" @click="showContactPicker = true">
|
||||
<u--input
|
||||
style="pointer-events:none"
|
||||
readonly
|
||||
placeholder="点击选择联系人"
|
||||
v-model="form.supplier.managerName"
|
||||
suffixIcon="arrow-right"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb m-right-20">联系方式:</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
disabled
|
||||
placeholder="请输入内容"
|
||||
v-model="form.supplier.managerContract"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt-20 flex justify-start items-center">
|
||||
<text class="mr-25">您是否对以上信息进行了详细核实:</text>
|
||||
<el-radio label="是" v-model="checked">
|
||||
<text>是</text>
|
||||
</el-radio>
|
||||
<el-radio label="否" v-model="checked">
|
||||
<text>否</text>
|
||||
</el-radio>
|
||||
</view>
|
||||
<view class="mt-20 flex justify-start items-center">
|
||||
<text class="mr-25">是否加急({{ urgentAmount }}元/次):</text>
|
||||
<el-radio :label="true" v-model="form.isUrgent">
|
||||
<text>是</text>
|
||||
</el-radio>
|
||||
<el-radio :label="false" v-model="form.isUrgent">
|
||||
<text>否</text>
|
||||
</el-radio>
|
||||
</view>
|
||||
<view class="my-25 text-main font-bold">本月剩余旧货发布次数:{{ remainOldNum }}</view>
|
||||
<view class="flex justify-start items-center">
|
||||
<el-checkbox :value="agree" active-color="#A92924" @change="handleAgreementCheck">我已阅读并同意</el-checkbox>
|
||||
<span class="text-main pointer font-bold" @click="showAgreement">《金久信旧货交易协议》</span>
|
||||
</view>
|
||||
<view class="flex justify-center items-center mt-30 m-a w-100p">
|
||||
<view class="flex-1 mx-15">
|
||||
<u-button type="primary" @click="save" plain="">暂存</u-button>
|
||||
</view>
|
||||
<view class="flex-1 mx-15">
|
||||
<u-button type="primary" :disabled="checked === '否' || !agree" @click="publish">立即发布</u-button>
|
||||
</view>
|
||||
</view>
|
||||
<u-picker v-if="showPicker" :show="showPicker" :columns="[cateData, cateData[cateDataIndex].children]"
|
||||
keyName="name" @change="changeCate"
|
||||
@cancel="showPicker = false" @close="showPicker = false" closeOnClickOverlay
|
||||
@confirm="confirmCate"></u-picker>
|
||||
<AddressSelect ref="AddressSelect" @confirm="regionConfirm"/>
|
||||
<u-picker :show="showUnit" :columns="[unitList]"
|
||||
@cancel="showUnit = false" @close="showUnit = false" closeOnClickOverlay
|
||||
@confirm="confirmUnit"></u-picker>
|
||||
<u-datetime-picker :show="showExpire" v-model="expireTime" mode="date" @cancel="showExpire = false"
|
||||
:minDate="minDate" :maxDate="maxDate"
|
||||
@confirm="handConfirmDate"></u-datetime-picker>
|
||||
<u-picker :show="showContactPicker" :columns="[contactList]" keyName="name"
|
||||
@cancel="showContactPicker = false" @close="showContactPicker = false" closeOnClickOverlay
|
||||
@confirm="confirmContact"></u-picker>
|
||||
<agreement ref="agreementRef" @read-complete="onAgreementReadComplete"/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import AddressSelect from "@/components/AddressSelect.vue";
|
||||
import dayjs from "dayjs";
|
||||
import md5 from "js-md5";
|
||||
import Agreement from "@/pages/junk/agreement.vue";
|
||||
|
||||
export default {
|
||||
name: "type_0",
|
||||
components: {Agreement, AddressSelect},
|
||||
props: {
|
||||
urgentAmount: {
|
||||
type: Number,
|
||||
default: 10
|
||||
},
|
||||
remainOldNum: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
agreement: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
commonContractUrl: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
contactList: {
|
||||
type: Array,
|
||||
default: ''
|
||||
},
|
||||
user: {
|
||||
type: Object,
|
||||
default: null
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pickerOptions: {
|
||||
disabledDate(time) {
|
||||
return time.getTime() < Date.now();
|
||||
},
|
||||
},
|
||||
agree: false,
|
||||
agreementReadCompleted: false,
|
||||
unitList: ['吨', '万吨'],
|
||||
allChildCate: [],
|
||||
cateData: [],
|
||||
cateDataIndex: 0,
|
||||
form: {
|
||||
type: 3,
|
||||
category: 0,
|
||||
files: [],
|
||||
otherCate: false,
|
||||
otherCateName: '',
|
||||
title: '',
|
||||
desc: '',
|
||||
addressRegion: {},
|
||||
addressDetail: '',
|
||||
startNum: '',
|
||||
unit: '吨',
|
||||
startAmount: '',
|
||||
expiredTime: '',
|
||||
offerAddressRegion: {},
|
||||
offerAddressNoLimit: false,
|
||||
payMethod: '预付',
|
||||
prePayRate: '',
|
||||
otherPayMethodDesc: '',
|
||||
signMethod: 0,
|
||||
buyer: {
|
||||
companyName: '',
|
||||
contract: '',
|
||||
personalName: '',
|
||||
personalContract: '',
|
||||
managerName: '',
|
||||
managerContract: '',
|
||||
},
|
||||
supplier: {
|
||||
companyName: '',
|
||||
contract: '',
|
||||
personalName: '',
|
||||
personalContract: '',
|
||||
managerName: '',
|
||||
managerContract: '',
|
||||
},
|
||||
contractAttachment: [],
|
||||
isUrgent: false,
|
||||
supplementary: ''
|
||||
},
|
||||
provinceIndex: null,
|
||||
cityIndex: null,
|
||||
areaIndex: null,
|
||||
offerProvinceIndex: null,
|
||||
offerCityIndex: null,
|
||||
offerAreaIndex: null,
|
||||
checked: '否',
|
||||
showPicker: false,
|
||||
cateName: '',
|
||||
region: '',
|
||||
showUnit: false,
|
||||
showExpire: false,
|
||||
expireTime: '',
|
||||
showContactPicker: false,
|
||||
minDate: Number(new Date()),
|
||||
maxDate: dayjs().add(1, 'year').valueOf()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
showAddress() {
|
||||
this.$refs.AddressSelect.open(this.form.addressRegion);
|
||||
},
|
||||
regionConfirm({province, city, area}) {
|
||||
this.form.addressRegion = {province, city, area}
|
||||
this.region = `${province.name} ${city.name} ${area.name}`
|
||||
},
|
||||
async publish() {
|
||||
if (this.remainOldNum === 0) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您的旧货发布次数已用完,是否立即购买?',
|
||||
success: async res => {
|
||||
if (res.confirm) {
|
||||
const {data} = await vk.callFunction({
|
||||
url: 'client/old/kh/buyNum',
|
||||
})
|
||||
vk.navigateTo({
|
||||
url: `/pages/shop/pay?id=${data}`
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!this.form.addressRegion) return this.$message({
|
||||
message: "请选择完整的物资所在地",
|
||||
type: 'warning'
|
||||
})
|
||||
if (!this.form.addressDetail) return this.$message({
|
||||
message: "请填写详细物资所在地",
|
||||
type: 'warning'
|
||||
})
|
||||
if (!this.form.title) return this.$message({
|
||||
message: "请填写标题",
|
||||
type: 'warning'
|
||||
})
|
||||
if (!this.form.otherCate) {
|
||||
if (!this.form.category) return this.$message({
|
||||
message: "请选择分类",
|
||||
type: 'warning'
|
||||
})
|
||||
} else {
|
||||
if (!this.form.otherCateName) return this.$message({
|
||||
message: "请输入其他分类",
|
||||
type: 'warning'
|
||||
})
|
||||
this.form.category = ['', this.form.otherCateName]
|
||||
}
|
||||
if (!this.form.expiredTime) return this.$message({
|
||||
message: "请选择失效时间",
|
||||
type: 'warning'
|
||||
})
|
||||
if (dayjs(this.form.expiredTime).valueOf() > this.maxDate) return this.$message({
|
||||
message: "为保证信息有效性发布最长时限为1年(12个月)",
|
||||
type: 'warning'
|
||||
})
|
||||
|
||||
this.form.files = this.form.files.map(i => i.url)
|
||||
const res = await vk.callFunction({
|
||||
url: 'client/old/kh/add',
|
||||
data: this.form
|
||||
})
|
||||
localStorage.removeItem("old_3")
|
||||
this.$message({
|
||||
message: "您的信息已经提交,等待管理员审核,请您耐心等待!",
|
||||
type: 'success'
|
||||
})
|
||||
setTimeout(() => {
|
||||
if (this.form.isUrgent) {
|
||||
vk.navigateTo({
|
||||
url: `/pages/shop/pay?id=${res.data}`
|
||||
})
|
||||
} else {
|
||||
vk.redirectTo({url: '/pages/junk/junk'});
|
||||
}
|
||||
}, 1500)
|
||||
},
|
||||
handleAgreementCheck(value) {
|
||||
if (!value) {
|
||||
this.agree = false
|
||||
return
|
||||
}
|
||||
if (!this.agreementReadCompleted) {
|
||||
this.agree = false
|
||||
uni.showToast({
|
||||
title: '请先查看《金久信旧货交易协议》5秒以上',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
this.agree = true
|
||||
},
|
||||
onAgreementReadComplete() {
|
||||
this.agreementReadCompleted = true
|
||||
},
|
||||
showAgreement() {
|
||||
// this.$confirm(this.agreement, '金久信旧货交易协议', {
|
||||
// cancelButtonText: '关闭',
|
||||
// showConfirmButton: false,
|
||||
// dangerouslyUseHTMLString: true,
|
||||
// })
|
||||
this.$refs.agreementRef.open()
|
||||
},
|
||||
openDownload() {
|
||||
// window.open(this.commonContractUrl)
|
||||
window.location.href = this.commonContractUrl
|
||||
},
|
||||
navTo() {
|
||||
vk.navigateTo({url: '/pages/user/user?menu=business-contact'})
|
||||
},
|
||||
confirmCate({value}) {
|
||||
this.form.category = value.map(i => i.name)
|
||||
this.cateName = `${value[0].name}${value[1].name}`
|
||||
this.showPicker = false
|
||||
},
|
||||
confirmUnit({value}) {
|
||||
this.form.unit = value
|
||||
this.showUnit = false
|
||||
},
|
||||
afterRead({file}) {
|
||||
file.forEach(item => {
|
||||
const suffix = item.name.split('.').pop()
|
||||
uniCloud.uploadFile({
|
||||
filePath: item.url,
|
||||
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + md5(item.name + Date.now().toString()) + `.${suffix}`,
|
||||
success: ({fileID}) => {
|
||||
uniCloud.getTempFileURL({
|
||||
fileList: [fileID]
|
||||
}).then(res => {
|
||||
this.form.files.push({url: res.fileList[0].tempFileURL})
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
deletePic({index}) {
|
||||
this.form.files.splice(index, 1)
|
||||
},
|
||||
handConfirmDate({value}) {
|
||||
this.form.expiredTime = dayjs(value).format('YYYY-MM-DD')
|
||||
this.showExpire = false
|
||||
},
|
||||
confirmContact({value}) {
|
||||
this.form.supplier.managerName = value[0].name
|
||||
this.form.supplier.managerContract = value[0].phone
|
||||
this.showContactPicker = false
|
||||
},
|
||||
changeCate({columnIndex, index}) {
|
||||
if (columnIndex === 0) {
|
||||
this.cateDataIndex = index
|
||||
}
|
||||
},
|
||||
save() {
|
||||
localStorage.setItem("old_3", JSON.stringify({
|
||||
form: this.form,
|
||||
cateName: this.cateName,
|
||||
region: this.region,
|
||||
}))
|
||||
this.$message({
|
||||
message: "已保存",
|
||||
type: 'success'
|
||||
})
|
||||
},
|
||||
setOther(){
|
||||
this.cateName = ''
|
||||
},
|
||||
openPicker(){
|
||||
if(this.form.otherCate) return
|
||||
this.showPicker = true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
vk.callFunction({
|
||||
url: 'client/old/pub/getTree',
|
||||
title: '请求中...',
|
||||
data: {type: 3},
|
||||
success: (data) => {
|
||||
this.cateData = data.rows.map(item => {
|
||||
item.children.forEach(child => {
|
||||
delete child.children
|
||||
})
|
||||
return item
|
||||
})
|
||||
}
|
||||
});
|
||||
if (this.user.accountType === 2) {
|
||||
this.form.supplier.companyName = this.user.company.companyName
|
||||
this.form.supplier.contract = this.user.company.mobile
|
||||
} else {
|
||||
this.form.supplier.companyName = this.user.person.personName
|
||||
this.form.supplier.contract = this.user.person.mobile
|
||||
}
|
||||
this.form.supplier.contract = this.user.businessCard.companyMobile
|
||||
if (!!localStorage.getItem("old_3")) {
|
||||
this.$confirm('您有一份暂存数据,是否恢复?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const savedData = JSON.parse(localStorage.getItem("old_3"))
|
||||
this.form = savedData.form
|
||||
this.cateName = savedData.cateName
|
||||
this.region = savedData.region
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.layout-header {
|
||||
margin: 0rpx 30rpx;
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1px solid rgba(169, 41, 36, 0.34);
|
||||
|
||||
.big {
|
||||
font-size: 32rpx;
|
||||
line-height: 48rpx;
|
||||
color: #000000;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.small {
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
color: #9a9a9a;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.ptb {
|
||||
margin-right: 20rpx;
|
||||
padding: 6rpx 14rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
color: #333333;
|
||||
border: 1px solid #f2f2f2;
|
||||
|
||||
&:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.active {
|
||||
color: #ffffff;
|
||||
border-color: #A92924;
|
||||
background: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.public-btn {
|
||||
width: 95%;
|
||||
margin-top: 60rpx;
|
||||
color: #ffffff;
|
||||
background: #A92924;
|
||||
}
|
||||
|
||||
.layout-publish {
|
||||
padding: 20rpx 30rpx;
|
||||
}
|
||||
|
||||
.tag-title {
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
color: #000000;
|
||||
|
||||
.limit {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.tag-box {
|
||||
padding: 20rpx 0;
|
||||
|
||||
.item {
|
||||
padding: 6rpx 10rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 32rpx;
|
||||
color: #555555;
|
||||
}
|
||||
|
||||
.active {
|
||||
color: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.lb, .fix {
|
||||
position: relative;
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.lbx {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.download {
|
||||
padding: 8rpx 20rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #A92924;
|
||||
border: 1px solid #A92924;
|
||||
}
|
||||
|
||||
.need::before {
|
||||
position: absolute;
|
||||
left: -16rpx;
|
||||
top: 50%;
|
||||
z-index: 9;
|
||||
margin-top: -12rpx;
|
||||
content: '*';
|
||||
color: #A92924;
|
||||
font-size: 32rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
position: relative;
|
||||
padding-left: 20rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
line-height: 48rpx;
|
||||
color: #A92924;
|
||||
|
||||
&:before {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
z-index: 9;
|
||||
margin-top: -14rpx;
|
||||
content: '';
|
||||
width: 6rpx;
|
||||
height: 28rpx;
|
||||
background: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.template-tab {
|
||||
.ttb {
|
||||
margin-right: 30rpx;
|
||||
padding: 6rpx 20rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
color: #333333;
|
||||
border: 1px solid #f2f2f2;
|
||||
}
|
||||
|
||||
.active {
|
||||
color: #A92924;
|
||||
border-color: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.template-content {
|
||||
padding: 30rpx 0;
|
||||
}
|
||||
|
||||
.goods-item {
|
||||
padding: 18rpx 0;
|
||||
}
|
||||
|
||||
.expire-tip {
|
||||
padding: 0 20rpx 18rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #A92924;
|
||||
}
|
||||
|
||||
.add-btn {
|
||||
margin-left: 0;
|
||||
width: 180rpx;
|
||||
height: 60rpx;
|
||||
color: #A92924;
|
||||
border-color: #A92924;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,321 @@
|
||||
<template> <!-- 忘记密码 -->
|
||||
<view class="wrap">
|
||||
<view class="login-img">
|
||||
<image class="full" src="/static/img/login.png" mode=""></image>
|
||||
</view>
|
||||
<view class="layout-login bg-white">
|
||||
<view class="login-title">找回密码</view>
|
||||
<view class="login-form">
|
||||
<view class="m-top-30">
|
||||
<u--input
|
||||
v-model="form1.mobile"
|
||||
placeholder="请输入手机号"
|
||||
prefixIcon="account"
|
||||
prefixIconStyle="font-size: 26px;color: #909399"
|
||||
></u--input>
|
||||
</view>
|
||||
<view class="m-top-30">
|
||||
<u--input
|
||||
v-model="form1.code"
|
||||
placeholder="请输入短信验证码"
|
||||
prefixIcon="email"
|
||||
prefixIconStyle="font-size: 26px;color: #909399"
|
||||
>
|
||||
<template slot="suffix">
|
||||
<u-code
|
||||
ref="uCode"
|
||||
@change="codeChange"
|
||||
seconds="20"
|
||||
changeText="X秒重新获取"
|
||||
></u-code>
|
||||
<u-button
|
||||
@tap="sendSmsCode"
|
||||
:text="smsTips"
|
||||
type="success"
|
||||
size="mini"
|
||||
color="#db1c2c"
|
||||
></u-button>
|
||||
</template>
|
||||
</u--input>
|
||||
</view>
|
||||
<view class="m-top-30">
|
||||
<u--input
|
||||
v-model="form1.password"
|
||||
placeholder="设置登录密码"
|
||||
prefixIcon="lock"
|
||||
prefixIconStyle="font-size: 26px;color: #909399"
|
||||
></u--input>
|
||||
</view>
|
||||
<view class="m-top-30">
|
||||
<u--input
|
||||
v-model="form1.repassword"
|
||||
placeholder="确认登录密码"
|
||||
prefixIcon="lock"
|
||||
prefixIconStyle="font-size: 26px;color: #909399"
|
||||
></u--input>
|
||||
</view>
|
||||
<view class="m-top-30">
|
||||
<u-button color="#db1c2c" text="立即找回" @click="handleSubmit"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
let timer = null
|
||||
let timeS = 60
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
roleIndex: 1,
|
||||
tabIndex: 1,
|
||||
tips: '',
|
||||
checked: false,
|
||||
smsTips: '获取验证码',
|
||||
form1: {
|
||||
mobile: '',
|
||||
password: '',
|
||||
repassword: '',
|
||||
code: '',
|
||||
username: ''
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handRole(index) {
|
||||
this.roleIndex = index
|
||||
},
|
||||
handTab(index) {
|
||||
this.tabIndex = index
|
||||
},
|
||||
codeChange(text) {
|
||||
this.tips = text;
|
||||
},
|
||||
getCode() {
|
||||
if (this.$refs.uCode.canGetCode) {
|
||||
// 模拟向后端请求验证码
|
||||
uni.showLoading({
|
||||
title: '正在获取验证码'
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.hideLoading();
|
||||
// 这里此提示会被this.start()方法中的提示覆盖
|
||||
uni.$u.toast('验证码已发送');
|
||||
// 通知验证码组件内部开始倒计时
|
||||
this.$refs.uCode.start();
|
||||
}, 2000);
|
||||
} else {
|
||||
uni.$u.toast('倒计时结束后再发送');
|
||||
}
|
||||
},
|
||||
handleSubmit() {
|
||||
if (this.testForm()) {
|
||||
const {
|
||||
password,
|
||||
mobile,
|
||||
code
|
||||
} = this.form1
|
||||
|
||||
vk.userCenter.resetPasswordByMobile({
|
||||
data: {
|
||||
password,
|
||||
mobile,
|
||||
code
|
||||
},
|
||||
success: (data) => {
|
||||
// 成功后的逻辑
|
||||
this.$message({
|
||||
message: "密码重置成功",
|
||||
type: 'success'
|
||||
})
|
||||
vk.redirectTo({
|
||||
url: '/pages/auth/login/login'
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
sendSmsCode() {
|
||||
if (timer != null) {
|
||||
return
|
||||
}
|
||||
vk.userCenter.sendSmsCode({
|
||||
loading: false,
|
||||
data: {
|
||||
mobile: this.form1.mobile,
|
||||
type: 'reset-pwd',
|
||||
},
|
||||
success: (data) => {
|
||||
|
||||
this.$message({
|
||||
message: "验证码已发送",
|
||||
type: 'success'
|
||||
})
|
||||
timeS = 60
|
||||
timer = setInterval(() => {
|
||||
timeS--
|
||||
if (timeS <= 0) {
|
||||
this.smsTips = "重新发送"
|
||||
this.stopTimer()
|
||||
} else {
|
||||
this.smsTips = timeS + "秒"
|
||||
}
|
||||
|
||||
}, 1000)
|
||||
}
|
||||
});
|
||||
},
|
||||
stopTimer() {
|
||||
if (timer != null) {
|
||||
clearInterval(timer)
|
||||
timer = null
|
||||
}
|
||||
|
||||
},
|
||||
loginSuccess() {
|
||||
uni.reLaunch({
|
||||
url: '/'
|
||||
})
|
||||
},
|
||||
testForm() {
|
||||
const {
|
||||
mobile, // 手机号
|
||||
code, // 短信验证码4-8位
|
||||
password, // 密码 6-20位
|
||||
repassword, // 重复输入密码
|
||||
} = this.form1;
|
||||
|
||||
// 手机号验证
|
||||
if (!mobile || !/^1[3456789]\d{9}$/.test(mobile)) {
|
||||
this.$message({
|
||||
message: '手机号为空或格式不正确',
|
||||
type: 'error'
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
// 短信验证码验证
|
||||
if (!code || !/^\d{4,8}$/.test(code)) {
|
||||
// 短信验证码为空或格式不正确
|
||||
// 处理错误逻辑
|
||||
this.$message({
|
||||
message: '短信验证码为空或格式不正确',
|
||||
type: 'error'
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
// 密码验证
|
||||
if (!password || password.length < 6 || password.length > 20) {
|
||||
// 密码为空或长度不符合要求
|
||||
this.$message({
|
||||
message: '密码长度不符合要求',
|
||||
type: 'error'
|
||||
})
|
||||
return false
|
||||
// 处理错误逻辑
|
||||
}
|
||||
|
||||
// 重复输入密码验证
|
||||
if (password !== repassword) {
|
||||
// 两次输入的密码不一致
|
||||
this.$message({
|
||||
message: '两次输入的密码不一致',
|
||||
type: 'error'
|
||||
})
|
||||
return false
|
||||
// 处理错误逻辑
|
||||
}
|
||||
return true
|
||||
|
||||
},
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
onUnload() {
|
||||
if (timer != null) {
|
||||
clearInterval(timer)
|
||||
timer = null
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #e8f5fe;
|
||||
}
|
||||
|
||||
.login-img {
|
||||
width: 100%;
|
||||
height: 330rpx;
|
||||
}
|
||||
|
||||
.layout-login {
|
||||
margin: 20rpx 30rpx;
|
||||
padding: 30rpx 30rpx 50rpx;
|
||||
|
||||
.login-title {
|
||||
font-size: 44rpx;
|
||||
font-weight: 500;
|
||||
line-height: 60rpx;
|
||||
text-align: center;
|
||||
color: #101010;
|
||||
}
|
||||
|
||||
.login-type {
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #8e8e8e;
|
||||
}
|
||||
|
||||
.login-role .role {
|
||||
position: relative;
|
||||
margin: 0 50rpx;
|
||||
padding-left: 60rpx;
|
||||
font-size: 30rpx;
|
||||
line-height: 40rpx;
|
||||
color: #666666;
|
||||
|
||||
&:before {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
z-index: 9;
|
||||
content: '';
|
||||
transform: translateY(-50%);
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
padding: 10rpx;
|
||||
border: 1px solid #f2f2f2;
|
||||
border-radius: 50%;
|
||||
box-sizing: border-box;
|
||||
background-clip: content-box;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
}
|
||||
|
||||
.login-role .active {
|
||||
color: #A92924;
|
||||
|
||||
&:before {
|
||||
border-color: #A92924;
|
||||
background-color: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.fg {
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.xie {
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
color: blue;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,251 @@
|
||||
<template> <!-- 登录 -->
|
||||
<view class="wrap pos-r h-100 flex flex-col justify-start items-center" style="background-color: #AB0011">
|
||||
<u-image src="/static/img/login.jpg" width="750rpx" height="470rpx" mode=""></u-image>
|
||||
<view class="layout-login card" style="z-index: 10">
|
||||
<view class="login-title">会员登录</view>
|
||||
<view class="login-type flex justify-between m-top-30">
|
||||
<view :class="['type', {red : tabIndex == 1}]" @click="handTab(1)">账号密码登录</view>
|
||||
<!-- <view :class="['type', {red : tabIndex == 2}]" @click="handTab(2)">短信验证登录</view>-->
|
||||
</view>
|
||||
<view class="login-form">
|
||||
<view class="m-top-30">
|
||||
<u--input
|
||||
v-model="form.username"
|
||||
placeholder="请输入手机号"
|
||||
prefixIcon="account"
|
||||
prefixIconStyle="font-size: 26px;color: #909399"
|
||||
></u--input>
|
||||
</view>
|
||||
<view class="m-top-30" v-if="tabIndex == 1">
|
||||
<u--input
|
||||
v-model="form.password"
|
||||
placeholder="请输入密码"
|
||||
prefixIcon="lock"
|
||||
type="password"
|
||||
prefixIconStyle="font-size: 26px;color: #909399"
|
||||
></u--input>
|
||||
</view>
|
||||
<view class="m-top-30" v-if="tabIndex == 2">
|
||||
<u--input
|
||||
v-model="form.smsCode"
|
||||
placeholder="请输入验证码"
|
||||
prefixIcon="email"
|
||||
prefixIconStyle="font-size: 26px;color: #909399"
|
||||
>
|
||||
<template slot="suffix">
|
||||
<u-code
|
||||
ref="uCode"
|
||||
@change="codeChange"
|
||||
seconds="20"
|
||||
changeText="X秒重新获取"
|
||||
></u-code>
|
||||
<u-button
|
||||
@tap="getCode"
|
||||
:text="tips"
|
||||
type="success"
|
||||
size="mini"
|
||||
color="#db1c2c"
|
||||
></u-button>
|
||||
</template>
|
||||
</u--input>
|
||||
</view>
|
||||
<!-- <view class="m-top-30">-->
|
||||
<!-- <drag-verify ref="dragVerify" :width="280" :isPassing.sync="isPassing"-->
|
||||
<!-- text="请按住滑块拖动" successText="验证通过"-->
|
||||
<!-- handlerIcon="el-icon-d-arrow-right" successIcon="el-icon-circle-check">-->
|
||||
<!-- <i v-show="!isPassing" slot="textBefore" class="el-icon-lock"></i>-->
|
||||
<!-- </drag-verify>-->
|
||||
<!-- </view>-->
|
||||
<view class="m-top-30">
|
||||
<u-button color="#db1c2c" text="立即登录" @click="handleSubmit"></u-button>
|
||||
</view>
|
||||
<view class="flex justify-between m-top-20">
|
||||
<view class="fg" @click="registerLink">免费注册新账号</view>
|
||||
<view class="fg" @click="forgetLink">找回密码</view>
|
||||
</view>
|
||||
<view class="m-top-30 p-top-20">
|
||||
<u-divider text="第三方登录"></u-divider>
|
||||
</view>
|
||||
<view class="flex justify-center align-center">
|
||||
<u-icon name="weixin-circle-fill" color="#05BC04" size="38" @click="wechatLogin"></u-icon>
|
||||
<!-- <view style="width: 50rpx;"></view>-->
|
||||
<!-- <u-icon name="qq-circle-fill" color="#2286EA" size="38"></u-icon>-->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dragVerify from 'vue-drag-verify2'
|
||||
|
||||
export default {
|
||||
components: {dragVerify},
|
||||
data() {
|
||||
return {
|
||||
tabIndex: 1,
|
||||
tips: '',
|
||||
isPassing: false,
|
||||
form: {
|
||||
mobile: '',
|
||||
password: '',
|
||||
smsCode: '',
|
||||
username: ''
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
registerLink() {
|
||||
uni.$u.route('/pages/login/register')
|
||||
},
|
||||
forgetLink() {
|
||||
uni.$u.route('/pages/login/forget')
|
||||
},
|
||||
handTab(index) {
|
||||
this.tabIndex = index
|
||||
},
|
||||
codeChange(text) {
|
||||
this.tips = text;
|
||||
},
|
||||
getCode() {
|
||||
if (this.$refs.uCode.canGetCode) {
|
||||
// 模拟向后端请求验证码
|
||||
uni.showLoading({
|
||||
title: '正在获取验证码'
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.hideLoading();
|
||||
// 这里此提示会被this.start()方法中的提示覆盖
|
||||
uni.$u.toast('验证码已发送');
|
||||
// 通知验证码组件内部开始倒计时
|
||||
this.$refs.uCode.start();
|
||||
}, 2000);
|
||||
} else {
|
||||
uni.$u.toast('倒计时结束后再发送');
|
||||
}
|
||||
},
|
||||
handleSubmit() {
|
||||
// if (!this.isPassing) return this.$message.error('请先完成滑块验证')
|
||||
let data = {}
|
||||
|
||||
const {
|
||||
username,
|
||||
password,
|
||||
mobile,
|
||||
smsCode
|
||||
} = this.form
|
||||
|
||||
if (this.tabIndex === 1) {
|
||||
data = {
|
||||
username,
|
||||
password,
|
||||
}
|
||||
vk.userCenter.login({
|
||||
loading: false,
|
||||
data,
|
||||
success: (data) => {
|
||||
this.loginSuccess()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
vk.userCenter.loginBySms({
|
||||
loading: false,
|
||||
data: {
|
||||
mobile: mobile,
|
||||
code: smsCode,
|
||||
},
|
||||
success: (data) => {
|
||||
this.loginSuccess()
|
||||
}
|
||||
}).catch(() => {
|
||||
// this.$refs.dragVerify.reset()
|
||||
})
|
||||
}
|
||||
},
|
||||
loginSuccess() {
|
||||
uni.reLaunch({
|
||||
url: '/'
|
||||
})
|
||||
},
|
||||
wechatLogin(){
|
||||
const redirect_uri = 'https://m.jinjiuxinzg.cn/pages/login/wechat'
|
||||
const state = `jjx_2`
|
||||
let url = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx950c88b951cadd52'
|
||||
url += '&redirect_uri=' + encodeURIComponent(redirect_uri)
|
||||
url += `&response_type=code&scope=snsapi_userinfo&state=${state}#wechat_redirect`
|
||||
window.location.href = url
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.login-img {
|
||||
width: 100%;
|
||||
height: 330rpx;
|
||||
}
|
||||
|
||||
.layout-login {
|
||||
margin: 40rpx 30rpx;
|
||||
padding: 30rpx 30rpx 50rpx;
|
||||
width: 80%;
|
||||
|
||||
.login-title {
|
||||
font-size: 44rpx;
|
||||
font-weight: 500;
|
||||
line-height: 60rpx;
|
||||
text-align: center;
|
||||
color: #101010;
|
||||
}
|
||||
|
||||
.login-type {
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #8e8e8e;
|
||||
}
|
||||
|
||||
.login-role .role {
|
||||
position: relative;
|
||||
margin: 0 50rpx;
|
||||
padding-left: 60rpx;
|
||||
font-size: 30rpx;
|
||||
line-height: 40rpx;
|
||||
color: #666666;
|
||||
|
||||
&:before {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
z-index: 9;
|
||||
content: '';
|
||||
transform: translateY(-50%);
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
padding: 10rpx;
|
||||
border: 1px solid #f2f2f2;
|
||||
border-radius: 50%;
|
||||
box-sizing: border-box;
|
||||
background-clip: content-box;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
}
|
||||
|
||||
.login-role .active {
|
||||
color: #A92924;
|
||||
|
||||
&:before {
|
||||
border-color: #A92924;
|
||||
background-color: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.fg {
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,438 @@
|
||||
<template> <!-- 注册 -->
|
||||
<view class="wrap pos-r h-100 flex flex-col justify-start items-center" style="background-color: #AB0011">
|
||||
<u-image :src="registerBgImage || '/static/img/login.jpg'" width="750rpx" height="470rpx" mode=""></u-image>
|
||||
<view class="layout-login card" style="z-index: 10">
|
||||
<view class="login-title">免费注册会员</view>
|
||||
<view class="login-role flex justify-center m-top-20">
|
||||
<view :class="['role', {active : form1.accountType === 2}]" @click="form1.accountType = 2">企业用户
|
||||
</view>
|
||||
<view :class="['role', {active : form1.accountType === 1}]" @click="form1.accountType = 1">个人用户
|
||||
</view>
|
||||
</view>
|
||||
<view class="login-form">
|
||||
<view class="m-top-30">
|
||||
<view class="m-top-30" v-if="form1.accountType === 2">
|
||||
<u--input
|
||||
v-model="form1.company.companyName"
|
||||
placeholder="请输入公司名称"
|
||||
prefixIcon="integral"
|
||||
prefixIconStyle="font-size: 26px;color: #909399"
|
||||
></u--input>
|
||||
</view>
|
||||
<view class="m-top-30" v-if="form1.accountType === 1">
|
||||
<u--input
|
||||
v-model="form1.person.personName"
|
||||
placeholder="请输入姓名"
|
||||
prefixIcon="integral"
|
||||
prefixIconStyle="font-size: 26px;color: #909399"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="m-top-30">
|
||||
<u--input
|
||||
placeholder="请输入邀请码,选填"
|
||||
prefixIcon="coupon"
|
||||
prefixIconStyle="font-size: 26px;color: #909399"
|
||||
></u--input>
|
||||
</view>
|
||||
<view class="m-top-30">
|
||||
<u--input
|
||||
v-model="form1.password"
|
||||
type="password"
|
||||
placeholder="设置登录密码"
|
||||
prefixIcon="lock"
|
||||
prefixIconStyle="font-size: 26px;color: #909399"
|
||||
></u--input>
|
||||
</view>
|
||||
<view class="tips mb-15 text-gray">6~20位的数字、字母组合</view>
|
||||
<view class="m-top-30">
|
||||
<u--input
|
||||
v-model="form1.repassword"
|
||||
type="password"
|
||||
placeholder="确认登录密码"
|
||||
prefixIcon="lock"
|
||||
prefixIconStyle="font-size: 26px;color: #909399"
|
||||
></u--input>
|
||||
</view>
|
||||
<view class="tips mb-15 text-gray">6~20位的数字、字母组合</view>
|
||||
<view class="m-top-30">
|
||||
<u--input
|
||||
v-model="form1.mobile"
|
||||
placeholder="请输入手机号"
|
||||
prefixIcon="account"
|
||||
prefixIconStyle="font-size: 26px;color: #909399"
|
||||
></u--input>
|
||||
</view>
|
||||
<view class="m-top-30">
|
||||
<u--input
|
||||
v-model="form1.smsCode"
|
||||
placeholder="请输入短信验证码"
|
||||
prefixIcon="email"
|
||||
prefixIconStyle="font-size: 26px;color: #909399"
|
||||
>
|
||||
<template slot="suffix">
|
||||
<u-code
|
||||
ref="uCode"
|
||||
@change="codeChange"
|
||||
seconds="20"
|
||||
:changeText="smsTips"
|
||||
></u-code>
|
||||
<u-button
|
||||
@tap="sendSmsCode"
|
||||
type="success"
|
||||
size="mini"
|
||||
color="#db1c2c"
|
||||
>{{ smsTips }}
|
||||
</u-button>
|
||||
</template>
|
||||
</u--input>
|
||||
</view>
|
||||
<view class="check-box flex justify-start m-top-30">
|
||||
<u-checkbox-group v-model="checked" placement="row" @change="changeCheck" :disabled="!hasRead">
|
||||
<u-checkbox activeColor="red" label="阅读并同意" name="agree"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
<text class="xie" @click="getInfo">《用户服务协议和隐私政策》</text>
|
||||
</view>
|
||||
<view class="m-top-30">
|
||||
<u-button color="#db1c2c" text="立即免费登录" @click="handleSubmit"></u-button>
|
||||
</view>
|
||||
<view class="flex justify-center m-top-20">
|
||||
<view class="fg">已有账号,</view>
|
||||
<view class="fg red" @click="loginLink">去登录</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-popup mode="center" :show="showRule" closeable close-on-click-overlay @close="showRule = false" round="15"
|
||||
:customStyle="{width: '90%'}">
|
||||
<view class="p-30 rule">
|
||||
<view v-html="info"></view>
|
||||
<u-button :disabled="readCountDown > 0" type="primary" @click="showRule = false;hasRead = true">
|
||||
确定{{ readCountDown > 0 ? `${readCountDown}秒` : '' }}
|
||||
</u-button>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
roleIndex: 1,
|
||||
tabIndex: 1,
|
||||
tips: '',
|
||||
checked: [],
|
||||
timer: null,
|
||||
timeS: 60,
|
||||
smsTips: '获取验证码',
|
||||
form1: {
|
||||
accountType: 2, // business 企业 、、personal个人
|
||||
mobile: '',
|
||||
smsCode: '',
|
||||
password: '',
|
||||
repassword: '',
|
||||
inviteCode: '',
|
||||
person: {
|
||||
personName: ''
|
||||
},
|
||||
company: {
|
||||
companyName: ''
|
||||
}
|
||||
},
|
||||
hasRead: false,
|
||||
showRule: false,
|
||||
info: null,
|
||||
registerBgImage: '',
|
||||
readCountDown: 10,
|
||||
readInterval: null
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.loadSiteConfig()
|
||||
},
|
||||
methods: {
|
||||
async loadSiteConfig() {
|
||||
try {
|
||||
const {data = {}} = await vk.callFunction({
|
||||
url: 'client/site_config/pub/detail',
|
||||
loading: false
|
||||
})
|
||||
this.registerBgImage = data.registerH5BgImage || ''
|
||||
} catch (e) {
|
||||
this.registerBgImage = ''
|
||||
}
|
||||
},
|
||||
changeCheck(e) {
|
||||
console.log(e)
|
||||
},
|
||||
loginLink() {
|
||||
uni.$u.route('/pages/login/login')
|
||||
},
|
||||
handTab(index) {
|
||||
this.tabIndex = index
|
||||
},
|
||||
codeChange(text) {
|
||||
this.tips = text;
|
||||
},
|
||||
sendSmsCode() {
|
||||
if (this.timer != null) return
|
||||
if (!this.form1.mobile) return this.$message.error('请输入手机号');
|
||||
vk.userCenter.sendSmsCode({
|
||||
loading: false,
|
||||
data: {
|
||||
mobile: this.form1.mobile,
|
||||
type: 'register',
|
||||
},
|
||||
success: (data) => {
|
||||
this.$message({
|
||||
message: "验证码已发送",
|
||||
type: 'success'
|
||||
})
|
||||
this.timeS = 60
|
||||
this.timer = setInterval(() => {
|
||||
console.log(this.smsTips)
|
||||
this.timeS--
|
||||
if (this.timeS <= 0) {
|
||||
this.smsTips = "重新发送"
|
||||
this.stopTimer()
|
||||
} else {
|
||||
this.smsTips = this.timeS + "秒"
|
||||
}
|
||||
}, 1000)
|
||||
}
|
||||
});
|
||||
},
|
||||
handleSubmit() {
|
||||
if (!this.checked.includes('agree')) {
|
||||
this.$message({
|
||||
message: '请先阅读并同意《金久信注册协议》',
|
||||
type: 'warning'
|
||||
})
|
||||
} else {
|
||||
if (this.testForm()) {
|
||||
const {
|
||||
mobile, // 手机号
|
||||
smsCode, // 短信验证码4-8位
|
||||
password, // 密码 6-20位
|
||||
repassword, // 重复输入密码
|
||||
inviteCode, // 邀请码
|
||||
accountType,
|
||||
company,
|
||||
person
|
||||
} = this.form1
|
||||
|
||||
vk.userCenter.loginBySms({
|
||||
data: {
|
||||
type: 'register',
|
||||
mobile: mobile,
|
||||
code: smsCode,
|
||||
password,
|
||||
inviteCode,
|
||||
accountType,
|
||||
company,
|
||||
person
|
||||
},
|
||||
success: (data) => {
|
||||
uni.reLaunch({
|
||||
url: '/'
|
||||
})
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
testForm() {
|
||||
const {
|
||||
mobile, // 手机号
|
||||
smsCode, // 短信验证码4-8位
|
||||
password, // 密码 6-20位
|
||||
repassword, // 重复输入密码
|
||||
inviteCode, // 邀请码
|
||||
accountType,
|
||||
company,
|
||||
person
|
||||
} = this.form1;
|
||||
|
||||
// 手机号验证
|
||||
if (!mobile || !/^1[3456789]\d{9}$/.test(mobile)) {
|
||||
this.$message({
|
||||
message: '手机号为空或格式不正确',
|
||||
type: 'error'
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
// 短信验证码验证
|
||||
if (!smsCode || !/^\d{4,8}$/.test(smsCode)) {
|
||||
// 短信验证码为空或格式不正确
|
||||
// 处理错误逻辑
|
||||
this.$message({
|
||||
message: '短信验证码为空或格式不正确',
|
||||
type: 'error'
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
// 密码验证
|
||||
if (!password || password.length < 6 || password.length > 20) {
|
||||
// 密码为空或长度不符合要求
|
||||
this.$message({
|
||||
message: '密码长度不符合要求',
|
||||
type: 'error'
|
||||
})
|
||||
return false
|
||||
// 处理错误逻辑
|
||||
}
|
||||
|
||||
const reg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]+$/
|
||||
if (!reg.test(password)) {
|
||||
this.$message({
|
||||
message: '密码必须由数字和字母组成',
|
||||
type: 'error'
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
// 重复输入密码验证
|
||||
if (password !== repassword) {
|
||||
// 两次输入的密码不一致
|
||||
this.$message({
|
||||
message: '两次输入的密码不一致',
|
||||
type: 'error'
|
||||
})
|
||||
return false
|
||||
// 处理错误逻辑
|
||||
}
|
||||
|
||||
if (parseInt(accountType) === 1 && !person.personName) {
|
||||
this.$message({
|
||||
message: '请输入姓名',
|
||||
type: 'error'
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
if (parseInt(accountType) === 2 && !company.companyName) {
|
||||
this.$message({
|
||||
message: '请输入公司名称',
|
||||
type: 'error'
|
||||
})
|
||||
return false
|
||||
}
|
||||
return true
|
||||
|
||||
},
|
||||
stopTimer() {
|
||||
if (this.timer != null) {
|
||||
clearInterval(this.timer)
|
||||
this.timer = null
|
||||
}
|
||||
},
|
||||
async getInfo() {
|
||||
const {content} = await vk.callFunction({
|
||||
url: `client/otherArticle/list/pub/getDetail`,
|
||||
data: {id: '65792dc8652341901b34a0bc'}
|
||||
});
|
||||
this.info = content
|
||||
this.showRule = true
|
||||
this.readCountDown = 10
|
||||
this.readInterval = setInterval(() => {
|
||||
this.readCountDown--
|
||||
if (this.readCountDown <= 0) {
|
||||
clearInterval(this.readInterval)
|
||||
}
|
||||
}, 1000)
|
||||
},
|
||||
clickAgree(check) {
|
||||
if (check && !this.hasRead) {
|
||||
this.agree = false
|
||||
return this.$message.error('请先阅读并同意《金久信注册协议》')
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #e8f5fe;
|
||||
}
|
||||
|
||||
.login-img {
|
||||
width: 100%;
|
||||
height: 330rpx;
|
||||
}
|
||||
|
||||
.layout-login {
|
||||
margin: 20rpx 30rpx;
|
||||
padding: 30rpx;
|
||||
|
||||
.login-title {
|
||||
font-size: 44rpx;
|
||||
font-weight: 500;
|
||||
line-height: 60rpx;
|
||||
text-align: center;
|
||||
color: #101010;
|
||||
}
|
||||
|
||||
.login-type {
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #8e8e8e;
|
||||
}
|
||||
|
||||
.login-role .role {
|
||||
position: relative;
|
||||
margin: 0 50rpx;
|
||||
padding-left: 60rpx;
|
||||
font-size: 30rpx;
|
||||
line-height: 40rpx;
|
||||
color: #666666;
|
||||
|
||||
&:before {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
z-index: 9;
|
||||
content: '';
|
||||
transform: translateY(-50%);
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
padding: 10rpx;
|
||||
border: 1px solid #f2f2f2;
|
||||
border-radius: 50%;
|
||||
box-sizing: border-box;
|
||||
background-clip: content-box;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
}
|
||||
|
||||
.login-role .active {
|
||||
color: #A92924;
|
||||
|
||||
&:before {
|
||||
border-color: #A92924;
|
||||
background-color: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.fg {
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.xie {
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
color: blue;
|
||||
}
|
||||
}
|
||||
|
||||
.rule {
|
||||
height: 90vh;
|
||||
margin: 20rpx;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,427 @@
|
||||
<template> <!-- 注册 -->
|
||||
<view class="wrap pos-r h-100 flex flex-col justify-start items-center" style="background-color: #AB0011">
|
||||
<u-image src="/static/img/login.jpg" width="750rpx" height="470rpx" mode=""></u-image>
|
||||
<view class="layout-login card" style="z-index: 10">
|
||||
<view class="login-title">手机号绑定</view>
|
||||
<template v-if="showBind">
|
||||
<view class="login-role flex justify-center m-top-20">
|
||||
<view :class="['role', {active : form1.accountType === 2}]" @click="form1.accountType = 2">企业用户
|
||||
</view>
|
||||
<view :class="['role', {active : form1.accountType === 1}]" @click="form1.accountType = 1">个人用户
|
||||
</view>
|
||||
</view>
|
||||
<view class="login-form">
|
||||
<view class="m-top-30">
|
||||
<u--input
|
||||
v-model="form1.mobile"
|
||||
placeholder="请输入手机号"
|
||||
prefixIcon="account"
|
||||
prefixIconStyle="font-size: 26px;color: #909399"
|
||||
></u--input>
|
||||
</view>
|
||||
<view class="m-top-30">
|
||||
<u--input
|
||||
v-model="form1.password"
|
||||
type="password"
|
||||
placeholder="设置登录密码"
|
||||
prefixIcon="lock"
|
||||
prefixIconStyle="font-size: 26px;color: #909399"
|
||||
></u--input>
|
||||
</view>
|
||||
<view class="m-top-30">
|
||||
<u--input
|
||||
v-model="form1.repassword"
|
||||
type="password"
|
||||
placeholder="确认登录密码"
|
||||
prefixIcon="lock"
|
||||
prefixIconStyle="font-size: 26px;color: #909399"
|
||||
></u--input>
|
||||
</view>
|
||||
<view class="m-top-30" v-if="form1.accountType === 2">
|
||||
<u--input
|
||||
v-model="form1.company.companyName"
|
||||
placeholder="请输入公司名称"
|
||||
prefixIcon="integral"
|
||||
prefixIconStyle="font-size: 26px;color: #909399"
|
||||
></u--input>
|
||||
</view>
|
||||
<view class="m-top-30" v-if="form1.accountType === 1">
|
||||
<u--input
|
||||
v-model="form1.person.personName"
|
||||
placeholder="请输入姓名"
|
||||
prefixIcon="integral"
|
||||
prefixIconStyle="font-size: 26px;color: #909399"
|
||||
></u--input>
|
||||
</view>
|
||||
<view class="m-top-30">
|
||||
<u--input
|
||||
placeholder="请输入邀请码,选填"
|
||||
prefixIcon="coupon"
|
||||
prefixIconStyle="font-size: 26px;color: #909399"
|
||||
></u--input>
|
||||
</view>
|
||||
<view class="m-top-30">
|
||||
<u--input
|
||||
v-model="form1.smsCode"
|
||||
placeholder="请输入短信验证码"
|
||||
prefixIcon="email"
|
||||
prefixIconStyle="font-size: 26px;color: #909399"
|
||||
>
|
||||
<template slot="suffix">
|
||||
<u-code
|
||||
ref="uCode"
|
||||
@change="codeChange"
|
||||
seconds="20"
|
||||
:changeText="smsTips"
|
||||
></u-code>
|
||||
<u-button
|
||||
@tap="sendSmsCode"
|
||||
type="success"
|
||||
size="mini"
|
||||
color="#db1c2c"
|
||||
>{{ smsTips }}
|
||||
</u-button>
|
||||
</template>
|
||||
</u--input>
|
||||
</view>
|
||||
<view class="check-box flex justify-start m-top-30">
|
||||
<u-checkbox-group v-model="checked" placement="row" @change="changeCheck">
|
||||
<u-checkbox activeColor="red" label="阅读并同意" name="agree"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
<text class="xie" @click="getInfo">《金久信注册协议》</text>
|
||||
</view>
|
||||
<view class="m-top-30">
|
||||
<u-button color="#db1c2c" text="立即免费登录" @click="handleSubmit"></u-button>
|
||||
</view>
|
||||
<view class="flex justify-center m-top-20">
|
||||
<view class="fg">已有账号,</view>
|
||||
<view class="fg red" @click="loginLink">去登录</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
<u-popup mode="center" :show="showRule" closeable close-on-click-overlay @close="showRule = false" round="15"
|
||||
:customStyle="{width: '90%'}">
|
||||
<view class="p-30 rule">
|
||||
<view v-html="info"></view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
roleIndex: 1,
|
||||
tabIndex: 1,
|
||||
tips: '',
|
||||
checked: [],
|
||||
timer: null,
|
||||
timeS: 60,
|
||||
smsTips: '获取验证码',
|
||||
form1: {
|
||||
accountType: 2, // business 企业 、、personal个人
|
||||
mobile: '',
|
||||
smsCode: '',
|
||||
password: '',
|
||||
repassword: '',
|
||||
inviteCode: '',
|
||||
person: {
|
||||
personName: ''
|
||||
},
|
||||
company: {
|
||||
companyName: ''
|
||||
}
|
||||
},
|
||||
hasRead: false,
|
||||
showRule: false,
|
||||
info: null,
|
||||
code: null,
|
||||
uid: null,
|
||||
showBind: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeCheck(e) {
|
||||
console.log(e)
|
||||
},
|
||||
loginLink() {
|
||||
uni.$u.route('/pages/login/login')
|
||||
},
|
||||
handTab(index) {
|
||||
this.tabIndex = index
|
||||
},
|
||||
codeChange(text) {
|
||||
this.tips = text;
|
||||
},
|
||||
sendSmsCode() {
|
||||
if (this.timer != null) return
|
||||
if (!this.form1.mobile) return this.$message.error('请输入手机号');
|
||||
vk.userCenter.sendSmsCode({
|
||||
loading: false,
|
||||
data: {
|
||||
mobile: this.form1.mobile,
|
||||
type: 'bind',
|
||||
},
|
||||
success: (data) => {
|
||||
this.$message({
|
||||
message: "验证码已发送",
|
||||
type: 'success'
|
||||
})
|
||||
this.timeS = 60
|
||||
this.timer = setInterval(() => {
|
||||
console.log(this.smsTips)
|
||||
this.timeS--
|
||||
if (this.timeS <= 0) {
|
||||
this.smsTips = "重新发送"
|
||||
this.stopTimer()
|
||||
} else {
|
||||
this.smsTips = this.timeS + "秒"
|
||||
}
|
||||
}, 1000)
|
||||
}
|
||||
});
|
||||
},
|
||||
async handleSubmit() {
|
||||
if (!this.checked.includes('agree')) {
|
||||
this.$message({
|
||||
message: '请先阅读并同意《金久信注册协议》',
|
||||
type: 'warning'
|
||||
})
|
||||
} else {
|
||||
if (this.testForm()) {
|
||||
await vk.callFunction({
|
||||
url: '/client/user/kh/updateLoginInfo',
|
||||
data: {
|
||||
uid: this.uid,
|
||||
accountType: this.form1.accountType,
|
||||
nickname: this.form1.nickname,
|
||||
inviteCode: this.form1.inviteCode,
|
||||
}
|
||||
})
|
||||
vk.userCenter.bindMobile({
|
||||
data: {
|
||||
mobile: this.form1.mobile,
|
||||
code: this.form1.smsCode,
|
||||
},
|
||||
success: () => {
|
||||
vk.userCenter.resetPwd({
|
||||
data: {
|
||||
password: this.form1.password,
|
||||
},
|
||||
success: async () => {
|
||||
vk.redirectTo({url: '/pages/login/login'})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
testForm() {
|
||||
const {
|
||||
mobile, // 手机号
|
||||
smsCode, // 短信验证码4-8位
|
||||
password, // 密码 6-20位
|
||||
repassword, // 重复输入密码
|
||||
inviteCode, // 邀请码
|
||||
accountType,
|
||||
company,
|
||||
person
|
||||
} = this.form1;
|
||||
|
||||
// 手机号验证
|
||||
if (!mobile || !/^1[3456789]\d{9}$/.test(mobile)) {
|
||||
this.$message({
|
||||
message: '手机号为空或格式不正确',
|
||||
type: 'error'
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
// 短信验证码验证
|
||||
if (!smsCode || !/^\d{4,8}$/.test(smsCode)) {
|
||||
// 短信验证码为空或格式不正确
|
||||
// 处理错误逻辑
|
||||
this.$message({
|
||||
message: '短信验证码为空或格式不正确',
|
||||
type: 'error'
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
// 密码验证
|
||||
if (!password || password.length < 6 || password.length > 20) {
|
||||
// 密码为空或长度不符合要求
|
||||
this.$message({
|
||||
message: '密码长度不符合要求',
|
||||
type: 'error'
|
||||
})
|
||||
return false
|
||||
// 处理错误逻辑
|
||||
}
|
||||
|
||||
const reg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]+$/
|
||||
if (!reg.test(password)) {
|
||||
this.$message({
|
||||
message: '密码必须由数字和字母组成',
|
||||
type: 'error'
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
// 重复输入密码验证
|
||||
if (password !== repassword) {
|
||||
// 两次输入的密码不一致
|
||||
this.$message({
|
||||
message: '两次输入的密码不一致',
|
||||
type: 'error'
|
||||
})
|
||||
return false
|
||||
// 处理错误逻辑
|
||||
}
|
||||
|
||||
if (parseInt(accountType) === 1 && !person.personName) {
|
||||
this.$message({
|
||||
message: '请输入姓名',
|
||||
type: 'error'
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
if (parseInt(accountType) === 2 && !company.companyName) {
|
||||
this.$message({
|
||||
message: '请输入公司名称',
|
||||
type: 'error'
|
||||
})
|
||||
return false
|
||||
}
|
||||
return true
|
||||
|
||||
},
|
||||
stopTimer() {
|
||||
if (this.timer != null) {
|
||||
clearInterval(this.timer)
|
||||
this.timer = null
|
||||
}
|
||||
},
|
||||
async getInfo() {
|
||||
const {content} = await vk.callFunction({
|
||||
url: `client/otherArticle/list/pub/getDetail`,
|
||||
data: {id: '65792dc8652341901b34a0bc'}
|
||||
});
|
||||
this.info = content
|
||||
this.showRule = true
|
||||
this.readCountDown = 10
|
||||
this.readInterval = setInterval(() => {
|
||||
this.readCountDown--
|
||||
if (this.readCountDown <= 0) {
|
||||
clearInterval(this.readInterval)
|
||||
}
|
||||
}, 1000)
|
||||
},
|
||||
clickAgree(check) {
|
||||
if (check && !this.hasRead) {
|
||||
this.agree = false
|
||||
return this.$message.error('请先阅读并同意《金久信注册协议》')
|
||||
}
|
||||
},
|
||||
loginSuccess() {
|
||||
uni.reLaunch({url: '/'})
|
||||
},
|
||||
},
|
||||
async onLoad(options) {
|
||||
if (options.state && options.state.includes('jjx')) {
|
||||
this.form1.accountType = parseInt(options.state.split('_')[1])
|
||||
this.code = options.code
|
||||
if (options.code) {
|
||||
this.code = options.code
|
||||
const {uid, type, mobileConfirmed} = await vk.callFunction({
|
||||
url: 'user/pub/loginByWeixin',
|
||||
data: {
|
||||
code: this.code,
|
||||
accountType: this.form1.accountType,
|
||||
wap: true
|
||||
},
|
||||
})
|
||||
this.uid = uid
|
||||
this.showBind = type === "register"
|
||||
if (mobileConfirmed) this.loginSuccess()
|
||||
else this.showBind = true
|
||||
|
||||
} else {
|
||||
this.showBind = !vk.getVuex('$user.userInfo.mobile')
|
||||
}
|
||||
} else this.loginSuccess()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.login-img {
|
||||
width: 100%;
|
||||
height: 330rpx;
|
||||
}
|
||||
|
||||
.layout-login {
|
||||
margin: 40rpx 30rpx;
|
||||
padding: 30rpx 30rpx 50rpx;
|
||||
width: 80%;
|
||||
|
||||
.login-title {
|
||||
font-size: 44rpx;
|
||||
font-weight: 500;
|
||||
line-height: 60rpx;
|
||||
text-align: center;
|
||||
color: #101010;
|
||||
}
|
||||
|
||||
.login-type {
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #8e8e8e;
|
||||
}
|
||||
|
||||
.login-role .role {
|
||||
position: relative;
|
||||
margin: 0 50rpx;
|
||||
padding-left: 60rpx;
|
||||
font-size: 30rpx;
|
||||
line-height: 40rpx;
|
||||
color: #666666;
|
||||
|
||||
&:before {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
z-index: 9;
|
||||
content: '';
|
||||
transform: translateY(-50%);
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
padding: 10rpx;
|
||||
border: 1px solid #f2f2f2;
|
||||
border-radius: 50%;
|
||||
box-sizing: border-box;
|
||||
background-clip: content-box;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
}
|
||||
|
||||
.login-role .active {
|
||||
color: #A92924;
|
||||
|
||||
&:before {
|
||||
border-color: #A92924;
|
||||
background-color: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.fg {
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,295 @@
|
||||
<template>
|
||||
<view class="wrap">
|
||||
<!-- 吸顶 -->
|
||||
<u-sticky offset-top="0" customNavHeight="0">
|
||||
<!-- 顶部 -->
|
||||
<uititle title="报价单"></uititle>
|
||||
</u-sticky>
|
||||
<quote-remain-num v-if="reloaded && sheet" :amount="sheet.quoteAmount" type="enquiry" :id="enquiryId"/>
|
||||
<view class="layout layout-title m-top-20">填写报价信息</view>
|
||||
<view class="layout layout-publish m-top-20 bg-white">
|
||||
<view class="card-title m-top-30">报价信息</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need m-right-20 w-25p">货款总价:</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
@blur="formatter"
|
||||
placeholder="请输入货款总价"
|
||||
border="surround"
|
||||
v-model="formData.totalPrice"
|
||||
suffixIcon="元"
|
||||
suffixIconStyle="font-size: 24rpx;color: #909399"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex items-start m-top-30">
|
||||
<view class="lb m-right-20 w-25p mt-20">报价单详情:</view>
|
||||
<view class="vl flex-1">
|
||||
<u-textarea
|
||||
placeholder="请输入报价单详情"
|
||||
border="surround"
|
||||
v-model="formData.remark"
|
||||
suffixIconStyle="font-size: 24rpx;color: #909399"
|
||||
></u-textarea>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex items-start m-top-30" v-if="sheet.payMethod !== 1">
|
||||
<view class="lb m-right-20 w-25p mt-20">供应商合同补充条款:</view>
|
||||
<view class="vl flex-1">
|
||||
<u-textarea
|
||||
placeholder="如:完全符合采购标准或描述差异部分或其他说明。"
|
||||
border="surround"
|
||||
v-model="formData.supplierExt"
|
||||
suffixIconStyle="font-size: 24rpx;color: #909399"
|
||||
></u-textarea>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="card-title m-top-30 need">附件信息</view>
|
||||
<view class="group m-top-20">
|
||||
<!-- <view class="lb m-right-20">附件内容:</view>-->
|
||||
<!-- <view class="flex justify-between align-center m-top-20">-->
|
||||
<!-- <view class="lbx flex-1">上传自有报价单图片或文档,支持jpg/png/word/excel。</view>-->
|
||||
<!-- <view class="download">报价单样板下载</view>-->
|
||||
<!-- </view>-->
|
||||
<view class="m-top-30">
|
||||
<u-upload
|
||||
:fileList="formData.files"
|
||||
@afterRead="afterRead"
|
||||
@delete="deletePic"
|
||||
accept="file"
|
||||
:maxCount="10"
|
||||
multiple
|
||||
:previewImage="false"
|
||||
>
|
||||
<view class="w-100p">
|
||||
<view>
|
||||
<u-button size="mini" type="primary">点击上传</u-button>
|
||||
</view>
|
||||
<view class="mt-10 flex justify-between items-center w-100p" @click="delFiles(index)"
|
||||
v-for="(item, index) in fileNameList" :key="index">
|
||||
<text>{{ item }}</text>
|
||||
<u-icon name="trash"/>
|
||||
</view>
|
||||
</view>
|
||||
</u-upload>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-button class="public-btn m-top-30" text="提交报价" @click="submit"></u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uititle from '@/components/common/title'
|
||||
import dayjs from "dayjs";
|
||||
import QuoteRemainNum from "@/components/quote-remain-num/quote-remain-num.vue";
|
||||
import md5 from "js-md5";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
QuoteRemainNum,
|
||||
uititle,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
enquiryId: null,
|
||||
sheet: null,
|
||||
formData: {
|
||||
totalPrice: '',
|
||||
files: [],
|
||||
remark: '',
|
||||
supplierExt: '',
|
||||
},
|
||||
reloaded: false,
|
||||
fileNameList: []
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
handTag(val) {
|
||||
val.checked = !val.checked
|
||||
},
|
||||
afterRead({file}) {
|
||||
for (let i = 0; i < file.length; i++) {
|
||||
const item = file[i]
|
||||
if (item.type !== 'application/pdf') {
|
||||
uni.showToast({
|
||||
title: '请上传PDF文件',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
uniCloud.uploadFile({
|
||||
filePath: item.url,
|
||||
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + md5(item.name + Date.now().toString()) + '.pdf',
|
||||
success: ({fileID}) => {
|
||||
uniCloud.getTempFileURL({
|
||||
fileList: [fileID]
|
||||
}).then(res => {
|
||||
this.formData.files.push(res.fileList[0].tempFileURL)
|
||||
this.fileNameList.push(item.name)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
deletePic({index}) {
|
||||
this.formData.files.splice(index, 1)
|
||||
},
|
||||
async submit() {
|
||||
if (!this.formData.totalPrice) return this.$message.error('请填写金额')
|
||||
if (!this.formData.files.length) return this.$message.error('请上传附件')
|
||||
// if (this.formData.files.length > 0) this.formData.files = this.formData.files.map(item => item.url)
|
||||
vk.callFunction({
|
||||
url: 'client/enquiry/quote/kh/addQuote',
|
||||
title: '请求中...',
|
||||
data: {
|
||||
sheetId: this.enquiryId,
|
||||
...this.formData
|
||||
},
|
||||
success: (data) => {
|
||||
this.$message({
|
||||
message: "报价成功",
|
||||
type: 'success'
|
||||
})
|
||||
uni.navigateBack()
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取询价单详情
|
||||
*/
|
||||
getEnquiryDetail() {
|
||||
vk.callFunction({
|
||||
url: 'client/enquiry/sheet/pub/getDetail',
|
||||
title: '请求中...',
|
||||
data: {
|
||||
_id: this.enquiryId
|
||||
},
|
||||
success: (res) => {
|
||||
this.sheet = res.data
|
||||
}
|
||||
});
|
||||
},
|
||||
delFiles(index){
|
||||
this.formData.files.splice(index, 1)
|
||||
this.fileNameList.splice(index, 1)
|
||||
},
|
||||
formatter(val){
|
||||
this.formData.totalPrice = parseFloat(val).toFixed(2)
|
||||
},
|
||||
},
|
||||
onLoad({enquiryId}) {
|
||||
this.enquiryId = enquiryId
|
||||
this.getEnquiryDetail()
|
||||
},
|
||||
onShow() {
|
||||
this.reloaded = false
|
||||
setTimeout(() => {
|
||||
this.reloaded = true
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.layout-title {
|
||||
padding: 20rpx 30rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
line-height: 44rpx;
|
||||
color: #A92924;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
position: relative;
|
||||
padding-left: 20rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 600;
|
||||
line-height: 48rpx;
|
||||
color: #A92924;
|
||||
|
||||
&:before {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
z-index: 9;
|
||||
margin-top: -14rpx;
|
||||
content: '';
|
||||
width: 4rpx;
|
||||
height: 28rpx;
|
||||
background: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.public-btn {
|
||||
width: 80%;
|
||||
margin-top: 60rpx;
|
||||
color: #ffffff;
|
||||
background: #A92924;
|
||||
}
|
||||
|
||||
.layout-publish {
|
||||
margin: 20rpx 30rpx;
|
||||
padding: 50rpx 30rpx;
|
||||
border-radius: 18rpx;
|
||||
}
|
||||
|
||||
.tag-title {
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
color: #000000;
|
||||
|
||||
.limit {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.tag-box {
|
||||
padding: 20rpx 0;
|
||||
|
||||
.item {
|
||||
padding: 6rpx 10rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 32rpx;
|
||||
color: #555555;
|
||||
}
|
||||
|
||||
.active {
|
||||
color: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.lb, .fix {
|
||||
position: relative;
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.lbx {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.download {
|
||||
padding: 8rpx 20rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #A92924;
|
||||
border: 1px solid #A92924;
|
||||
}
|
||||
|
||||
.need::before {
|
||||
position: absolute;
|
||||
left: -16rpx;
|
||||
top: 50%;
|
||||
z-index: 9;
|
||||
margin-top: -12rpx;
|
||||
content: '*';
|
||||
color: #A92924;
|
||||
font-size: 32rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,195 @@
|
||||
<template>
|
||||
<view class="wrap">
|
||||
<!-- 吸顶 -->
|
||||
<u-sticky offset-top="0" customNavHeight="0">
|
||||
<!-- 顶部 -->
|
||||
<uititle title="报价单"></uititle>
|
||||
</u-sticky>
|
||||
<view class="layout layout-goods">
|
||||
<view class="goods-title">商品1:螺纹钢</view>
|
||||
<view class="goods-box m-top-20 clear">
|
||||
<!-- 百分比,hundred-100%,half-50%,third-33.33%,fourth-25%,fifth-20% -->
|
||||
<view class="goods-item half flex flex-wrap fl">
|
||||
<view class="lb">直径D mm:</view>
|
||||
<view class="vl flex-1">12mm</view>
|
||||
</view>
|
||||
<view class="goods-item half flex flex-wrap fl">
|
||||
<view class="lb">执行标准:</view>
|
||||
<view class="vl flex-1">GB/T1499.2</view>
|
||||
</view>
|
||||
<view class="goods-item half flex flex-wrap fl">
|
||||
<view class="lb">单件长度:</view>
|
||||
<view class="vl flex-1">6000定尺 mm</view>
|
||||
</view>
|
||||
<view class="goods-item half flex flex-wrap fl">
|
||||
<view class="lb">材质:</view>
|
||||
<view class="vl flex-1">HRB355</view>
|
||||
</view>
|
||||
<view class="goods-item half flex flex-wrap fl">
|
||||
<view class="lb">计价形式:</view>
|
||||
<view class="vl flex-1">过磅</view>
|
||||
</view>
|
||||
<view class="goods-item half flex flex-wrap fl">
|
||||
<view class="lb">采购数量:</view>
|
||||
<view class="vl flex-1">100吨</view>
|
||||
</view>
|
||||
<view class="goods-item half flex flex-wrap fl">
|
||||
<view class="lb">交货时限: </view>
|
||||
<view class="vl flex-1">2024-05-11</view>
|
||||
</view>
|
||||
<view class="goods-item hundred flex flex-wrap fl">
|
||||
<view class="lb">交货服务:</view>
|
||||
<view class="vl flex-1">供货方送至交货地点</view>
|
||||
</view>
|
||||
<view class="goods-item hundred flex flex-wrap fl">
|
||||
<view class="lb">交货地点:</view>
|
||||
<view class="vl flex-1">广西壮族自治区-贵港市-覃塘区-大圩</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex justify-between align-center m-top-20">
|
||||
<view class="group flex align-center" style="width: 48%;">
|
||||
<view class="lb m-right-20">报价单价:</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
placeholder="请输入内容"
|
||||
border="surround"
|
||||
v-model="value"
|
||||
suffixIcon="元"
|
||||
suffixIconStyle="font-size: 26rpx;color: #909399"
|
||||
@change="change"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center" style="width: 48%;">
|
||||
<view class="lb m-right-20">小计金额:</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
placeholder="请输入内容"
|
||||
border="surround"
|
||||
v-model="value"
|
||||
suffixIcon="元"
|
||||
suffixIconStyle="font-size: 26rpx;color: #909399"
|
||||
@change="change"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="layout layout-publish bg-white">
|
||||
<view class="group flex align-center">
|
||||
<view class="lb need strong m-right-20">货款总价:</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
placeholder="请输入内容"
|
||||
border="surround"
|
||||
v-model="value"
|
||||
suffixIcon="元"
|
||||
suffixIconStyle="font-size: 26rpx;color: #909399"
|
||||
@change="change"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group flex align-center m-top-30">
|
||||
<view class="lb need strong m-right-20">人民币大写:</view>
|
||||
<view class="vl flex-1">
|
||||
<u--input
|
||||
placeholder="请输入内容"
|
||||
border="surround"
|
||||
v-model="value"
|
||||
suffixIcon="元"
|
||||
suffixIconStyle="font-size: 26rpx;color: #909399"
|
||||
@change="change"
|
||||
></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<u--text text="温馨提示:贷款总价由各个商品报价加起来" size="24rpx" color="#777" margin="30rpx 0"></u--text>
|
||||
</view>
|
||||
<u-button class="public-btn m-top-30" text="提交报价"></u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uititle from '@/components/common/title'
|
||||
export default {
|
||||
components: {
|
||||
uititle,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 输入框自定义样式
|
||||
inputStyle: {
|
||||
borderRadius: 0,
|
||||
},
|
||||
value: '', // 模拟值
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
handTag(val) {
|
||||
val.checked = !val.checked
|
||||
},
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #ffffff;
|
||||
}
|
||||
.goods-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
line-height: 40rpx;
|
||||
color: #101010;
|
||||
}
|
||||
.layout-goods {
|
||||
margin: 20rpx 30rpx;
|
||||
padding: 30rpx 0;
|
||||
font-size: 28rpx;
|
||||
line-height: 32rpx;
|
||||
color: #626262;
|
||||
border-bottom: 1px solid #f2f2f2;
|
||||
.goods-item {
|
||||
padding: 18rpx 0;
|
||||
}
|
||||
}
|
||||
.public-btn {
|
||||
width: 80%;
|
||||
margin-top: 60rpx;
|
||||
color: #ffffff;
|
||||
background: #A92924;
|
||||
}
|
||||
.layout-publish {
|
||||
margin: 20rpx 30rpx;
|
||||
padding: 50rpx 30rpx;
|
||||
border-radius: 18rpx;
|
||||
}
|
||||
.group .lb {
|
||||
position: relative;
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
color: #A92924;
|
||||
}
|
||||
.group .strong {
|
||||
width: 160rpx;
|
||||
font-weight: 600;
|
||||
color: #101010;
|
||||
}
|
||||
.lbx {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
.need::before {
|
||||
position: absolute;
|
||||
left: -16rpx;
|
||||
top: 50%;
|
||||
z-index: 9;
|
||||
margin-top: -12rpx;
|
||||
content: '*';
|
||||
color: #A92924;
|
||||
font-size: 32rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,526 @@
|
||||
<template>
|
||||
<view class="border-bottom pt-20">
|
||||
<el-form ref="form" :model="form1" label-width="80px" :rules="form1.props.rules">
|
||||
<view class="flex flex-wrap justify-start items-start">
|
||||
<view class="w-25p">
|
||||
<el-form-item label="商品名称">
|
||||
<el-select v-model="form1.data.goodsId" placeholder="请选择商品" @change="selectGoods">
|
||||
<el-option
|
||||
v-for="(item, index) in goodsList"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item._id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</view>
|
||||
<view class="w-25p" v-for="(item, index) in goodsAttributes" :key="index">
|
||||
<template v-if="goodsAttributes && goodsAttributes.length > 0">
|
||||
<el-form-item :label="item.label" v-if="item.label">
|
||||
<el-select v-model="form1.data.model[index].value" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="(value, valueIndex) in item.values" :key="valueIndex" :label="value"
|
||||
:value="value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="10">
|
||||
<el-form-item label="单件长度">
|
||||
<el-input placeholder="请输入内容" v-model="form1.data.singleLength" class="input-with-select"
|
||||
type="number">
|
||||
<template slot="append">米</template>
|
||||
<!-- <el-select v-model="form1.data.singleLengthUnit" slot="append" placeholder="请选择">-->
|
||||
<!-- <template v-if=" attributes.find(attr => attr.label === '单件长度')">-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="(item, index) in attributes.find(attr => attr.label === '单件长度').options"-->
|
||||
<!-- :key="index"-->
|
||||
<!-- :label="item.label"-->
|
||||
<!-- :value="item.value">-->
|
||||
<!-- </el-option>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-select>-->
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="6">-->
|
||||
<!-- <el-form-item label="尺寸">-->
|
||||
<!-- <el-select v-model="form1.data.materialQuality" placeholder="请选择">-->
|
||||
<!-- <template v-if=" attributes.find(attr => attr.label === '尺寸')">-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="(item, index) in attributes.find(attr => attr.label === '尺寸').options"-->
|
||||
<!-- :key="index"-->
|
||||
<!-- :label="item.label"-->
|
||||
<!-- :value="item.value">-->
|
||||
<!-- </el-option>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<el-col :span="6">
|
||||
<el-form-item label="交货服务">
|
||||
<el-select v-model="form1.data.deliverService" placeholder="请选择">
|
||||
<template v-if=" attributes.find(attr => attr.label === '交货服务')">
|
||||
<el-option
|
||||
v-for="(item, index) in attributes.find(attr => attr.label === '交货服务').options"
|
||||
:key="index"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</template>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="采购数量">
|
||||
<el-input v-model="form1.data.procureNumber" class="input-with-select" type="number">
|
||||
<el-select v-model="form1.data.procureUnit" slot="append" placeholder="请选择">
|
||||
<template v-if=" attributes.find(attr => attr.label === '单位')">
|
||||
<el-option
|
||||
v-for="(item, index) in attributes.find(attr => attr.label === '单位').options"
|
||||
:key="index"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</template>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="计价形式">
|
||||
<el-select v-model="form1.data.pricingForm" placeholder="请选择">
|
||||
<template v-if="attributes.find(attr => attr.label === '计价形式')">
|
||||
<el-option
|
||||
v-for="(item, index) in attributes.find(attr => attr.label === '计价形式').options"
|
||||
:key="index"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</template>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import provinces from "@/util/address/provinces.json";
|
||||
import citys from "@/util/address/citys.json";
|
||||
import areas from "@/util/address/areas.json";
|
||||
|
||||
export default {
|
||||
props: {
|
||||
value: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
baseAttributes: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return []
|
||||
}
|
||||
},
|
||||
productIndex: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pickerOptions: {
|
||||
disabledDate(time) {
|
||||
return time.getTime() < Date.now();
|
||||
},
|
||||
},
|
||||
provinceData: provinces,
|
||||
cityData: citys,
|
||||
areaData: areas,
|
||||
provinceIndex: null,
|
||||
cityIndex: null,
|
||||
areaIndex: null,
|
||||
title: '商品',
|
||||
attributesLoaded: false,
|
||||
goodsList: [],
|
||||
attributes: [],
|
||||
goodsAttributes: [],
|
||||
address: ['', '', ''],
|
||||
form: {
|
||||
addressDetail: ''
|
||||
},
|
||||
// 表单相关开始-----------------------------------------------------------
|
||||
form1: {
|
||||
// 表单请求数据,此处可以设置默认值
|
||||
data: {
|
||||
goodsId: null,
|
||||
model: [],
|
||||
otherData: null,
|
||||
materialQuality: null,
|
||||
singleLength: null,
|
||||
singleLengthUnit: null,
|
||||
deliverService: null,
|
||||
standard: null,
|
||||
pricingForm: null,
|
||||
deliveryTime: null,
|
||||
len: null,
|
||||
extraAttributes: {},
|
||||
attributes: {},
|
||||
addressRegion: [],
|
||||
addressDetail: null
|
||||
},
|
||||
// 表单属性
|
||||
props: {
|
||||
// 表单请求地址
|
||||
action: "client/enquiry/kh/add",
|
||||
// 表单字段显示规则
|
||||
columns: [
|
||||
{key: "", title: "商品1", type: "bar-title", component: 'custom-form-section'},
|
||||
{
|
||||
key: "name",
|
||||
title: "模板",
|
||||
type: "remote-select",
|
||||
action: "client/enquiry/template/pub/getList",
|
||||
showAll: true,
|
||||
actionData: {
|
||||
pageSize: 1000
|
||||
},
|
||||
props: {
|
||||
list: "rows",
|
||||
value: "name",
|
||||
label: "name"
|
||||
},
|
||||
watch: (res) => {
|
||||
const {
|
||||
option
|
||||
} = res
|
||||
console.log(option);
|
||||
if (option.extraAttributes) {
|
||||
let groupIndex = -1
|
||||
option.extraAttributes.forEach((item, index) => {
|
||||
if (index % 4 == 0) {
|
||||
this.form1.props.columns[2].columns.push({
|
||||
key: "",
|
||||
title: "",
|
||||
type: "group",
|
||||
justify: "start",
|
||||
showLabel: false,
|
||||
columns: []
|
||||
})
|
||||
groupIndex++
|
||||
}
|
||||
|
||||
this.form1.props.columns[2].columns[0].columns.push({
|
||||
key: index,
|
||||
title: item.label,
|
||||
type: "select",
|
||||
allowCreate: true,
|
||||
filterable: true,
|
||||
data: item.values.map(citem => {
|
||||
return {
|
||||
value: JSON.stringify({keyName: item.lable, keyValue: citem}),
|
||||
label: citem
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
} else {
|
||||
this.form1.props.columns[2].columns = []
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
key: "extraAttributes",
|
||||
title: "额外属性",
|
||||
type: "object",
|
||||
justify: "start",
|
||||
showLabel: false,
|
||||
columns: [],
|
||||
},
|
||||
{
|
||||
key: "",
|
||||
title: "",
|
||||
type: "group",
|
||||
justify: "start",
|
||||
showLabel: false,
|
||||
columns: [
|
||||
{
|
||||
key: "brand",
|
||||
title: "品牌厂家",
|
||||
type: "select",
|
||||
showAll: true,
|
||||
allowCreate: true,
|
||||
filterable: true,
|
||||
data: () => {
|
||||
const row = this.attributes.find(item => item.label == '品牌厂家')
|
||||
if (row) {
|
||||
return row.options
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
{
|
||||
key: "materialQuality",
|
||||
title: "材质",
|
||||
type: "select",
|
||||
showAll: true,
|
||||
allowCreate: true,
|
||||
filterable: true,
|
||||
data: () => {
|
||||
const row = this.attributes.find(item => item.label == '材质')
|
||||
if (row) {
|
||||
return row.options
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
},
|
||||
{
|
||||
key: "singleLength",
|
||||
title: "单件长度",
|
||||
type: "select",
|
||||
showAll: true,
|
||||
allowCreate: true,
|
||||
filterable: true,
|
||||
data: () => {
|
||||
const row = this.attributes.find(item => item.label == '单件长度')
|
||||
if (row) {
|
||||
return row.options
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
},
|
||||
{
|
||||
key: "productStandard",
|
||||
title: "产品标准",
|
||||
type: "select",
|
||||
showAll: true,
|
||||
allowCreate: true,
|
||||
filterable: true,
|
||||
data: () => {
|
||||
const row = this.attributes.find(item => item.label == '产品标准')
|
||||
if (row) {
|
||||
return row.options
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
key: "",
|
||||
title: "",
|
||||
type: "group",
|
||||
justify: "start",
|
||||
showLabel: false,
|
||||
columns: [
|
||||
|
||||
{
|
||||
key: "pricingForm",
|
||||
title: "计价形式",
|
||||
type: "select",
|
||||
showAll: true,
|
||||
allowCreate: true,
|
||||
filterable: true,
|
||||
data: () => {
|
||||
const row = this.attributes.find(item => item.label == '计价形式')
|
||||
if (row) {
|
||||
return row.options
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
},
|
||||
{
|
||||
key: "processStandard",
|
||||
title: "加工标准",
|
||||
type: "select",
|
||||
showAll: true,
|
||||
allowCreate: true,
|
||||
filterable: true,
|
||||
data: () => {
|
||||
const row = this.attributes.find(item => item.label == '加工标准')
|
||||
if (row) {
|
||||
return row.options
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
},
|
||||
{
|
||||
key: "deliveryService",
|
||||
title: "交货服务",
|
||||
type: "select",
|
||||
showAll: true,
|
||||
allowCreate: true,
|
||||
filterable: true,
|
||||
data: () => {
|
||||
const row = this.attributes.find(item => item.label == '交货服务')
|
||||
if (row) {
|
||||
return row.options
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
},
|
||||
{key: "deliveryTime", title: "交货时限", type: "date",},
|
||||
],
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
key: "", title: "", type: 'group', showLabel: false, justify: "start", columns:
|
||||
[
|
||||
{key: "procureNumber", title: "采购数量", type: "number",},
|
||||
{
|
||||
key: "procureUnit",
|
||||
title: "单位",
|
||||
type: "select",
|
||||
showAll: true,
|
||||
allowCreate: true,
|
||||
filterable: true,
|
||||
data: () => {
|
||||
const row = this.attributes.find(item => item.label == '单位')
|
||||
if (row) {
|
||||
return row.options
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
},
|
||||
{key: "addressRegion", title: "交货地点", type: "address",},
|
||||
{key: "addressDetail", title: "详细地址", type: "textarea",},
|
||||
]
|
||||
},
|
||||
],
|
||||
// 表单验证规则
|
||||
rules: {
|
||||
goodsId: [
|
||||
{required: true, message: '商品不能为空', trigger: ["change", "blur"]}
|
||||
],
|
||||
addressRegion: [
|
||||
{required: true, message: '交货地点不能为空', trigger: ["change", "blur"]}
|
||||
],
|
||||
procureNumber: [
|
||||
{required: true, message: '采购数量不能为空', trigger: ["change", "blur"]},
|
||||
{min: 1, type: 'number', message: '采购数量不能小于1', trigger: ["change", "blur"]}
|
||||
],
|
||||
procureUnit: [
|
||||
{required: true, message: '采购数量不能为空', trigger: ["change", "blur"]},
|
||||
],
|
||||
|
||||
},
|
||||
// add 代表添加 update 代表修改
|
||||
formType: "add",
|
||||
// 表单是否在请求中
|
||||
loading: false,
|
||||
// 是否显示表单1 的弹窗
|
||||
show: false,
|
||||
beforeAction: (formData) => {
|
||||
|
||||
return false
|
||||
}
|
||||
}
|
||||
},
|
||||
// 表单相关结束-----------------------------------------------------------
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.form1.props.columns[0].title = '商品' + (this.productIndex + 1)
|
||||
vk.callFunction({
|
||||
url: 'client/enquiry/attributes/pub/getList',
|
||||
title: '请求中...',
|
||||
data: {},
|
||||
success: (data) => {
|
||||
this.attributes = data.rows
|
||||
this.attributesLoaded = true
|
||||
}
|
||||
});
|
||||
this.getGoodsList()
|
||||
},
|
||||
methods: {
|
||||
getGoodsList() {
|
||||
vk.callFunction({
|
||||
url: 'client/enquiry/template/pub/getList',
|
||||
pageSize: 500,
|
||||
title: '请求中',
|
||||
success: ({rows}) => {
|
||||
this.goodsList = rows
|
||||
}
|
||||
})
|
||||
},
|
||||
selectGoods(val) {
|
||||
this.form1.data.model = []
|
||||
this.goodsList.forEach(({_id, name, extraAttributes}) => {
|
||||
if (_id === val) {
|
||||
this.form1.data.goodsName = name
|
||||
this.goodsAttributes = extraAttributes
|
||||
this.goodsAttributes.forEach(attr => {
|
||||
if (attr.label) this.form1.data.model.push({
|
||||
label: attr.label,
|
||||
value: null
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
selectProvince(index) {
|
||||
this.form1.data.addressRegion[0] = this.provinceData[index].code
|
||||
},
|
||||
selectCity(index) {
|
||||
this.form1.data.addressRegion[1] = this.cityData[this.provinceIndex][index].code
|
||||
},
|
||||
selectArea(index) {
|
||||
this.form1.data.addressRegion[2] = this.areaData[this.provinceIndex][this.cityIndex][index].code
|
||||
},
|
||||
|
||||
},
|
||||
watch: {
|
||||
"form1.data": {
|
||||
immediate: true,
|
||||
handler(val) {
|
||||
this.$emit('input', val)
|
||||
console.log("this.$emit('input', val.data)");
|
||||
}
|
||||
},
|
||||
value: {
|
||||
immediate: true,
|
||||
handler(val) {
|
||||
this.form1.data = val
|
||||
console.log("this.form1.data = val", val);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.product-title {
|
||||
margin: 10px;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
/deep/ .input-with-select .el-input-group__append {
|
||||
background-color: #fff !important;
|
||||
width: 130px !important;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,817 @@
|
||||
<template> <!-- 询价单详情 -->
|
||||
<view class="wrap">
|
||||
<!-- 吸顶 -->
|
||||
<u-sticky offset-top="0" customNavHeight="0">
|
||||
<!-- 顶部 -->
|
||||
<uititle title="询价详情"></uititle>
|
||||
</u-sticky>
|
||||
<!-- 内容 -->
|
||||
<view class="layout layout-detail">
|
||||
<view class="company flex m-top-20">
|
||||
<!-- <view class="logo">-->
|
||||
<!-- <image v-if="sheet.user && sheet.user.businessCard" class="full" :src="sheet.user.businessCard.logo"-->
|
||||
<!-- mode=""></image>-->
|
||||
<!-- <image v-else class="full" src="/static/no-logo.jpg" mode=""></image>-->
|
||||
<!-- </view>-->
|
||||
<view class="info flex-1 p-left-20 w-100p">
|
||||
<view class="name-text w-100p">{{
|
||||
sheet.user.accountType === 1 ? sheet.user.person.personName.replace(/^(.).*$/, "$1**") : sheet.user.company.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6")
|
||||
}}
|
||||
</view>
|
||||
<!-- <view class="name flex justify-start align-center">-->
|
||||
<!-- 认证图标 -->
|
||||
<!-- <view class="name-icon m-left-20">-->
|
||||
<!-- <image class="full" src="/static/img/idente.png" mode=""></image>-->
|
||||
<!-- </view>-->
|
||||
<!-- </view>-->
|
||||
<!-- <view class="zhu">-->
|
||||
<!-- 主营业务:-->
|
||||
<!-- 主营业务:{{-->
|
||||
<!-- (sheet.user.company.mainSpotCategory && sheet.user.company.mainSpotCategory.length > 0) ? sheet.user.company.mainSpotCategory.join() : ''-->
|
||||
<!-- }}-->
|
||||
|
||||
<!-- </view>-->
|
||||
<view class="zhu">
|
||||
{{ sheet._add_time_str }} 发布
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 批量上传-判断使用 -->
|
||||
<template>
|
||||
<view class="detail m-top-20">
|
||||
<view class="detail-title">{{ sheet.title }}</view>
|
||||
</view>
|
||||
</template>
|
||||
<view class="flex justify-start items-end text-25 mt-20"
|
||||
v-if="sheet.answerEndTime && dayjs(sheet.answerEndTime).diff(dayjs(), 'second') > 0">
|
||||
<text>距离报价结束还有:</text>
|
||||
<view class="border-main countdown text-main">{{
|
||||
dayjs(sheet.answerEndTime).diff(dayjs(), 'day')
|
||||
}}
|
||||
</view>
|
||||
<text>天</text>
|
||||
<view class="border-main countdown text-main">
|
||||
{{ (dayjs(sheet.answerEndTime).diff(dayjs(), 'hour')) % 24 }}
|
||||
</view>
|
||||
<text>时</text>
|
||||
</view>
|
||||
<!-- 手动上传-判断使用 -->
|
||||
<template>
|
||||
<view class="card-title m-top-30">主要商品</view>
|
||||
<view class="goods-box m-top-20 clear" v-if="sheet.fillType === 1">
|
||||
{{
|
||||
batchProductNames
|
||||
}}
|
||||
</view>
|
||||
<view class="goods-box m-top-20 flex justify-start items-start flex-col" v-else>
|
||||
<view v-for="(item, index) in sheet.productList" :key="index">
|
||||
<text class="font-bold clear">{{ item.goodsName }}:</text>
|
||||
<view class="goods-item half flex flex-wrap fl" v-for="(model, modelIndex) in item.model">
|
||||
<view class="lb">{{ model.label }}:</view>
|
||||
<view class="vl flex-1">{{ model.value }}</view>
|
||||
</view>
|
||||
<!-- <view class="goods-item half flex flex-wrap fl">-->
|
||||
<!-- <view class="lb">单件长度:</view>-->
|
||||
<!-- <view class="vl flex-1">{{-->
|
||||
<!-- item.singleLength ? item.singleLength : ''-->
|
||||
<!-- }}{{ item.singleLengthUnit ? item.singleLengthUnit : '' }}-->
|
||||
<!-- </view>-->
|
||||
<!-- </view>-->
|
||||
<view class="goods-item half flex flex-wrap fl">
|
||||
<view class="lb">交货服务:</view>
|
||||
<view class="vl flex-1">{{
|
||||
item.deliverService ? item.deliverService : ''
|
||||
}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-item half flex flex-wrap fl">
|
||||
<view class="lb">采购数量:</view>
|
||||
<view class="vl flex-1">{{
|
||||
item.procureNumber ? item.procureNumber : ''
|
||||
}}{{ item.procureUnit ? item.procureUnit : '' }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-item half flex flex-wrap fl">
|
||||
<view class="lb">计价形式:</view>
|
||||
<view class="vl flex-1">{{
|
||||
item.pricingForm ? item.pricingForm : ''
|
||||
}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-item half flex flex-wrap fl">
|
||||
<view class="lb">交货时限:</view>
|
||||
<view class="vl flex-1">{{ sheet.deliveryTime ? sheet.deliveryTime : '' }}</view>
|
||||
</view>
|
||||
<view class="goods-item half flex flex-wrap fl">
|
||||
<view class="lb">交货地点:</view>
|
||||
<view class="vl flex-1">{{ sheet.fullAddress }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<view class="card-title m-top-30">上传的附件</view>
|
||||
<view class="m-top-20" v-if="sheet.files">
|
||||
<file-type :item="item" v-for="(item, index) in sheet.files" :key="index"/>
|
||||
</view>
|
||||
<view class="m-top-20" v-if="sheet.multiFiles">
|
||||
<file-type :item="item" v-for="(item, index) in sheet.multiFiles" :key="index"/>
|
||||
</view>
|
||||
|
||||
<view class="card-title m-top-30" v-if="sheet.remark">采购商其他要求</view>
|
||||
<view class="detail-text">
|
||||
{{ sheet.remark }}
|
||||
</view>
|
||||
|
||||
<view class="card-title m-top-30">合同条款</view>
|
||||
<view class="detail-text">是否含税:{{ sheet.invoice ? '含税' : '不含税' }}</view>
|
||||
<template v-if="sheet.invoice">
|
||||
<view class="detail-text">开票时间:{{ WRITE_INVOICE_TIME[sheet.writeInvoiceTime] }}</view>
|
||||
<!-- <view class="detail-text">发票种类:{{ INVOICE_TYPE[sheet.invoiceType] }}</view>-->
|
||||
<!-- <view class="detail-text" v-if="sheet.invoiceOther">其他要求:{{ sheet.invoiceOther }}</view>-->
|
||||
<view class="detail-text" v-if="sheet.invoiceOther">税票要求:{{ sheet.invoiceOther }}</view>
|
||||
<template v-else>
|
||||
<view class="detail-text">纳税人身份:{{ sheet.taxType ? sheet.taxType : '无' }}</view>
|
||||
<view class="detail-text">发票种类:{{ sheet.invoiceType ? sheet.invoiceType : '无' }}</view>
|
||||
<view class="detail-text">税率:{{ sheet.taxRate ? sheet.taxRate : '无' }}</view>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<view class="card-title m-top-30">运输要求</view>
|
||||
<view class="detail-text" v-if="sheet.transportDocuments && sheet.transportDocuments.length > 0">
|
||||
随货资料:{{ sheet.transportDocuments.join() }}
|
||||
</view>
|
||||
<view class="detail-text" v-if="sheet.otherTransportDocuments">其他资料:{{
|
||||
sheet.otherTransportDocuments
|
||||
}}
|
||||
</view>
|
||||
<view class="detail-text">运输限制:{{ sheet.transportLimit ? '有' : '无' }}</view>
|
||||
<view class="detail-text" v-if="sheet.transportLimit && sheet.otherTransportRequest">
|
||||
运输限制说明:{{ sheet.otherTransportRequest }}
|
||||
</view>
|
||||
|
||||
<view class="card-title m-top-30">交易模式</view>
|
||||
<view class="detail-text">交易模式:{{ sheet.tradeMethod === 0 ? '自主交易' : '金久信公证' }}</view>
|
||||
|
||||
<view class="card-title m-top-30">交易说明</view>
|
||||
<view class="detail-text">付款方式:{{ PROCESS_PAY_METHOD[sheet.payMethod] }}{{
|
||||
sheet.payMethod === 0 ? `${sheet.advancePayRate}%货到付全款` : ''
|
||||
}}{{
|
||||
sheet.payMethod === 3 ? `${sheet.reputationPayDay}天` :
|
||||
(sheet.payMethod === 4 ? `:${sheet.otherPayMethod}` : '')
|
||||
}}
|
||||
</view>
|
||||
<view class="detail-text">报价形式:{{ sheet.offerType === 0 ? '整单报价' : '可分项报价' }}</view>
|
||||
<view class="detail-text" v-if="sheet.answerStartTime && sheet.answerEndTime">报价期限:{{
|
||||
dayjs(sheet.answerStartTime).format('YYYY-MM-DD')
|
||||
}}~{{ dayjs(sheet.answerEndTime).format('YYYY-MM-DD') }}
|
||||
</view>
|
||||
<view class="card-title m-top-30">采购商信息</view>
|
||||
<view class="detail-text">项目名称:{{ sheet.projectName ? sheet.projectName : '' }}</view>
|
||||
<view class="detail-text">项目地址:{{ sheet.fullAddress }}</view>
|
||||
<template v-if="(sheet.isMine || sheet.hasQuote || userInfo.userLevel > 0) && dayjs(sheet.answerEndTime).isBefore(dayjs())">
|
||||
<view class="detail-text" v-if="sheet.companyName">采购商信息:{{
|
||||
sheet.companyName ? sheet.companyName : ''
|
||||
}}
|
||||
</view>
|
||||
<view class="detail-text" v-if="sheet.companyMobile">采购商联系方式:{{
|
||||
sheet.companyMobile ? sheet.companyMobile : ''
|
||||
}}
|
||||
</view>
|
||||
<view class="detail-text">授权业务咨询人:{{
|
||||
sheet.businessName ? sheet.businessName : ''
|
||||
}}
|
||||
</view>
|
||||
<view class="detail-text">业务咨询联系方式:{{
|
||||
sheet.businessMobile ? sheet.businessMobile : ''
|
||||
}}
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="detail-text" v-if="sheet.companyName">采购商信息:{{
|
||||
sheet.companyName ? sheet.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6") : ''
|
||||
}}
|
||||
</view>
|
||||
<view class="detail-text" v-if="sheet.companyMobile">采购商联系方式:{{
|
||||
sheet.companyMobile ? sheet.companyMobile.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : ''
|
||||
}}
|
||||
</view>
|
||||
<view class="detail-text">授权业务咨询人:{{
|
||||
sheet.businessName ? sheet.businessName.replace(/^(.).*(.)$/, "$1***$2") : ''
|
||||
}}
|
||||
</view>
|
||||
<view class="detail-text">业务咨询联系方式:{{
|
||||
sheet.businessMobile ? sheet.businessMobile.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : ''
|
||||
}}
|
||||
</view>
|
||||
</template>
|
||||
<view class="card-title m-top-30">平台交易保证金要求</view>
|
||||
<view class="detail-text">{{ sheet.earnestMoney ? sheet.earnestMoney : '无' }}</view>
|
||||
|
||||
<view class="card-title m-top-30">签约模式</view>
|
||||
<view class="detail-text">
|
||||
<view>{{
|
||||
sheet.signMethod === 0 ? '线上签约-标准合同' : (sheet.signMethod !== 1 ? '线上签约-双方协商合同' : '线下签约')
|
||||
}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-wrap" v-if="sheet.signMethod === 0">
|
||||
<view class="card-title m-top-30">合同条款</view>
|
||||
<view class="mt-15">违约责任:</view>
|
||||
<view class="mt-15">
|
||||
1.乙方所交产品品种、型号、规格、质量不符合规定的,如果甲方同意利用,应当按质论价;如果甲方不能利用的,应根据产品的具体情况,由乙方负责包换或包修,并承担修理、调换或退货而支付的实际费用;2.乙方不予供货违约责任为甲方的实际损失+违约金,如乙方材料符合订货标准,甲方不能退货和不收货,甲方无条件应按实际本合同订货数量支付100%货款,并支付乙方因此产生的实际费用。带有甲乙双方单位相关收货人和发货人签字的本合同的发货清单事项和内容均视为本合同的补充合同,与本合同有相同的法律效力,双方应共同遵照执行。
|
||||
</view>
|
||||
<view class="mt-15">解决纠纷的方法:</view>
|
||||
<view class="mt-15">
|
||||
1、凡因本合同引起的或与本合同有关的任何争议,均可友好协商或仲裁解决,协商或仲裁不成的,双方协商同意在合同签订地人民法院管辖地起诉,违约一方或对合同争议承担主要责任的一方,应承担对方因仲裁和起诉而产生的全部律师代理费、鉴定(检验)费、诉讼保全费、诉讼保险费、公告费、差旅费、执行费、误工費和获取证据产生费用等其他相关费用。2、双方本合同相关权利放弃均应有双方书面作出并加盖公章或授权委托人签字后生效。
|
||||
</view>
|
||||
<view class="mt-15">不可抗力:</view>
|
||||
<view class="mt-15">
|
||||
甲乙双方的任何一方由于不可抗力或突发公共事件的原因不能履行合同时,应及时向对方通报不能履行或不能完全履行的理由,以减轻可能给对方造成的损失,在取得有关机构证明以后,允许延期履行、部分履行或者不履行合同,并根据情况可部分或全部免予承担违约责任。
|
||||
</view>
|
||||
<view class="mt-15">其他:</view>
|
||||
<view class="mt-15">
|
||||
本合同的全部内容由双方平等共同协商一致,共同起草制定,非一方事先拟定,不属于格式条款。本合同自双方签字盖章后生效(包括电子签字、盖章),按本合同内容地址、联系方式寄送的一切文书、函件送达与否,均为视为送达有法律效力,通知途径和本合同内联系方式或地址送达文件双方均予以验证。
|
||||
</view>
|
||||
<view class="mt-15">采购方补充条款: {{ sheet.supplementary }}</view>
|
||||
<!-- <view class="mt-15">供应方补充条款:</view>-->
|
||||
</view>
|
||||
|
||||
<template v-else-if="sheet.signMethod === 2">
|
||||
<view class="item-wrap">
|
||||
<view class="form-title-wrap">
|
||||
<view class="goods-sheet-title">
|
||||
<view class="form-title">
|
||||
合同附件
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in sheet.contractAttachment" :key="index" class="mr-25 my-25">
|
||||
<file-type :item="item" @click.native="openDownload(item)"/>
|
||||
</view>
|
||||
</template>
|
||||
<!-- <view class="card-title m-top-30">已收到的加工申请</view>-->
|
||||
<!-- <view class="table-box m-top-30">-->
|
||||
<!-- <view class="thead">-->
|
||||
<!-- <view class="tr">-->
|
||||
<!-- <view class="th">申请人</view>-->
|
||||
<!-- <view class="th">申请时间</view>-->
|
||||
<!-- </view>-->
|
||||
<!-- </view>-->
|
||||
<!-- <view class="tbody">-->
|
||||
<!-- <view class="tr" v-for="(item, index) in sheet.quoteList" :key="index">-->
|
||||
<!-- <view class="td">{{ item.subjectName }}</view>-->
|
||||
<!-- <view class="td">{{ item._add_time_str }}</view>-->
|
||||
<!-- </view>-->
|
||||
<!-- </view>-->
|
||||
<!-- </view>-->
|
||||
</view>
|
||||
<!-- 底部 -->
|
||||
<view class="fiexd-bottom flex justify-between align-center bg-white">
|
||||
<u-icon name="integral" color="#A92924" size="26"></u-icon>
|
||||
<view class="text red flex-1 m-left-20">{{ sheet.quoteNum }}家已经报价</view>
|
||||
<view class="apply-btn" v-if="userInfo._id !== sheet.userId && sheet.status === 0" @click="toQuote">{{
|
||||
sheet.disabled ? '已超时无法报价' : '我要报价'
|
||||
}}
|
||||
</view>
|
||||
<view class="apply-btn" v-else-if="userInfo._id === sheet.userId" @click="showEnquiryModal">收到的报价
|
||||
</view>
|
||||
</view>
|
||||
<!-- 弹出窗-报价次数 -->
|
||||
<u-popup :show="isPrice" mode="center" @close="isPrice = false">
|
||||
<view class="popup-box" style="padding: 50rpx 30rpx;width: 600rpx;">
|
||||
<view class="residue text-center">
|
||||
今日剩余报价
|
||||
<text class="red">3</text>
|
||||
次
|
||||
</view>
|
||||
<u-button class="custom-style" text="继续报价" @click="isPopup = true,isPrice = false"></u-button>
|
||||
<view class="increase text-center">
|
||||
*升级会员可以增加每日报价次数,
|
||||
<text class="red">去升级</text>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<!-- 模态框-报价类型-->
|
||||
<!-- 弹出窗-报价列表 -->
|
||||
<u-popup :show="isPopup" mode="center" @close="isPopup = false">
|
||||
<view class="popup-box">
|
||||
<view class="popup-title flex justify-between align-center">
|
||||
<view class="title">收到的报价列表</view>
|
||||
<view class="close" @click="isPopup = false">关闭</view>
|
||||
</view>
|
||||
<view class="table-box m-top-30">
|
||||
<view class="thead">
|
||||
<view class="tr">
|
||||
<view class="th w-25p">供应商</view>
|
||||
<view class="th w-25p">联系方式</view>
|
||||
<view class="th w-25p">报价</view>
|
||||
<view class="th w-25p">操作</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tbody">
|
||||
<view class="tr" v-for="(item, index) in sheet.quoteList" :key="index">
|
||||
<view class="td w-25p">{{ item.subjectName }}</view>
|
||||
<view class="td w-25p">
|
||||
<text>{{ item.subjectMobile }}</text>
|
||||
</view>
|
||||
<view class="td w-25p">{{ item.totalPrice }}元</view>
|
||||
<view class="td w-25p">
|
||||
<u-button
|
||||
size="mini"
|
||||
type="error"
|
||||
plain="true"
|
||||
text="选择"
|
||||
style="width: 40rpx;"
|
||||
@click="confirm(item)"
|
||||
></u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<u-modal
|
||||
:show="isEnquiryTip"
|
||||
title="重点提示"
|
||||
confirmText="同意悉知"
|
||||
cancelText="取消"
|
||||
confirmColor="#A92924"
|
||||
showCancelButton
|
||||
@confirm="confirmEnquiryModal"
|
||||
@cancel="isEnquiryTip = false"
|
||||
>
|
||||
<view class="enquiry-tip-content">
|
||||
<view v-for="(item, index) in enquiryTipList" :key="index" class="enquiry-tip-item">
|
||||
{{ item }}
|
||||
</view>
|
||||
</view>
|
||||
</u-modal>
|
||||
<enquiry-modal ref="enquiryModal"/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uiheader from '@/components/index/header'
|
||||
import uititle from '@/components/common/title'
|
||||
import {INVOICE_TYPE, PROCESS_PAY_METHOD, WRITE_INVOICE_TIME} from "@/util";
|
||||
import dayjs from "dayjs";
|
||||
import FileType from "@/components/file-type/file-type.vue";
|
||||
import EnquiryModal from "@/pages/user/components/enquiryModal.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
EnquiryModal,
|
||||
FileType,
|
||||
uiheader,
|
||||
uititle,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
fileList3: [
|
||||
{url: 'https://cdn.uviewui.com/uview/swiper/1.jpg',},
|
||||
{url: 'https://cdn.uviewui.com/uview/swiper/1.jpg',},
|
||||
{url: 'https://cdn.uviewui.com/uview/swiper/1.jpg',},
|
||||
],
|
||||
isPopup: false,
|
||||
isPrice: false,
|
||||
isModal: false,
|
||||
isEnquiryTip: false,
|
||||
enquiryTipList: [
|
||||
'1、请您谨慎点击"选择",选择供应商后,系统将自动关闭您此条询价信息,无法返回,只能再次发布询价信息;',
|
||||
'2、点击"选择"前,您可通过供应商联系方式,仔细商讨:商品明细、数量、单价、执行标准、交货方式、交货期、验收方式、合同条款等细节关键题确认,各种交易细节无误后要求供应商进行最终报价;',
|
||||
'3、您承诺对此次交易的内容用途已经完全了解并知悉经过严格仔细审核后实施,此次交易为合法经营,如违反相关法律规定,您将承担全部责任,与平台无关。您确认以上描述无误后请点击"选择"。'
|
||||
],
|
||||
parseText: '<p>露从今夜白,月是故乡明</p>',
|
||||
WRITE_INVOICE_TIME,
|
||||
INVOICE_TYPE,
|
||||
PROCESS_PAY_METHOD,
|
||||
hasQuote: false,
|
||||
productList: [],
|
||||
sheet: {
|
||||
user: {},
|
||||
productList: [],
|
||||
transportDocuments: [],
|
||||
otherCate: null
|
||||
},
|
||||
userInfo: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
batchProductNames() {
|
||||
if (this.sheet.otherCate) return this.sheet.otherCate
|
||||
return this.sheet.productList.map(item => item.goodsName + `${item.materialQuality ? `(${item.materialQuality})` : ''}`).join(',')
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
dayjs,
|
||||
applyLink() {
|
||||
uni.$u.route('/pages/price/apply', {
|
||||
id: 0,
|
||||
});
|
||||
},
|
||||
showEnquiryModal() {
|
||||
this.isEnquiryTip = true
|
||||
},
|
||||
confirmEnquiryModal() {
|
||||
this.isEnquiryTip = false
|
||||
this.$refs.enquiryModal.open(this.sheet)
|
||||
},
|
||||
handConfirmModal() {
|
||||
this.isPopup = false
|
||||
this.isModal = false
|
||||
uni.$u.route('/pages/price/apply1', {
|
||||
id: 0,
|
||||
});
|
||||
},
|
||||
handCancelModal() {
|
||||
this.isPopup = false
|
||||
this.isModal = false
|
||||
uni.$u.route('/pages/price/apply2', {
|
||||
id: 0,
|
||||
});
|
||||
},
|
||||
async toQuote() {
|
||||
if (this.sheet.disabled) return
|
||||
const {userInfo, accountNum} = await vk.callFunction({
|
||||
url: 'user/kh/getMyUserInfo'
|
||||
})
|
||||
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您尚未认证, 是否前往认证?',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 0)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请完善名片信息',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 1)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else if (accountNum === 0) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请先到个人中心添加收款账户',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 7)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
if (userInfo.businessCard.status !== 1) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您的名片信息未审核,请耐心等待',
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.sheet.tradeMethod === 1) {
|
||||
const rate = this.sheet.notaryServiceRate || 0.1
|
||||
uni.showModal({
|
||||
title: '重要提示',
|
||||
content: `提示着您成功签约交易,平台将收取总交易金额 x${rate}%服务费,如您存在利用系统漏洞恶意逃避支付服务费的情况,平台有将您的失信行为进行公布,情况严重的平台予以劝退。\n并有权依法追回平台服务费。您承诺此次交易为合法经营,如违反相关法律法规您将承担全部任与平台无关。您已经完全理解解并知悉,您不同意请点击'取消',取消报价,您同意以上夠定请点击'同意并知悉'。`,
|
||||
confirmText: '同意并知悉',
|
||||
cancelText: '取消',
|
||||
success: ({confirm}) => {
|
||||
if (confirm) {
|
||||
vk.navigateTo({url: '/pages/price/apply1?enquiryId=' + this.enquiryId});
|
||||
}
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
vk.navigateTo({url: '/pages/price/apply1?enquiryId=' + this.enquiryId});
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 获取询价单详情
|
||||
*/
|
||||
getEnquiryDetail() {
|
||||
vk.callFunction({
|
||||
url: 'client/enquiry/sheet/pub/getDetail',
|
||||
title: '请求中...',
|
||||
data: {
|
||||
_id: this.enquiryId
|
||||
},
|
||||
success: (res) => {
|
||||
this.sheet = res.data
|
||||
this.sheet.disabled = (!this.sheet.answerEndTime || dayjs(this.sheet.answerEndTime).isBefore(dayjs()))
|
||||
this.sheet.fullAddress = ''
|
||||
if (this.sheet.deliveryTime) this.sheet.deliveryTime = dayjs(this.sheet.deliveryTime).format('YYYY-MM-DD HH:mm:ss')
|
||||
this.sheet.fullAddress = (this.sheet.addressRegion && this.sheet.addressRegion.province) ? `${this.sheet.addressRegion.province.name}${this.sheet.addressRegion.city.name}${this.sheet.addressRegion.area.name}` : ''
|
||||
if (this.sheet.addressRegion.addressDetail) this.list.rows[index].fullAddress += this.sheet.addressRegion.addressDetail
|
||||
}
|
||||
});
|
||||
},
|
||||
confirm(item) {
|
||||
this.isPopup = false
|
||||
if (this.sheet.tradeMethod === 1 && (!this.sheet.user || this.sheet.user.isNotaryBusiness !== 1)) {
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: '请您先至个人中心-卖家中心-金久信公正银联资料,完成银联资料收集,并联系金久信客服开通功能。才能进行金久信公正交易',
|
||||
showCancel: false,
|
||||
confirmText: '确定'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.sheet.tradeMethod === 1) {
|
||||
const rate = this.sheet.notaryServiceRate || 0.1
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: `提示若您成功签约交易,平台将收取总交易金额 x${rate}%服务费,如您存在利用系统漏洞恶意逃避支付服务费的情况。\n平台有将您的失信行为进行公布,情况严重的平台予以劝退。\n并有权依法追回平台服务费。您承诺此次交易为合法经营,如违反相关法律法规您将承担全部任与平台无关。您己经完全理解并知悉,您不同意请点击“取消”,取消报价,您同意以上约定请点击“同意并知悉”。`,
|
||||
confirmText: '同意并知悉',
|
||||
cancelText: '取消',
|
||||
success: ({confirm}) => {
|
||||
if (confirm) this.doConfirm(item)
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
this.doConfirm(item)
|
||||
},
|
||||
doConfirm(item) {
|
||||
vk.callFunction({
|
||||
url: 'client/enquiry/quote/kh/confirmQuote',
|
||||
title: '请求中...',
|
||||
data: {
|
||||
quoteId: item._id,
|
||||
},
|
||||
success: (data) => {
|
||||
this.showDialog = false
|
||||
if (this.sheet.signMethod === 0) vk.navigateTo('/pages/public/contract')
|
||||
else {
|
||||
if (this.sheet.signMethod === 1) vk.navigateTo('/pages/user/buyer')
|
||||
else vk.navigateTo('/pages/public/contract')
|
||||
}
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '报价确认成功'
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
onLoad({id}) {
|
||||
this.enquiryId = id
|
||||
this.userInfo = vk.getStorageSync('uni_id_user_info')
|
||||
this.getEnquiryDetail()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
padding-bottom: 150rpx;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
position: relative;
|
||||
padding-left: 20rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
line-height: 48rpx;
|
||||
color: #A92924;
|
||||
|
||||
&:before {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
z-index: 9;
|
||||
margin-top: -14rpx;
|
||||
content: '';
|
||||
width: 6rpx;
|
||||
height: 28rpx;
|
||||
background: #A92924;
|
||||
}
|
||||
|
||||
.more {
|
||||
font-size: 24rpx;
|
||||
font-weight: normal;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.layout-detail {
|
||||
padding: 20rpx 30rpx;
|
||||
}
|
||||
|
||||
.company {
|
||||
padding-bottom: 40rpx;
|
||||
border-bottom: 1px solid #f2f2f2;
|
||||
|
||||
.logo {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
}
|
||||
|
||||
.name-text {
|
||||
//max-width: 380rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
line-height: 40rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.name-icon {
|
||||
width: 80rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
|
||||
.zhu {
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 32rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.detail-title {
|
||||
font-size: 26rpx;
|
||||
font-weight: 600;
|
||||
line-height: 40rpx;
|
||||
color: #101010;
|
||||
}
|
||||
|
||||
.detail-text {
|
||||
padding: 15rpx 0;
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.fiexd-bottom {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
z-index: 99;
|
||||
width: 100%;
|
||||
height: 130rpx;
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
border-top: 1px solid #f2f2f2;
|
||||
|
||||
.text {
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
||||
.apply-btn {
|
||||
width: 220rpx;
|
||||
height: 70rpx;
|
||||
font-size: 26rpx;
|
||||
line-height: 70rpx;
|
||||
text-align: center;
|
||||
color: #ffffff;
|
||||
background: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.table-box {
|
||||
font-size: 24rpx;
|
||||
line-height: 28rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.tr {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.th {
|
||||
color: #666 !important;
|
||||
background: #FFF8F2;
|
||||
}
|
||||
|
||||
.th, .td {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 50%;
|
||||
height: 76rpx;
|
||||
color: #999;
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
border-left: 1px solid #f2f2f2;
|
||||
border-right: 1px solid #f2f2f2;
|
||||
border-bottom: 1px solid #f2f2f2;
|
||||
}
|
||||
|
||||
.td {
|
||||
border-right: 1px solid #f2f2f2;
|
||||
border-bottom: 1px solid #f2f2f2;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.td-3 {
|
||||
width: 33.33%;
|
||||
}
|
||||
|
||||
.popup-box {
|
||||
padding: 20rpx 20rpx;
|
||||
width: 700rpx;
|
||||
|
||||
.residue {
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.increase {
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
color: #727272;
|
||||
}
|
||||
|
||||
.custom-style {
|
||||
margin: 40rpx auto;
|
||||
width: 200rpx;
|
||||
color: #ffffff;
|
||||
background: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.popup-title {
|
||||
padding: 18rpx 0;
|
||||
border-bottom: 1px solid #A92924;
|
||||
|
||||
.title {
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
color: #A92924;
|
||||
}
|
||||
|
||||
.close {
|
||||
width: 80rpx;
|
||||
height: 40rpx;
|
||||
font-size: 22rpx;
|
||||
line-height: 40rpx;
|
||||
text-align: center;
|
||||
color: #ffffff;
|
||||
background: #A92924;
|
||||
}
|
||||
}
|
||||
|
||||
.goods-item {
|
||||
padding: 18rpx 0;
|
||||
font-size: 24rpx;
|
||||
line-height: 32rpx;
|
||||
color: #626262;
|
||||
}
|
||||
|
||||
|
||||
.item-wrap {
|
||||
margin: 24px 0;
|
||||
font-size: 25rpx;
|
||||
|
||||
.form-title-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.goods-info-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.form-title {
|
||||
padding-left: 10px;
|
||||
color: #A92924;
|
||||
font-size: 18px;
|
||||
line-height: 18px;
|
||||
border-left: 4px solid #A92924;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.countdown {
|
||||
padding: 2px 5px;
|
||||
margin: 0 5px;
|
||||
}
|
||||
|
||||
.enquiry-tip-content {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.enquiry-tip-item {
|
||||
padding-bottom: 12rpx;
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
color: #333333;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,205 @@
|
||||
<template>
|
||||
<view class="wrap">
|
||||
<u-sticky offset-top="0" customNavHeight="0">
|
||||
<uititle title="我发布的询价"></uititle>
|
||||
</u-sticky>
|
||||
<view class="issue" @click="toRelease">
|
||||
<u-icon name="plus" color="#fff" size="24"></u-icon>
|
||||
</view>
|
||||
<view class="layout-goods">
|
||||
<view class="goods-box p-top-10" v-if="list.length">
|
||||
<view class="item bg-white" v-for="(item, index) in list"
|
||||
:key="index">
|
||||
<view @click="detailLink(item._id)" class="askfor">查看详情</view>
|
||||
<view @click="detailLink(item._id)" class="text-25 text-gray text-single">单号{{ item.enquiryNo }}</view>
|
||||
<view @click="detailLink(item._id)" class="title text-single">{{ item.title }}</view>
|
||||
<view @click="detailLink(item._id)" class="text m-top-10">
|
||||
<text class="red">采购量:{{
|
||||
item.productList.map(i => (i.procureNumber ? i.procureNumber : '') + (i.procureUnit ? i.procureUnit : '')).join("/")
|
||||
}}
|
||||
</text>
|
||||
<text class="red">{{ item.quoteNum }}家已报价</text>
|
||||
</view>
|
||||
<text @click="detailLink(item._id)" class="text-25 text-gray">{{
|
||||
`${item.addressRegion.province.name}${item.addressRegion.city.name}${item.addressRegion.area.name} ${item.addressDetail}`
|
||||
}}
|
||||
</text>
|
||||
<text @click="detailLink(item._id)" class="text-25 text-gray" v-if="item.remark">备注:{{ item.remark }}</text>
|
||||
<view @click="detailLink(item._id)" class="date">{{ item._add_time_str }} 发布</view>
|
||||
<view>
|
||||
<u-button type="primary" plain size="mini" @click="del(item._id)">删除</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-empty v-else text="您未发布询价单"></u-empty>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uititle from '@/components/common/title'
|
||||
|
||||
export default {
|
||||
name: "my",
|
||||
components: {uititle},
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
userInfo: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
detailLink(id) {
|
||||
vk.navigateTo(`/pages/price/detail?id=${id}`);
|
||||
},
|
||||
async getList() {
|
||||
const {rows} = await vk.callFunction({
|
||||
url: 'client/enquiry/sheet/kh/getList'
|
||||
})
|
||||
this.list = rows
|
||||
},
|
||||
async toRelease() {
|
||||
const {userInfo, accountNum} = await vk.callFunction({
|
||||
url: 'user/kh/getMyUserInfo'
|
||||
})
|
||||
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您尚未认证, 是否前往认证?',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 0)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请完善名片信息',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 1)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else if (accountNum === 0) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请先到个人中心添加收款账户',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('user_tab', 7)
|
||||
uni.switchTab({url: '/pages/user/user'})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
vk.navigateTo({
|
||||
url: '/pages/price/publish'
|
||||
})
|
||||
}
|
||||
},
|
||||
del(_id) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '如果你要删除此条信息,之前其他客户填写的留言将无法查看',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
vk.callFunction({
|
||||
url: 'client/enquiry/sheet/kh/delete',
|
||||
title: '请求中...',
|
||||
data: {
|
||||
_id
|
||||
},
|
||||
}).then(res => {
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.userInfo = vk.getStorageSync('uni_id_user_info')
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.layout-goods {
|
||||
// width: 690rpx;
|
||||
padding: 10rpx 30rpx;
|
||||
|
||||
.item {
|
||||
position: relative;
|
||||
margin-top: 30rpx;
|
||||
padding: 10rpx 20rpx 20rpx;
|
||||
border-radius: 12rpx;
|
||||
|
||||
.title {
|
||||
width: 90%;
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
line-height: 48rpx;
|
||||
color: #101010;
|
||||
}
|
||||
|
||||
.link, .askfor {
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
top: 16rpx;
|
||||
z-index: 9;
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #A92924;
|
||||
padding: 4rpx 8rpx;
|
||||
}
|
||||
|
||||
.link {
|
||||
border: 1px solid #A92924;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.red {
|
||||
margin-right: 20rpx;
|
||||
color: #A92924;
|
||||
}
|
||||
|
||||
.date {
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #9a9a9a;
|
||||
}
|
||||
|
||||
.company {
|
||||
height: 40rpx;
|
||||
|
||||
.icon {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
|
||||
.text {
|
||||
//width: 300rpx;
|
||||
height: 40rpx;
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
color: #4f4f4f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.item:nth-child(1) {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user