人人商城

profile.html 13KB

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