Merge pull request 'dengjie commit : 代码完善' (#48) from DJ into dev

Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/48
This commit is contained in:
odjbin
2023-01-09 10:07:02 +00:00
16 changed files with 198 additions and 173 deletions

View File

@@ -10,7 +10,7 @@
</u--image>
</view>
<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"
@click="changeAvatar()">
</u--image>
@@ -32,7 +32,7 @@
member: false,
showEdit: true,
avatar: '',
nickname: '',
nickname: '用户',
normal: '/static/my/wo_icon_pthy.png',
VIP: '/static/my/wo_icon_vip.png',
};
@@ -43,6 +43,9 @@
}
this.getUser()
},
options: {
styleIsolation: 'shared', // 解除样式隔离
},
methods: {
//修改头像
changeAvatar() {
@@ -63,3 +66,8 @@
}
}
</script>
<style>
/deep/.u-image {
margin-left: 8rpx;
}
</style>

View File

@@ -21,11 +21,14 @@
return {
model: {
userInfo: {
name: '姓名',
phone: '2342233',
name: '',
phone: '',
},
},
};
},
created() {
}
}
</script>

View File

@@ -30,11 +30,11 @@
</view>
</view>
<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>
<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 style="font-size: 24rpx;color: #A3A3A3;text-align: center;padding: 26rpx 0;"
v-if="type==1&&productList.length==0">
@@ -96,17 +96,13 @@
},
confirm() {
this.showM = false
console.log('删除成功');
// this.$apiServe.deleteHistoryOrCollection(this.productId).then(res => {
// console.log('删除历史记录或收藏', res);
// this.getHistoryOrCollection()
// }).finally(_ => {})
this.$apiServe.deleteHistoryOrCollection(this.productId).then(res => {
// console.log('删除历史记录或收藏', res.data);
this.productList.splice(this.productId, 1)
}).finally(_ => {})
},
cancel() {
this.showM = false
},
close() {
this.showM = false
}
}
}

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);
}).finally(_ => {})
// 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
})
}
}
}

View File

@@ -9,7 +9,7 @@
export default {
data() {
return {
cjsShow: true,
cjsShow: true
}
},
methods: {

View File

@@ -46,12 +46,16 @@
//获取认证厂家详情
getCertifiedCjDetail() {
this.$apiServe.getCertifiedCjDetail(this.id).then(res => {
// console.log('认证厂家详情页', res.data.data)
// console.log('认证厂家详情页', res.data)
if (res.data.data) {
let data = res.data.data
data.images = data.images.split(';')
this.detailList = data
} else {
this.$toast.warn('没有更多详情了')
}
}).finally(_ => {})
},
}
}
}
</script>

View File

@@ -37,10 +37,13 @@
getNewsDetail() {
this.$apiServe.getNewsDetail(this.id).then(res => {
// console.log('新闻详情页', res.data.data)
if (res.data.data) {
let detail = res.data.data
detail.pub_time = dateFormatXwDetail(detail.pub_time)
this.detailList = res.data.data
} else {
this.$toast.warn('没有更多详情了')
}
}).finally(_ => {})
},
}

View File

@@ -64,7 +64,7 @@
</view>
<scroll-view scroll-y class="goods-list" @scrolltolower="reachGoodsBottom">
<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="image">
<image :src="item1.imageF" mode="scaleToFill"
@@ -225,6 +225,12 @@
})
},
methods: {
//点击goodsItem跳转到详情页
toDetailPage(item1) {
uni.navigateTo({
url: '/pages/detail/productsDetail/productsDetail?id=' + item1.id
})
},
goSearch(param) {
this.queryParam = param
const index = this.recentRecordList.findIndex(item => {
@@ -311,7 +317,8 @@
if (selectedCategoryId && selectedCategoryId === item.id) {
item.active = true
this.selectedCategory = index
} else if (selectedCategoryId === null && this.selectedCategory && this.selectedCategory === index) {
} else if (selectedCategoryId === null && this.selectedCategory && this
.selectedCategory === index) {
item.active = true
active = true
} else if (selectedCategoryId === null && !this.selectedCategory && !index) {

View File

@@ -56,7 +56,6 @@
</view>
<u-parse :content="detailList.desc" @preview="preview" @navigate="navigate"></u-parse>
</view>
</view>
</template>
@@ -83,16 +82,20 @@
//获取详情信息
getProductDetail() {
this.$apiServe.getProductDetail(this.id).then(res => {
console.log('详情页', res.data.data)
// console.log('产品详情页', res.data.data)
if (res.data.data.thumb) {
this.isThumb = true
}
if (res.data.data) {
let detail = res.data.data
detail.pub_time = dateFormatDetail(detail.pub_time)
let tag = detail.tags
this.tagsArray = tag.split(',')
detail.tags = this.tagsArray
this.detailList = res.data.data
} else {
this.$toast.warn('没有更多详情了')
}
}).finally(_ => {})
},
//收藏按钮

View File

@@ -13,7 +13,8 @@
<!-- 分类模块 -->
<view class="classify">
<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>
<!-- <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>
</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>
<u-tabs :list="tabList" lineColor="#15CA65" scrollable="false"
@@ -49,7 +45,6 @@
import {
serverHost
} from '@/service/request.js'
import loginVue from '../my/login/login.vue'
export default {
data() {
return {
@@ -80,7 +75,6 @@
this.getCategories()
this.getBanner()
this.getImgUrl()
this.getToken()
this.imgUrl = uni.getStorageSync('img_url')
},
methods: {
@@ -114,42 +108,6 @@
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() {
this.$apiServe.getCategories().then(res => {
@@ -178,6 +136,7 @@
url: '../../packageSearch/goods-category-search/category-index?categoryId=' + id
})
},
//获取图片url
getImgUrl() {
this.$apiServe.getImgUrl().then(res => {
try {

View File

@@ -22,10 +22,10 @@
@click="showModal()">
</u-cell>
</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">
<view>
<text>{{phone}}</text>
<view>{{phone}}</view>
<text>是否拨打客服电话</text>
</view>
</u-modal>
@@ -101,6 +101,10 @@
</script>
<style lang="scss">
.u-navbar__content__left {
display: none !important;
}
.table {
background-color: #fff;
margin-top: 50rpx;

View File

@@ -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
@@ -250,6 +272,13 @@ const apiService = {
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) {
const url = `/center/addfav/?pid=${pid}`