|
@@ -65,6 +65,7 @@ var fleaMarketForm = new Vue({
|
|
|
commitmentImage:'',//承诺函图片
|
|
|
fileName:'',//文件名称
|
|
|
ossName:'',//文件OSS名称
|
|
|
+ userId:''//用户
|
|
|
},
|
|
|
brandname:'请选择',
|
|
|
checkbox:false,
|
|
@@ -116,64 +117,58 @@ var fleaMarketForm = new Vue({
|
|
|
isMobileDisabled:true,
|
|
|
},
|
|
|
methods:{
|
|
|
- showBrand:function(){
|
|
|
- var _this = this;
|
|
|
- _this.selectBrand = !_this.selectBrand;
|
|
|
+ showBrand(){
|
|
|
+ this.selectBrand = !this.selectBrand;
|
|
|
},
|
|
|
- hadldPublishIdentity: function(item) {
|
|
|
- var _this = this;
|
|
|
- _this.handleCurrent = item.value;
|
|
|
- _this.secondParams.publishIdentity = item.value;
|
|
|
+ hadldPublishIdentity(item) {
|
|
|
+ this.handleCurrent = item.value;
|
|
|
+ this.secondParams.publishIdentity = item.value;
|
|
|
},
|
|
|
- secondHandRidio: function(item) {
|
|
|
- var _this = this;
|
|
|
- _this.currentId = item.value;
|
|
|
- _this.secondParams.secondHandType = item.value;
|
|
|
- if (item.value==1){
|
|
|
- _this.isShow = true;
|
|
|
+ secondHandRidio(item) {
|
|
|
+ this.currentId = item.value;
|
|
|
+ this.secondParams.secondHandType = item.value;
|
|
|
+ if (item.value===1){
|
|
|
+ this.isShow = true;
|
|
|
}else {
|
|
|
- _this.isShow = false;
|
|
|
+ this.isShow = false;
|
|
|
}
|
|
|
},
|
|
|
- secondHandType:function(item){ //二手仪器
|
|
|
- item.isChecked = ! item.isChecked;
|
|
|
- var _this = this;
|
|
|
- if(item.isChecked){
|
|
|
- _this.checkVal.push(item.value);
|
|
|
- _this.secondParams.instrumentType = _this.checkVal.toString();
|
|
|
- } else {
|
|
|
- _this.checkVal.splice(_this.checkVal.indexOf(item.value), 1);
|
|
|
- _this.secondParams.instrumentType = _this.checkVal.toString();
|
|
|
- }
|
|
|
+ secondHandType(item){ //二手仪器
|
|
|
+ item.isChecked = ! item.isChecked;
|
|
|
+ if(item.isChecked){
|
|
|
+ this.checkVal.push(item.value);
|
|
|
+ this.secondParams.instrumentType = this.checkVal.toString();
|
|
|
+ } else {
|
|
|
+ this.checkVal.splice(this.checkVal.indexOf(item.value), 1);
|
|
|
+ this.secondParams.instrumentType = this.checkVal.toString();
|
|
|
+ }
|
|
|
},
|
|
|
- ChangeBrand:function(item){ //品牌列表
|
|
|
- var _this = this;
|
|
|
- _this.brandname = item.name;
|
|
|
- _this.secondParams.brandId = item.id;
|
|
|
- if(_this.secondParams.brandId==161){
|
|
|
- _this.shoplogoTwo = true;
|
|
|
+ ChangeBrand(item){ //品牌列表
|
|
|
+ this.brandname = item.name;
|
|
|
+ this.secondParams.brandId = item.id;
|
|
|
+ if(this.secondParams.brandId===161){
|
|
|
+ this.shoplogoTwo = true;
|
|
|
}else {
|
|
|
- _this.shoplogoTwo = false;
|
|
|
+ this.shoplogoTwo = false;
|
|
|
}
|
|
|
},
|
|
|
- Detailed:function(){
|
|
|
- var _this = this;
|
|
|
- if(event.target.checked==true){
|
|
|
- _this.secondParams.detailTalkFlag = 2 ;//启用价格详聊
|
|
|
- _this.vShow_detailTalkFlag = true;
|
|
|
- }else {
|
|
|
- _this.secondParams.detailTalkFlag = 1 ;//不启用价格详聊
|
|
|
- _this.vShow_detailTalkFlag = false;
|
|
|
- }
|
|
|
+ Detailed(){
|
|
|
+ if(event.target.checked===true){
|
|
|
+ this.secondParams.detailTalkFlag = 2 ;//启用价格详聊
|
|
|
+ this.vShow_detailTalkFlag = true;
|
|
|
+ }else {
|
|
|
+ this.secondParams.detailTalkFlag = 1 ;//不启用价格详聊
|
|
|
+ this.vShow_detailTalkFlag = false;
|
|
|
+ }
|
|
|
},
|
|
|
- dragstart: function(value) { // 记录初始信息
|
|
|
+ dragstart(value) { // 记录初始信息
|
|
|
this.oldNum = value;
|
|
|
},
|
|
|
- uploadGoodsImagesFn: function(event){//上传商品图片
|
|
|
- var _this = this;
|
|
|
- var inputDOM = _this.$refs.goodsImages;
|
|
|
- var file = inputDOM.files[0];
|
|
|
- var size = file.size;
|
|
|
+ uploadGoodsImagesFn(event){//上传商品图片
|
|
|
+ const _this = this;
|
|
|
+ const inputDOM = _this.$refs.goodsImages;
|
|
|
+ const file = inputDOM.files[0];
|
|
|
+ const size = file.size;
|
|
|
if(size > 5242880){//限制了文件的大小5MB
|
|
|
CAIMEI.dialog('图片不能超过5M');
|
|
|
event.target.value = '';
|
|
@@ -186,12 +181,11 @@ var fleaMarketForm = new Vue({
|
|
|
event.target.value = '';
|
|
|
});
|
|
|
},
|
|
|
- removeGoodsImagesFn: function(index){//删除商品图片
|
|
|
- var _this = this;
|
|
|
- _this.GoodsImagesList.splice(index,1);
|
|
|
- _this.secondParams.image =_this.GoodsImagesList.toString()+',';
|
|
|
+ removeGoodsImagesFn(index){//删除商品图片
|
|
|
+ this.GoodsImagesList.splice(index,1);
|
|
|
+ this.secondParams.image = this.GoodsImagesList.toString()+',';
|
|
|
},
|
|
|
- contains:function(arr, val) {// 校验
|
|
|
+ contains(arr, val) {// 校验
|
|
|
return arr.some(item => item === val)
|
|
|
},
|
|
|
handleMobileCodeInput(){//
|
|
@@ -201,25 +195,26 @@ var fleaMarketForm = new Vue({
|
|
|
this.vShow_TownId = false;
|
|
|
this.vShow_Address = false;
|
|
|
},
|
|
|
- handleMobileInput:function () {// 控制联系人手机号显示获取验证码按钮
|
|
|
- var re = /^1\d{10}$/;
|
|
|
+ handleMobileInput () {// 控制联系人手机号显示获取验证码按钮
|
|
|
+ const re = /^1\d{10}$/;
|
|
|
if(re.test(this.secondParams.contactMobile)){
|
|
|
- this.isMobileDisabled = false
|
|
|
+ this.isMobileDisabled = false
|
|
|
+ }else{
|
|
|
+ this.isMobileDisabled = true
|
|
|
}
|
|
|
},
|
|
|
- getNewMobileCodeFn:function(){//获取联系人手机号短信验证码
|
|
|
- var _self = this;
|
|
|
- var pass = verifyCheack('.massageBtn');
|
|
|
- if (!pass) { return false; }
|
|
|
- var params = {
|
|
|
- mobile:_self.secondParams.contactMobile,
|
|
|
- isCheckCaptcha:1,
|
|
|
- activateCodeType:6,
|
|
|
- platformType:0
|
|
|
+ getNewMobileCodeFn(){//获取联系人手机号短信验证码
|
|
|
+ const _self = this;
|
|
|
+ if (!_self.secondParams.contactMobile) { return false; }
|
|
|
+ const params = {
|
|
|
+ mobile: _self.secondParams.contactMobile,
|
|
|
+ isCheckCaptcha: 1,
|
|
|
+ activateCodeType: 6,
|
|
|
+ platformType: 0
|
|
|
};
|
|
|
_self.isMobileDisabled = true;
|
|
|
UserApi.getRegisterMobileCode(params,function(response){
|
|
|
- if(response.code == 0){
|
|
|
+ if(response.code === 0){
|
|
|
CAIMEI.dialog('验证短信已发送',false,function () {});
|
|
|
var TIME_COUNT = 60;
|
|
|
if (!_self.mobilTime) {
|
|
@@ -243,21 +238,20 @@ var fleaMarketForm = new Vue({
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- showViewerImageFn2: function(index,imageIndex ){//预览图片
|
|
|
- var _this = this;
|
|
|
+ showViewerImageFn2(index,imageIndex ){//预览图片
|
|
|
+ const _this = this;
|
|
|
var DomEven = '#ViewerGoodsImages'+index;
|
|
|
var ViewerDom = document.querySelector(DomEven);
|
|
|
_this.viewer = new Viewer(ViewerDom, {url:'data-image'});
|
|
|
},
|
|
|
- getProductType:function(item){
|
|
|
- var _this = this;
|
|
|
- _this.secondType=item;
|
|
|
- _this.secondParams.secondProductType = item ;
|
|
|
+ getProductType(item){
|
|
|
+ this.secondType=item;
|
|
|
+ this.secondParams.secondProductType = item ;
|
|
|
},
|
|
|
- submitBtn:function () {
|
|
|
- var _this = this;
|
|
|
- var re = /^1\d{10}$/;
|
|
|
- if(_this.secondParams.contactName == ''){
|
|
|
+ submitBtn () {
|
|
|
+ const _this = this;
|
|
|
+ const re = /^1\d{10}$/;
|
|
|
+ if(_this.secondParams.contactName === ''){
|
|
|
_this.vShow_contactName = true;
|
|
|
_this.fromMessage = '请输入联系人姓名';
|
|
|
_this.scrollIntoView('secondHandrelease');
|
|
@@ -266,7 +260,7 @@ var fleaMarketForm = new Vue({
|
|
|
},3000);
|
|
|
return
|
|
|
}
|
|
|
- if(_this.secondParams.contactMobile == ''){
|
|
|
+ if(_this.secondParams.contactMobile === ''){
|
|
|
_this.vShow_contactMobile = true;
|
|
|
_this.fromMessage = '请输入联系方式';
|
|
|
_this.scrollIntoView('secondHandrelease');
|
|
@@ -284,7 +278,7 @@ var fleaMarketForm = new Vue({
|
|
|
},3000);
|
|
|
return
|
|
|
}
|
|
|
- if(_this.secondParams.checkCode == ''){
|
|
|
+ if(_this.secondParams.checkCode === ''){
|
|
|
_this.vShow_checkCode = true;
|
|
|
_this.fromMessage = '请输入短信验证码';
|
|
|
_this.scrollIntoView('secondHandrelease');
|
|
@@ -293,7 +287,7 @@ var fleaMarketForm = new Vue({
|
|
|
},3000);
|
|
|
return
|
|
|
}
|
|
|
- if(_this.secondParams.secondHandType == ''){
|
|
|
+ if(_this.secondParams.secondHandType === ''){
|
|
|
_this.vShow_secondHandType = true;
|
|
|
_this.fromMessage = '请选择分类';
|
|
|
_this.scrollIntoView('secondHandrelease');
|
|
@@ -302,8 +296,8 @@ var fleaMarketForm = new Vue({
|
|
|
},3000);
|
|
|
return;
|
|
|
}
|
|
|
- if(_this.secondParams.secondHandType == 1 ){
|
|
|
- if(_this.secondParams.instrumentType ==''){
|
|
|
+ if(_this.secondParams.secondHandType === 1 ){
|
|
|
+ if(_this.secondParams.instrumentType ===''){
|
|
|
_this.vShow_instrumentType = true;
|
|
|
_this.fromMessage = '请完善仪器分类';
|
|
|
_this.scrollIntoView('secondHandrelease');
|
|
@@ -313,7 +307,7 @@ var fleaMarketForm = new Vue({
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
- if(_this.secondParams.brandId == ''){
|
|
|
+ if(_this.secondParams.brandId === ''){
|
|
|
_this.vShow_BrandID = true;
|
|
|
_this.fromMessage = '请选择商品品牌';
|
|
|
_this.scrollIntoView('secondHandrelease');
|
|
@@ -322,7 +316,7 @@ var fleaMarketForm = new Vue({
|
|
|
},3000);
|
|
|
return;
|
|
|
}
|
|
|
- if(_this.secondParams.name == ''){
|
|
|
+ if(_this.secondParams.name === ''){
|
|
|
_this.vShow_Name = true;
|
|
|
_this.fromMessage = '请输入商品名称';
|
|
|
_this.scrollIntoView('secondHandrelease');
|
|
@@ -332,7 +326,7 @@ var fleaMarketForm = new Vue({
|
|
|
return
|
|
|
}
|
|
|
if(_this.secondParams.publishIdentity === 2){
|
|
|
- if(_this.secondParams.companyName == ''){
|
|
|
+ if(_this.secondParams.companyName === ''){
|
|
|
_this.vShow_companyName = true;
|
|
|
_this.fromMessage = '请输入公司名称';
|
|
|
_this.scrollIntoView('vShow_Name');
|
|
@@ -342,7 +336,7 @@ var fleaMarketForm = new Vue({
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
- if(_this.secondParams.productQuality == ''){
|
|
|
+ if(_this.secondParams.productQuality === ''){
|
|
|
_this.vShow_shopColor = true;
|
|
|
_this.fromMessage = '请输入商品成色';
|
|
|
_this.scrollIntoView('vShow_Name');
|
|
@@ -351,7 +345,7 @@ var fleaMarketForm = new Vue({
|
|
|
},3000);
|
|
|
return
|
|
|
}
|
|
|
- if(_this.secondParams.townId == ''|| _this.secondParams.townId == undefined){
|
|
|
+ if(_this.secondParams.townId === ''|| _this.secondParams.townId === undefined){
|
|
|
_this.vShow_TownId = true;
|
|
|
_this.fromMessage = '请完善联系地址';
|
|
|
_this.scrollIntoView('vShow_Name');
|
|
@@ -360,7 +354,7 @@ var fleaMarketForm = new Vue({
|
|
|
},3000);
|
|
|
return
|
|
|
}
|
|
|
- if(_this.secondParams.address == ''){
|
|
|
+ if(_this.secondParams.address === ''){
|
|
|
_this.vShow_Address = true;
|
|
|
_this.fromMessage = '请填写详细地址';
|
|
|
_this.scrollIntoView('vShow_Name');
|
|
@@ -369,7 +363,7 @@ var fleaMarketForm = new Vue({
|
|
|
},3000);
|
|
|
return
|
|
|
}
|
|
|
- if(_this.GoodsImagesList ==''){
|
|
|
+ if(_this.GoodsImagesList ===''){
|
|
|
_this.vShow_GoodsImages = true;
|
|
|
_this.fromMessage = '请上传图片';
|
|
|
_this.scrollIntoView('vShow_Address');
|
|
@@ -378,7 +372,7 @@ var fleaMarketForm = new Vue({
|
|
|
},3000);
|
|
|
return;
|
|
|
}
|
|
|
- if(_this.checkbox==false){
|
|
|
+ if(!_this.checkbox){
|
|
|
_this.vShow_checkBox = true;
|
|
|
_this.fromMessage='请阅读并勾选同意';
|
|
|
setTimeout(function(){
|
|
@@ -389,7 +383,7 @@ var fleaMarketForm = new Vue({
|
|
|
console.log(_this.secondParams);
|
|
|
_this.SecondHandProduct(_this.secondParams)
|
|
|
},
|
|
|
- SecondHandProduct:function(params){//提交发布
|
|
|
+ SecondHandProduct(params){//提交发布
|
|
|
var _this = this;
|
|
|
SecondApi.SecondHandProduct(params,function (res) {
|
|
|
if (res.code===0){
|
|
@@ -403,7 +397,7 @@ var fleaMarketForm = new Vue({
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- cancelButtonFn:function(){//弹窗操作按钮
|
|
|
+ cancelButtonFn(){//弹窗操作按钮
|
|
|
var _this = this;
|
|
|
switch(_this.isButtonsType){
|
|
|
case 1:
|
|
@@ -415,7 +409,7 @@ var fleaMarketForm = new Vue({
|
|
|
break;
|
|
|
}
|
|
|
},
|
|
|
- confirmButtonFn:function(){//弹窗操作按钮
|
|
|
+ confirmButtonFn(){//弹窗操作按钮
|
|
|
var _this = this;
|
|
|
switch(_this.isButtonsType){
|
|
|
case 1:
|
|
@@ -427,32 +421,30 @@ var fleaMarketForm = new Vue({
|
|
|
break;
|
|
|
}
|
|
|
},
|
|
|
- closePopupShow:function(){//关闭操作弹窗
|
|
|
- var _this = this;
|
|
|
- _this.PopupShow = false;
|
|
|
+ closePopupShow(){//关闭操作弹窗
|
|
|
+ this.PopupShow = false;
|
|
|
},
|
|
|
- scrollIntoView: function(id){
|
|
|
+ scrollIntoView(id){
|
|
|
document.getElementById(id).scrollIntoView({block: 'start', behavior: 'smooth'});
|
|
|
},
|
|
|
- province:function () {
|
|
|
- var _this = this;
|
|
|
- _this.from.province = event.target.value;
|
|
|
- console.log('aaa', _this.from.province)
|
|
|
- if(_this.from.province==''){//省为请选择时市区初始化
|
|
|
- _this.cityArray=[];
|
|
|
- _this.townArray=[];
|
|
|
- _this.secondParams.townId=''
|
|
|
+ province () {
|
|
|
+ this.from.province = event.target.value;
|
|
|
+ console.log('aaa', this.from.province)
|
|
|
+ if(this.from.province===''){//省为请选择时市区初始化
|
|
|
+ this.cityArray=[];
|
|
|
+ this.townArray=[];
|
|
|
+ this.secondParams.townId=''
|
|
|
}else {
|
|
|
- _this.getcity();
|
|
|
+ this.getcity();
|
|
|
}
|
|
|
},
|
|
|
- getcity:function(event){//加载市
|
|
|
- var _this = this;
|
|
|
+ getcity(event){//加载市
|
|
|
+ const _this = this;
|
|
|
PublicApi.GetCity({ type:1, parentId: _this.from.province },function(response){
|
|
|
- if(response.code == 0 ){
|
|
|
+ if(response.code === 0 ){
|
|
|
_this.cityArray = response.data;
|
|
|
_this.from.city = event.target.value;
|
|
|
- if(_this.from.city==''){
|
|
|
+ if(_this.from.city===''){
|
|
|
_this.townArray=[];
|
|
|
}else {
|
|
|
_this.getcTown();
|
|
@@ -461,38 +453,48 @@ var fleaMarketForm = new Vue({
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- getcTown:function(event){
|
|
|
- var _this = this;
|
|
|
+ getcTown(event){
|
|
|
+ const _this = this;
|
|
|
PublicApi.GetTown({ type:2, parentId:_this.from.city},function(response){
|
|
|
- if(response.code == 0 ){
|
|
|
+ if(response.code === 0 ){
|
|
|
_this.townArray = response.data;
|
|
|
_this.secondParams.townId = event.target.value;
|
|
|
}else{
|
|
|
- CAIMEI.Alert(response.msg, '确定', false);
|
|
|
+ console.log('获取区异常~')
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- changeBox:function () {
|
|
|
- if(event.target.checked ==true){
|
|
|
- this.checkbox = true
|
|
|
- }else {
|
|
|
- this.checkbox = false
|
|
|
- }
|
|
|
+ getBrandList(){//品牌列表
|
|
|
+ const _this = this;
|
|
|
+ SecondApi.brandList({},function (res) {
|
|
|
+ if(res.code === 0){
|
|
|
+ _this.BrandList = res.data;
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
- },
|
|
|
- mounted:function () {
|
|
|
- var _this = this;
|
|
|
- SecondApi.brandList({},function (res) {//品牌列表
|
|
|
- if(res.code == 0){
|
|
|
- _this.BrandList = res.data;
|
|
|
- }
|
|
|
- })
|
|
|
- PublicApi.GetProvince({},function(response){ //省份
|
|
|
- if(response.code == 0){
|
|
|
+ getProvince(){ //省份
|
|
|
+ const _this = this;
|
|
|
+ PublicApi.GetProvince({},function(response){ //省份
|
|
|
+ if(response.code === 0){
|
|
|
_this.provinceArray = response.data
|
|
|
}else{
|
|
|
- CAIMEI.Alert(response.msg, '确定', false);
|
|
|
+ console.log('获取省份异常~')
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ changeBox () {
|
|
|
+ if(event.target.checked ===true){
|
|
|
+ this.checkbox = true
|
|
|
+ }else {
|
|
|
+ this.checkbox = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ this.getBrandList()
|
|
|
+ this.getProvince()
|
|
|
+ if(globalUserData){
|
|
|
+ this.secondParams.userId = globalUserData.userId
|
|
|
+ }
|
|
|
+ },
|
|
|
})
|