Merge pull request 'dengjie' (#95) from dengjie into dev

Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/95
This commit is contained in:
odjbin
2023-02-24 10:01:08 +00:00
14 changed files with 91 additions and 94 deletions

View File

@@ -6,7 +6,7 @@
<view style="margin-top: 10rpx;margin-bottom: 4rpx;">
<u--image v-if="member=='2'" :src="normal" width="84rpx" height="30rpx">
</u--image>
<u--image v-if="member=='3'" :src="VIP" width="84rpx" height="30rpx">
<u--image v-if="member=='4'" :src="VIP" width="84rpx" height="30rpx">
</u--image>
</view>
<view style="display: flex;align-items: center;">
@@ -38,7 +38,7 @@
},
data() {
return {
member: false,
member: '',
showEdit: true,
avatar: '',
nickname: '用户',
@@ -67,7 +67,6 @@
//获取头像昵称和普通会员和VIP会员
getUser() {
this.$apiServe.getUser().then(res => {
console.log('个人信息==', res.data);
if (res.data.msg === "登录超时,请重新登录") {
this.isLoad = false
}
@@ -75,6 +74,8 @@
this.avatar = uni.getStorageSync('img_url') + data.avatar
this.nickname = data.nickname
this.member = data.member
uni.setStorageSync('member', data.member)
uni.setStorageSync('agreement', data.agreement)
uni.setStorageSync('com_name', data.com_name)
uni.setStorageSync('com_mobile', data.com_mobile)
}).finally(_ => {})

View File

@@ -12,13 +12,13 @@
</u-image>
<view class="img_tag">{{item.cate_name}}</view>
</view>
<view style="padding: 14rpx 22rpx;">
<view style="padding: 14rpx 24rpx 14rpx 16rpx;">
<view class="title_box">
<text class="title">{{item.name}}</text>
<u-tag :text="item.tags" type="warning" shape="circle"></u-tag>
</view>
<view class="product_desc">
{{item.desc}}
{{item.title}}
</view>
<view class="releaseDate">
<u-image src="/static/products/xp_icon_sjf.png" width="22rpx" height="22rpx"
@@ -66,7 +66,7 @@
styleIsolation: 'shared', // 解除样式隔离
},
created() {
this.imgUrl = uni.getStorageSync('img_url')
this.imgUrl = uni.getStorageSync('img_url')
this.getHistoryOrCollection()
},
methods: {

View File

@@ -11,7 +11,7 @@
</u-image>
<view class="img_tag">{{item.cate_name}}</view>
</view>
<view style="padding: 14rpx 22rpx;">
<view style="padding: 14rpx 24rpx 14rpx 16rpx;">
<view class="title_box">
<text class="title">{{item.name}}</text>
<u-tag :text="item.tags" type="warning" shape="circle"></u-tag>
@@ -53,7 +53,7 @@
// this.sortType = 2
// }
// })
this.imgUrl = uni.getStorageSync('img_url')
this.imgUrl = uni.getStorageSync('img_url')
this.getProductsByThumb()
},
methods: {

View File

@@ -11,7 +11,7 @@
</u-image>
<view class="img_tag">{{item.cate_name}}</view>
</view>
<view style="padding: 14rpx 22rpx;">
<view style="padding: 14rpx 24rpx 14rpx 16rpx;">
<view class="title_box">
<text class="title">{{item.name}}</text>
<u-tag :text="item.tags" type="warning" shape="circle"></u-tag>

View File

@@ -7,18 +7,14 @@
<u-icon name="arrow-left" color="#fff;" />
</view>
<view class="search-input">
<u-input v-if="!readOnly"
v-model="queryParamF"
:focus="true"
placeholder="搜索优质产品"
prefixIcon="search"
: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-input v-if="!readOnly" v-model="queryParamF" :focus="true" placeholder="搜索优质产品"
prefixIcon="search" :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>
<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 class="search-btn" @click="goSearch">搜索</view>
</view>
@@ -65,10 +61,10 @@
},
methods: {
goSearch(value) {
if(!this.queryParamF && value) {
if (!this.queryParamF && value) {
this.queryParamF = value
}
if(this.readOnly) {
if (this.readOnly) {
this.$emit('navigate')
return
}
@@ -94,12 +90,14 @@
margin: 10rpx 10rpx;
display: flex;
align-items: center;
.top-left {
width: calc(100% - 200rpx);
display: flex;
justify-content: space-around;
align-items: center;
height: 100%;
.search-input {
display: flex;
border: 2rpx solid #fff;
@@ -107,6 +105,7 @@
border-radius: 50rpx;
height: 100%;
margin-left: 10rpx;
.search-btn {
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;

View File

@@ -3,13 +3,14 @@
<u-navbar :autoBack="true" title="会员中心"></u-navbar>
<u--image src="/static/my/wo_icon_hyzxbj.png" width="750rpx" height="349rpx" :lazy-load="true">
</u--image>
<myAvatar :center="show"></myAvatar>
<myAvatar ref="myavatar" :center="show"></myAvatar>
<view style="height: 56rpx;"></view>
<myForm ref="nameAndphone"></myForm>
<view class="commitment">
{{commitment}}
</view>
<u-button type="success" text="升级VIP" color="#0EBB5B" @click="handleSureClick()"></u-button>
<u-button type="success" :text="btnText" color="#0EBB5B" @click="handleSureClick()" :disabled="btnDisabled">
</u-button>
<u-modal :show="showM" closeOnClickOverlay="false" confirmText="确定" @confirm="confirm">
<rich-text :nodes="content"></rich-text>
</u-modal>
@@ -23,17 +24,28 @@
name: '',
phone: '',
showM: false,
btnText: '升级VIP',
btnDisabled: false,
//部分产品无权限访问需升级VIP
needAsk: '',
//会员中心的用户名旁边不显示edit图标
show: false,
content: `请保持手机畅通<br>
客服会及时联系您`,
commitment: '承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置'
commitment: ''
}
},
onLoad(option) {
console.log('ask', option.ask);
if (uni.getStorageSync('member') == 2) {
this.btnText = '升级VIP'
} else if (uni.getStorageSync('member') == 3) {
this.btnText = '升级vip正在审核中'
this.btnDisabled = true
} else if (uni.getStorageSync('member') == 4) {
this.btnText = '升级VIP'
this.btnDisabled = true
}
this.commitment = uni.getStorageSync('agreement')
if (option.ask == 1) {
this.needAsk = option.ask
}

View File

@@ -11,7 +11,8 @@
<view class="time_line">
<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 style="display: flex;">
<view class="btn" @click="editIdeasAndNeeds(item)">
@@ -32,7 +33,9 @@
<text class="needs_text">{{item.pname}}</text>
<view class="time_line">
<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 style="display: flex;">
<view class="btn" @click="editIdeasAndNeeds(item)">
@@ -74,26 +77,27 @@
name: '创意发布'
}],
needsList: [],
ideasList: []
ideasList: [],
updateIndex: ''
}
},
onLoad(options) {
console.log(options)
if (options && options.index) {
console.log(options)
options.index = options.index - 1
this.updateIndex = options.index
this.tabChange(options)
return
}
this.getIdeasAndNeeds()
},
methods: {
//获取创意发布
//获取创意发布或需求发布
getIdeasAndNeeds() {
this.$apiServe.getIdeasAndNeeds(this.type).then(res => {
let data = res.data.data
for (const item of data) {
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(';') : []
item.images = imagesList.map(item1 => {
item1 = uni.getStorageSync('img_url') + '/' + item1
@@ -112,7 +116,6 @@
//切换需求发布和创意发布
tabChange(data) {
this.tabCurrent = data.index
// console.log('data.index', data.index);
if (data.index == 0) {
this.type = 1
} else if (data.index == 1) {
@@ -143,7 +146,6 @@
success: function(res) {
if (res.confirm) {
that.$apiServe.deleteIdeasAndNeeds(item.id).then(res => {
// console.log('删除发布', res);
if (res.data.code == 1) {
that.$toast.warn('删除成功')
}

View File

@@ -11,10 +11,10 @@
</u-image>
<view class="img_tag">{{item.cate_name}}</view>
</view>
<view style="padding: 14rpx 22rpx;">
<view style="padding: 14rpx 24rpx 14rpx 16rpx;">
<view class="title_box">
<text class="title">{{item.name}}</text>
<u-tag :text="item.tag" type="warning" shape="circle"></u-tag>
<u-tag :text="item.tags" type="warning" shape="circle"></u-tag>
</view>
<view class="product_desc">
{{item.title}}
@@ -24,7 +24,7 @@
:lazy-load="true">
</u-image>
<text class="release">发布日期</text>
<text>{{item.pub_time}}</text>
<text>{{item.pub_time_str}}</text>
</view>
</view>
</view>
@@ -44,7 +44,8 @@
},
queryTitle: null,
imgUrl: null,
productList: []
productList: [],
tagsArray: [],
}
},
onLoad(options) {
@@ -58,8 +59,17 @@
...this.queryParam,
title: this.queryTitle
}
this.$apiServe.getProductList(data).then(res => {
this.productList = res.data.data
let tags = res.data.data
if (tags) {
for (const item of tags) {
let tag = item.tags
this.tagsArray = tag.split(',')
item.tags = this.tagsArray[0]
}
this.productList = tags
}
}).finally(_ => {})
},
//点击图片跳转到详情页

View File

@@ -58,7 +58,6 @@
this.getDiscover()
const tempList = uni.getStorageSync('storage_search_record')
this.recentRecordList = tempList ? tempList : [];
console.log(this.recentRecordList)
const menuButtonInfo = uni.getMenuButtonBoundingClientRect();
this.searchBarTop = menuButtonInfo.top;
this.searchBarHeight = menuButtonInfo.height;
@@ -104,7 +103,6 @@
getDiscover() {
this.$apiServe.getDiscover().then(res => {
this.foundList = res.data.data
console.log(res.data.data)
}).finally(_ => {})
}
}

View File

@@ -48,18 +48,18 @@
</view>
<!-- thumb无值显示点赞二字 用户进行一次点赞之后显示1赞-->
<view v-else class="heart">
<view v-if="detailList.is_thumb==0">
<view v-if="detailList.is_thumb==0" style="display: flex;">
<u-image src="/static/detail/xp_icon_heart.png" width="34rpx" height="32rpx"
@click="heartTap">
</u-image>
<text class="thumb" @click="heartTap">点赞</text>
</view>
<view v-if="detailList.is_thumb==1">
<view v-if="detailList.is_thumb==1" style="display: flex;">
<!-- 用户是否点赞字段 showHeart -->
<u-image src="/static/detail/xp_icon_ysc.png" width="34rpx" height="32rpx"
@click="cancelHeartTap(detailList.thumb_id)">
</u-image>
<text class="thumb">{{detailList.thumb}} </text>
<text class="thumb">{{detailList.thumb==NaN?1:detailList.thumb}} </text>
</view>
</view>
</view>
@@ -151,12 +151,16 @@
this.showUpdate = true
}
//升级VIP正在审核中
if (dataCode == 0 && detail.mytpe == 0) {
if (dataCode == 0 && detail.mytpe == 3) {
this.showUpdating = true
}
if (detail) {
detail.pub_time = dateFormatDetail(detail.pub_time)
detail.tags = detail.tags.split(',')
if (detail.tags) {
detail.tags = detail.tags.split(',')
}
//点赞数
if (detail.thumbcount !== 0 && detail.is_thumb == 0) {
detail.thumb = parseInt(detail.thumb) + parseInt(detail.thumbcount)

View File

@@ -89,10 +89,15 @@
<view style="padding: 30rpx;background-color: #fff;">
<u-button color="#0EBB5B" text="确定发布" @tap.stop="submitForm"></u-button>
</view>
<view style="padding: 20rpx;text-align: center;background-color: #fff;">
<view style="padding: 12rpx 30rpx 20rpx 30rpx;background-color: #fff;">
<text
style="font-size: 24rpx;font-family: PingFangSC-Regular, PingFang SC;font-weight: 400;color: #C8C8C8;line-height: 28rpx;">承诺声明预留文字位置承诺声明预留文字位置</text>
style="font-size: 24rpx;font-family: PingFangSC-Regular, PingFang SC;font-weight: 400;color: #C8C8C8;line-height: 28rpx;"
v-if="tabCurrent === 0">{{claim_r}}</text>
<text
style="font-size: 24rpx;font-family: PingFangSC-Regular, PingFang SC;font-weight: 400;color: #C8C8C8;line-height: 28rpx;"
v-if="tabCurrent === 1">{{claim_c}}</text>
</view>
</view>
</u--form>
<view style="margin:0 20rpx;">
@@ -115,6 +120,8 @@
},
data() {
return {
claim_r: '',
claim_c: '',
tabsList: [{
name: '需求发布'
}, {
@@ -155,10 +162,8 @@
}
},
onTabItemTap() {
this.imgUrl = uni.getStorageSync('img_url')
console.log('----onShow')
this.imgUrl = uni.getStorageSync('img_url')
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
console.log(uni.getStorageSync('loginToken'))
this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
@@ -177,14 +182,11 @@
if (options && options.item && uni.getStorageSync(options.item)) {
try {
let publishFormList = uni.getStorageSync(options.item)
console.log(publishFormList.images)
this.fileList1 = publishFormList.images.map(item => {
console.log(this.imgUrl)
return {
url: item
}
})
console.log(this.fileList1)
this.needsPublishForm = publishFormList
} catch (error) {
this.$toast.warn(error)
@@ -207,11 +209,12 @@
},
getFormData() {
this.$apiServe.getIdeasAndNeedsFormdata().then(res => {
console.log(res.data.data)
const formData = res.data.data
this.productPickerColumn[0] = formData.product
this.positionPickerColumn[0] = formData.loc
this.categoryPickerList[0] = formData.class
this.claim_r = formData.claim_r
this.claim_c = formData.claim_c
// this.productPickerList = res.data.data.map((item, index) => {
// temp.push(item.name)
// return item
@@ -248,7 +251,6 @@
// }
// },
getCityValue(data) {
console.log(data)
this.showCityPicker = false
this.needsPublishForm.area_name = data[0].join('-')
this.needsPublishForm.area_code = data[1]
@@ -257,7 +259,6 @@
this.showProductPicker = false
this.showCategoryPicker = false
this.needsPublishForm.product = data.value[0]
// console.log(data)
// const obj = this.productPickerList.find(item => {
// return item.name === data.value[0]
// })
@@ -311,9 +312,6 @@
async afterRead(event) {
// 当设置 multiple 为 true 时, 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
lists.map((item) => {
this[`fileList${event.name}`].push({
@@ -323,7 +321,6 @@
})
})
for (let i = 0; i < lists.length; i++) {
console.log(lists[i])
const result = await this.uploadFilePromise(lists[i].url)
let item = this[`fileList${event.name}`][fileListLen]
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
@@ -336,16 +333,6 @@
},
uploadFilePromise(url) {
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({
url: apiService.uploadImgUrl,
filePath: url,
@@ -356,8 +343,6 @@
},
success: (res) => {
setTimeout(() => {
console.log('---355')
console.log(JSON.parse(res.data).data.url)
resolve(JSON.parse(res.data).data.url)
}, 1000)
}
@@ -365,7 +350,6 @@
})
},
submitForm() {
console.log(this.fileList1)
if (!/^1[3456789]\d{9}$/.test(this.needsPublishForm.mobile)) {
this.$toast.warn('请输入正确的手机号')
return false
@@ -396,10 +380,8 @@
pub_time: null,
...this.needsPublishForm
}
console.log(data)
apiService.submitIdeasAndNeeds(data).then(res => {
this.$toast.success('提交成功')
console.log('esf=', res);
if (res.data.code == 1) {
uni.navigateTo({
url: '../../packageMy/myRelease/myRelease?index=' + (this.tabCurrent + 1)
@@ -414,7 +396,6 @@
})
},
reOnLoad() {
console.log('----------------true')
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.$toast.warn('登录失败请重试')
this.isLoad = false
@@ -428,19 +409,10 @@
this.getFormData()
},
failToLoad() {
console.log('----------------false')
this.$toast.warn('登录失败请重试')
uni.reLaunch({
url: '/pages/index/index'
})
// uni.navigateBack({
// success: () => {
// let page = getCurrentPages().pop();
// if (page) {
// page.onLoad(page.options);//执行上个页面的方法
// };
// }
// })
}
}

View File

@@ -141,10 +141,12 @@
getBanner() {
this.$apiServe.getBanner().then(res => {
let banner = res.data.data
for (const item of banner) {
item.img = this.imgUrl + item.img
if (banner) {
for (const item of banner) {
item.img = this.imgUrl + item.img
}
this.swiperList = res.data.data
}
this.swiperList = res.data.data
}).finally(_ => {})
},
//点击轮播图

View File

@@ -55,7 +55,7 @@
}
},
onTabItemTap() {
// this.$refs.myavatar.getUser()
this.$refs.myavatar.getUser()
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.isLoad = false
return

View File

@@ -8,10 +8,7 @@
position: absolute;
right: 0;
top: 0;
.u-image__image {
margin-left: 6px;
}
width:356rpx;
.img_tag {
position: absolute;