dengjie commit : 代码完善

This commit is contained in:
clay
2023-01-09 18:03:51 +08:00
parent 9c0477da5c
commit c906a7d33a
16 changed files with 198 additions and 173 deletions

View File

@@ -2,6 +2,9 @@
<view>
<myForm ref="nameAndphone"></myForm>
<u-button type="success" text="确定" color="#0EBB5B" @click="handleSureClick()"></u-button>
<u-modal :show="showM" closeOnClickOverlay="false" confirmText="确定" @confirm="confirm">
<rich-text :nodes="content"></rich-text>
</u-modal>
</view>
</template>
@@ -11,23 +14,36 @@
return {
name: '',
phone: '',
showM: false,
content: `您的申请已提交<br>
请静待人工审核`,
}
},
onLoad() {
this.name = this.$refs.nameAndphone.model.userInfo.name
this.phone = this.$refs.nameAndphone.model.userInfo.phone
},
methods: {
handleSureClick() {
let name = this.$refs.nameAndphone.model.userInfo.name
let phone = this.$refs.nameAndphone.model.userInfo.phone
this.$apiServe.bindComponyAndUpdate({
uid: 1,
type: 1,
companyPhone: this.phone,
companyName: this.name
companyName: name,
companyPhone: phone
}).then(res => {
// console.log('绑定公司', res);
// console.log('绑定公司', res.data);
if (res.data.code == 20003) {
this.showM = true
} else if (res.data.code == 20005) {
this.$toast.warn('请完善数据')
}
}).finally(_ => {})
},
confirm() {
this.showM = false
// uni.switchTab({
// url: '/pages/my/my'
// })
}
}
}
</script>
@@ -40,4 +56,8 @@
border-radius: 20rpx !important;
margin-top: 168rpx;
}
.u-modal__button-group__wrapper--hover {
background: #0EBB5B !important;
}
</style>

View File

@@ -10,6 +10,9 @@
return {
type: ''
}
},
methods: {
}
}
</script>

View File

@@ -9,8 +9,8 @@
<view class="commitment">
{{commitment}}
</view>
<u-button type="success" text="升级VIP" color="#0EBB5B" @click="showModal()"></u-button>
<u-modal :show="showM" closeOnClickOverlay confirmText="确定" @confirm="confirm" @close="close">
<u-button type="success" text="升级VIP" color="#0EBB5B" @click="handleSureClick()"></u-button>
<u-modal :show="showM" closeOnClickOverlay="false" confirmText="确定" @confirm="confirm">
<rich-text :nodes="content"></rich-text>
</u-modal>
</view>
@@ -30,32 +30,32 @@
commitment: '承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置'
}
},
onLoad() {
this.name = this.$refs.nameAndphone.model.userInfo.name
this.phone = this.$refs.nameAndphone.model.userInfo.phone
},
methods: {
// 联系客服模态框
showModal() {
this.showM = true
},
confirm() {
this.showM = false
handleSureClick() {
let name = this.$refs.nameAndphone.model.userInfo.name
let phone = this.$refs.nameAndphone.model.userInfo.phone
this.$apiServe.bindComponyAndUpdate({
uid: 1,
type: 2,
companyPhone: this.phone,
companyName: this.name
companyName: name,
companyPhone: phone
}).then(res => {
console.log('升级VIP', res);
console.log('升级VIP', res.data);
if (res.data.code == 20003) {
this.showM = true
} else if (res.data.code == 20005) {
this.$toast.warn('请完善数据')
}
}).finally(_ => {})
},
cancel() {
confirm() {
this.showM = false
},
close() {
this.showM = false
},
// uni.switchTab({
// url: '/pages/my/my'
// })
}
}
}
</script>
@@ -81,4 +81,8 @@
padding: 43rpx 104rpx !important;
text-indent: 14rpx;
}
.u-modal__button-group__wrapper--hover {
background: #0EBB5B !important;
}
</style>

View File

@@ -8,8 +8,9 @@
export default {
data() {
return {
type: '',
type: ''
}
}
},
methods: {}
}
</script>

View File

@@ -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
})
}
}
}