controller.js 633 Bytes
'use strict';

import {
    Controller
} from 'yoho-mvc';

import {
    DetailView
} from './view';

import {
    globalSearch as search
} from '../models';

class ListController extends Controller {
    constructor() {
        super();
        
        this.detail = new DetailView();

        this.created();
    }

    created() {
    	let skn = this.detail.getSkn();
    	if (!skn) {
    		return;
    	}

    	setTimeout(()=> {
    		search('//m.yohobuy.com/product/global/gethtml', {
    			skn: skn
    		}).then((html)=>{
    			this.detail.setDetailHtml(html)
    		})
    	}, 500);
    }
}

module.exports = ListController;