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"> <!-- <link rel="stylesheet" href="__APP__/css/userShowIndex.css">
<style media="screen"> <style media="screen">
.bot_box #con_num, .bot_box img,.bot_box div{ .bot_box #con_num, .bot_box img,.bot_box div{
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
</style> --> </style> -->
<style type="text/css"> <style type="text/css">
.van-cell__title { .van-cell__title {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -25,23 +24,20 @@ ...@@ -25,23 +24,20 @@
.van-cell::after { .van-cell::after {
right: 1rem; right: 1rem;
} }
</style> </style>
<div id="app"> <div id="app">
<div class="layout_v"> <div class="layout_v">
<van-cell title="头像" is-link> <van-cell title="头像" is-link>
<slot> <slot>
<van-uploader <van-uploader result-type="file" :after-read="onRead">
result-type="file"
:after-read="onRead">
<van-image @error="onError" height="44" width="44" fit="cover" round :src="currentAvatar" /> <van-image @error="onError" height="44" width="44" fit="cover" round :src="currentAvatar" />
</van-uploader> </van-uploader>
</slot> </slot>
</van-cell> </van-cell>
<van-cell @click="onNickName" title="昵称" is-link :value="currentNickName" ></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="onGender" title="性别" is-link :value="currentGender"></van-cell>
<van-cell @click="onAddress" title="收货信息" is-link ></van-cell> <van-cell @click="onAddress" title="收货信息" is-link></van-cell>
<div @click="onConfirm" class="confirm_button" style="margin-top: 7.125rem;"> <div @click="onConfirm" class="confirm_button" style="margin-top: 7.125rem;">
<span>确认修改</span> <span>确认修改</span>
</div> </div>
...@@ -216,7 +212,7 @@ ...@@ -216,7 +212,7 @@
ui.error('昵称仅支持中英文、数字、下划线') ui.error('昵称仅支持中英文、数字、下划线')
return return
} }
$.post(U('home/User/saveUser'), {}, function (data) { $.post(U('home/User/saveUser'), {}, function(data) {
if (data.status) { if (data.status) {
ui.success('基本信息更改成功'); ui.success('基本信息更改成功');
setTimeout('window.location.reload();', 2000); setTimeout('window.location.reload();', 2000);
...@@ -226,13 +222,22 @@ ...@@ -226,13 +222,22 @@
}, 'json'); }, 'json');
}, },
onRead: function(r) { onRead: function(r) {
if ("undefined" != typeof (core.uploadFile)) { let formData = new FormData()
core.uploadFile.filehash = new Array(); 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'
core.plugInit('uploadFile', {}, function (data) { $.ajax({
let picurl = data.save_path + data.save_name; url: url,
type: "post",
data: formData,
contentType: false,
processData: false,
success: function(data) {
console.log(data) console.log(data)
}, 'image'); },
error: function(data) {
console.log(data)
}
})
}, },
onNickName: function() { onNickName: function() {
...@@ -250,4 +255,4 @@ ...@@ -250,4 +255,4 @@
}) })
</script> </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