123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202 |
- <template>
- <view>
- <tui-bottom-popup :show="show">
- <tui-list-cell :hover="false">
- <view class="tui-item__title">
- <view>填写您的昵称、头像</view>
- <view class="titletxt">提供具有辨识度的用户中心界面</view>
- </view>
- <view class="tui-icon-close" @tap="close">
- <tui-icon name="shut" :size="22" color="#BFBFBF"></tui-icon>
- </view>
- </tui-list-cell>
- <button class="avatar-wrapper" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
- <tui-list-cell :hover="false" :lineLeft="false">
- <view class="tui-cell-input">
- <label style="padding-right: 60rpx;">头像</label>
- <image :src="userpic || '/static/images/my/mine_def_touxiang_3x.png'" class="tui-avatar"></image>
- <label class="getuserpic">获取头像</label>
- </view>
- </tui-list-cell>
- </button>
- <tui-list-cell :hover="false" :lineLeft="false">
- <view class="tui-cell-input">
- <label style="padding-right: 60rpx;">昵称</label>
- <!-- #ifndef MP-WEIXIN -->
- <input type="text" v-model="nickname" placeholder="请输入昵称" placeholder-class="tui-phcolor" />
- <!-- #endif -->
- <!-- #ifdef MP-WEIXIN -->
- <input type="nickname" v-model="nickname" @blur="inputNickname" @input="inputNickname" placeholder="请输入昵称" placeholder-class="tui-phcolor" />
- <!-- #endif -->
- </view>
- </tui-list-cell>
- <view class="tui-btn-pay">
- <button class="gopaybutt" @click="bindSave" :style="'background:'+ stylecolor">保存</button>
- </view>
- </tui-bottom-popup>
- </view>
- </template>
- <script>
- export default {
- name: 'membetreg',
- props: {
- //支付方式
- paymethod: {
- type: Array,
- default() {
- return [];
- }
- },
- //控制显示
- show: {
- type: Boolean,
- default: false
- },
- amuont:{
- type: String,
- default: ''
- },
- stylecolor:{
- type: String,
- default: '#ff1e02'
- },
- page: {
- type: Number,
- default: 1
- }
- },
- data() {
- return {
- paymentType:"",
- nickname: '',
- userpic:''
- };
- },
-
- methods: {
- bindSave() {
- let _this = this;
- _this.$request.post('member.update', {
- samkey: (new Date()).valueOf(),
- nickname: _this.nickname,
- userpic: _this.userpic,
- }).then(res => {
- if (res.errno == 0) {
- this.$emit("loginnextpage")
- }
- });
- },
- inputNickname(e) {
- this.nickname = e.detail.value;
- },
- clearInput() {
- this.nickname = '';
- },
- close() {
- this.$emit("close", {})
- },
- paymentradioChange(e) {
- this.paymentType = e.target.value
- },
- onChooseAvatar(e) {
- let _this = this;
- this.userpic = e.detail.avatarUrl;
- this.$request.uploadFile(e.detail.avatarUrl).then(res => {
- //console.log(res);
- _this.userpic = res.url;
- _this.$request.post('member.update', {
- userpic: _this.userpic
- }).then(res => {});
- });
- },
- onChooseAvatar2() {
- let _this = this;
- uni.chooseImage({
- count: 1,
- sizeType: ['original', 'compressed'],
- sourceType: ['album', 'camera'],
- success: res => {
- //console.log(res);
- _this.userpic = res.tempFilePaths[0];
- this.$request.uploadFile(_this.userpic).then(res => {
- //console.log(res);
- _this.userpic = res.url;
- _this.$request.post('member.update', {
- userpic: _this.userpic
- }).then(res => {});
- });
- }
- });
- },
- }
- }
- </script>
- <style lang="scss">
- .tui-item__title {
- width: 100%;
- padding-bottom: 20rpx;
- align-items: center;
- justify-content: space-between;
- box-sizing: border-box;
- font-size: 34rpx;
- font-weight: bold;
- }
- .titletxt {
- color: #999999;
- padding-top: 10rpx;
- font-size: 34rpx;
- font-weight: normal;
- }
- .tui-icon-close {
- position: absolute;
- right: 30rpx;
- top: 60rpx;
- transform: translateY(-50%);
- }
-
- .getuserpic {
- color: #999;
- padding-top: 10rpx;
- padding-left: 30rpx;
- }
- .tui-cell-input {
- width: 100%;
- display: flex;
- align-items: center;
- padding-top: 18rpx;
- padding-bottom: $uni-spacing-col-base;
-
- input {
- flex: 1;
- padding-left: $uni-spacing-row-base;
- }
- }
- .avatar-wrapper {
- padding-left: 0px;
- padding-right: 0px;
- box-sizing: border-box;
- border-radius: 0px;
- }
- .tui-avatar {
- width: 100rpx;
- height: 100rpx;
- border-radius: 50%;
- display: block;
- }
- .tui-btn-pay {
- width: 100%;
- padding: 68rpx 60rpx 50rpx;
- box-sizing: border-box;
- }
- .gopaybutt {
- height: 88rpx;
- line-height: 88rpx;
- font-size: 28rpx;
- border-radius: 50rpx;
- color: #ffffff;
- align-items: center;
- }
- </style>
|