profile.html
13.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
{php define('MUI', true);}
{template 'common/header'}
<form class="tab-content clearfix js-ajax-form {if $_W['container'] !== 'wechat'}profile-form{/if}" action="{url 'mc/profile/editprofile'}" method="post" enctype="multipart/form-data">
<div class="mui-content {if $do == 'index'}mc-profile{/if}">
{if $do == 'index'}
{if !empty($mcFields['avatar'])}
{php echo tpl_app_fans_form('avatar', $profile['avatar'] );}
{/if}
<div class="mui-input-group mui-mt15">
{if !empty($mcFields['nickname'])}
<div class="mui-input-row">
<label>{$mcFields['nickname']['title']}</label>
{php echo tpl_app_fans_form('nickname', $profile['nickname'], $mcFields['nickname']['title']);}
</div>
{/if}
<div class="mui-input-cell">
{php echo tpl_form_field_image('nickname');}
</div>
{if !empty($mcFields['realname'])}
<div class="mui-input-row">
<label>{$mcFields['realname']['title']}</label>
{php echo tpl_app_fans_form('realname', $profile['realname'], $mcFields['realname']['title']);}
</div>
{/if}
{if !empty($mcFields['gender'])}
<div class="mui-input-row">
<label>{$mcFields['gender']['title']}</label>
{php echo tpl_app_fans_form('gender', $profile['gender'], $mcFields['gender']['title']);}
</div>
{/if}
{if !empty($mcFields['birthyear'])}
<div class="mui-input-row">
<label>{$mcFields['birthyear']['title']}</label>
{php echo tpl_app_fans_form('birth', array('year' => $profile['birthyear'], 'month' => $profile['birthmonth'], 'day' => $profile['birthday']), $mcFields['birthyear']['title']);}
</div>
{/if}
{if !empty($mcFields['resideprovince'])}
<div class="mui-input-row">
<label>{$mcFields['resideprovince']['title']}</label>
{php echo tpl_app_fans_form('reside', array('province' => $profile['resideprovince'], 'city' => $profile['residecity'], 'district' => $profile['residedist']), $mcFields['resideprovince']['title']);}
</div>
{/if}
</div>
<ul class="mui-table-view mui-table-view-chevron">
<li class="mui-table-view-cell">
<a href="{php echo url('mc/profile/personal_info') . 'wxref=mp.weixin.qq.com#wechat_redirect'}" class="mui-navigate-right">个人信息</a>
</li>
<li class="mui-table-view-cell">
<a href="{php echo url('mc/profile/contact_method') . 'wxref=mp.weixin.qq.com#wechat_redirect'}" class="mui-navigate-right">联系方式</a>
</li>
<li class="mui-table-view-cell">
<a href="{php echo url('mc/profile/education_info') . 'wxref=mp.weixin.qq.com#wechat_redirect'}" class="mui-navigate-right">教育信息</a>
</li>
<li class="mui-table-view-cell">
<a href="{php echo url('mc/profile/jobedit') . 'wxref=mp.weixin.qq.com#wechat_redirect'}" class="mui-navigate-right">工作信息</a>
</li>
</ul>
{/if}
{if $do == 'personal_info'}
<div class="mui-content-padded mui-text-muted">请完善您的个人信息</div>
<div class="mui-input-group mui-mt15">
{if !empty($mcFields['idcard'])}
<div class="mui-input-row">
<label>{$mcFields['idcard']['title']}</label>
{php echo tpl_app_fans_form('idcard', $profile['idcard'], $mcFields['idcard']['title']);}
</div>
{/if}
{if !empty($mcFields['height'])}
<div class="mui-input-row">
<label>{$mcFields['height']['title']}</label>
{php echo tpl_app_fans_form('height', $profile['height'], $mcFields['height']['title']);}
</div>
{/if}
{if !empty($mcFields['weight'])}
<div class="mui-input-row">
<label>{$mcFields['weight']['title']}</label>
{php echo tpl_app_fans_form('weight', $profile['weight'], $mcFields['weight']['title']);}
</div>
{/if}
{if !empty($mcFields['bloodtype'])}
<div class="mui-input-row">
<label>{$mcFields['bloodtype']['title']}</label>
{php echo tpl_app_fans_form('bloodtype', $profile['bloodtype'], $mcFields['bloodtype']['title']);}
</div>
{/if}
{if !empty($mcFields['zodiac'])}
<div class="mui-input-row">
<label>{$mcFields['zodiac']['title']}</label>
{php echo tpl_app_fans_form('zodiac', $profile['zodiac'], $mcFields['zodiac']['title']);}
</div>
{/if}
{if !empty($mcFields['constellation'])}
<div class="mui-input-row">
<label>{$mcFields['constellation']['title']}</label>
{php echo tpl_app_fans_form('constellation', $profile['constellation'], $mcFields['constellation']['title']);}
</div>
{/if}
{if !empty($mcFields['site'])}
<div class="mui-input-row">
<label>{$mcFields['site']['title']}</label>
{php echo tpl_app_fans_form('site', $profile['site'], $mcFields['site']['title']);}
</div>
{/if}
{if !empty($mcFields['affectivestatus'])}
<div class="mui-input-row">
<label>{$mcFields['affectivestatus']['title']}</label>
{php echo tpl_app_fans_form('affectivestatus', $profile['affectivestatus'], $mcFields['affectivestatus']['title']);}
</div>
{/if}
{if !empty($mcFields['lookingfor'])}
<div class="mui-input-row">
<label>{$mcFields['lookingfor']['title']}</label>
{php echo tpl_app_fans_form('lookingfor', $profile['lookingfor'], $mcFields['lookingfor']['title']);}
</div>
{/if}
{if !empty($mcFields['bio'])}
<div class="mui-input-row">
<label>{$mcFields['bio']['title']}</label>
{php echo tpl_app_fans_form('bio', $profile['bio'], $mcFields['bio']['title']);}
</div>
{/if}
{if !empty($mcFields['interest'])}
<div class="mui-input-row">
<label>{$mcFields['interest']['title']}</label>
{php echo tpl_app_fans_form('interest', $profile['interest'], $mcFields['interest']['title']);}
</div>
{/if}
</div>
{/if}
{if $do == 'contact_method'}
<div class="mui-content-padded mui-text-muted">请完善您的联系方式</div>
<div class="mui-input-group mui-mt15">
{if !empty($mcFields['telephone'])}
<div class="mui-input-row">
<label>{$mcFields['telephone']['title']}</label>
{php echo tpl_app_fans_form('telephone', $profile['telephone'], $mcFields['telephone']['title']);}
</div>
{/if}
{if !empty($mcFields['qq'])}
<div class="mui-input-row">
<label>{$mcFields['qq']['title']}</label>
{php echo tpl_app_fans_form('qq', $profile['qq'], $mcFields['qq']['title']);}
</div>
{/if}
{if !empty($mcFields['msn'])}
<div class="mui-input-row">
<label>{$mcFields['msn']['title']}</label>
{php echo tpl_app_fans_form('msn', $profile['msn'], $mcFields['msn']['title']);}
</div>
{/if}
{if !empty($mcFields['taobao'])}
<div class="mui-input-row">
<label>{$mcFields['taobao']['title']}</label>
{php echo tpl_app_fans_form('taobao', $profile['taobao'], $mcFields['taobao']['title']);}
</div>
{/if}
{if !empty($mcFields['alipay'])}
<div class="mui-input-row">
<label>{$mcFields['alipay']['title']}</label>
{php echo tpl_app_fans_form('alipay', $profile['alipay'], $mcFields['alipay']['title']);}
</div>
{/if}
</div>
{/if}
{if $do == 'education_info'}
<div class="mui-content-padded mui-text-muted">请完善您的教育信息</div>
<div class="mui-input-group mui-mt15">
{if !empty($mcFields['education'])}
<div class="mui-input-row">
<label>{$mcFields['education']['title']}</label>
{php echo tpl_app_fans_form('education', $profile['education'],$mcFields['education']['title']);}
</div>
{/if}
{if !empty($mcFields['graduateschool'])}
<div class="mui-input-row">
<label>{$mcFields['graduateschool']['title']}</label>
{php echo tpl_app_fans_form('graduateschool', $profile['graduateschool'], $mcFields['graduateschool']['title']);}
</div>
{/if}
{if !empty($mcFields['studentid'])}
<div class="mui-input-row">
<label>{$mcFields['studentid']['title']}</label>
{php echo tpl_app_fans_form('studentid', $profile['studentid'], $mcFields['studentid']['title']);}
</div>
{/if}
</div>
{/if}
{if $do == 'jobedit'}
<div class="mui-content-padded mui-text-muted">请完善您的工作信息</div>
<div class="mui-input-group mui-mt15">
{if !empty($mcFields['company'])}
<div class="mui-input-row">
<label>{$mcFields['company']['title']}</label>
{php echo tpl_app_fans_form('company', $profile['company'], $mcFields['company']['title']);}
</div>
{/if}
{if !empty($mcFields['occupation'])}
<div class="mui-input-row">
<label>{$mcFields['occupation']['title']}</label>
{php echo tpl_app_fans_form('occupation', $profile['occupation'], $mcFields['occupation']['title']);}
</div>
{/if}
{if !empty($mcFields['position'])}
<div class="mui-input-row">
<label>{$mcFields['position']['title']}</label>
{php echo tpl_app_fans_form('position', $profile['position'], $mcFields['position']['title']);}
</div>
{/if}
{if !empty($mcFields['revenue'])}
<div class="mui-input-row">
<label>{$mcFields['revenue']['title']}</label>
{php echo tpl_app_fans_form('revenue', $profile['revenue'], $mcFields['revenue']['title']);}
</div>
{/if}
</div>
{/if}
<div class="mui-content-padded">
<button class="mui-btn mui-btn-success mui-btn-block" type="submit" name="submit" value="提交">保存</button>
<input type="hidden" name="token" value="{$_W['token']}" />
</div>
</div>
</form>
{if $do == 'address' && empty($_GPC['addid'])}
<div class="mui-content mc-address-list">
<ul class="mui-table-view">
{if empty($addresses)}
<li class="mui-table-view-cell mui-text-center">
暂无收货地址,请点击新增收货地址.
</li>
{/if}
{loop $addresses $address}
<li class="mui-table-view-cell mui-table-view-chevron">
<div class="mui-slider-right mui-disabled">
{if !$address['isdefault']}
<a class="mui-btn mui-btn-yellow" href="{php echo url('mc/profile/address', array('op' => 'default', 'id' => $address['id'], address => $address['province'].$address['city'].$address['district'].$address['address']))}">设为默认</a>
{/if}
<a class="mui-btn mui-btn-red" href="{php echo url('mc/profile/address', array('op' => 'delete', 'id' => $address['id']))}">删除</a>
</div>
<a data-href="{php echo url('mc/profile/addressadd', array('addid' => $address['id']));}" class="mui-slider-handle mui-navigate-right js-slider-handle">
<div>
{$address['username']}<span class="tel mui-ml15">{$address['mobile']}</span>
<div class="mui-ellipsis mui-text-muted mui-mt5">{$address['province']} {$address['city']} {$address['district']} {$address['address']}</div>
{if $address['isdefault'] > 0}
<span class="default-marker">默认</span>
{/if}
</div>
</a>
</li>
{/loop}
<li class="mui-table-view-cell">
<a href="{php echo url('mc/profile/addressadd', array('uid' => $address['openid']));}" class="mui-text-success mui-text-center mui-bg-white">
<span class="fa fa-plus-circle mui-mr10"></span>新增收货地址
</a>
</li>
</ul>
</div>
<script type="text/javascript">
{if ($_W['account']['level'] == ACCOUNT_SUBSCRIPTION_VERIFY || $_W['account']['level'] == ACCOUNT_SERVICE_VERIFY) && empty($address)}
wx.ready(function () {
wx.openAddress({
success:function(result){
username = result.userName;
mobile = result.telNumber;
zipcode = result.postalCode;
province = result.provinceName;
city = result.cityName;
district = result.countryName;
address = result.detailInfo;
address_data = {'username':username, 'mobile':mobile, 'zipcode':zipcode, 'province':province, 'city':city, 'district':district, 'address': address};
$.post('{php echo url("mc/profile/addressadd")}', {address : address_data}, function(data) {
data = $.parseJSON(data);
if (data.type == 'success') {
alert(data.message)
};
location.reload();
});
}
});
});
{/if}
$(document).on('tap', '.js-slider-handle', function(event){
var href = $(this).data('href');
var has = $(this).prev().hasClass('mui-selected');
if (has) {
$(this).prev().removeClass('mui-selected');
$(this).parent().removeClass('mui-selected');
$(this).removeAttr('style');
} else {
location.href = href;
}
});
</script>
{/if}
{if $do == 'addressadd'}
<form class="tab-content clearfix js-ajax-form {if $_W['container'] !== 'wechat'}profile-form{/if}" action="{url 'mc/profile/addressadd'}" method="post" enctype="multipart/form-data" id="addressform">
<div class="mui-content">
<div class="mui-content-padded mui-text-muted">请您填写收货地址</div>
<div class="mui-input-group mui-mt15">
<div class="mui-input-row">
<label>姓名</label>
<input type="text" value="{$address['username']}" name="address[username]" placeholder="收货人姓名"/>
</div>
<div class="mui-input-row">
<label>手机号码</label>
<input type="text" value="{$address['mobile']}" name="address[mobile]" placeholder="手机号"/>
</div>
<div class="mui-input-row">
<label>邮政编码</label>
<input type="text" name="address[zipcode]" value="{$address['zipcode']}" placeholder="邮政编码"/>
</div>
<div class="mui-input-row">
<label>选择地区</label>
{php echo tpl_app_form_field_district('address',array('province' => $address['province'],'city' => $address['city'],'district' => $address['district']));}
</div>
<div class="mui-input-row">
<label>详细地址</label>
<input type="text" name="address[address]" class="form-control" value="{$address['address']}" placeholder="详细地址"/>
</div>
</div>
<div class="mui-content-padded">
<button class="mui-btn mui-btn-success mui-btn-block" type="submit" value="提交" name="submit">保存</button>
<input type="hidden" name="addid" value="{$address['id']}">
<input type="hidden" name="token" value="{$_W['token']}" />
</div>
</div>
</form>
{/if}
{template 'common/footer'}