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