发布商品bu修复

This commit is contained in:
zmj 2024-05-03 15:03:12 +08:00
parent fd5181b55c
commit eaff04f995
7 changed files with 72 additions and 65 deletions

View File

@ -94,9 +94,6 @@
uni.onHostEventReceive((event, data) => { uni.onHostEventReceive((event, data) => {
if (event == 'tocustomlist') { if (event == 'tocustomlist') {
Toast("收到消息")
Toast(JSON.stringify(event))
Toast(JSON.stringify(data))
if (data.page_type == 1) { if (data.page_type == 1) {
uni.switchTab({ uni.switchTab({
url: data.route url: data.route

View File

@ -900,30 +900,13 @@
}, },
onShow() { onShow() {
if (Boolean(this.$store.state.app.userInfo.service?.mer_id)) {
isNewMer(this.$store.state.app.userInfo.uid, this.$store.state.app.userInfo.service?.mer_id).then(
res => {
console.log(res.data)
if (res.data == 'true' && this.elInfo) {
let that = this
const query = uni.createSelectorQuery().in(this);
query
.select(".tools-two-img")
.boundingClientRect((data) => {
let info = JSON.stringify(data)
that.elInfo = data
// #ifdef APP-PLUS
that.openDiver()
// #endif
})
.exec();
}
})
}
if (this.loadEndFlag) { if (this.loadEndFlag) {
this.getUserInfo(); this.getUserInfo();
this.codelist(); this.codelist();
console.log('wcnmonshow')
} else {
this.isNewUser()
console.log('1111111111')
} }
}, },
@ -932,6 +915,38 @@
this.$bus.$off('value-updated') this.$bus.$off('value-updated')
}, },
methods: { methods: {
isNewUser(data) {
let user;
if (data) {
user = data
} else {
user = this.$store.state.app.userInfo
}
setTimeout(() => {
if (Boolean(user.service?.mer_id)) {
isNewMer(user.uid, user.service
?.mer_id).then(
res => {
if (res.data == 'true' && this.elInfo) {
let that = this
setTimeout(() => {
const query = uni.createSelectorQuery().in(this);
query
.select(".tools-two-img")
.boundingClientRect((data) => {
let info = JSON.stringify(data)
that.elInfo = data
// #ifdef APP-PLUS
that.openDiver()
// #endif
})
.exec();
}, 500)
}
})
}
}, 500)
},
test1() { test1() {
isNewMer(this.$store.state.app.userInfo.uid, this.$store.state.app.userInfo.service?.mer_id).then(res => { isNewMer(this.$store.state.app.userInfo.uid, this.$store.state.app.userInfo.service?.mer_id).then(res => {
console.log(res, 'res') console.log(res, 'res')
@ -1389,6 +1404,8 @@
this.userid = res.data.uid this.userid = res.data.uid
this.userInfoData = res.data; this.userInfoData = res.data;
this.$store.commit('SET_USERINFO', res.data); this.$store.commit('SET_USERINFO', res.data);
console.log('resdata', res.data)
this.isNewUser(res.data)
this.merchantData.phone = res.data.phone; this.merchantData.phone = res.data.phone;
if (res.data.mer_info.is_company == 0) !this.merchantData.company_name ? this.merchantData if (res.data.mer_info.is_company == 0) !this.merchantData.company_name ? this.merchantData
.company_name = "" : null; .company_name = "" : null;

View File

@ -58,7 +58,6 @@
this.subNVue = uni.getSubNVueById('concat') this.subNVue = uni.getSubNVueById('concat')
let that = this let that = this
uni.$on('diverIndexEmit', (data) => { uni.$on('diverIndexEmit', (data) => {
console.log('data', data)
that.left = data.left that.left = data.left
that.top = data.top that.top = data.top
}) })

View File

@ -732,9 +732,10 @@
formData.attr.splice(1, 999) formData.attr.splice(1, 999)
formData.attr[0].value = ' ' formData.attr[0].value = ' '
formData.attr[0].detail = formData.attrValue.map(item => item.sku) formData.attr[0].detail = formData.attrValue.map(item => item.sku)
formData.attrValue.forEach(item => {
formData.attrValue.forEach((item, index) => {
item.detail = {} item.detail = {}
item.detail[' '] = item.sku item.detail[' '] = formData.attr[0].detail[index]
}) })
this.formData = formData this.formData = formData
}, },

View File

@ -256,22 +256,12 @@
uni.$u.toast(errList[0]) uni.$u.toast(errList[0])
return return
} }
// let flag = false console.log(this.attrValue)
// if (this.formData.attr.length > 1) {
// this.formData.attr.forEach(item => {
// if (!item.value) {
// flag = true
// }
// })
// }
// if (flag) {
// uni.$u.toast('')
// return
// }
// //
this.formData.attr[0].detail = [] this.formData.attr[0].detail = []
this.attrValue.forEach(item => { this.attrValue.forEach(item => {
item.detail[' '] = item.sku typeof(item.detail) == 'object' ?
item.detail[' '] = item.sku: (item.detail = {}, item.detail[' '] = item.sku)
console.log(this.formData.attr) console.log(this.formData.attr)
this.formData.attr[0].detail.push(item.sku) this.formData.attr[0].detail.push(item.sku)
}) })

View File

@ -109,8 +109,8 @@
<view class="footer-li" @click="handClick(2)"> <view class="footer-li" @click="handClick(2)">
扫码入库 扫码入库
</view> </view>
<view class="footer-li act fbsp" @click="handClick(3)"> <view class="footer-li act wcnm" id='fbsp' @click="handClick(3)">
发布商品{{where.type}} <text>发布商品</text>
</view> </view>
</view> </view>
@ -346,27 +346,31 @@
this.where.page = ++this.where.page; this.where.page = ++this.where.page;
this.getList(this.mer_id, false); this.getList(this.mer_id, false);
}, },
onReady() { onShow() {
if (!this.newUser) return if (!this.newUser) return
let that = this let that = this
const query = uni.createSelectorQuery().in(this); setTimeout(() => {
query const query = uni.createSelectorQuery().in(this);
.select(".fbsp") query
.boundingClientRect((data) => { .select(".wcnm")
let info = JSON.stringify(data) .boundingClientRect((data) => {
that.elInfo = data let info = JSON.stringify(data)
// #ifdef APP-PLUS console.log(data)
setTimeout(() => { that.elInfo = data
// #ifdef APP-PLUS
that.openDiver() that.openDiver()
}, 1000) // #endif
// #endif })
}) .exec();
.exec(); }, 500)
}, },
methods: { methods: {
openDiver() { openDiver() {
let that = this let that = this
const subNVue = uni.getSubNVueById('concatpro') const subNVue = uni.getSubNVueById('concatpro')
// console.log(that.elInfo)
// return
subNVue.show('zoom-out', 300, () => { subNVue.show('zoom-out', 300, () => {
uni.$emit('diverProductEmit', that.elInfo); uni.$emit('diverProductEmit', that.elInfo);
}) })
@ -1609,7 +1613,7 @@
.footer { .footer {
width: 750rpx; width: 750rpx;
height: 150rpx; height: 75px;
background-color: white; background-color: white;
position: fixed; position: fixed;
bottom: 0; bottom: 0;
@ -1622,11 +1626,11 @@
.footer-li { .footer-li {
border: 1px solid #989898; border: 1px solid #989898;
font-size: 32rpx; font-size: 32rpx;
padding: 14rpx 27rpx; padding: 7px 27rpx;
border-radius: 40rpx; border-radius: 40rpx;
overflow: hidden; overflow: hidden;
width: 184rpx; width: 184rpx;
height: 72rpx; height: 36px;
} }
.act { .act {

View File

@ -1,7 +1,7 @@
<template> <template>
<view class="" style="width: 750rpx;height: 100%;"> <view class="" style="width: 750rpx;height: 100%;">
<view class="jump" @click="jump"> <view class="jump" @click="jump">
<text class="font">跳过</text> <text class="font">跳过 </text>
</view> </view>
<view class="target" :style="{left:left+'px',top:top+'px'}" v-if="top"> <view class="target" :style="{left:left+'px',top:top+'px'}" v-if="top">
<text style="color:white;text-align: center;font-size: 32rpx;line-height: 32px;">发布商品</text> <text style="color:white;text-align: center;font-size: 32rpx;line-height: 32px;">发布商品</text>
@ -33,11 +33,10 @@
return { return {
isActive: false, isActive: false,
left: -100, left: -100,
top: -100, top: 0,
// left: 227.82386779785156,
// top: 777.7727661132812,
subNVue: null, subNVue: null,
bottomBtn: -100, bottomBtn: -100,
screenHeight: 672,
} }
}, },
methods: { methods: {
@ -61,10 +60,12 @@
this.subNVue = uni.getSubNVueById('concatpro') this.subNVue = uni.getSubNVueById('concatpro')
uni.$on('diverProductEmit', (data) => { uni.$on('diverProductEmit', (data) => {
that.left = data.left that.left = data.left
that.top = data.top
const res = uni.getSystemInfo({ const res = uni.getSystemInfo({
success: (res => { success: (res => {
that.bottomBtn = res.screenHeight - 150 that.bottomBtn = res.screenHeight - 150
this.screenHeight = res.screenHeight
that.top = res.screenHeight - 55
// console.log('screenheight', this.screenHeight)
}) })
}); });
}), }),
@ -159,8 +160,6 @@
.next-btn-text { .next-btn-text {
line-height: 76rpx; line-height: 76rpx;
text-align: center; text-align: center;
} }
.jump { .jump {