|
|
|
|
|
|
|
|
import ZeroSellService from './service/zero-sell'
|
|
|
import CommonService from './service/common'
|
|
|
|
|
|
import {
|
|
|
decodePhoneNumber,
|
|
|
getUnionID,
|
|
|
decodeUnionId,
|
|
|
openAuthorizeSettings
|
|
|
openAuthorizeSettings,
|
|
|
} from '../../utils/login';
|
|
|
|
|
|
import {formatImageUrl} from '../../utils/util'
|
|
|
|
|
|
import {
|
|
|
Toast
|
|
|
} from '../../vendors/zanui/index';
|
|
|
import router from './router/router';
|
|
|
import { jumpByUrl } from '../../libs/urlRoute';
|
|
|
|
|
|
let app = getApp()
|
|
|
|
...
|
...
|
@@ -33,15 +37,23 @@ Page(Object.assign({ |
|
|
footText: '',
|
|
|
hasUnionID: false,
|
|
|
uid: 0,
|
|
|
isLogin: false
|
|
|
isLogin: false,
|
|
|
dialogSrc: null,
|
|
|
dialogUrl: null,
|
|
|
bannerSrc: null,
|
|
|
bannerUrl: null
|
|
|
},
|
|
|
|
|
|
onLoad() {
|
|
|
this.service = new ZeroSellService();
|
|
|
this.commonService = new CommonService();
|
|
|
|
|
|
this._init();
|
|
|
|
|
|
new app.WeToast();
|
|
|
|
|
|
this._getResouceCode()
|
|
|
this._getBottomBanner()
|
|
|
},
|
|
|
|
|
|
onShow() {
|
...
|
...
|
@@ -54,6 +66,8 @@ Page(Object.assign({ |
|
|
})
|
|
|
|
|
|
this._getUser();
|
|
|
|
|
|
this.dialog = this.selectComponent("#dialog");
|
|
|
},
|
|
|
|
|
|
onPullDownRefresh() {
|
...
|
...
|
@@ -153,6 +167,42 @@ Page(Object.assign({ |
|
|
}
|
|
|
},
|
|
|
|
|
|
_getResouceCode() {
|
|
|
this.commonService.getResourceCode('194ffd46254d6ad20e6c538bea4d89d7')
|
|
|
.then(data => {
|
|
|
// console.log(data)
|
|
|
this.setData({
|
|
|
dialogSrc: formatImageUrl(data.src, 340 * app.globalData.systemInfo.pixelRatio, 340 * app.globalData.systemInfo.pixelRatio, 2),
|
|
|
dialogUrl: data.url
|
|
|
})
|
|
|
this.dialog.showDialog();
|
|
|
})
|
|
|
.catch(error => {
|
|
|
console.log(error)
|
|
|
})
|
|
|
|
|
|
},
|
|
|
_getBottomBanner() {
|
|
|
this.commonService.getResourceCode('5a2203f5656fbc9788bd8af70f2823d3')
|
|
|
.then(data => {
|
|
|
// console.log(data)
|
|
|
this.setData({
|
|
|
bannerSrc: formatImageUrl(data.src, app.globalData.systemInfo.screenWidth, 70, 2),
|
|
|
bannerUrl: data.url
|
|
|
})
|
|
|
})
|
|
|
.catch(error => {
|
|
|
console.log(error)
|
|
|
})
|
|
|
},
|
|
|
|
|
|
_jumpBanner() {
|
|
|
if (this.data.bannerUrl == null) {
|
|
|
return;
|
|
|
}
|
|
|
jumpByUrl(that.data.bannerUrl);
|
|
|
},
|
|
|
|
|
|
onTabChange({detail}) {
|
|
|
this.setData({
|
|
|
tabIndex: detail,
|
...
|
...
|
|