parent
5fd3df9095
commit
fbb4d41934
@ -0,0 +1,213 @@ |
||||
<template> |
||||
<div> |
||||
|
||||
<el-form ref="form" :model="form"> |
||||
<el-form-item> |
||||
<el-row> |
||||
<el-col :span="22"> |
||||
<el-input v-model="form.oldpassword" autofocus="true" prefix-icon="el-icon-user" |
||||
placeholder="真实姓名" clearable></el-input> |
||||
</el-col> |
||||
</el-row> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-row> |
||||
<el-col :span="22"> |
||||
<el-input v-model="form.newpassword" clearable prefix-icon="el-icon-s-order" |
||||
placeholder="身份证号"></el-input> |
||||
</el-col> |
||||
</el-row> |
||||
</el-form-item> |
||||
|
||||
<el-form-item> |
||||
<el-row> |
||||
<el-col :span="22"> |
||||
<el-input v-model="form.surepassword" clearable prefix-icon="el-icon-house" |
||||
placeholder="居住地"></el-input> |
||||
</el-col> |
||||
</el-row> |
||||
</el-form-item> |
||||
|
||||
<el-form-item label="身份证" style="width: 100%"> |
||||
|
||||
<div class="appdownload"> |
||||
<el-image |
||||
style="width: 155px;height: 188px;margin-right: 20px;background-color: #d1eef9;float: left" |
||||
fit="scale-down" |
||||
@click="delscreen(screen.id)" |
||||
v-for="(screen) in user_certification" :key="screen.id" :src="screen.url" alt=""/> |
||||
<div style="width: 155px;height: 188px;background-color: #d1eef9;float: left" |
||||
v-if="user_certification && user_certification.length < 2"> |
||||
<el-upload |
||||
drag |
||||
action="#" |
||||
accept=".png , .jpg , .jpeg" |
||||
:before-upload="beforeAvatarUpload"> |
||||
<i class="el-icon-upload"></i> |
||||
</el-upload> |
||||
</div> |
||||
|
||||
</div> |
||||
|
||||
</el-form-item> |
||||
|
||||
|
||||
<el-form-item> |
||||
<el-row> |
||||
<el-col :span="22"> |
||||
<el-input v-model="form.mobile" ref="phone" clearable |
||||
prefix-icon="el-icon-mobile" placeholder="请输入手机号码" maxlength="11"></el-input> |
||||
</el-col> |
||||
</el-row> |
||||
</el-form-item> |
||||
|
||||
<el-form-item style="height: 40px" v-if="cptch.cptch_image"> |
||||
<el-row style="height: 40px" :gutter="10"> |
||||
<el-col :span="11"> |
||||
<el-input placeholder="请输入图片验证码" v-model="userinfo.authcode" maxlength="6"></el-input> |
||||
</el-col> |
||||
<el-col :span="8"> |
||||
<el-image |
||||
style="margin:0px 4px;border-radius:4px;cursor:pointer;height: 40px" |
||||
:src="cptch.cptch_image" |
||||
fit="contain" @click="get_auth_code"> |
||||
</el-image> |
||||
</el-col> |
||||
</el-row> |
||||
</el-form-item> |
||||
|
||||
<el-form-item> |
||||
<el-row :gutter="10"> |
||||
<el-col :span="16"> |
||||
<el-input v-model="userinfo.auth_key" prefix-icon="el-icon-mobile" placeholder="请输入您收到的验证码" |
||||
maxlength="6"></el-input> |
||||
</el-col> |
||||
<el-col :span="6"> |
||||
<el-button type="info" @click="getsmsemailcode('sms',userinfo.mobile)" plain |
||||
style="margin:0 4px;border-radius:4px;cursor:pointer;height: 40px;background-color: #ecf5ff;color: #dd6161"> |
||||
获取验证码 |
||||
</el-button> |
||||
</el-col> |
||||
|
||||
</el-row> |
||||
</el-form-item> |
||||
|
||||
|
||||
<el-form-item> |
||||
<el-row> |
||||
<el-col :span="22"> |
||||
<el-button type="danger" @click="updatepasswd">提交</el-button> |
||||
</el-col> |
||||
</el-row> |
||||
</el-form-item> |
||||
|
||||
</el-form> |
||||
|
||||
|
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import {userinfos} from "../restful"; |
||||
import {AvatarUploadUtils} from "../utils"; |
||||
|
||||
export default { |
||||
name: "FirUserProfileCertification", |
||||
data() { |
||||
return { |
||||
form: { |
||||
oldpassword: '', |
||||
newpassword: '', |
||||
surepassword: '' |
||||
}, |
||||
cptch: {}, |
||||
userinfo: {}, |
||||
user_certification: [], |
||||
} |
||||
}, methods: { |
||||
beforeAvatarUpload(file) { |
||||
// eslint-disable-next-line no-unused-vars |
||||
return AvatarUploadUtils(this, file, { |
||||
'app_id': this.$store.state.userinfo.uid, |
||||
'upload_key': file.name, |
||||
'ftype': 'certification', |
||||
'ext': {'type': 1} |
||||
}, res => { |
||||
}); |
||||
|
||||
}, |
||||
updatepasswd() { |
||||
if (this.form.newpassword === this.form.surepassword) { |
||||
|
||||
userinfos(data => { |
||||
if (data.code === 1000) { |
||||
this.userinfo = data.data; |
||||
this.$message.success('密码修改成功'); |
||||
} else { |
||||
this.$message.error('密码修改失败,' + data.msg); |
||||
} |
||||
}, { |
||||
"methods": 'PUT', 'data': { |
||||
"oldpassword": this.form.oldpassword, |
||||
"surepassword": this.form.surepassword |
||||
} |
||||
}); |
||||
} else { |
||||
this.$message.error('密码不一致'); |
||||
} |
||||
} |
||||
}, mounted() { |
||||
this.$store.dispatch('douserInfoIndex', 2); |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style scoped> |
||||
.el-form { |
||||
max-width: 360px; |
||||
margin: 0 auto; |
||||
} |
||||
|
||||
.el-form-item .el-button { |
||||
max-width: 360px; |
||||
width: 100%; |
||||
height: 50px; |
||||
} |
||||
|
||||
.appdownload /deep/ .el-upload-dragger { |
||||
background: #d1eef9; |
||||
width: 155px; |
||||
height: 188px; |
||||
} |
||||
|
||||
.appdownload /deep/ .el-icon-upload { |
||||
margin-top: 45%; |
||||
} |
||||
|
||||
.avatar-uploader .el-upload { |
||||
border: 1px dashed #d9d9d9; |
||||
border-radius: 6px; |
||||
cursor: pointer; |
||||
position: relative; |
||||
overflow: hidden; |
||||
} |
||||
|
||||
.avatar-uploader .el-upload:hover { |
||||
border-color: #409EFF; |
||||
} |
||||
|
||||
.avatar-uploader-icon { |
||||
font-size: 28px; |
||||
color: #8c939d; |
||||
width: 178px; |
||||
height: 178px; |
||||
line-height: 178px; |
||||
text-align: center; |
||||
} |
||||
|
||||
.avatar { |
||||
width: 178px; |
||||
height: 178px; |
||||
display: block; |
||||
} |
||||
</style> |
@ -0,0 +1,53 @@ |
||||
# Generated by Django 3.0.3 on 2021-03-29 14:10 |
||||
|
||||
from django.conf import settings |
||||
from django.db import migrations, models |
||||
import django.db.models.deletion |
||||
|
||||
|
||||
class Migration(migrations.Migration): |
||||
dependencies = [ |
||||
('api', '0024_auto_20210324_1751'), |
||||
] |
||||
|
||||
operations = [ |
||||
migrations.CreateModel( |
||||
name='Price', |
||||
fields=[ |
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
||||
('name', models.CharField(max_length=128, unique=True, verbose_name='下载包唯一名称')), |
||||
('title', models.CharField(max_length=128, verbose_name='下载包名称')), |
||||
('description', models.CharField(max_length=128, verbose_name='下载包描述')), |
||||
('price', models.FloatField(verbose_name='下载包价格')), |
||||
('package_size', models.BigIntegerField(verbose_name='下载包次数')), |
||||
('download_count_gift', models.IntegerField(default=0, verbose_name='赠送下载次数')), |
||||
('is_enable', models.BooleanField(default=True, verbose_name='是否启用该价格')), |
||||
('updated_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')), |
||||
], |
||||
options={ |
||||
'verbose_name': '价格列表', |
||||
'verbose_name_plural': '价格列表', |
||||
'unique_together': {('price', 'package_size')}, |
||||
}, |
||||
), |
||||
migrations.CreateModel( |
||||
name='Order', |
||||
fields=[ |
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
||||
('payment_type', models.SmallIntegerField(choices=[(0, '微信'), (1, '支付宝'), (2, '优惠码'), (4, '银联')])), |
||||
('payment_number', models.CharField(blank=True, max_length=128, null=True, verbose_name='支付第3方订单号')), |
||||
('order_number', models.CharField(max_length=128, unique=True, verbose_name='订单号')), |
||||
('actual_amount', models.FloatField(verbose_name='实付金额')), |
||||
('status', models.SmallIntegerField( |
||||
choices=[(0, '交易成功'), (1, '待支付'), (2, '退费申请中'), (3, '已退费'), (4, '主动取消'), (5, '超时取消')], |
||||
verbose_name='状态')), |
||||
('order_type', |
||||
models.SmallIntegerField(choices=[(0, '用户下单'), (1, '后台充值')], default=0, verbose_name='订单类型')), |
||||
('date', models.DateTimeField(auto_now_add=True, verbose_name='订单生成时间')), |
||||
('pay_time', models.DateTimeField(blank=True, null=True, verbose_name='付款时间')), |
||||
('cancel_time', models.DateTimeField(blank=True, null=True, verbose_name='订单取消时间')), |
||||
( |
||||
'account', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), |
||||
], |
||||
), |
||||
] |
@ -0,0 +1,17 @@ |
||||
# Generated by Django 3.0.3 on 2021-03-29 14:19 |
||||
|
||||
from django.db import migrations, models |
||||
|
||||
|
||||
class Migration(migrations.Migration): |
||||
dependencies = [ |
||||
('api', '0025_order_price'), |
||||
] |
||||
|
||||
operations = [ |
||||
migrations.AlterField( |
||||
model_name='price', |
||||
name='price', |
||||
field=models.BigIntegerField(verbose_name='下载包价格'), |
||||
), |
||||
] |
@ -0,0 +1,34 @@ |
||||
# Generated by Django 3.0.3 on 2021-03-29 15:06 |
||||
|
||||
from django.db import migrations, models |
||||
|
||||
|
||||
class Migration(migrations.Migration): |
||||
dependencies = [ |
||||
('api', '0026_auto_20210329_1419'), |
||||
] |
||||
|
||||
operations = [ |
||||
migrations.AddField( |
||||
model_name='order', |
||||
name='actual_download_gift_times', |
||||
field=models.BigIntegerField(default=0, verbose_name='实际赠送的数量'), |
||||
preserve_default=False, |
||||
), |
||||
migrations.AddField( |
||||
model_name='order', |
||||
name='actual_download_times', |
||||
field=models.BigIntegerField(default=0, verbose_name='实际购买的数量'), |
||||
preserve_default=False, |
||||
), |
||||
migrations.AlterField( |
||||
model_name='order', |
||||
name='actual_amount', |
||||
field=models.BigIntegerField(verbose_name='实付金额,单位分'), |
||||
), |
||||
migrations.AlterField( |
||||
model_name='price', |
||||
name='price', |
||||
field=models.BigIntegerField(verbose_name='下载包价格,单位分'), |
||||
), |
||||
] |
@ -0,0 +1,19 @@ |
||||
# Generated by Django 3.0.3 on 2021-03-29 15:12 |
||||
|
||||
from django.db import migrations, models |
||||
import django.utils.timezone |
||||
|
||||
|
||||
class Migration(migrations.Migration): |
||||
dependencies = [ |
||||
('api', '0027_auto_20210329_1506'), |
||||
] |
||||
|
||||
operations = [ |
||||
migrations.AddField( |
||||
model_name='order', |
||||
name='created_time', |
||||
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now, verbose_name='订单创建时间'), |
||||
preserve_default=False, |
||||
), |
||||
] |
@ -0,0 +1,16 @@ |
||||
# Generated by Django 3.0.3 on 2021-03-29 16:27 |
||||
|
||||
from django.db import migrations |
||||
|
||||
|
||||
class Migration(migrations.Migration): |
||||
dependencies = [ |
||||
('api', '0028_order_created_time'), |
||||
] |
||||
|
||||
operations = [ |
||||
migrations.RemoveField( |
||||
model_name='order', |
||||
name='date', |
||||
), |
||||
] |
@ -0,0 +1,27 @@ |
||||
# Generated by Django 3.0.3 on 2021-03-29 17:55 |
||||
|
||||
from django.db import migrations, models |
||||
|
||||
|
||||
class Migration(migrations.Migration): |
||||
dependencies = [ |
||||
('api', '0029_remove_order_date'), |
||||
] |
||||
|
||||
operations = [ |
||||
migrations.AddField( |
||||
model_name='order', |
||||
name='description', |
||||
field=models.TextField(blank=True, default='', null=True, verbose_name='备注'), |
||||
), |
||||
migrations.AlterField( |
||||
model_name='order', |
||||
name='actual_download_gift_times', |
||||
field=models.BigIntegerField(default=0, verbose_name='实际赠送的数量'), |
||||
), |
||||
migrations.AlterField( |
||||
model_name='order', |
||||
name='actual_download_times', |
||||
field=models.BigIntegerField(default=0, verbose_name='实际购买的数量'), |
||||
), |
||||
] |
@ -0,0 +1,51 @@ |
||||
# Generated by Django 3.0.3 on 2021-04-07 20:21 |
||||
|
||||
from django.conf import settings |
||||
from django.db import migrations, models |
||||
import django.db.models.deletion |
||||
|
||||
|
||||
class Migration(migrations.Migration): |
||||
dependencies = [ |
||||
('api', '0030_auto_20210329_1755'), |
||||
] |
||||
|
||||
operations = [ |
||||
migrations.CreateModel( |
||||
name='UserCertificationInfo', |
||||
fields=[ |
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
||||
('name', models.CharField(max_length=128, verbose_name='真实姓名')), |
||||
('card', models.CharField(max_length=128, verbose_name='身份证号码')), |
||||
('addr', models.CharField(max_length=128, verbose_name='居住地')), |
||||
('mobile', models.BigIntegerField(unique=True, verbose_name='手机号码')), |
||||
('status', models.SmallIntegerField(choices=[(0, '审核中'), (1, '审核成功'), (2, '审核失败')], default=0, |
||||
verbose_name='审核状态')), |
||||
('created_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')), |
||||
('user_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, |
||||
verbose_name='用户ID')), |
||||
], |
||||
options={ |
||||
'verbose_name': '用户认证信息', |
||||
'verbose_name_plural': '用户认证信息', |
||||
}, |
||||
), |
||||
migrations.CreateModel( |
||||
name='CertificationInfo', |
||||
fields=[ |
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
||||
('certification_url', models.CharField(blank=True, max_length=128, verbose_name='认证URL')), |
||||
('created_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')), |
||||
('user_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, |
||||
verbose_name='用户ID')), |
||||
], |
||||
options={ |
||||
'verbose_name': '身份证截图', |
||||
'verbose_name_plural': '身份证截图', |
||||
}, |
||||
), |
||||
migrations.AddIndex( |
||||
model_name='usercertificationinfo', |
||||
index=models.Index(fields=['card'], name='api_usercer_card_246743_idx'), |
||||
), |
||||
] |
@ -0,0 +1,19 @@ |
||||
# Generated by Django 3.0.3 on 2021-04-07 20:44 |
||||
|
||||
from django.db import migrations, models |
||||
|
||||
|
||||
class Migration(migrations.Migration): |
||||
dependencies = [ |
||||
('api', '0031_auto_20210407_2021'), |
||||
] |
||||
|
||||
operations = [ |
||||
migrations.AddField( |
||||
model_name='certificationinfo', |
||||
name='type', |
||||
field=models.SmallIntegerField(choices=[(0, '国徽面照片'), (1, '人像面照片'), (2, '手持身份证照片')], default=0, |
||||
verbose_name='图像类型'), |
||||
preserve_default=False, |
||||
), |
||||
] |
@ -0,0 +1,18 @@ |
||||
# Generated by Django 3.0.3 on 2021-04-07 20:45 |
||||
|
||||
from django.db import migrations, models |
||||
|
||||
|
||||
class Migration(migrations.Migration): |
||||
dependencies = [ |
||||
('api', '0032_certificationinfo_type'), |
||||
] |
||||
|
||||
operations = [ |
||||
migrations.AlterField( |
||||
model_name='certificationinfo', |
||||
name='type', |
||||
field=models.SmallIntegerField(choices=[(0, '未知'), (1, '国徽面照片'), (2, '人像面照片'), (3, '手持身份证照片')], default=0, |
||||
verbose_name='图像类型'), |
||||
), |
||||
] |
Loading…
Reference in new issue