Commit 4a43f4dd by 陈超

T

parent 1fedd3bf
<include file="__THEME__/public_header_w3g"/>
<include file="__THEME__/public_header_w3g" />
<!-- <link rel="stylesheet" href="__APP__/css/userShowIndex.css">
<style media="screen">
.bot_box #con_num, .bot_box img,.bot_box div{
......@@ -7,7 +7,6 @@
</style> -->
<style type="text/css">
.van-cell__title {
display: flex;
align-items: center;
......@@ -25,23 +24,20 @@
.van-cell::after {
right: 1rem;
}
</style>
<div id="app">
<div class="layout_v">
<van-cell title="头像" is-link>
<slot>
<van-uploader
result-type="file"
:after-read="onRead">
<van-uploader result-type="file" :after-read="onRead">
<van-image @error="onError" height="44" width="44" fit="cover" round :src="currentAvatar" />
</van-uploader>
</slot>
</van-cell>
<van-cell @click="onNickName" title="昵称" is-link :value="currentNickName" ></van-cell>
<van-cell @click="onGender" title="性别" is-link :value="currentGender" ></van-cell>
<van-cell @click="onAddress" title="收货信息" is-link ></van-cell>
<van-cell @click="onNickName" title="昵称" is-link :value="currentNickName"></van-cell>
<van-cell @click="onGender" title="性别" is-link :value="currentGender"></van-cell>
<van-cell @click="onAddress" title="收货信息" is-link></van-cell>
<div @click="onConfirm" class="confirm_button" style="margin-top: 7.125rem;">
<span>确认修改</span>
</div>
......@@ -216,7 +212,7 @@
ui.error('昵称仅支持中英文、数字、下划线')
return
}
$.post(U('home/User/saveUser'), {}, function (data) {
$.post(U('home/User/saveUser'), {}, function(data) {
if (data.status) {
ui.success('基本信息更改成功');
setTimeout('window.location.reload();', 2000);
......@@ -226,13 +222,22 @@
}, 'json');
},
onRead: function(r) {
if ("undefined" != typeof (core.uploadFile)) {
core.uploadFile.filehash = new Array();
}
core.plugInit('uploadFile', {}, function (data) {
let picurl = data.save_path + data.save_name;
let formData = new FormData()
formData.append('file', f.file)
let url = U('widget/Upload/save') + '&attach_type=avatar&upload_type=image&thumb=1&width=44&height=44&cut=false'
$.ajax({
url: url,
type: "post",
data: formData,
contentType: false,
processData: false,
success: function(data) {
console.log(data)
}, 'image');
},
error: function(data) {
console.log(data)
}
})
},
onNickName: function() {
......@@ -250,4 +255,4 @@
})
</script>
<include file="__THEME__/public_footer_w3g"/>
<include file="__THEME__/public_footer_w3g" />
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment