Merge pull request '修改小程序bug' (#102) from dengjie into dev

Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/102
This commit is contained in:
odjbin
2023-02-27 16:03:50 +00:00
7 changed files with 77 additions and 69 deletions

View File

@@ -4,7 +4,7 @@
<u-avatar :src="avatar" size="100rpx" shape="circle" @click="changeAvatar()"></u-avatar>
</view>
<view style="margin-top: 10rpx;margin-bottom: 4rpx;">
<u--image v-if="member=='2'" :src="normal" width="84rpx" height="30rpx">
<u--image v-if="member=='2'||member=='3'" :src="normal" width="84rpx" height="30rpx">
</u--image>
<u--image v-if="member=='4'" :src="VIP" width="84rpx" height="30rpx">
</u--image>
@@ -71,10 +71,12 @@
this.isLoad = false
}
var data = res.data.data
console.log('data个人信息', data);
if (data) {
this.avatar = uni.getStorageSync('img_url') + data.avatar
this.nickname = data.nickname
this.member = data.member
uni.setStorageSync('user_id', data.user_id)
uni.setStorageSync('member', data.member)
uni.setStorageSync('agreement', data.agreement)
uni.setStorageSync('com_name', data.com_name)

View File

@@ -3,11 +3,11 @@
<u--form labelPosition="left" :model="model">
<u-form-item label="公司名称" prop="userInfo.name" borderBottom>
<u--input v-model="model.userInfo.name" border="none" placeholder="请输入您的名称"
placeholderStyle="color: #CCCCCC;font-size: 24rpx;"></u--input>
placeholderStyle="color: #CCCCCC;font-size: 24rpx;" :disabled="disabled"></u--input>
</u-form-item>
<u-form-item label="公司电话" prop="userInfo.phone" borderBottom>
<u--input v-model="model.userInfo.phone" border="none" placeholder="请输入您的电话"
placeholderStyle="color: #CCCCCC;font-size: 24rpx;">
placeholderStyle="color: #CCCCCC;font-size: 24rpx;" :disabled="disabled">
</u--input>
</u-form-item>
</u--form>
@@ -19,6 +19,7 @@
name: "myForm",
data() {
return {
disabled: false,
model: {
userInfo: {
name: '',
@@ -27,6 +28,9 @@
},
};
},
options: {
styleIsolation: 'shared', // 解除样式隔离
},
created() {
// if (uni.getStorageSync('com_mobile') && uni.getStorageSync('com_name')) {
// this.model.userInfo.name = uni.getStorageSync('com_name')
@@ -36,6 +40,8 @@
}
</script>
<style>
<style scoped>
/deep/.u-input__content__field-wrapper__field {
background-color: #fff !important;
}
</style>

View File

@@ -21,32 +21,32 @@
}
},
methods: {
handleSureClick() {
let name = this.$refs.nameAndphone.model.userInfo.name
let phone = this.$refs.nameAndphone.model.userInfo.phone
if (!/^1[3456789]\d{9}$/.test(phone)) {
this.$toast.warn('请输入正确的手机号')
return false
}
this.$apiServe.bindComponyAndUpdate({
uid: 1,
type: 1,
companyName: name,
companyPhone: phone
}).then(res => {
console.log('绑定公司', res.data);
if (res.data.code == 20003) {
this.showM = true
} else if (res.data.code == 20005) {
this.$toast.warn('请完善数据')
}
}).finally(_ => {})
},
confirm() {
uni.reLaunch({
url: '/pages/my/my'
})
}
// handleSureClick() {
// let name = this.$refs.nameAndphone.model.userInfo.name
// let phone = this.$refs.nameAndphone.model.userInfo.phone
// if (!/^1[3456789]\d{9}$/.test(phone)) {
// this.$toast.warn('请输入正确的手机号')
// return false
// }
// // this.$apiServe.bindComponyAndUpdate({
// // uid: 1,
// // type: 1,
// // companyName: name,
// // companyPhone: phone
// // }).then(res => {
// // console.log('绑定公司', res.data);
// // if (res.data.code == 20003) {
// // this.showM = true
// // } else if (res.data.code == 20005) {
// // this.$toast.warn('请完善数据')
// // }
// // }).finally(_ => {})
// },
// confirm() {
// uni.reLaunch({
// url: '/pages/my/my'
// })
// }
}
}
</script>

View File

