dengjie commit : 代码完善
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
</u--image>
|
</u--image>
|
||||||
</view>
|
</view>
|
||||||
<view style="display: flex;align-items: center;">
|
<view style="display: flex;align-items: center;">
|
||||||
<text style="margin-right: 8rpx;">{{nickname}}</text>
|
<text>{{nickname}}</text>
|
||||||
<u--image v-if="showEdit==true" src="/static/my/wd_icon_bj.png" width="22rpx" height="22rpx"
|
<u--image v-if="showEdit==true" src="/static/my/wd_icon_bj.png" width="22rpx" height="22rpx"
|
||||||
@click="changeAvatar()">
|
@click="changeAvatar()">
|
||||||
</u--image>
|
</u--image>
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
member: false,
|
member: false,
|
||||||
showEdit: true,
|
showEdit: true,
|
||||||
avatar: '',
|
avatar: '',
|
||||||
nickname: '',
|
nickname: '用户',
|
||||||
normal: '/static/my/wo_icon_pthy.png',
|
normal: '/static/my/wo_icon_pthy.png',
|
||||||
VIP: '/static/my/wo_icon_vip.png',
|
VIP: '/static/my/wo_icon_vip.png',
|
||||||
};
|
};
|
||||||
@@ -43,6 +43,9 @@
|
|||||||
}
|
}
|
||||||
this.getUser()
|
this.getUser()
|
||||||
},
|
},
|
||||||
|
options: {
|
||||||
|
styleIsolation: 'shared', // 解除样式隔离
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//修改头像
|
//修改头像
|
||||||
changeAvatar() {
|
changeAvatar() {
|
||||||
@@ -63,3 +66,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
<style>
|
||||||
|
/deep/.u-image {
|
||||||
|
margin-left: 8rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -21,11 +21,14 @@
|
|||||||
return {
|
return {
|
||||||
model: {
|
model: {
|
||||||
userInfo: {
|
userInfo: {
|
||||||
name: '姓名',
|
name: '',
|
||||||
phone: '2342233',
|
phone: '',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -30,11 +30,11 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<u-button v-if="type==1" type="success" text="移除" color="#0EBB5B" @click="showModal()"></u-button>
|
<u-button v-if="type==1" type="success" text="移除" color="#0EBB5B" @click="showModal()"></u-button>
|
||||||
<u-button v-if="type==2" type="success" text="取消收藏" color="#0EBB5B"></u-button>
|
<u-button v-if="type==2" type="success" text="取消收藏" color="#0EBB5B" @click="showModal()"></u-button>
|
||||||
</u-grid-item>
|
</u-grid-item>
|
||||||
</u-grid>
|
</u-grid>
|
||||||
<u-modal :show="showM" :content="content" showCancelButton closeOnClickOverlay @confirm="confirm"
|
<u-modal :show="showM" :content="content" showCancelButton closeOnClickOverlay="false" @confirm="confirm"
|
||||||
@cancel="cancel" @close="close">
|
@cancel="cancel">
|
||||||
</u-modal>
|
</u-modal>
|
||||||
<view style="font-size: 24rpx;color: #A3A3A3;text-align: center;padding: 26rpx 0;"
|
<view style="font-size: 24rpx;color: #A3A3A3;text-align: center;padding: 26rpx 0;"
|
||||||
v-if="type==1&&productList.length==0">
|
v-if="type==1&&productList.length==0">
|
||||||
@@ -96,17 +96,13 @@
|
|||||||
},
|
},
|
||||||
confirm() {
|
confirm() {
|
||||||
this.showM = false
|
this.showM = false
|
||||||
console.log('删除成功');
|
this.$apiServe.deleteHistoryOrCollection(this.productId).then(res => {
|
||||||
// this.$apiServe.deleteHistoryOrCollection(this.productId).then(res => {
|
// console.log('删除历史记录或收藏', res.data);
|
||||||
// console.log('删除历史记录或收藏', res);
|
this.productList.splice(this.productId, 1)
|
||||||
// this.getHistoryOrCollection()
|
}).finally(_ => {})
|
||||||
// }).finally(_ => {})
|
|
||||||
},
|
},
|
||||||
cancel() {
|
cancel() {
|
||||||
this.showM = false
|
this.showM = false
|
||||||
},
|
|
||||||
close() {
|
|
||||||
this.showM = false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,9 @@
|
|||||||
<view>
|
<view>
|
||||||
<myForm ref="nameAndphone"></myForm>
|
<myForm ref="nameAndphone"></myForm>
|
||||||
<u-button type="success" text="确定" color="#0EBB5B" @click="handleSureClick()"></u-button>
|
<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>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -11,23 +14,36 @@
|
|||||||
return {
|
return {
|
||||||
name: '',
|
name: '',
|
||||||
phone: '',
|
phone: '',
|
||||||
|
showM: false,
|
||||||
|
content: `您的申请已提交<br>
|
||||||
|
请静待人工审核`,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
|
||||||
this.name = this.$refs.nameAndphone.model.userInfo.name
|
|
||||||
this.phone = this.$refs.nameAndphone.model.userInfo.phone
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
handleSureClick() {
|
handleSureClick() {
|
||||||
|
let name = this.$refs.nameAndphone.model.userInfo.name
|
||||||
|
let phone = this.$refs.nameAndphone.model.userInfo.phone
|
||||||
this.$apiServe.bindComponyAndUpdate({
|
this.$apiServe.bindComponyAndUpdate({
|
||||||
uid: 1,
|
uid: 1,
|
||||||
type: 1,
|
type: 1,
|
||||||
companyPhone: this.phone,
|
companyName: name,
|
||||||
companyName: this.name
|
companyPhone: phone
|
||||||
}).then(res => {
|
}).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(_ => {})
|
}).finally(_ => {})
|
||||||
|
},
|
||||||
|
confirm() {
|
||||||
|
this.showM = false
|
||||||
|
// uni.switchTab({
|
||||||
|
// url: '/pages/my/my'
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -40,4 +56,8 @@
|
|||||||
border-radius: 20rpx !important;
|
border-radius: 20rpx !important;
|
||||||
margin-top: 168rpx;
|
margin-top: 168rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.u-modal__button-group__wrapper--hover {
|
||||||
|
background: #0EBB5B !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -10,6 +10,9 @@
|
|||||||
return {
|
return {
|
||||||
type: ''
|
type: ''
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
<view class="commitment">
|
<view class="commitment">
|
||||||
{{commitment}}
|
{{commitment}}
|
||||||
</view>
|
</view>
|
||||||
<u-button type="success" text="升级VIP" color="#0EBB5B" @click="showModal()"></u-button>
|
<u-button type="success" text="升级VIP" color="#0EBB5B" @click="handleSureClick()"></u-button>
|
||||||
<u-modal :show="showM" closeOnClickOverlay confirmText="确定" @confirm="confirm" @close="close">
|
<u-modal :show="showM" closeOnClickOverlay="false" confirmText="确定" @confirm="confirm">
|
||||||
<rich-text :nodes="content"></rich-text>
|
<rich-text :nodes="content"></rich-text>
|
||||||
</u-modal>
|
</u-modal>
|
||||||
</view>
|
</view>
|
||||||
@@ -30,32 +30,32 @@
|
|||||||
commitment: '承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置'
|
commitment: '承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
|
||||||
this.name = this.$refs.nameAndphone.model.userInfo.name
|
|
||||||
this.phone = this.$refs.nameAndphone.model.userInfo.phone
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
// 联系客服模态框
|
// 联系客服模态框
|
||||||
showModal() {
|
handleSureClick() {
|
||||||
this.showM = true
|
let name = this.$refs.nameAndphone.model.userInfo.name
|
||||||
},
|
let phone = this.$refs.nameAndphone.model.userInfo.phone
|
||||||
confirm() {
|
|
||||||
this.showM = false
|
|
||||||
this.$apiServe.bindComponyAndUpdate({
|
this.$apiServe.bindComponyAndUpdate({
|
||||||
uid: 1,
|
uid: 1,
|
||||||
type: 2,
|
type: 2,
|
||||||
companyPhone: this.phone,
|
companyName: name,
|
||||||
companyName: this.name
|
companyPhone: phone
|
||||||
}).then(res => {
|
}).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(_ => {})
|
}).finally(_ => {})
|
||||||
},
|
},
|
||||||
cancel() {
|
confirm() {
|
||||||
this.showM = false
|
this.showM = false
|
||||||
},
|
// uni.switchTab({
|
||||||
close() {
|
// url: '/pages/my/my'
|
||||||
this.showM = false
|
// })
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -81,4 +81,8 @@
|
|||||||
padding: 43rpx 104rpx !important;
|
padding: 43rpx 104rpx !important;
|
||||||
text-indent: 14rpx;
|
text-indent: 14rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.u-modal__button-group__wrapper--hover {
|
||||||
|
background: #0EBB5B !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -8,8 +8,9 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
type: '',
|
type: ''
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
methods: {}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -4,20 +4,21 @@
|
|||||||
<u-tabs :list="tabsList" :scrollable="false" lineColor="#0A994A" color="#969696"
|
<u-tabs :list="tabsList" :scrollable="false" lineColor="#0A994A" color="#969696"
|
||||||
activeStyle="color:#15CA65;font-weight: bold;" :current="tabCurrent" @change="tabChange"></u-tabs>
|
activeStyle="color:#15CA65;font-weight: bold;" :current="tabCurrent" @change="tabChange"></u-tabs>
|
||||||
</view>
|
</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"
|
<view v-for="(item,index) in needsList" :key="index" class="my_line"
|
||||||
style="padding: 24rpx 19rpx;border-bottom: 1px solid #EEEEEE;">
|
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="time_line">
|
||||||
<view class="release_time">
|
<view class="release_time">
|
||||||
<text>{{item.time}}</text>
|
<text>{{item.pub_time}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view style="display: flex;">
|
<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>
|
<u-icon name="edit-pen" color="#15CA65" size="20"></u-icon>
|
||||||
<text class="btn_text">修改</text>
|
<text class="btn_text">修改</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="btn" @click="showModal()">
|
<view class="btn" @click="deleteIdeasAndNeeds(item)">
|
||||||
<u-icon name="trash" color="#15CA65" size="20"></u-icon>
|
<u-icon name="trash" color="#15CA65" size="20"></u-icon>
|
||||||
<text class="btn_text">删除</text>
|
<text class="btn_text">删除</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -25,64 +26,43 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<u-modal :show="showM" :content="content" showCancelButton closeOnClickOverlay @confirm="confirm"
|
<u-modal :show="showM" :content="content" showCancelButton closeOnClickOverlay="false" @confirm="confirm"
|
||||||
@cancel="cancel" @close="close">
|
@cancel="cancel">
|
||||||
</u-modal>
|
</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>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {
|
||||||
|
dateFormatXwDetail
|
||||||
|
} from '../../utills/date.js'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
id: '',
|
||||||
showM: false,
|
showM: false,
|
||||||
content: '您确定删除吗?',
|
content: '您确定删除吗?',
|
||||||
tabCurrent: 0,
|
tabCurrent: 0,
|
||||||
type: '',
|
type: '',
|
||||||
|
desc: '',
|
||||||
|
pname: '',
|
||||||
|
pub_time: '',
|
||||||
tabsList: [{
|
tabsList: [{
|
||||||
name: '需求发布'
|
name: '需求发布'
|
||||||
}, {
|
}, {
|
||||||
name: '创意发布'
|
name: '创意发布'
|
||||||
}],
|
}],
|
||||||
|
|
||||||
needsList: [{
|
needsList: [{
|
||||||
needsText: '需求描述需求描述需求描述需求描述需求描述需求描述需求描述需求描述需求描述描述需求描述描...',
|
id: 1,
|
||||||
time: '2022-12-03 09:59',
|
desc: '需求描述需求描述需求描述需求描述需求描述需求描述需求描述需求描述需求描述描述需求描述描...',
|
||||||
|
pname: '产品名称产品名称产品名称',
|
||||||
|
pub_time: '2022-12-03 09:59',
|
||||||
}, {
|
}, {
|
||||||
needsText: '需求描述需求描述需求描述需求描述需求描述需求描述需求描述需求描述需求描述描述需求描述描...',
|
id: 2,
|
||||||
time: '2022-12-03 09:59',
|
desc: '需求描述需求描述需求描述需求描述需求描述需求描述需求描述需求描述需求描述描述需求描述描...',
|
||||||
}, ],
|
pname: '产品名称产品名称产品名称',
|
||||||
ideasList: [{
|
pub_time: '2022-12-03 09:59',
|
||||||
needsText: '产品名称产品名称产品名称',
|
}]
|
||||||
time: '2022-12-03 09:59',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
needsText: '产品名称产品名称产品名称',
|
|
||||||
time: '2022-12-03 09:59',
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
@@ -98,6 +78,11 @@
|
|||||||
getIdeasAndNeeds() {
|
getIdeasAndNeeds() {
|
||||||
this.$apiServe.getIdeasAndNeeds(this.type).then(res => {
|
this.$apiServe.getIdeasAndNeeds(this.type).then(res => {
|
||||||
console.log('获取创意发布&需求发布', res.data);
|
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
|
// this.productList = data
|
||||||
}).finally(_ => {
|
}).finally(_ => {
|
||||||
|
|
||||||
@@ -107,32 +92,28 @@
|
|||||||
this.tabCurrent = data.index
|
this.tabCurrent = data.index
|
||||||
this.getIdeasAndNeeds()
|
this.getIdeasAndNeeds()
|
||||||
},
|
},
|
||||||
//删除按钮
|
//修改我的需求或创意
|
||||||
showModal() {
|
editIdeasAndNeeds(item) {
|
||||||
|
uni.reLaunch({
|
||||||
|
url: '/pages/ideasAndNeeds/ideasAndNeeds?item=' + JSON.stringify(item)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//删除我的需求或创意
|
||||||
|
deleteIdeasAndNeeds(item) {
|
||||||
this.showM = true
|
this.showM = true
|
||||||
},
|
},
|
||||||
|
//删除确认按钮
|
||||||
confirm() {
|
confirm() {
|
||||||
|
this.showM = false
|
||||||
|
// this.$apiServe.deleteIdeasAndNeeds(this.id).then(res => {
|
||||||
|
// console.log('删除发布', res.data);
|
||||||
|
// // this.needsList.splice(this.needsList.id, 1)
|
||||||
|
// }).finally(_ => {
|
||||||
|
|
||||||
|
// })
|
||||||
},
|
},
|
||||||
cancel() {
|
cancel() {
|
||||||
this.showM = false
|
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
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
cjsShow: true,
|
cjsShow: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -46,12 +46,16 @@
|
|||||||
//获取认证厂家详情
|
//获取认证厂家详情
|
||||||
getCertifiedCjDetail() {
|
getCertifiedCjDetail() {
|
||||||
this.$apiServe.getCertifiedCjDetail(this.id).then(res => {
|
this.$apiServe.getCertifiedCjDetail(this.id).then(res => {
|
||||||
// console.log('认证厂家详情页', res.data.data)
|
// console.log('认证厂家详情页', res.data)
|
||||||
let data = res.data.data
|
if (res.data.data) {
|
||||||
data.images = data.images.split(';')
|
let data = res.data.data
|
||||||
this.detailList = data
|
data.images = data.images.split(';')
|
||||||
|
this.detailList = data
|
||||||
|
} else {
|
||||||
|
this.$toast.warn('没有更多详情了')
|
||||||
|
}
|
||||||
}).finally(_ => {})
|
}).finally(_ => {})
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -37,10 +37,13 @@
|
|||||||
getNewsDetail() {
|
getNewsDetail() {
|
||||||
this.$apiServe.getNewsDetail(this.id).then(res => {
|
this.$apiServe.getNewsDetail(this.id).then(res => {
|
||||||
// console.log('新闻详情页', res.data.data)
|
// console.log('新闻详情页', res.data.data)
|
||||||
let detail = res.data.data
|
if (res.data.data) {
|
||||||
detail.pub_time = dateFormatXwDetail(detail.pub_time)
|
let detail = res.data.data
|
||||||
this.detailList = res.data.data
|
detail.pub_time = dateFormatXwDetail(detail.pub_time)
|
||||||
|
this.detailList = res.data.data
|
||||||
|
} else {
|
||||||
|
this.$toast.warn('没有更多详情了')
|
||||||
|
}
|
||||||
}).finally(_ => {})
|
}).finally(_ => {})
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,7 +64,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<scroll-view scroll-y class="goods-list" @scrolltolower="reachGoodsBottom">
|
<scroll-view scroll-y class="goods-list" @scrolltolower="reachGoodsBottom">
|
||||||
<block v-for="(item1,index1) in goodsList" :key="index1">
|
<block v-for="(item1,index1) in goodsList" :key="index1">
|
||||||
<view class="goods-item">
|
<view class="goods-item" @click="toDetailPage(item1)">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<view class="image">
|
<view class="image">
|
||||||
<image :src="item1.imageF" mode="scaleToFill"
|
<image :src="item1.imageF" mode="scaleToFill"
|
||||||
@@ -225,6 +225,12 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
//点击goodsItem跳转到详情页
|
||||||
|
toDetailPage(item1) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/detail/productsDetail/productsDetail?id=' + item1.id
|
||||||
|
})
|
||||||
|
},
|
||||||
goSearch(param) {
|
goSearch(param) {
|
||||||
this.queryParam = param
|
this.queryParam = param
|
||||||
const index = this.recentRecordList.findIndex(item => {
|
const index = this.recentRecordList.findIndex(item => {
|
||||||
@@ -308,10 +314,11 @@
|
|||||||
this.$apiServe.getCategories().then(res => {
|
this.$apiServe.getCategories().then(res => {
|
||||||
this.categoryList = res.data.data.map((item, index) => {
|
this.categoryList = res.data.data.map((item, index) => {
|
||||||
item.icon = this.imgUrl + item.icon
|
item.icon = this.imgUrl + item.icon
|
||||||
if(selectedCategoryId && selectedCategoryId === item.id) {
|
if (selectedCategoryId && selectedCategoryId === item.id) {
|
||||||
item.active = true
|
item.active = true
|
||||||
this.selectedCategory = index
|
this.selectedCategory = index
|
||||||
} else if (selectedCategoryId === null && this.selectedCategory && this.selectedCategory === index) {
|
} else if (selectedCategoryId === null && this.selectedCategory && this
|
||||||
|
.selectedCategory === index) {
|
||||||
item.active = true
|
item.active = true
|
||||||
active = true
|
active = true
|
||||||
} else if (selectedCategoryId === null && !this.selectedCategory && !index) {
|
} else if (selectedCategoryId === null && !this.selectedCategory && !index) {
|
||||||
|
|||||||
@@ -56,7 +56,6 @@
|
|||||||
</view>
|
</view>
|
||||||
<u-parse :content="detailList.desc" @preview="preview" @navigate="navigate"></u-parse>
|
<u-parse :content="detailList.desc" @preview="preview" @navigate="navigate"></u-parse>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -83,16 +82,20 @@
|
|||||||
//获取详情信息
|
//获取详情信息
|
||||||
getProductDetail() {
|
getProductDetail() {
|
||||||
this.$apiServe.getProductDetail(this.id).then(res => {
|
this.$apiServe.getProductDetail(this.id).then(res => {
|
||||||
console.log('详情页', res.data.data)
|
// console.log('产品详情页', res.data.data)
|
||||||
if (res.data.data.thumb) {
|
if (res.data.data.thumb) {
|
||||||
this.isThumb = true
|
this.isThumb = true
|
||||||
}
|
}
|
||||||
let detail = res.data.data
|
if (res.data.data) {
|
||||||
detail.pub_time = dateFormatDetail(detail.pub_time)
|
let detail = res.data.data
|
||||||
let tag = detail.tags
|
detail.pub_time = dateFormatDetail(detail.pub_time)
|
||||||
this.tagsArray = tag.split(',')
|
let tag = detail.tags
|
||||||
detail.tags = this.tagsArray
|
this.tagsArray = tag.split(',')
|
||||||
this.detailList = res.data.data
|
detail.tags = this.tagsArray
|
||||||
|
this.detailList = res.data.data
|
||||||
|
} else {
|
||||||
|
this.$toast.warn('没有更多详情了')
|
||||||
|
}
|
||||||
}).finally(_ => {})
|
}).finally(_ => {})
|
||||||
},
|
},
|
||||||
//收藏按钮
|
//收藏按钮
|
||||||
|
|||||||
@@ -13,7 +13,8 @@
|
|||||||
<!-- 分类模块 -->
|
<!-- 分类模块 -->
|
||||||
<view class="classify">
|
<view class="classify">
|
||||||
<u-grid :border="false" col="5">
|
<u-grid :border="false" col="5">
|
||||||
<u-grid-item v-for="(listItem,listIndex) in classifyList" :key="listIndex" @click="toClassify(listItem.id)">
|
<u-grid-item v-for="(listItem,listIndex) in classifyList" :key="listIndex"
|
||||||
|
@click="toClassify(listItem.id)">
|
||||||
<u--image :src="imgUrl+listItem.icon" width="86rpx" height="86rpx" :lazy-load="true">
|
<u--image :src="imgUrl+listItem.icon" width="86rpx" height="86rpx" :lazy-load="true">
|
||||||
</u--image>
|
</u--image>
|
||||||
<!-- <u-icon size="86rpx" :name="listItem.icon"></u-icon> -->
|
<!-- <u-icon size="86rpx" :name="listItem.icon"></u-icon> -->
|
||||||
@@ -26,11 +27,6 @@
|
|||||||
<u-swiper :list="swiperList" keyName="img" indicatorMode="line" radius="0" circular></u-swiper>
|
<u-swiper :list="swiperList" keyName="img" indicatorMode="line" radius="0" circular></u-swiper>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<!-- <view style="width: 100px; height: 100px; z-index: 999;">
|
|
||||||
<u-button type="primary" open-type="getPhoneNumber" size="medium" @getphonenumber="getphonenumber">
|
|
||||||
获取电话号码</u-button>
|
|
||||||
</view> -->
|
|
||||||
<!-- 选项卡: 上架时间和点赞量 -->
|
<!-- 选项卡: 上架时间和点赞量 -->
|
||||||
<view>
|
<view>
|
||||||
<u-tabs :list="tabList" lineColor="#15CA65" scrollable="false"
|
<u-tabs :list="tabList" lineColor="#15CA65" scrollable="false"
|
||||||
@@ -49,7 +45,6 @@
|
|||||||
import {
|
import {
|
||||||
serverHost
|
serverHost
|
||||||
} from '@/service/request.js'
|
} from '@/service/request.js'
|
||||||
import loginVue from '../my/login/login.vue'
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -80,7 +75,6 @@
|
|||||||
this.getCategories()
|
this.getCategories()
|
||||||
this.getBanner()
|
this.getBanner()
|
||||||
this.getImgUrl()
|
this.getImgUrl()
|
||||||
this.getToken()
|
|
||||||
this.imgUrl = uni.getStorageSync('img_url')
|
this.imgUrl = uni.getStorageSync('img_url')
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -114,42 +108,6 @@
|
|||||||
this.$refs.getProductsByTime.productList.push(...res.data.data)
|
this.$refs.getProductsByTime.productList.push(...res.data.data)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//获取token
|
|
||||||
getToken() {
|
|
||||||
var that = this
|
|
||||||
uni.login({
|
|
||||||
"provider": "weixin",
|
|
||||||
"onlyAuthorize": true, // 微信登录仅请求授权认证
|
|
||||||
success: function(event) {
|
|
||||||
const {
|
|
||||||
code
|
|
||||||
} = event
|
|
||||||
that.$apiServe.login({
|
|
||||||
code: code
|
|
||||||
}).then(res => {
|
|
||||||
var data = res.data.data
|
|
||||||
// console.log('登录code换取的信息', data);
|
|
||||||
uni.setStorageSync('token', data.token);
|
|
||||||
})
|
|
||||||
},
|
|
||||||
fail: function(err) {
|
|
||||||
// 登录授权失败
|
|
||||||
// err.code是错误码
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
//获取手机code
|
|
||||||
getphonenumber(e) {
|
|
||||||
let that = this
|
|
||||||
// const {
|
|
||||||
// code
|
|
||||||
// } = e.detail;
|
|
||||||
// console.log("手机code : ", code);
|
|
||||||
},
|
|
||||||
//获取子组件的getProducts方法返回数据的length,用于当length为0时取消发送请求
|
|
||||||
// getChild(e) {
|
|
||||||
// this.reachBottomLength = e
|
|
||||||
// },
|
|
||||||
//获取一级分类
|
//获取一级分类
|
||||||
getCategories() {
|
getCategories() {
|
||||||
this.$apiServe.getCategories().then(res => {
|
this.$apiServe.getCategories().then(res => {
|
||||||
@@ -178,6 +136,7 @@
|
|||||||
url: '../../packageSearch/goods-category-search/category-index?categoryId=' + id
|
url: '../../packageSearch/goods-category-search/category-index?categoryId=' + id
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
//获取图片url
|
||||||
getImgUrl() {
|
getImgUrl() {
|
||||||
this.$apiServe.getImgUrl().then(res => {
|
this.$apiServe.getImgUrl().then(res => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -22,10 +22,10 @@
|
|||||||
@click="showModal()">
|
@click="showModal()">
|
||||||
</u-cell>
|
</u-cell>
|
||||||
</u-cell-group>
|
</u-cell-group>
|
||||||
<u-modal :show="showM" showCancelButton closeOnClickOverlay confirmText="是" cancelText="否"
|
<u-modal :show="showM" showCancelButton closeOnClickOverlay="false" confirmText="是" cancelText="否"
|
||||||
@confirm="confirm" @cancel="cancel" @close="close">
|
@confirm="confirm" @cancel="cancel" @close="close">
|
||||||
<view>
|
<view>
|
||||||
<text>{{phone}}</text>
|
<view>{{phone}}</view>
|
||||||
<text>是否拨打客服电话</text>
|
<text>是否拨打客服电话</text>
|
||||||
</view>
|
</view>
|
||||||
</u-modal>
|
</u-modal>
|
||||||
@@ -101,6 +101,10 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
.u-navbar__content__left {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
.table {
|
.table {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
margin-top: 50rpx;
|
margin-top: 50rpx;
|
||||||
|
|||||||
@@ -115,6 +115,28 @@ const service = {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
delete(url, data, isLogin) {
|
||||||
|
const header = {}
|
||||||
|
header['token'] = uni.getStorageSync('token')
|
||||||
|
header['content-type'] = 'application/json'
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
uni.request({
|
||||||
|
method: 'delete',
|
||||||
|
url: serverHost + url,
|
||||||
|
data: data,
|
||||||
|
header: header,
|
||||||
|
success: res => {
|
||||||
|
resolve(res)
|
||||||
|
},
|
||||||
|
fail: err => {
|
||||||
|
// 调用接口失败
|
||||||
|
// toast.error(res.data.message)
|
||||||
|
uni.hideLoading()
|
||||||
|
reject(err)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const toastDuration = 1500
|
const toastDuration = 1500
|
||||||
@@ -250,6 +272,13 @@ const apiService = {
|
|||||||
resolve(service.get(url, type))
|
resolve(service.get(url, type))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
//删除创意发布&需求发布
|
||||||
|
deleteIdeasAndNeeds(id) {
|
||||||
|
const url = `/center/delreq/?id=${id}`
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
resolve(service.delete(url, id))
|
||||||
|
})
|
||||||
|
},
|
||||||
//收藏按钮
|
//收藏按钮
|
||||||
collect(pid) {
|
collect(pid) {
|
||||||
const url = `/center/addfav/?pid=${pid}`
|
const url = `/center/addfav/?pid=${pid}`
|
||||||
|
|||||||
Reference in New Issue
Block a user