第一次提交
This commit is contained in:
187
sub_pages/user/base/address/address.vue
Normal file
187
sub_pages/user/base/address/address.vue
Normal file
@@ -0,0 +1,187 @@
|
||||
<template>
|
||||
<view class="page-wrap">
|
||||
<view class="page-bg">
|
||||
<u-navbar leftIconColor="#FFFFFF" :autoBack="true" bg-color="transparent" safeAreaInsetTop placeholder></u-navbar>
|
||||
<view class="notice">
|
||||
请如实填写个人资料,真实的资料会更受欢迎
|
||||
</view>
|
||||
<view class="title">
|
||||
你所在地区是?
|
||||
</view>
|
||||
<view class="desc">
|
||||
<!-- 给你推荐年龄相近的异性 -->
|
||||
</view>
|
||||
<view class="birthday">
|
||||
<picker-view :indicator-style="indicatorStyle" indicator-class="indicator-class" mask-class="mask-class"
|
||||
:value="currentValue" @change="bindChange" class="picker-view">
|
||||
<picker-view-column id="provinces">
|
||||
<view :class="{current: index == currentValue[0]}" class="item" v-for="(item,index) in provinces" :key="index">{{item.label}}</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view :class="{current: index == currentValue[1]}" class="item" v-for="(item,index) in citys" :key="index">{{item.label}}</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view :class="{current: index == currentValue[2]}" class="item" v-for="(item,index) in areas" :key="index">{{item.label}}</view>
|
||||
</picker-view-column>
|
||||
</picker-view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="btn-wrapper">
|
||||
<u-button text="继续" color="linear-gradient(#95258d, #440a5f);" shape="circle" @click="handleSubmit"></u-button>
|
||||
</view>
|
||||
<u-safe-bottom></u-safe-bottom>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
let cityData = []
|
||||
var QQMapWX = require('@/js_sdk/qqmap-wx-jssdk.min.js');
|
||||
var qqmapsdk;
|
||||
export default {
|
||||
data: function() {
|
||||
|
||||
return {
|
||||
title: 'picker-view',
|
||||
provinces: [],
|
||||
province: '',
|
||||
citys: [],
|
||||
city: '',
|
||||
areas: [],
|
||||
area: '',
|
||||
currentValue: [0, 0, 0],
|
||||
indicatorStyle: `height: 50px;color: #FFF;`
|
||||
}
|
||||
},
|
||||
async onLoad() {
|
||||
const app = this
|
||||
qqmapsdk = new QQMapWX({
|
||||
key: 'RDABZ-IF7AB-L4AUO-JHMX3-GBSGE-KIF53'
|
||||
});
|
||||
await this.loadData()
|
||||
// 获取定位信息
|
||||
uni.getLocation({
|
||||
success: (e)=>{
|
||||
|
||||
qqmapsdk.reverseGeocoder({
|
||||
location: {
|
||||
latitude: e.latitude,
|
||||
longitude: e.longitude
|
||||
},
|
||||
success: (res)=>{
|
||||
const {province, city, district} = res.result.address_component
|
||||
console.log(province);
|
||||
const provinceIndex = app.provinces.findIndex(item=> item.label == province)
|
||||
app.citys = app.filterData(cityData[provinceIndex].children)
|
||||
const cityIndex = app.citys.findIndex(item=> item.label == city)
|
||||
app.areas = app.filterData(cityData[provinceIndex].children[cityIndex].children)
|
||||
const areaIndex = app.areas.findIndex(item=> item.label == district)
|
||||
app.$nextTick(()=>{
|
||||
app.currentValue = [provinceIndex,cityIndex, areaIndex]
|
||||
app.province = app.provinces[app.currentValue[0]]
|
||||
app.city = app.citys[app.currentValue[1]]
|
||||
app.area = app.areas[app.currentValue[2]]
|
||||
})
|
||||
},
|
||||
fail: (error)=> {
|
||||
console.log('error: ',error);
|
||||
}
|
||||
})
|
||||
console.log(e);
|
||||
},
|
||||
fail() {
|
||||
app.$toast('获取定位失败,请点击右下角按钮重新尝试定位')
|
||||
app.isAuthor = false
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
||||
formatCityData() {
|
||||
const currentValue = this.currentValue
|
||||
const provinceList = this.filterData(cityData)
|
||||
|
||||
const cityList = this.filterData(cityData[currentValue[0]].children)
|
||||
const areaList = this.filterData(cityData[currentValue[0]].children[currentValue[1]].children)
|
||||
|
||||
const provice = provinceList[currentValue[0]]
|
||||
const city = cityList[currentValue[1]]
|
||||
const area = areaList[currentValue[2]]
|
||||
this.provinces = provinceList
|
||||
this.citys = cityList
|
||||
this.areas = areaList
|
||||
this.province = provice
|
||||
this.city = city
|
||||
this.area = area
|
||||
},
|
||||
bindChange: function(e) {
|
||||
|
||||
const val = e.detail.value;
|
||||
let {
|
||||
currentValue
|
||||
} = this
|
||||
console.log('val:', val)
|
||||
console.log('currentValue:', currentValue)
|
||||
if (val[0] !== currentValue[0]) {
|
||||
currentValue = [val[0], 0, 0]
|
||||
this.currentValue = currentValue
|
||||
} else if (val[1] !== currentValue[1]) {
|
||||
currentValue = [val[0], val[1], 0]
|
||||
this.currentValue = currentValue
|
||||
} else if (val[2] !== currentValue[2]) {
|
||||
currentValue = val
|
||||
this.currentValue = currentValue
|
||||
}
|
||||
this.formatCityData()
|
||||
|
||||
this.province = this.provinces[val[0]]
|
||||
this.city = this.citys[val[1]]
|
||||
this.area = this.areas[val[2]]
|
||||
},
|
||||
filterData(arr = []) {
|
||||
return arr.map(item=>{
|
||||
return {
|
||||
label: item.label,
|
||||
value: item.value
|
||||
}
|
||||
})
|
||||
},
|
||||
handleSubmit() {
|
||||
|
||||
const userBase = uni.getStorageSync('UserBase') || {}
|
||||
userBase.province = this.province
|
||||
userBase.city = this.city
|
||||
userBase.region = this.area
|
||||
userBase.address = `${this.province} ${this.city} ${this.area}`
|
||||
uni.setStorageSync("UserBase", userBase)
|
||||
this.$push('/sub_pages/user/base/yearpay/yearpay')
|
||||
},
|
||||
loadData() {
|
||||
return new Promise((reso,rej) => {
|
||||
uni.request({
|
||||
url: 'https://file.wsdns.cn/json/city.js',
|
||||
success: (res) => {
|
||||
cityData = res.data
|
||||
this.formatCityData()
|
||||
return reso()
|
||||
},
|
||||
fail() {
|
||||
return rej()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "../base.scss";
|
||||
|
||||
.birthday {
|
||||
margin-top: 100rpx;
|
||||
}
|
||||
</style>
|
||||
218
sub_pages/user/base/avatar/avatar.vue
Normal file
218
sub_pages/user/base/avatar/avatar.vue
Normal file
@@ -0,0 +1,218 @@
|
||||
<template>
|
||||
<view class="page-wrap">
|
||||
<view class="page-bg">
|
||||
<u-navbar leftIconColor="#FFFFFF" :autoBack="true" bg-color="transparent" safeAreaInsetTop
|
||||
placeholder></u-navbar>
|
||||
<view class="notice">
|
||||
请如实填写个人资料,真实的资料会更受欢迎
|
||||
</view>
|
||||
<view class="title">
|
||||
上传头像/封面
|
||||
</view>
|
||||
<view class="desc">
|
||||
一张亮眼的头像更容易获得青睐
|
||||
</view>
|
||||
<view class="avatar">
|
||||
<button class="btn-avatar u-reset-button" @click="onChooseAvatar">
|
||||
<image class="btn-avatar-plus" v-if="!avatar" src="@/static/icon/path.png" mode="widthFix"></image>
|
||||
<image class="avatar-img" v-else :src="avatar" mode="widthFix"></image>
|
||||
</button>
|
||||
</view>
|
||||
|
||||
<ksp-cropper mode="ratio" :url="avatarTemp"
|
||||
@cancel="avatarTemp = ''" @ok="cropperOk"></ksp-cropper>
|
||||
<view class="tips">
|
||||
<view class="tips-item">
|
||||
<image src="https://file-jimei.oss-cn-shenzhen.aliyuncs.com/static/user-base/5.png" mode="aspectFill" class="tips-item-image"></image>
|
||||
<view class="tips-item-text">999+喜欢</view>
|
||||
<image class="tips-ft" src="@/static/user-base/y.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="tips-item">
|
||||
<image src="https://file-jimei.oss-cn-shenzhen.aliyuncs.com/static/user-base/4.png" mode="aspectFill" class="tips-item-image"></image>
|
||||
<view class="tips-item-text">暴露照</view>
|
||||
<image class="tips-ft" src="@/static/user-base/n.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="tips-item">
|
||||
<image src="https://file-jimei.oss-cn-shenzhen.aliyuncs.com/static/user-base/3.png" mode="aspectFill" class="tips-item-image"></image>
|
||||
<view class="tips-item-text">模糊照</view>
|
||||
<image class="tips-ft" src="@/static/user-base/n.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="tips-item">
|
||||
<image src="https://file-jimei.oss-cn-shenzhen.aliyuncs.com/static/user-base/2.png" mode="aspectFill" class="tips-item-image"></image>
|
||||
<view class="tips-item-text">非人物照</view>
|
||||
<image class="tips-ft" src="@/static/user-base/n.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="tips-item">
|
||||
<image src="https://file-jimei.oss-cn-shenzhen.aliyuncs.com/static/user-base/1.png" mode="aspectFill" class="tips-item-image"></image>
|
||||
<view class="tips-item-text">网络图片</view>
|
||||
<image class="tips-ft" src="@/static/user-base/n.png" mode="widthFix"></image>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="btn-wrapper-pla">
|
||||
|
||||
</view>
|
||||
<view class="btn-wrapper">
|
||||
<u-button v-if="avatar == null || avatar == ''" text="继续" color="#837C8B" shape="circle" @click="handleSubmit"></u-button>
|
||||
<u-button v-else text="继续" color="linear-gradient(#95258d, #440a5f);" shape="circle" @click="handleSubmit"></u-button>
|
||||
</view>
|
||||
<u-safe-bottom></u-safe-bottom>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as UserProfileApi from '@/api/love-user-profile.js'
|
||||
import * as UploadApi from '@/api/upload'
|
||||
import {
|
||||
dateFormat
|
||||
} from '@/utils/util.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
avatarTemp: '',
|
||||
fileList1: [],
|
||||
avatar: '',
|
||||
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
},
|
||||
methods: {
|
||||
async cropperOk(e) {
|
||||
const res = await this.uploadFilePromise(e.path)
|
||||
this.avatarTemp = ''
|
||||
this.avatar = res.url
|
||||
},
|
||||
async onChooseAvatar({
|
||||
detail
|
||||
}) {
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
success: (res) => {
|
||||
this.avatarTemp = res.tempFilePaths[0]
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
handleSubmit() {
|
||||
|
||||
if (!this.avatar) {
|
||||
uni.showToast({
|
||||
title: '请上传头像',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
const userBase = uni.getStorageSync('UserBase') || {}
|
||||
userBase.avatar = this.avatar
|
||||
uni.setStorageSync("UserBase", userBase)
|
||||
this.$push('/sub_pages/user/base/photo/photo')
|
||||
},
|
||||
// 删除图片
|
||||
deletePic(event) {
|
||||
this[`fileList${event.name}`].splice(event.index, 1)
|
||||
},
|
||||
uploadFilePromise(url) {
|
||||
return new Promise((resolve, reject) => {
|
||||
UploadApi.uploadFile({
|
||||
filePath: url,
|
||||
fileType: 'image',
|
||||
name: 'file',
|
||||
header: {
|
||||
Authorization: uni.getStorageSync('AccessToken')
|
||||
},
|
||||
}).then(result => {
|
||||
setTimeout(() => {
|
||||
resolve(result.data)
|
||||
}, 1000)
|
||||
}).catch(err => {
|
||||
console.log("err: ", err);
|
||||
})
|
||||
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "../base.scss";
|
||||
.avatar{
|
||||
margin: 100rpx 0 100rpx 0;
|
||||
}
|
||||
|
||||
|
||||
.nickname {
|
||||
width: 620rpx;
|
||||
margin: 160rpx auto 120rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
&-input {
|
||||
background-color: #FFFFFF;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
/deep/.u-upload__button {
|
||||
background-color: rgba(#6A6A6A, .6) !important;
|
||||
border-radius: 10rpx !important;
|
||||
border: 4rpx rgba(#BBBBBB, .5) solid;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.tips {
|
||||
display: flex;
|
||||
width: 640rpx;
|
||||
margin: 10rpx auto;
|
||||
justify-content: space-between;
|
||||
|
||||
|
||||
&-item {
|
||||
width: 104rpx;
|
||||
font-size: 24rpx;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
&-image {
|
||||
width: 104rpx;
|
||||
height: 104rpx;
|
||||
}
|
||||
|
||||
&-text {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
}
|
||||
.tips-ft{
|
||||
width: 20rpx;
|
||||
position: absolute;
|
||||
right: 6rpx;
|
||||
top: 82rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
.btn-avatar{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 320rpx;
|
||||
height: 320rpx;
|
||||
background: rgba(15, 0, 32, 0.5);
|
||||
border: 2rpx solid rgb(151, 99, 157);
|
||||
|
||||
border-radius: 10rpx;
|
||||
overflow: hidden;
|
||||
|
||||
.btn-avatar-plus{
|
||||
width: 72rpx;
|
||||
height: 72rpx;
|
||||
}
|
||||
.avatar-img{
|
||||
width: 320rpx;
|
||||
height: 320rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
120
sub_pages/user/base/base.scss
Normal file
120
sub_pages/user/base/base.scss
Normal file
@@ -0,0 +1,120 @@
|
||||
|
||||
.page-wrap {
|
||||
background-image: url('https://file-jimei.oss-cn-shenzhen.aliyuncs.com/static/AgAACjstO6aGYdpKbYVInIACkhYjoWai.png');
|
||||
background-position: center;
|
||||
background-size: 100%;
|
||||
background-repeat: no-repeat;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.page-bg{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
// background-color: $user-base-bg-color;
|
||||
}
|
||||
page {
|
||||
// /* background-color: #1F021E; */
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
.notice {
|
||||
font-size: 28rpx;
|
||||
// background-color: #999999;
|
||||
background-color: #330436;
|
||||
color: #c6c6c6;
|
||||
border-radius: 30rpx;
|
||||
width: 600rpx;
|
||||
margin: 20rpx auto;
|
||||
text-align: center;
|
||||
padding: 10rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
text-align: center;
|
||||
font-size: 48rpx;
|
||||
font-weight: bold;
|
||||
margin: 40rpx 0;
|
||||
|
||||
}
|
||||
|
||||
.desc {
|
||||
text-align: center;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
.sex{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
.sex-item{
|
||||
position: relative;
|
||||
.gou{
|
||||
position: absolute;
|
||||
border-radius: 100%;
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
right: 0;
|
||||
bottom: 38rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btn-wrapper-pla{
|
||||
height: 350rpx;
|
||||
}
|
||||
.btn-wrapper {
|
||||
position: fixed;
|
||||
bottom: 120rpx;
|
||||
left: 0;
|
||||
right: 0;
|
||||
|
||||
width: 400rpx;
|
||||
margin: auto;
|
||||
// display: flex;
|
||||
// align-items: center;
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
|
||||
.indicator-class {
|
||||
|
||||
line-height: 60rpx !important;
|
||||
height: 60rpx !important;
|
||||
&::after{
|
||||
display: none;
|
||||
}
|
||||
&::before{
|
||||
display: none;
|
||||
}
|
||||
// color: #fff;
|
||||
background-color: rgba(#000000, .2);
|
||||
|
||||
border-radius: 50rpx;
|
||||
// border: none !important;
|
||||
|
||||
}
|
||||
|
||||
.mask-class {
|
||||
// background: #1F021E;
|
||||
background: transparent;
|
||||
color: #FFF;
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.picker-view {
|
||||
width: 690rpx;
|
||||
height: 300rpx;
|
||||
margin: 220rpx auto;
|
||||
// background: $user-base-bg-color;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
.item {
|
||||
line-height: 60rpx !important;
|
||||
height: 60rpx !important;
|
||||
text-align: center;
|
||||
/* background: #1F021E; */
|
||||
color: #999;
|
||||
&.current{
|
||||
color: #FFFFFF
|
||||
}
|
||||
}
|
||||
94
sub_pages/user/base/birthday/birthday.vue
Normal file
94
sub_pages/user/base/birthday/birthday.vue
Normal file
@@ -0,0 +1,94 @@
|
||||
<template>
|
||||
<view class="page-wrap">
|
||||
<view class="page-bg">
|
||||
<u-navbar leftIconColor="#FFFFFF" :autoBack="true" bg-color="transparent" safeAreaInsetTop placeholder></u-navbar>
|
||||
<view class="notice">
|
||||
请如实填写个人资料,真实的资料会更受欢迎
|
||||
</view>
|
||||
<view class="title">
|
||||
你的生日是?
|
||||
</view>
|
||||
<view class="desc">
|
||||
给你推荐年龄相近的异性
|
||||
</view>
|
||||
<view class="birthday">
|
||||
<picker-view :indicator-style="indicatorStyle" indicator-class="indicator-class" mask-class="mask-class" :value="value" @change="bindChange" class="picker-view">
|
||||
<picker-view-column>
|
||||
<view class="item" :class="{current: item == year}" v-for="(item,index) in years" :key="index">{{item}}年</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view class="item" :class="{current: index == month - 1}" v-for="(item,index) in months" :key="index">{{item}}月</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view class="item" :class="{current: index == day - 1}" v-for="(item,index) in days" :key="index">{{item}}日</view>
|
||||
</picker-view-column>
|
||||
</picker-view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="btn-wrapper">
|
||||
<u-button text="继续" color="linear-gradient(#95258d, #440a5f);" :disabled="disabled" shape="circle"
|
||||
@click="handleSubmit"></u-button>
|
||||
</view>
|
||||
<u-safe-bottom></u-safe-bottom>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data: function() {
|
||||
const date = new Date()
|
||||
const years = []
|
||||
const months = []
|
||||
const month = date.getMonth() + 1
|
||||
const days = []
|
||||
const day = date.getDate()
|
||||
for (let i = 1950; i <= date.getFullYear() - 18; i++) {
|
||||
years.push(i)
|
||||
}
|
||||
for (let i = 1; i <= 12; i++) {
|
||||
months.push(i)
|
||||
}
|
||||
for (let i = 1; i <= 31; i++) {
|
||||
days.push(i)
|
||||
}
|
||||
const year = years[40]
|
||||
return {
|
||||
title: 'picker-view',
|
||||
years,
|
||||
year,
|
||||
months,
|
||||
month,
|
||||
days,
|
||||
day,
|
||||
value: [40, month - 1, day - 1],
|
||||
indicatorStyle: `height: 50px;color: #FFF;`
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
bindChange: function(e) {
|
||||
const val = e.detail.value
|
||||
this.year = this.years[val[0]]
|
||||
this.month = this.months[val[1]]
|
||||
this.day = this.days[val[2]]
|
||||
},
|
||||
handleSubmit(){
|
||||
|
||||
const userBase = uni.getStorageSync('UserBase') || {}
|
||||
userBase.birthday = [this.year,this.month,this.day].join("-")
|
||||
uni.setStorageSync("UserBase", userBase)
|
||||
this.$push('/sub_pages/user/base/height/height')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "../base.scss";
|
||||
.birthday{
|
||||
margin-top: 100rpx;
|
||||
}
|
||||
|
||||
</style>
|
||||
80
sub_pages/user/base/height/height.vue
Normal file
80
sub_pages/user/base/height/height.vue
Normal file
@@ -0,0 +1,80 @@
|
||||
<template>
|
||||
<view class="page-wrap">
|
||||
<view class="page-bg">
|
||||
<u-navbar leftIconColor="#FFFFFF" :autoBack="true" bg-color="transparent" safeAreaInsetTop placeholder></u-navbar>
|
||||
<view class="notice">
|
||||
请如实填写个人资料,真实的资料会更受欢迎
|
||||
</view>
|
||||
<view class="title">
|
||||
你的身高是?
|
||||
</view>
|
||||
<view class="desc">
|
||||
</view>
|
||||
<view class="height">
|
||||
<picker-view :indicator-style="indicatorStyle" indicator-class="indicator-class" mask-class="mask-class"
|
||||
:value="value" @change="bindChange" class="picker-view">
|
||||
<picker-view-column>
|
||||
<view class="item" :class="{current: index == value[0]}" v-for="(item,index) in heightList" :key="index">{{item}}</view>
|
||||
</picker-view-column>
|
||||
</picker-view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="btn-wrapper">
|
||||
<u-button text="继续" color="linear-gradient(#95258d, #440a5f);" :disabled="disabled"
|
||||
shape="circle" @click="handleSubmit()"></u-button>
|
||||
</view>
|
||||
<u-safe-bottom></u-safe-bottom>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as DictApi from '@/api/dict.js'
|
||||
export default {
|
||||
data: function() {
|
||||
// const heightList = []
|
||||
// for (let i = 140; i <= 200; i++) {
|
||||
// heightList.push(i)
|
||||
// }
|
||||
return {
|
||||
title: 'picker-view',
|
||||
heightList: [],
|
||||
height: 165,
|
||||
|
||||
value: [0],
|
||||
indicatorStyle: `height: 50px;color: #FFF;`,
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.loadData()
|
||||
},
|
||||
methods: {
|
||||
bindChange: function(e) {
|
||||
this.value = e.detail.value
|
||||
},
|
||||
handleSubmit(){
|
||||
const userBase = uni.getStorageSync('UserBase') || {}
|
||||
userBase.height = this.heightList[this.value[0]]
|
||||
uni.setStorageSync("UserBase", userBase)
|
||||
this.$push('/sub_pages/user/base/address/address')
|
||||
},
|
||||
loadData() {
|
||||
DictApi.listDictionary().then(res => {
|
||||
this.heightList = res.data.height[0];
|
||||
this.$nextTick(()=>{
|
||||
this.value = [25]
|
||||
})
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "../base.scss";
|
||||
.height{
|
||||
margin-top: 200rpx;
|
||||
}
|
||||
</style>
|
||||
129
sub_pages/user/base/nickname/nickname.vue
Normal file
129
sub_pages/user/base/nickname/nickname.vue
Normal file
@@ -0,0 +1,129 @@
|
||||
<template>
|
||||
<view class="page-wrap">
|
||||
<view class="page-bg">
|
||||
<u-navbar leftIconColor="#FFFFFF" :autoBack="true" bg-color="transparent" safeAreaInsetTop placeholder></u-navbar>
|
||||
<view class="notice">
|
||||
请如实填写个人资料,真实的资料会更受欢迎
|
||||
</view>
|
||||
<view class="title">
|
||||
你的昵称是?
|
||||
</view>
|
||||
<view class="desc">
|
||||
</view>
|
||||
<view class="nickname">
|
||||
<u-input color="#FFFFFF" shape="circle" slot="value" class="nickname-input" v-model="nickname" type="nickname" maxlength="8" placeholder="请输入昵称" />
|
||||
</view>
|
||||
|
||||
|
||||
<view class="btn-wrapper">
|
||||
<u-button v-if="nickname == null || nickname == ''" text="继续" color="#837C8B" shape="circle" ></u-button>
|
||||
<u-button v-else text="继续" color="linear-gradient(#95258d, #440a5f);" shape="circle" @click="handleSubmit"></u-button>
|
||||
</view>
|
||||
<u-safe-bottom></u-safe-bottom>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as UserProfileApi from '@/api/love-user-profile.js'
|
||||
import {
|
||||
dateFormat
|
||||
} from '@/utils/util.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
nickname: null,
|
||||
disabled: false,
|
||||
form: {
|
||||
userInfo: null
|
||||
},
|
||||
interest: null,
|
||||
fileList1: null
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.loadData();
|
||||
},
|
||||
methods: {
|
||||
loadData() {
|
||||
const app = this
|
||||
const userId = uni.getStorageSync('userId')
|
||||
UserProfileApi.getUserProfile(userId).then(res => {
|
||||
app.form = res.data
|
||||
const userInfo = res.data.userInfo
|
||||
app.form.avatar = userInfo.avatar
|
||||
app.form.nickname = userInfo.nickname
|
||||
app.form.comments = userInfo.comments
|
||||
app.form.sexName = userInfo.sexName
|
||||
app.form.birthday = userInfo.birthday
|
||||
app.interest = JSON.parse(app.form.interest)
|
||||
app.fileList1 = JSON.parse(app.form.images)
|
||||
app.isLogin = false
|
||||
}).catch(err => {
|
||||
app.$success(err)
|
||||
})
|
||||
},
|
||||
handleSubmit() {
|
||||
const userBase = uni.getStorageSync('UserBase') || {}
|
||||
userBase.nickname = this.nickname
|
||||
uni.setStorageSync("UserBase", userBase)
|
||||
this.updateUserInfo()
|
||||
// this.$push('/sub_pages/user/base/sex/sex')
|
||||
},
|
||||
updateUserInfo() {
|
||||
const app = this
|
||||
const userBase = uni.getStorageSync('UserBase') || {}
|
||||
app.form.interest = JSON.stringify(app.interest)
|
||||
this.form.province = userBase.province.label
|
||||
this.form.city = userBase.city.label
|
||||
this.form.region = userBase.region.label
|
||||
this.form.area = `${userBase.province.label} ${userBase.city.label} ${userBase.region.label}`
|
||||
this.form.sex = userBase.sex
|
||||
this.form.yearlyPay = userBase.yearlyPay
|
||||
this.form.nickname = userBase.nickname
|
||||
this.form.height = userBase.height
|
||||
this.form.birthday = userBase.birthday
|
||||
this.form.images = JSON.stringify(userBase.images)
|
||||
this.form.avatar = userBase.avatar
|
||||
// 同步user表
|
||||
this.form.userInfo.province = userBase.province.label
|
||||
this.form.userInfo.city = userBase.city.label
|
||||
this.form.userInfo.region = userBase.region.label
|
||||
this.form.userInfo.address = `${userBase.province.label} ${userBase.city.label} ${userBase.region.label}`
|
||||
this.form.userInfo.nickname = userBase.nickname
|
||||
this.form.userInfo.height = userBase.height
|
||||
this.form.userInfo.yearlyPay = userBase.yearlyPay
|
||||
this.form.userInfo.sex = userBase.sex
|
||||
this.form.userInfo.birthday = userBase.birthday
|
||||
this.form.userInfo.avatar = userBase.avatar
|
||||
|
||||
// 计算年龄
|
||||
const birthdayYear = dateFormat('YYYY', new Date(userBase.birthday))
|
||||
const age = new Date().getFullYear() - birthdayYear
|
||||
this.form.age = age
|
||||
this.form.userInfo.age = age
|
||||
UserProfileApi.updateUserProfile(app.form).then(result => {
|
||||
uni.reLaunch({
|
||||
url: "/pages/index/index"
|
||||
})
|
||||
}).catch(err => {
|
||||
uni.$u.toast(err)
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "../base.scss";
|
||||
|
||||
.nickname{
|
||||
width: 690rpx;
|
||||
margin: 140rpx auto 0;
|
||||
&-input {
|
||||
background-color: #FFFFFF;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
323
sub_pages/user/base/photo/photo.vue
Normal file
323
sub_pages/user/base/photo/photo.vue
Normal file
@@ -0,0 +1,323 @@
|
||||
<template>
|
||||
<view class="page-wrap">
|
||||
<view class="page-bg">
|
||||
<u-navbar leftIconColor="#FFFFFF" :autoBack="true" bg-color="transparent" safeAreaInsetTop
|
||||
placeholder></u-navbar>
|
||||
<view class="notice">
|
||||
请如实填写个人资料,真实的资料会更受欢迎
|
||||
</view>
|
||||
<view class="title">
|
||||
上传形象照
|
||||
</view>
|
||||
<view class="desc">
|
||||
可上传工作照、生活照,能获得更多青睐喔~
|
||||
</view>
|
||||
<view class="nickname">
|
||||
<button class="btn-avatar u-reset-button" @click="onChooseAvatar(0)">
|
||||
<image class="btn-avatar-plus" v-if="!fileList1[0].url" src="@/static/icon/path.png" mode="widthFix"></image>
|
||||
<image class="avatar-img" v-else :src="fileList1[0].url" mode="widthFix"></image>
|
||||
</button>
|
||||
<button class="btn-avatar u-reset-button" @click="onChooseAvatar(1)">
|
||||
<image class="btn-avatar-plus" v-if="!fileList1[1].url" src="@/static/icon/path.png" mode="widthFix"></image>
|
||||
<image class="avatar-img" v-else :src="fileList1[1].url" mode="widthFix"></image>
|
||||
</button>
|
||||
<button class="btn-avatar u-reset-button" @click="onChooseAvatar(2)">
|
||||
<image class="btn-avatar-plus" v-if="!fileList1[2].url" src="@/static/icon/path.png" mode="widthFix"></image>
|
||||
<image class="avatar-img" v-else :src="fileList1[2].url" mode="widthFix"></image>
|
||||
</button>
|
||||
</view>
|
||||
<view class="tips">
|
||||
<view class="tips-item">
|
||||
<image src="https://file-jimei.oss-cn-shenzhen.aliyuncs.com/static/user-base/5.png" mode="aspectFill" class="tips-item-image"></image>
|
||||
<view class="tips-item-text">999+喜欢</view>
|
||||
<image class="tips-ft" src="@/static/user-base/y.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="tips-item">
|
||||
<image src="https://file-jimei.oss-cn-shenzhen.aliyuncs.com/static/user-base/4.png" mode="aspectFill" class="tips-item-image"></image>
|
||||
<view class="tips-item-text">暴露照</view>
|
||||
<image class="tips-ft" src="@/static/user-base/n.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="tips-item">
|
||||
<image src="https://file-jimei.oss-cn-shenzhen.aliyuncs.com/static/user-base/3.png" mode="aspectFill" class="tips-item-image"></image>
|
||||
<view class="tips-item-text">模糊照</view>
|
||||
<image class="tips-ft" src="@/static/user-base/n.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="tips-item">
|
||||
<image src="https://file-jimei.oss-cn-shenzhen.aliyuncs.com/static/user-base/2.png" mode="aspectFill" class="tips-item-image"></image>
|
||||
<view class="tips-item-text">非人物照</view>
|
||||
<image class="tips-ft" src="@/static/user-base/n.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="tips-item">
|
||||
<image src="https://file-jimei.oss-cn-shenzhen.aliyuncs.com/static/user-base/1.png" mode="aspectFill" class="tips-item-image"></image>
|
||||
<view class="tips-item-text">网络图片</view>
|
||||
<image class="tips-ft" src="@/static/user-base/n.png" mode="widthFix"></image>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="btn-wrapper-pla">
|
||||
|
||||
</view>
|
||||
<view class="btn-wrapper">
|
||||
<u-button v-if="fileList1 == null || fileList1.length == 0" text="继续" color="#837C8B" shape="circle" @click="handleSubmit"></u-button>
|
||||
<u-button v-else text="继续" color="linear-gradient(#95258d, #440a5f);" shape="circle" @click="handleSubmit"></u-button>
|
||||
<view @click="handleSubmit" class="btn-skip">
|
||||
跳过
|
||||
</view>
|
||||
</view>
|
||||
<u-safe-bottom></u-safe-bottom>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as UserProfileApi from '@/api/love-user-profile.js'
|
||||
import * as UploadApi from '@/api/upload'
|
||||
import {
|
||||
dateFormat
|
||||
} from '@/utils/util.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
avatarTemp: '',
|
||||
fileList1: [{url: ''},{url: ''},{url: ''}],
|
||||
avatar: '',
|
||||
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
},
|
||||
methods: {
|
||||
async cropperOk(e) {
|
||||
const res = await this.uploadFilePromise(e.path)
|
||||
this.avatarTemp = ''
|
||||
this.avatar = res.url
|
||||
},
|
||||
async onChooseAvatar({
|
||||
detail
|
||||
}) {
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
success: (res) => {
|
||||
this.avatarTemp = res.tempFilePaths[0]
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
onChooseAvatar(index) {
|
||||
const app = this
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
success: (res) => {
|
||||
app.uploadFilePromise(res.tempFilePaths[0]).then(result => {
|
||||
console.log('index: ',index);
|
||||
console.log('app.fileList1: ',app.fileList1);
|
||||
app.fileList1[index].url = result.url
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
handleSubmit() {
|
||||
|
||||
|
||||
const userBase = uni.getStorageSync('UserBase') || {}
|
||||
userBase.images = this.fileList1.filter(item => item.url)
|
||||
if(userBase.images.length == 0){
|
||||
userBase.images = [{url: userBase.avatar}]
|
||||
}
|
||||
uni.setStorageSync("UserBase", userBase)
|
||||
this.$push('/sub_pages/user/base/nickname/nickname')
|
||||
},
|
||||
// 删除图片
|
||||
deletePic(event) {
|
||||
this[`fileList${event.name}`].splice(event.index, 1)
|
||||
},
|
||||
// 新增图片
|
||||
async afterRead(event) {
|
||||
console.log("event: ", event);
|
||||
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
|
||||
let lists = [].concat(event.file)
|
||||
let fileListLen = this[`fileList${event.name}`].length
|
||||
lists.map((item) => {
|
||||
this[`fileList${event.name}`].push({
|
||||
...item,
|
||||
status: 'uploading',
|
||||
message: '上传中'
|
||||
})
|
||||
})
|
||||
for (let i = 0; i < lists.length; 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, {
|
||||
status: 'success',
|
||||
message: '',
|
||||
url: result.url,
|
||||
thumb: result.thumbUrl
|
||||
}))
|
||||
fileListLen++
|
||||
}
|
||||
},
|
||||
uploadFilePromise(url) {
|
||||
return new Promise((resolve, reject) => {
|
||||
UploadApi.uploadFile({
|
||||
filePath: url,
|
||||
fileType: 'image',
|
||||
name: 'file',
|
||||
header: {
|
||||
Authorization: uni.getStorageSync('AccessToken')
|
||||
},
|
||||
}).then(result => {
|
||||
setTimeout(() => {
|
||||
resolve(result.data)
|
||||
}, 1000)
|
||||
}).catch(err => {
|
||||
console.log("err: ", err);
|
||||
})
|
||||
// UploadApi.uploadFile()
|
||||
// let a = uni.uploadFile({
|
||||
// url: fileUrl + '/file/image', // 仅为示例,非真实的接口地址
|
||||
// filePath: url,
|
||||
// name: 'file',
|
||||
// header: {
|
||||
// Authorization: uni.getStorageSync('AccessToken')
|
||||
// },
|
||||
// formData: {
|
||||
// user: 'test'
|
||||
// },
|
||||
// success: (res) => {
|
||||
// const result = JSON.parse(res.data)
|
||||
// setTimeout(() => {
|
||||
// resolve(result)
|
||||
// }, 1000)
|
||||
// }
|
||||
// });
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "../base.scss";
|
||||
.avatar{
|
||||
margin: 100rpx 0 100rpx 0;
|
||||
}
|
||||
|
||||
.btn-avatar{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.nickname {
|
||||
width: 690rpx;
|
||||
margin: 160rpx auto 120rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
&-input {
|
||||
background-color: #FFFFFF;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
/deep/.u-upload__wrap {
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
&::after {
|
||||
content: '';
|
||||
width: 200rpx;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
/deep/.u-upload__button {
|
||||
background-color: rgba(#6A6A6A, .6) !important;
|
||||
border-radius: 10rpx !important;
|
||||
border: 4rpx rgba(#BBBBBB, .5) solid;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.tips {
|
||||
display: flex;
|
||||
width: 640rpx;
|
||||
margin: 10rpx auto;
|
||||
justify-content: space-between;
|
||||
|
||||
|
||||
&-item {
|
||||
width: 104rpx;
|
||||
font-size: 24rpx;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
&-image {
|
||||
width: 104rpx;
|
||||
height: 104rpx;
|
||||
}
|
||||
|
||||
&-text {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
}
|
||||
.tips-ft{
|
||||
width: 20rpx;
|
||||
position: absolute;
|
||||
right: 6rpx;
|
||||
top: 82rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-avatar{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 320rpx;
|
||||
height: 320rpx;
|
||||
background: rgba(15, 0, 32, 0.5);
|
||||
border: 2rpx solid rgb(151, 99, 157);
|
||||
|
||||
border-radius: 10rpx;
|
||||
overflow: hidden;
|
||||
|
||||
.btn-avatar-plus{
|
||||
width: 72rpx;
|
||||
height: 72rpx;
|
||||
}
|
||||
.avatar-img{
|
||||
width: 320rpx;
|
||||
height: 320rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-skip{
|
||||
font-size: 32rpx;
|
||||
text-align: center;
|
||||
margin-top: 64rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.btn-avatar{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
background: rgba(15, 0, 32, 0.5);
|
||||
border: 2rpx solid rgb(151, 99, 157);
|
||||
|
||||
border-radius: 10rpx;
|
||||
overflow: hidden;
|
||||
|
||||
.btn-avatar-plus{
|
||||
width: 72rpx;
|
||||
height: 72rpx;
|
||||
}
|
||||
.avatar-img{
|
||||
width: 320rpx;
|
||||
height: 320rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
100
sub_pages/user/base/sex/sex.vue
Normal file
100
sub_pages/user/base/sex/sex.vue
Normal file
@@ -0,0 +1,100 @@
|
||||
<template>
|
||||
<view class="page-wrap">
|
||||
<view class="page-bg">
|
||||
<u-navbar leftIconColor="#FFFFFF" :autoBack="true" bg-color="transparent" safeAreaInsetTop placeholder></u-navbar>
|
||||
<view class="notice">
|
||||
请如实填写个人资料,真实的资料会更受欢迎
|
||||
</view>
|
||||
<view class="title">
|
||||
你的性别是?
|
||||
</view>
|
||||
<view class="desc">
|
||||
注册后将无法更改,请认真填写
|
||||
</view>
|
||||
<view class="sex">
|
||||
<view :class="{current: sex == 1}" @click="sex = 1" class="sex-item">
|
||||
<image class="sex-item-icon" :src="sex == 1 ? 'https://file-jimei.oss-cn-shenzhen.aliyuncs.com/static/boy-02.png' : 'https://file-jimei.oss-cn-shenzhen.aliyuncs.com/static/boy-01.png'" mode="aspectFill"></image>
|
||||
<view class="sex-item-text">
|
||||
男
|
||||
</view>
|
||||
<image src="../../../../static/icon/gou.png" v-if="sex == 1" class="gou"></image>
|
||||
</view>
|
||||
<view :class="{current: sex == 2}" @click="sex = 2" class="sex-item" style="margin-top: 50rpx;">
|
||||
<image class="sex-item-icon" :src="sex == 2 ? 'https://file-jimei.oss-cn-shenzhen.aliyuncs.com/static/girl-02.png' : 'https://file-jimei.oss-cn-shenzhen.aliyuncs.com/static/girl-01.png'" mode="aspectFill"></image>
|
||||
<view class="sex-item-text">
|
||||
女
|
||||
</view>
|
||||
<image src="../../../../static/icon/gou.png" v-if="sex == 2" class="gou"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="btn-wrapper">
|
||||
<u-button v-if="sex == null" text="继续" color="#837C8B" shape="circle" ></u-button>
|
||||
<u-button v-else text="继续" color="linear-gradient(#95258d, #440a5f);" shape="circle" @click="handleSubmit"></u-button>
|
||||
</view>
|
||||
<u-safe-bottom></u-safe-bottom>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
sex: null
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
handleSubmit() {
|
||||
console.log('this.sex: ', this.sex);
|
||||
if (this.sex != null) {
|
||||
const userBase = uni.getStorageSync('UserBase') || {}
|
||||
userBase.sex = this.sex
|
||||
uni.setStorageSync("UserBase", userBase)
|
||||
this.$push('/sub_pages/user/base/birthday/birthday')
|
||||
}else {
|
||||
if (!this.avatar) {
|
||||
uni.showToast({
|
||||
title: '请选择性别',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "../base.scss";
|
||||
|
||||
.sex {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
margin-top: 200rpx;
|
||||
|
||||
&-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
opacity: .4;
|
||||
|
||||
&.current {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
&-icon {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
border-radius: 50%;
|
||||
// background-color: #FFF;
|
||||
}
|
||||
|
||||
&-text {
|
||||
font-size: 28rpx;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
80
sub_pages/user/base/yearpay/yearpay.vue
Normal file
80
sub_pages/user/base/yearpay/yearpay.vue
Normal file
@@ -0,0 +1,80 @@
|
||||
<template>
|
||||
<view class="page-wrap">
|
||||
<view class="page-bg">
|
||||
<u-navbar leftIconColor="#FFFFFF" :autoBack="true" bg-color="transparent" safeAreaInsetTop placeholder></u-navbar>
|
||||
<view class="notice">
|
||||
请如实填写个人资料,真实的资料会更受欢迎
|
||||
</view>
|
||||
<view class="title">
|
||||
你的年收入是?
|
||||
</view>
|
||||
<view class="desc">
|
||||
</view>
|
||||
<view class="height">
|
||||
<picker-view :indicator-style="indicatorStyle" indicator-class="indicator-class" mask-class="mask-class"
|
||||
:value="value" @change="bindChange" class="picker-view">
|
||||
<picker-view-column>
|
||||
<view :class="{current: index == value[0]}" class="item" v-for="(item,index) in heightList" :key="index">{{item}}</view>
|
||||
</picker-view-column>
|
||||
</picker-view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="btn-wrapper">
|
||||
<u-button text="继续" color="linear-gradient(#95258d, #440a5f);" :disabled="disabled"
|
||||
shape="circle" @click="handleSubmit()"></u-button>
|
||||
</view>
|
||||
<u-safe-bottom></u-safe-bottom>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as DictApi from '@/api/dict.js'
|
||||
export default {
|
||||
data: function() {
|
||||
// const heightList = []
|
||||
// for (let i = 140; i <= 200; i++) {
|
||||
// heightList.push(i)
|
||||
// }
|
||||
return {
|
||||
title: 'picker-view',
|
||||
heightList: [],
|
||||
height: 165,
|
||||
|
||||
value: [0],
|
||||
indicatorStyle: `height: 50px;color: #FFF;`,
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.loadData()
|
||||
},
|
||||
methods: {
|
||||
bindChange: function(e) {
|
||||
this.value = e.detail.value
|
||||
},
|
||||
handleSubmit(){
|
||||
const userBase = uni.getStorageSync('UserBase') || {}
|
||||
userBase.yearlyPay = this.heightList[this.value[0]]
|
||||
console.log(userBase);
|
||||
uni.setStorageSync("UserBase", userBase)
|
||||
this.$push('/sub_pages/user/base/avatar/avatar')
|
||||
},
|
||||
loadData() {
|
||||
DictApi.listDictionary().then(res => {
|
||||
this.heightList = res.data.yearlyPay[0];
|
||||
this.$nextTick(()=>{
|
||||
this.value = [1]
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "../base.scss";
|
||||
.height{
|
||||
margin-top: 200rpx;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user