Commit 5a8400f1 by chenwq

众筹,默认地址

1 parent 5b3cc591
import { http, http_common, http2 } from '@/main' import { http, http_common, http2, http_merchant } from '@/main'
const defaultPath = 'scrm.api.carlife.' const defaultPath = 'scrm.api.carlife.'
const getMerchantGoodsListApi = params => { const getMerchantGoodsListApi = params => {
...@@ -139,4 +139,15 @@ const getStaffFollowerListApi = params => { ...@@ -139,4 +139,15 @@ const getStaffFollowerListApi = params => {
}) })
} }
export default { getMerchantGoodsListApi, getGoodsListApi, uploadImgApi, uploadMusicApi, uploadVideoApi, getMerchantList, getSimpleMerchantList, getZoneListApi, getClassifyListApi, pictureUpload, querylabeltree, getCrowdTreeListApi, getStaffFollowerListApi } // 获取商户信息
const getMerchantInfoApi = params => {
params.method = 'merchants.api.merchant.findMerchantBaseInfo'
return http_merchant({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getMerchantGoodsListApi, getGoodsListApi, uploadImgApi, uploadMusicApi, uploadVideoApi, getMerchantList, getSimpleMerchantList, getZoneListApi, getClassifyListApi, pictureUpload, querylabeltree, getCrowdTreeListApi, getStaffFollowerListApi, getMerchantInfoApi }
...@@ -180,6 +180,7 @@ export default { ...@@ -180,6 +180,7 @@ export default {
footerLeft: '0', footerLeft: '0',
footerWidth: '0', footerWidth: '0',
editChildRef: 'editChildRef', editChildRef: 'editChildRef',
userInfo: {},
pickerOptions: { pickerOptions: {
disabledDate(v) { disabledDate(v) {
//禁用当前之前的日期 //禁用当前之前的日期
...@@ -301,11 +302,6 @@ export default { ...@@ -301,11 +302,6 @@ export default {
} }
], ],
// 活动配置 // 活动配置
// customerServiceName: [{ required: true, message: '请输入客服名称', trigger: 'change' }],
// customerServicePhone: [{ required: true, message: '请输入客服电话', trigger: 'change' }],
// customerServiceQrImg: [{ required: true, message: '请选择客服二维码', trigger: 'change' }],
// sponsorName: [{ required: true, message: '请输入主办方', trigger: 'change' }],
// activityAddressDetailName: [{ required: true, message: '请选择活动地址', trigger: 'change' }],
activityBigImg: [{ required: true, message: '请选择活动大图', trigger: 'change' }], activityBigImg: [{ required: true, message: '请选择活动大图', trigger: 'change' }],
activityDetail: [{ required: true, message: '请输入活动详情', trigger: 'change' }], activityDetail: [{ required: true, message: '请输入活动详情', trigger: 'change' }],
forwardTitle: [{ required: true, message: '请输入转发标题', trigger: 'change' }] forwardTitle: [{ required: true, message: '请输入转发标题', trigger: 'change' }]
...@@ -579,7 +575,7 @@ export default { ...@@ -579,7 +575,7 @@ export default {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.routeInfo = this.$route.query this.routeInfo = this.$route.query
this.routeInfo.addOrEdit != 'add' ? this.getInfo() : '' this.routeInfo.addOrEdit != 'add' ? this.getInfo() : this.getMerchantInfo()
var id = this.routeInfo.id var id = this.routeInfo.id
var detailDisableList = ['editFormData'] var detailDisableList = ['editFormData']
if (id) { if (id) {
...@@ -615,10 +611,10 @@ export default { ...@@ -615,10 +611,10 @@ export default {
newValue && newValue.length && this.countDown() newValue && newValue.length && this.countDown()
}, },
'editForm.predictVolume'(newValue, oldValue) { 'editForm.predictVolume'(newValue, oldValue) {
this.editForm.predictVolume = limitPrice(newValue, oldValue, 7, 0, 0, 1000000) this.editForm.predictVolume = limitPrice(newValue, oldValue, 7, 2, 0, 1000000)
}, },
'editForm.fictitiousGroupQuantity'(newValue, oldValue) { 'editForm.fictitiousGroupQuantity'(newValue, oldValue) {
this.editForm.fictitiousGroupQuantity = limitPrice(newValue, oldValue, 7, 0, 0) this.editForm.fictitiousGroupQuantity = limitPrice(newValue, oldValue, 3, 0, 0, 100)
}, },
'editForm.fictitiousLadderQuantity'(newValue, oldValue) { 'editForm.fictitiousLadderQuantity'(newValue, oldValue) {
this.editForm.fictitiousLadderQuantity = limitPrice(newValue, oldValue, 7, 0, 0) this.editForm.fictitiousLadderQuantity = limitPrice(newValue, oldValue, 7, 0, 0)
...@@ -918,6 +914,29 @@ export default { ...@@ -918,6 +914,29 @@ export default {
}) })
}, },
getMerchantInfo() {
let merchantId = this.$globalState.session.merchantId
this.$apis.common.getMerchantInfoApi({ merchantId: merchantId }).then(res => {
this.userInfo = res
this.editForm.sponsorName = res.merchantName
// 地图
if (res.provinceName || res.cityName) {
this.$refs.configEditFormRef.$refs.provinceForm[0].init(res.provinceName, res.cityName)
let mapAttr = this.configEditFormData.find(item => item.name == 'activityAddressDetailName')
this.editForm[mapAttr.attrObj.provinceName] = res.provinceName
this.editForm[mapAttr.attrObj.provinceCode] = res.provinceCode
this.editForm[mapAttr.attrObj.cityName] = res.cityName
this.editForm[mapAttr.attrObj.cityCode] = res.cityCode
this.editForm[mapAttr.attrObj.lat] = res.lat
this.editForm[mapAttr.attrObj.lng] = res.lng
this.editForm[mapAttr.attrObj.fullAddress] = res.merchantAddress
}
this.$nextTick(() => {
this.editStatus = false
})
})
},
getInfo() { getInfo() {
this.$apis.seckillActivity.getActivityDetailApi({ id: this.routeInfo.id }).then(res => { this.$apis.seckillActivity.getActivityDetailApi({ id: this.routeInfo.id }).then(res => {
var info = res var info = res
...@@ -929,6 +948,10 @@ export default { ...@@ -929,6 +948,10 @@ export default {
this.editForm.activityPrice = (info.activityPrice / 100).toFixed(2) this.editForm.activityPrice = (info.activityPrice / 100).toFixed(2)
this.editForm.goodsStock = info.goodsStock + '' this.editForm.goodsStock = info.goodsStock + ''
} }
// 预估销量
if (info.predictVolume) {
this.editForm.predictVolume = (info.predictVolume / 100).toFixed(2)
}
// 地图 // 地图
if (info.activityAddressProvinceName || info.activityAddressCityName) { if (info.activityAddressProvinceName || info.activityAddressCityName) {
this.$refs.configEditFormRef.$refs.provinceForm[0].init(info.activityAddressProvinceName, info.activityAddressCityName) this.$refs.configEditFormRef.$refs.provinceForm[0].init(info.activityAddressProvinceName, info.activityAddressCityName)
...@@ -999,6 +1022,10 @@ export default { ...@@ -999,6 +1022,10 @@ export default {
param.specificationDetailList.push(obj) param.specificationDetailList.push(obj)
}) })
} }
// 预估销量
if (this.editForm.predictVolume) {
param.predictVolume = (this.editForm.predictVolume * 100).toFixed(0)
}
// 活动详情 // 活动详情
if (this.editForm.activityDetail) { if (this.editForm.activityDetail) {
param.activityDetail = encodeURIComponent(this.editForm.activityDetail) param.activityDetail = encodeURIComponent(this.editForm.activityDetail)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!