@@ -49,6 +49,11 @@
if (option.ask == 1) {
this.needAsk = option.ask
}
if (uni.getStorageSync('com_name') && uni.getStorageSync('com_mobile')) {
this.$refs.nameAndphone.model.userInfo.name = uni.getStorageSync('com_name')
this.$refs.nameAndphone.model.userInfo.phone = uni.getStorageSync('com_mobile')
this.$refs.nameAndphone.disabled = true
}
},
methods: {
handleSureClick() {
@@ -69,7 +74,7 @@
if (name && phone) {
console.log('数据已完善');
this.$apiServe.bindComponyAndUpdate({
uid: 1,
uid: uni.getStorageSync('user_id'),
type: 2,
companyName: name,
companyPhone: phone

View File

@@ -12,7 +12,7 @@
<view class="time_line">
<view class="release_time">
<text v-if="updateIndex==0||updateIndex==1">{{item.update_time}}</text>
<text v-else>{{item.pub_time}}</text>
<text v-else>{{item.update_time}}</text>
</view>
<view style="display: flex;">
<view class="btn" @click="viewIdeasOrNeeds(item)" v-if="item.status==1">
@@ -39,7 +39,7 @@
<view class="release_time">
<text v-if="updateIndex==0||updateIndex==1">{{item.update_time}}</text>
<text v-else>{{item.pub_time}}</text>
<text v-else>{{item.update_time}}</text>
</view>
<view style="display: flex;">
<view class="btn" @click="viewIdeasOrNeeds(item)" v-if="item.status==1">

View File

@@ -155,22 +155,13 @@
this.showUpdating = true
}
if (detail) {
detail.pub_time = dateFormatDetail(detail.pub_time)
if (detail.tags) {
detail.tags = detail.tags.split(',')
}
//点赞数
if (detail.thumbcount !== 0 && detail.is_thumb == 0) {
detail.thumb = parseInt(detail.thumb) + parseInt(detail.thumbcount)
} else {
if (detail.is_thumb == 1) {
detail.thumb = parseInt(detail.thumb) + parseInt(detail.thumbcount)
} else {
detail.thumb = parseInt(detail.thumb) - parseInt(detail.thumbcount)
}
}
this.detailList = detail
}
}).finally(_ => {})

View File

@@ -9,10 +9,10 @@
<view style="margin-bottom: 20rpx;">
<u-form-item label="姓名" borderBottom>
<u-input v-model="needsPublishForm.name" :border="false" placeholder="请输入您的名称"
placeholder-style="color:#CCCCCC" />
placeholder-style="color:#CCCCCC" :disabled="btnDisabled" disabledColor="#ffffff" />
</u-form-item>
<u-form-item label="城市">
<view class="select-view" @tap="showCityPicker = true">
<view class="select-view" @tap="btnDisabled==true?showCityPicker=false:showCityPicker = true">
<text v-if="needsPublishForm.area_name">{{needsPublishForm.area_name}}</text>
<text v-else style="color:#CCCCCC;">请选择所在城市</text>
<u-icon name="arrow-right" color="#969696" size="14"></u-icon>
@@ -26,39 +26,46 @@
<view v-if="tabCurrent === 1">
<u-form-item label="品名" borderBottom>
<u-input v-model="needsPublishForm.pname" :border="false" placeholder="请输入您的产品名称"
placeholder-style="color:#CCCCCC" />
placeholder-style="color:#CCCCCC" :disabled="btnDisabled" disabledColor="#ffffff" />
</u-form-item>
<u-form-item label="分类" borderBottom>
<view class="select-view" @tap="showCategoryPicker = true">
<view class="select-view"
@tap="btnDisabled==true?showCategoryPicker=false: showCategoryPicker=true">
<text v-if="needsPublishForm.class">{{needsPublishForm.class}}</text>
<text v-else style="color:#CCCCCC;">请选择分类</text>
<u-icon name="arrow-right" color="#969696" size="14"></u-icon>
</view>
<u-picker :show="showCategoryPicker" :columns="categoryPickerList"
@cancel="showCategoryPicker = false" @confirm="getCategoryValue"></u-picker>
@cancel="showCategoryPicker = false" @confirm="getCategoryValue">
</u-picker>
</u-form-item>
</view>
<u-form-item label="产品" borderBottom>
<view class="select-view" @tap="showProductPicker = true">
<view class="select-view"
@tap="btnDisabled==true?showProductPicker=false: showProductPicker = true">
<text v-if="needsPublishForm.product">{{needsPublishForm.product}}</text>
<text v-else style="color:#CCCCCC;">请选择产品类型</text>
<u-icon name="arrow-right" color="#969696" size="14"></u-icon>
</view>
<u-picker :show="showProductPicker" :columns="productPickerColumn"
@cancel="showProductPicker = false" @confirm="getProductValue"></u-picker>
@cancel="showProductPicker = false" @confirm="getProductValue">
</u-picker>
</u-form-item>
<u-form-item label="定位" borderBottom>
<view class="select-view" @tap="showPositionPicker = true">
<view class="select-view"
@tap="btnDisabled==true?showPositionPicker=false:showPositionPicker = true">
<text v-if="needsPublishForm.loc">{{needsPublishForm.loc}}</text>
<text v-else style="color:#CCCCCC;">请选择产品定位</text>
<u-icon name="arrow-right" color="#969696" size="14"></u-icon>
</view>
<u-picker :show=showPositionPicker :columns="positionPickerColumn"
@cancel="showPositionPicker = false" @confirm="getPositionValue"></u-picker>
@cancel="showPositionPicker = false" @confirm="getPositionValue">
</u-picker>
</u-form-item>
<view style="padding: 20rpx 15rpx;background-color: #fff;">
<u-textarea v-model="needsPublishForm.desc" border="surround" placeholder="请输入具体描述(限120字)"
:maxlength="120" placeholder-style="color:#CCCCCC"></u-textarea>
:maxlength="120" placeholder-style="color:#CCCCCC" :disabled="btnDisabled"
disabledColor="#ffffff"></u-textarea>
</view>
</view>
@@ -66,7 +73,7 @@
<u-form-item label="上传图片" labelPosition="top">
<view style="padding-left: 20rpx;margin-top: 20rpx;">
<u-upload :fileList="fileList1" :auto-upload="false" @afterRead="afterRead" @delete="deletePic"
name="1" multiple :maxCount="10"></u-upload>
name="1" multiple :maxCount="10" :disabled="btnDisabled"></u-upload>
</view>
</u-form-item>
</view>
@@ -74,7 +81,7 @@
<view style="background-color: #fff;">
<u-form-item label="手机" borderBottom>
<u--input placeholder="请输入手机号" :border="false" v-model="needsPublishForm.mobile"
placeholder-style="color:#CCCCCC"></u--input>
placeholder-style="color:#CCCCCC" :disabled="btnDisabled" disabledColor="#ffffff"></u--input>
</u-form-item>
<!-- <u-form-item label="验证" borderBottom>
<view style="display: flex;padding-right: 20rpx;align-items: center;">
@@ -97,7 +104,6 @@
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;">
@@ -143,18 +149,13 @@
productPickerList: [],
productPickerColumn: [
[]
// {name: '烘焙', val: 'hongbei'}
// {name: '零食', val: 'ls'}
// {name: '饮料', val: 'yl'}
],
positionPickerList: [],
positionPickerColumn: [
[]
],
categoryPickerList: [],
fileList1: [
// uploads/images/20230117/202301172309397deda1543.jpg
],
fileList1: [],
isLoad: true,
cateName: null,
tagName: null,
@@ -166,9 +167,6 @@
this.imgUrl = uni.getStorageSync('img_url')
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
// })
return
}
this.isLoad = true
@@ -193,14 +191,14 @@
this.$toast.warn(error)
}
}
if (options.view == 11) {
this.btnDisabled = true
}
if (options.index == 0) {
this.tabCurrent = 0
} else if (options.index == 1) {
this.tabCurrent = 1
}
if (options.view == 11) {
this.btnDisabled = true
}
// this.getProductPickerList()
},
onShow() {
@@ -210,6 +208,8 @@
tabChange(data) {
this.tabCurrent = data.index
this.needsPublishForm = {}
this.fileList1 = []
this.btnDisabled = this.btnDisabled == true ? false : false;
},
getFormData() {
this.$apiServe.getIdeasAndNeedsFormdata().then(res => {
@@ -427,6 +427,10 @@
</script>
<style lang="less" scoped>
/deep/.u-textarea--disabled {
background-color: #ffffff !important;
}
.content {
background-color: #F8F8F8;