|
|
import 'home/family-userInfo.page.css';
|
|
|
import 'home/family/city-swiper.css';
|
|
|
import CitySwiper from './family/city-swiper';
|
|
|
import CitySwiper from 'plugin/city-swiper';
|
|
|
import $ from 'yoho-jquery';
|
|
|
import Page from 'yoho-page';
|
|
|
import tip from 'plugin/tip';
|
...
|
...
|
@@ -34,10 +34,10 @@ class UserInfo extends Page { |
|
|
cityRender
|
|
|
};
|
|
|
|
|
|
this.init();
|
|
|
this.CityId = 0;
|
|
|
this.province = this.selector.$provinceText.text();
|
|
|
this.city = this.selector.$cityText.text();
|
|
|
this.init();
|
|
|
}
|
|
|
|
|
|
init() {
|
...
|
...
|
@@ -54,6 +54,7 @@ class UserInfo extends Page { |
|
|
}
|
|
|
});
|
|
|
this.defaultPic();
|
|
|
this.getCity();
|
|
|
}
|
|
|
|
|
|
bindEvents() {
|
...
|
...
|
@@ -67,9 +68,14 @@ class UserInfo extends Page { |
|
|
|
|
|
userPic() {
|
|
|
if (yoho.isApp) {
|
|
|
yoho.ready(function() {
|
|
|
yoho.ready(() => {
|
|
|
yoho.invokeMethod('go.setAvatar', {}, (data) => {
|
|
|
console.log(data);
|
|
|
if (data) {
|
|
|
let reg = /(\w*){mode}(.*){width}(.*){height}(.*)/g;
|
|
|
|
|
|
data = data.replace(reg, '$12$2100$3100$4');
|
|
|
this.selector.$userAvatar.css('background-image', `url(${data})`);
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
}
|
...
|
...
|
@@ -86,8 +92,8 @@ class UserInfo extends Page { |
|
|
|
|
|
this.province = $provinceActive.text();
|
|
|
this.city = $cityActive.text();
|
|
|
$chosenCityText = `<span class="province-text">${this.province}</span>
|
|
|
<span class="city-text">${this.city}</span>`;
|
|
|
$chosenCityText = `<span class="province-text">
|
|
|
${this.province}</span> <span class="city-text">${this.city}</span>`;
|
|
|
this.selector.$chosenCity.find('.inp').html($chosenCityText);
|
|
|
this.selector.$citySwiper.hide();
|
|
|
}
|
...
|
...
|
@@ -141,7 +147,6 @@ class UserInfo extends Page { |
|
|
if (this.CityId === 0) {
|
|
|
this.selector.$province.append(this.view.cityRender(result));
|
|
|
new CitySwiper({
|
|
|
swiperNum: 2, // swiper列数
|
|
|
lineNum: 5, // 每列行数
|
|
|
centeredSlides: true, // 剧中显示
|
|
|
hidePartingLine: false // 隐藏两条分割线
|
...
|
...
|
|