dengjie commit : 代码完善
This commit is contained in:
@@ -4,20 +4,21 @@
|
||||
<u-tabs :list="tabsList" :scrollable="false" lineColor="#0A994A" color="#969696"
|
||||
activeStyle="color:#15CA65;font-weight: bold;" :current="tabCurrent" @change="tabChange"></u-tabs>
|
||||
</view>
|
||||
<view v-if="tabCurrent == 0" style="background-color: #fff;">
|
||||
<view style="background-color: #fff;">
|
||||
<view v-for="(item,index) in needsList" :key="index" class="my_line"
|
||||
style="padding: 24rpx 19rpx;border-bottom: 1px solid #EEEEEE;">
|
||||
<text class="needs_text">{{item.needsText}}</text>
|
||||
<text v-if="tabCurrent == 0" class="needs_text">{{item.desc}}</text>
|
||||
<text v-if="tabCurrent == 1" class="needs_text">{{item.pname}}</text>
|
||||
<view class="time_line">
|
||||
<view class="release_time">
|
||||
<text>{{item.time}}</text>
|
||||
<text>{{item.pub_time}}</text>
|
||||
</view>
|
||||
<view style="display: flex;">
|
||||
<view class="btn" @click="editNeeds()">
|
||||
<view class="btn" @click="editIdeasAndNeeds(item)">
|
||||
<u-icon name="edit-pen" color="#15CA65" size="20"></u-icon>
|
||||
<text class="btn_text">修改</text>
|
||||
</view>
|
||||
<view class="btn" @click="showModal()">
|
||||
<view class="btn" @click="deleteIdeasAndNeeds(item)">
|
||||
<u-icon name="trash" color="#15CA65" size="20"></u-icon>
|
||||
<text class="btn_text">删除</text>
|
||||
</view>
|
||||
@@ -25,64 +26,43 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-modal :show="showM" :content="content" showCancelButton closeOnClickOverlay @confirm="confirm"
|
||||
@cancel="cancel" @close="close">
|
||||
<u-modal :show="showM" :content="content" showCancelButton closeOnClickOverlay="false" @confirm="confirm"
|
||||
@cancel="cancel">
|
||||
</u-modal>
|
||||
<view v-if="tabCurrent == 1" style="background-color: #fff;">
|
||||
<view v-for="(item,index) in ideasList" :key="index" class="my_line"
|
||||
style="padding: 24rpx 19rpx; border-bottom: 1px solid #EEEEEE;">
|
||||
<text class="needs_text">{{item.needsText}}</text>
|
||||
<view class="time_line">
|
||||
<view class="release_time">
|
||||
<text>{{item.time}}</text>
|
||||
</view>
|
||||
<view style="display: flex;">
|
||||
<view class="btn" @click="editIdeas()">
|
||||
<u-icon name="edit-pen" color="#15CA65" size="20"></u-icon>
|
||||
<text class="btn_text">修改</text>
|
||||
</view>
|
||||
<view class="btn" @click="showModal()">
|
||||
<u-icon name="trash" color="#15CA65" size="20"></u-icon>
|
||||
<text class="btn_text">删除</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
dateFormatXwDetail
|
||||
} from '../../utills/date.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
id: '',
|
||||
showM: false,
|
||||
content: '您确定删除吗?',
|
||||
tabCurrent: 0,
|
||||
type: '',
|
||||
desc: '',
|
||||
pname: '',
|
||||
pub_time: '',
|
||||
tabsList: [{
|
||||
name: '需求发布'
|
||||
}, {
|
||||
name: '创意发布'
|
||||
}],
|
||||
|
||||
needsList: [{
|
||||
needsText: '需求描述需求描述需求描述需求描述需求描述需求描述需求描述需求描述需求描述描述需求描述描...',
|
||||
time: '2022-12-03 09:59',
|
||||
id: 1,
|
||||
desc: '需求描述需求描述需求描述需求描述需求描述需求描述需求描述需求描述需求描述描述需求描述描...',
|
||||
pname: '产品名称产品名称产品名称',
|
||||
pub_time: '2022-12-03 09:59',
|
||||
}, {
|
||||
needsText: '需求描述需求描述需求描述需求描述需求描述需求描述需求描述需求描述需求描述描述需求描述描...',
|
||||
time: '2022-12-03 09:59',
|
||||
}, ],
|
||||
ideasList: [{
|
||||
needsText: '产品名称产品名称产品名称',
|
||||
time: '2022-12-03 09:59',
|
||||
},
|
||||
{
|
||||
needsText: '产品名称产品名称产品名称',
|
||||
time: '2022-12-03 09:59',
|
||||
},
|
||||
]
|
||||
|
||||
id: 2,
|
||||
desc: '需求描述需求描述需求描述需求描述需求描述需求描述需求描述需求描述需求描述描述需求描述描...',
|
||||
pname: '产品名称产品名称产品名称',
|
||||
pub_time: '2022-12-03 09:59',
|
||||
}]
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
@@ -98,6 +78,11 @@
|
||||
getIdeasAndNeeds() {
|
||||
this.$apiServe.getIdeasAndNeeds(this.type).then(res => {
|
||||
console.log('获取创意发布&需求发布', res.data);
|
||||
let data = res.data.data
|
||||
for (const item of data) {
|
||||
item.pub_time = dateFormatXwDetail(pub_time)
|
||||
this.id = item.id
|
||||
}
|
||||
// this.productList = data
|
||||
}).finally(_ => {
|
||||
|
||||
@@ -107,32 +92,28 @@
|
||||
this.tabCurrent = data.index
|
||||
this.getIdeasAndNeeds()
|
||||
},
|
||||
//删除按钮
|
||||
showModal() {
|
||||
//修改我的需求或创意
|
||||
editIdeasAndNeeds(item) {
|
||||
uni.reLaunch({
|
||||
url: '/pages/ideasAndNeeds/ideasAndNeeds?item=' + JSON.stringify(item)
|
||||
})
|
||||
},
|
||||
//删除我的需求或创意
|
||||
deleteIdeasAndNeeds(item) {
|
||||
this.showM = true
|
||||
},
|
||||
//删除确认按钮
|
||||
confirm() {
|
||||
this.showM = false
|
||||
// this.$apiServe.deleteIdeasAndNeeds(this.id).then(res => {
|
||||
// console.log('删除发布', res.data);
|
||||
// // this.needsList.splice(this.needsList.id, 1)
|
||||
// }).finally(_ => {
|
||||
|
||||
// })
|
||||
},
|
||||
cancel() {
|
||||
this.showM = false
|
||||
},
|
||||
close() {
|
||||
this.showM = false
|
||||
},
|
||||
//修改我的需求
|
||||
editNeeds() {
|
||||
console.log('修改需求');
|
||||
uni.reLaunch({
|
||||
url: '/pages/ideasAndNeeds/ideasAndNeeds?index=' + 0
|
||||
})
|
||||
},
|
||||
//修改我的创意
|
||||
editIdeas() {
|
||||
console.log('修改创意');
|
||||
uni.reLaunch({
|
||||
url: '/pages/ideasAndNeeds/ideasAndNeeds?index=' + 1
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user