修改bug
This commit is contained in:
@@ -67,7 +67,6 @@
|
||||
//获取头像昵称和普通会员和VIP会员
|
||||
getUser() {
|
||||
this.$apiServe.getUser().then(res => {
|
||||
console.log('个人信息==', res.data);
|
||||
if (res.data.msg === "登录超时,请重新登录") {
|
||||
this.isLoad = false
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
</u-image>
|
||||
<view class="img_tag">{{item.cate_name}}</view>
|
||||
</view>
|
||||
<view style="padding: 14rpx 22rpx;">
|
||||
<view style="padding: 14rpx 24rpx 14rpx 16rpx;">
|
||||
<view class="title_box">
|
||||
<text class="title">{{item.name}}</text>
|
||||
<u-tag :text="item.tags" type="warning" shape="circle"></u-tag>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</u-image>
|
||||
<view class="img_tag">{{item.cate_name}}</view>
|
||||
</view>
|
||||
<view style="padding: 14rpx 22rpx;">
|
||||
<view style="padding: 14rpx 24rpx 14rpx 16rpx;">
|
||||
<view class="title_box">
|
||||
<text class="title">{{item.name}}</text>
|
||||
<u-tag :text="item.tags" type="warning" shape="circle"></u-tag>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</u-image>
|
||||
<view class="img_tag">{{item.cate_name}}</view>
|
||||
</view>
|
||||
<view style="padding: 14rpx 22rpx;">
|
||||
<view style="padding: 14rpx 24rpx 14rpx 16rpx;">
|
||||
<view class="title_box">
|
||||
<text class="title">{{item.name}}</text>
|
||||
<u-tag :text="item.tags" type="warning" shape="circle"></u-tag>
|
||||
|
||||
@@ -7,18 +7,14 @@
|
||||
<u-icon name="arrow-left" color="#fff;" />
|
||||
</view>
|
||||
<view class="search-input">
|
||||
<u-input v-if="!readOnly"
|
||||
v-model="queryParamF"
|
||||
:focus="true"
|
||||
placeholder="搜索优质产品"
|
||||
prefixIcon="search"
|
||||
:border="false"
|
||||
style="background-color: #fff;border: none;"
|
||||
confirm-type="go"
|
||||
@confirm="goSearch(queryParamF)"/>
|
||||
<view v-else style="width: 360rpx;padding: 10rpx 20rpx;display: flex;align-items: center;" @click="goSearch">
|
||||
<u-input v-if="!readOnly" v-model="queryParamF" :focus="true" placeholder="搜索优质产品"
|
||||
prefixIcon="search" :border="false" style="background-color: #fff;border: none;"
|
||||
confirm-type="go" @confirm="goSearch(queryParamF)" />
|
||||
<view v-else style="width: 360rpx;padding: 10rpx 20rpx;display: flex;align-items: center;"
|
||||
@click="goSearch">
|
||||
<u-icon name="search" color="#969696" size="22"></u-icon>
|
||||
<text style="margin-left:10rpx;font-size: 30rpx;font-family: PingFangSC-Regular, PingFang SC;font-weight: 400;color: #969696;line-height: 37rpx;">搜索优质商品</text>
|
||||
<text
|
||||
style="margin-left:10rpx;font-size: 30rpx;font-family: PingFangSC-Regular, PingFang SC;font-weight: 400;color: #969696;line-height: 37rpx;">搜索优质商品</text>
|
||||
</view>
|
||||
<view class="search-btn" @click="goSearch">搜索</view>
|
||||
</view>
|
||||
@@ -65,10 +61,10 @@
|
||||
},
|
||||
methods: {
|
||||
goSearch(value) {
|
||||
if(!this.queryParamF && value) {
|
||||
if (!this.queryParamF && value) {
|
||||
this.queryParamF = value
|
||||
}
|
||||
if(this.readOnly) {
|
||||
if (this.readOnly) {
|
||||
this.$emit('navigate')
|
||||
return
|
||||
}
|
||||
@@ -94,12 +90,14 @@
|
||||
margin: 10rpx 10rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.top-left {
|
||||
width: calc(100% - 200rpx);
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
|
||||
.search-input {
|
||||
display: flex;
|
||||
border: 2rpx solid #fff;
|
||||
@@ -107,6 +105,7 @@
|
||||
border-radius: 50rpx;
|
||||
height: 100%;
|
||||
margin-left: 10rpx;
|
||||
|
||||
.search-btn {
|
||||
font-size: 32rpx;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
|
||||
<view class="time_line">
|
||||
<view class="release_time">
|
||||
<text>{{item.pub_time}}</text>
|
||||
<text v-if="updateIndex==0||updateIndex==1">{{item.update_time}}</text>
|
||||
<text v-else>{{item.pub_time}}</text>
|
||||
</view>
|
||||
<view style="display: flex;">
|
||||
<view class="btn" @click="editIdeasAndNeeds(item)">
|
||||
@@ -32,7 +33,9 @@
|
||||
<text class="needs_text">{{item.pname}}</text>
|
||||
<view class="time_line">
|
||||
<view class="release_time">
|
||||
<text>{{item.pub_time}}</text>
|
||||
|
||||
<text v-if="updateIndex==0||updateIndex==1">{{item.update_time}}</text>
|
||||
<text v-else>{{item.pub_time}}</text>
|
||||
</view>
|
||||
<view style="display: flex;">
|
||||
<view class="btn" @click="editIdeasAndNeeds(item)">
|
||||
@@ -74,26 +77,27 @@
|
||||
name: '创意发布'
|
||||
}],
|
||||
needsList: [],
|
||||
ideasList: []
|
||||
ideasList: [],
|
||||
updateIndex: ''
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
console.log(options)
|
||||
if (options && options.index) {
|
||||
console.log(options)
|
||||
options.index = options.index - 1
|
||||
this.updateIndex = options.index
|
||||
this.tabChange(options)
|
||||
return
|
||||
}
|
||||
this.getIdeasAndNeeds()
|
||||
},
|
||||
methods: {
|
||||
//获取创意发布
|
||||
//获取创意发布或需求发布
|
||||
getIdeasAndNeeds() {
|
||||
this.$apiServe.getIdeasAndNeeds(this.type).then(res => {
|
||||
let data = res.data.data
|
||||
for (const item of data) {
|
||||
item.pub_time = dateFormatXwDetail(item.pub_time)
|
||||
item.update_time = dateFormatXwDetail(item.update_time)
|
||||
const imagesList = item.images && item.images.length > 0 ? item.images.split(';') : []
|
||||
item.images = imagesList.map(item1 => {
|
||||
item1 = uni.getStorageSync('img_url') + '/' + item1
|
||||
@@ -112,7 +116,6 @@
|
||||
//切换需求发布和创意发布
|
||||
tabChange(data) {
|
||||
this.tabCurrent = data.index
|
||||
// console.log('data.index', data.index);
|
||||
if (data.index == 0) {
|
||||
this.type = 1
|
||||
} else if (data.index == 1) {
|
||||
@@ -143,7 +146,6 @@
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
that.$apiServe.deleteIdeasAndNeeds(item.id).then(res => {
|
||||
// console.log('删除发布', res);
|
||||
if (res.data.code == 1) {
|
||||
that.$toast.warn('删除成功')
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</u-image>
|
||||
<view class="img_tag">{{item.cate_name}}</view>
|
||||
</view>
|
||||
<view style="padding: 14rpx 22rpx;">
|
||||
<view style="padding: 14rpx 24rpx 14rpx 16rpx;">
|
||||
<view class="title_box">
|
||||
<text class="title">{{item.name}}</text>
|
||||
<u-tag :text="item.tags" type="warning" shape="circle"></u-tag>
|
||||
@@ -59,14 +59,17 @@
|
||||
...this.queryParam,
|
||||
title: this.queryTitle
|
||||
}
|
||||
|
||||
this.$apiServe.getProductList(data).then(res => {
|
||||
let tags = res.data.data
|
||||
for (const item of tags) {
|
||||
let tag = item.tags
|
||||
this.tagsArray = tag.split(',')
|
||||
item.tags = this.tagsArray[0]
|
||||
if (tags) {
|
||||
for (const item of tags) {
|
||||
let tag = item.tags
|
||||
this.tagsArray = tag.split(',')
|
||||
item.tags = this.tagsArray[0]
|
||||
}
|
||||
this.productList = tags
|
||||
}
|
||||
this.productList = res.data.data
|
||||
}).finally(_ => {})
|
||||
},
|
||||
//点击图片跳转到详情页
|
||||
|
||||
@@ -58,7 +58,6 @@
|
||||
this.getDiscover()
|
||||
const tempList = uni.getStorageSync('storage_search_record')
|
||||
this.recentRecordList = tempList ? tempList : [];
|
||||
console.log(this.recentRecordList)
|
||||
const menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
||||
this.searchBarTop = menuButtonInfo.top;
|
||||
this.searchBarHeight = menuButtonInfo.height;
|
||||
@@ -104,7 +103,6 @@
|
||||
getDiscover() {
|
||||
this.$apiServe.getDiscover().then(res => {
|
||||
this.foundList = res.data.data
|
||||
console.log(res.data.data)
|
||||
}).finally(_ => {})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,9 +163,7 @@
|
||||
},
|
||||
onTabItemTap() {
|
||||
this.imgUrl = uni.getStorageSync('img_url')
|
||||
console.log('----onShow')
|
||||
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
|
||||
console.log(uni.getStorageSync('loginToken'))
|
||||
this.isLoad = false
|
||||
// uni.navigateTo({
|
||||
// url: '../../pages/my/login/login'
|
||||
@@ -184,14 +182,11 @@
|
||||
if (options && options.item && uni.getStorageSync(options.item)) {
|
||||
try {
|
||||
let publishFormList = uni.getStorageSync(options.item)
|
||||
console.log(publishFormList.images)
|
||||
this.fileList1 = publishFormList.images.map(item => {
|
||||
console.log(this.imgUrl)
|
||||
return {
|
||||
url: item
|
||||
}
|
||||
})
|
||||
console.log(this.fileList1)
|
||||
this.needsPublishForm = publishFormList
|
||||
} catch (error) {
|
||||
this.$toast.warn(error)
|
||||
@@ -256,7 +251,6 @@
|
||||
// }
|
||||
// },
|
||||
getCityValue(data) {
|
||||
console.log(data)
|
||||
this.showCityPicker = false
|
||||
this.needsPublishForm.area_name = data[0].join('-')
|
||||
this.needsPublishForm.area_code = data[1]
|
||||
@@ -265,7 +259,6 @@
|
||||
this.showProductPicker = false
|
||||
this.showCategoryPicker = false
|
||||
this.needsPublishForm.product = data.value[0]
|
||||
// console.log(data)
|
||||
// const obj = this.productPickerList.find(item => {
|
||||
// return item.name === data.value[0]
|
||||
// })
|
||||
@@ -319,9 +312,6 @@
|
||||
async afterRead(event) {
|
||||
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
|
||||
let lists = [].concat(event.file)
|
||||
console.log(this.fileList1)
|
||||
console.log(lists)
|
||||
console.log(this[`fileList${event.name}`])
|
||||
let fileListLen = this[`fileList${event.name}`].length
|
||||
lists.map((item) => {
|
||||
this[`fileList${event.name}`].push({
|
||||
@@ -331,7 +321,6 @@
|
||||
})
|
||||
})
|
||||
for (let i = 0; i < lists.length; i++) {
|
||||
console.log(lists[i])
|
||||
const result = await this.uploadFilePromise(lists[i].url)
|
||||
let item = this[`fileList${event.name}`][fileListLen]
|
||||
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
|
||||
@@ -344,16 +333,6 @@
|
||||
},
|
||||
uploadFilePromise(url) {
|
||||
return new Promise((resolve, reject) => {
|
||||
// const data = {
|
||||
// file: new File
|
||||
// }
|
||||
// let a = apiService.postImage(data).then(res => {
|
||||
// console.log(res)
|
||||
// })
|
||||
console.log('--345')
|
||||
console.log(url)
|
||||
console.log(this.token)
|
||||
console.log(apiService.uploadImgUrl)
|
||||
let a = uni.uploadFile({
|
||||
url: apiService.uploadImgUrl,
|
||||
filePath: url,
|
||||
@@ -364,8 +343,6 @@
|
||||
},
|
||||
success: (res) => {
|
||||
setTimeout(() => {
|
||||
console.log('---355')
|
||||
console.log(JSON.parse(res.data).data.url)
|
||||
resolve(JSON.parse(res.data).data.url)
|
||||
}, 1000)
|
||||
}
|
||||
@@ -373,7 +350,6 @@
|
||||
})
|
||||
},
|
||||
submitForm() {
|
||||
console.log(this.fileList1)
|
||||
if (!/^1[3456789]\d{9}$/.test(this.needsPublishForm.mobile)) {
|
||||
this.$toast.warn('请输入正确的手机号')
|
||||
return false
|
||||
@@ -404,10 +380,8 @@
|
||||
pub_time: null,
|
||||
...this.needsPublishForm
|
||||
}
|
||||
console.log(data)
|
||||
apiService.submitIdeasAndNeeds(data).then(res => {
|
||||
this.$toast.success('提交成功')
|
||||
console.log('esf=', res);
|
||||
if (res.data.code == 1) {
|
||||
uni.navigateTo({
|
||||
url: '../../packageMy/myRelease/myRelease?index=' + (this.tabCurrent + 1)
|
||||
@@ -422,7 +396,6 @@
|
||||
})
|
||||
},
|
||||
reOnLoad() {
|
||||
console.log('----------------true')
|
||||
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
|
||||
this.$toast.warn('登录失败请重试')
|
||||
this.isLoad = false
|
||||
@@ -436,19 +409,10 @@
|
||||
this.getFormData()
|
||||
},
|
||||
failToLoad() {
|
||||
console.log('----------------false')
|
||||
this.$toast.warn('登录失败请重试')
|
||||
uni.reLaunch({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
// uni.navigateBack({
|
||||
// success: () => {
|
||||
// let page = getCurrentPages().pop();
|
||||
// if (page) {
|
||||
// page.onLoad(page.options);//执行上个页面的方法
|
||||
// };
|
||||
// }
|
||||
// })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user