Merge pull request '登录组件' (#47) from chenxuelian into dev

Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/47
This commit is contained in:
1171906056
2023-01-08 12:08:11 +00:00
2 changed files with 17 additions and 11 deletions

View File

@@ -13,7 +13,7 @@
</u-form-item> </u-form-item>
<u-form-item label="城市"> <u-form-item label="城市">
<view class="select-view" @tap="showCityPicker = true"> <view class="select-view" @tap="showCityPicker = true">
<text v-if="needsPublishForm.city">{{needsPublishForm.city}}</text> <text v-if="needsPublishForm.area_name">{{needsPublishForm.area_name}}</text>
<text v-else style="color:#CCCCCC;">请选择所在城市</text> <text v-else style="color:#CCCCCC;">请选择所在城市</text>
<u-icon name="arrow-right" color="#969696" size="14"></u-icon> <u-icon name="arrow-right" color="#969696" size="14"></u-icon>
</view> </view>
@@ -25,12 +25,12 @@
<view style="margin-bottom: 20rpx;"> <view style="margin-bottom: 20rpx;">
<view v-if="tabCurrent === 1"> <view v-if="tabCurrent === 1">
<u-form-item label="品名" borderBottom> <u-form-item label="品名" borderBottom>
<u-input v-model="needsPublishForm.productName" :border="false" placeholder="请输入您的产品名称" <u-input v-model="needsPublishForm.pname" :border="false" placeholder="请输入您的产品名称"
placeholder-style="color:#CCCCCC" /> placeholder-style="color:#CCCCCC" />
</u-form-item> </u-form-item>
<u-form-item label="分类" borderBottom> <u-form-item label="分类" borderBottom>
<view class="select-view" @tap="showCategoryPicker = true"> <view class="select-view" @tap="showCategoryPicker = true">
<text v-if="needsPublishForm.productCategory">{{needsPublishForm.productCategory}}</text> <text v-if="needsPublishForm.cate_id">{{needsPublishForm.cate_id}}</text>
<text v-else style="color:#CCCCCC;">请选择分类</text> <text v-else style="color:#CCCCCC;">请选择分类</text>
<u-icon name="arrow-right" color="#969696" size="14"></u-icon> <u-icon name="arrow-right" color="#969696" size="14"></u-icon>
</view> </view>
@@ -40,7 +40,7 @@
</view> </view>
<u-form-item label="产品" borderBottom> <u-form-item label="产品" borderBottom>
<view class="select-view" @tap="showProductPicker = true"> <view class="select-view" @tap="showProductPicker = true">
<text v-if="needsPublishForm.product">{{needsPublishForm.product}}</text> <text v-if="needsPublishForm.pname">{{needsPublishForm.pname}}</text>
<text v-else style="color:#CCCCCC;">请选择产品类型</text> <text v-else style="color:#CCCCCC;">请选择产品类型</text>
<u-icon name="arrow-right" color="#969696" size="14"></u-icon> <u-icon name="arrow-right" color="#969696" size="14"></u-icon>
</view> </view>
@@ -76,7 +76,7 @@
<u--input placeholder="请输入手机号" :border="false" v-model="needsPublishForm.phone" <u--input placeholder="请输入手机号" :border="false" v-model="needsPublishForm.phone"
placeholder-style="color:#CCCCCC"></u--input> placeholder-style="color:#CCCCCC"></u--input>
</u-form-item> </u-form-item>
<u-form-item label="验证" borderBottom> <!-- <u-form-item label="验证" borderBottom>
<view style="display: flex;padding-right: 20rpx;align-items: center;"> <view style="display: flex;padding-right: 20rpx;align-items: center;">
<u--input placeholder="请输入验证码" :border="false" v-model="needsPublishForm.invalidCode" <u--input placeholder="请输入验证码" :border="false" v-model="needsPublishForm.invalidCode"
placeholder-style="color:#CCCCCC"></u--input> placeholder-style="color:#CCCCCC"></u--input>
@@ -85,9 +85,9 @@
<u-button size="small" type="primary" @tap="getCode" :text="tips" color="#EEEEEE" <u-button size="small" type="primary" @tap="getCode" :text="tips" color="#EEEEEE"
:disabled="disabled" customStyle="color:#666666; width:160rpx;"></u-button> :disabled="disabled" customStyle="color:#666666; width:160rpx;"></u-button>
</view> </view>
</u-form-item> </u-form-item> -->
<view style="padding: 30rpx;background-color: #fff;"> <view style="padding: 30rpx;background-color: #fff;">
<u-button color="#0EBB5B" text="确定发布"></u-button> <u-button color="#0EBB5B" text="确定发布" @tap.stop="submitForm"></u-button>
</view> </view>
<view style="padding: 20rpx;text-align: center;background-color: #fff;"> <view style="padding: 20rpx;text-align: center;background-color: #fff;">
<text <text
@@ -172,11 +172,11 @@
}, },
getCityValue(data) { getCityValue(data) {
this.showCityPicker = false this.showCityPicker = false
this.needsPublishForm.city = data.join('/') this.needsPublishForm.area_name = data.join('/')
}, },
getProductValue(data) { getProductValue(data) {
this.showProductPicker = false this.showProductPicker = false
this.needsPublishForm.product = data.value[0] this.needsPublishForm.tagids = data.value[0]
}, },
getPositionValue(data) { getPositionValue(data) {
this.showPositionPicker = false this.showPositionPicker = false
@@ -184,7 +184,7 @@
}, },
getCategoryValue(data) { getCategoryValue(data) {
this.showCategoryPicker = false this.showCategoryPicker = false
this.needsPublishForm.productCategory = data.value[0] this.needsPublishForm.cate_id = data.value[0]
}, },
getCode() { getCode() {
if (this.$refs.uCode.canGetCode) { if (this.$refs.uCode.canGetCode) {
@@ -250,6 +250,12 @@
// }); // });
// }) // })
}, },
submitForm() {
if (!/^1[3456789]\d{9}$/.test(this.needsPublishForm.phone)) {
this.$toast.warn('请输入正确的手机号')
return false
}
},
reOnLoad() { reOnLoad() {
console.log('----------------true') console.log('----------------true')
if (!uni.getStorageSync('token') || uni.getStorageSync('token').length === 0) { if (!uni.getStorageSync('token') || uni.getStorageSync('token').length === 0) {

View File

@@ -34,7 +34,7 @@
var data = res.data.data var data = res.data.data
// console.log('登录code换取的信息', data); // console.log('登录code换取的信息', data);
uni.setStorageSync('token', data.token); uni.setStorageSync('token', data.token);
that.$toast.warn('登录成功') that.$toast.success('登录成功')
that.$emit('success') that.$emit('success')
}) })
}, },