Authored by 陈峰

commit vue2.0 60%

Showing 100 changed files with 709 additions and 606 deletions

Too many changes to show.

To preserve performance only 100 of 100+ files are displayed.

{
"parser": "babel-eslint",
"env": {
"es6": true
},
"extends": "yoho",
"plugins": ["html"]
"parserOptions": {
"sourceType": "module"
},
"plugins": [
"html"
],
"rules": {
"camelcase": "off",
"max-len": "off"
}
}
... ...
<div id="channel">
<div id="ssr" class="resources" style="position: absolute; top: 2.25rem;">
{{!-- <div id="ssr" class="resources" style="position: absolute; top: 2.25rem;">
{{#resources}}
{{#if focus}}
<div class="focus-floor" style="height: 9.1rem;">
... ... @@ -35,8 +35,5 @@
{{/if}}
{{/resources}}
</div>
<channel>
</channel>
</div> --}}
</div>
... ...
... ... @@ -51,9 +51,7 @@
"scss-loader": "0.0.1",
"serve-favicon": "^2.3.0",
"uuid": "^2.0.2",
"vue": "1.0.26",
"vue-loader": "^8.3.0",
"vue-template-compiler": "^2.3.3",
"vue": "^2.4.2",
"webpack-uglify-parallel": "^0.1.3",
"webpack-visualizer-plugin": "^0.1.11",
"winston": "^2.2.0",
... ... @@ -65,6 +63,7 @@
"devDependencies": {
"autoprefixer": "^7.0.1",
"babel-core": "^6.24.1",
"babel-eslint": "^7.2.3",
"babel-loader": "^7.0.0",
"babel-plugin-transform-runtime": "^6.12.0",
"babel-preset-env": "^1.4.0",
... ... @@ -102,18 +101,18 @@
"stylelint-config-yoho": "^1.2.7",
"stylelint-processor-html": "^1.0.0",
"vue-hot-reload-api": "^1.2.0",
"vue-html-loader": "^1.0.0",
"vue-infinite-scroll": "0.2.3",
"vue-lazyload": "^0.7.0",
"vue-loader": "^8.7.0",
"vue-style-loader": "^1.0.0",
"vue-swipe": "0.2.6",
"vue-template-compiler": "^2.3.3",
"vue-touch": "1.1.0",
"webpack": "^2.5.1",
"vue-html-loader": "^1.2.4",
"vue-infinite-scroll": "^2.0.1",
"vue-lazyload": "^1.0.6",
"vue-loader": "^13.0.2",
"vue-style-loader": "^3.0.1",
"vue-swipe": "^2.0.3",
"vue-template-compiler": "^2.4.2",
"vue-touch": "^1.1.0",
"webpack": "3.3",
"webpack-bundle-analyzer": "^2.8.2",
"webpack-dashboard": "^0.1.8",
"webpack-dev-server": "^2.4.5",
"webpack-dev-server": "^2.6.1",
"webpack-merge": "^4.1.0",
"webpack-stream": "^3.1.0",
"yoho-cookie": "1.2.0",
... ...
... ... @@ -5,11 +5,12 @@
* Time: 14:13
*/
const Vue = require('vue');
const lazyload = require('vue-lazyload');
const brandListBox = require('channel/brand-list-box.vue');
import Vue from 'vue';
import lazyload from 'vue-lazyload';
import brandListBox from 'channel/brand-list-box.vue';
import filter from 'common/vue-filter';
require('common/vue-filter')(Vue);
filter(Vue);
Vue.use(lazyload, { preLoad: 3 });
... ...
const Vue = require('vue');
const lazyload = require('vue-lazyload');
const cateRes = require('channel/cate-resource-box.vue');
import Vue from 'vue';
import lazyload from 'vue-lazyload';
import cateRes from 'channel/cate-resource-box.vue';
import filter from 'common/vue-filter';
require('common/vue-filter')(Vue);
filter(Vue);
Vue.use(lazyload, { preLoad: 3 });
... ...
const Vue = require('vue');
const brandCateBox = require('channel/brand-cate-box.vue');
import Vue from 'vue';
import brandCateBox from 'channel/brand-cate-box.vue';
new Vue({
el: '#brand-cate-box',
... ...
const Vue = require('vue');
const lazyload = require('vue-lazyload');
const infinitScroll = require('vue-infinite-scroll');
import Vue from 'vue';
import lazyload from 'vue-lazyload';
import infinitScroll from 'vue-infinite-scroll';
const channel = require('channel/index.vue');
import channel from 'channel/index.vue';
import filter from 'common/vue-filter';
import 'common/count-down';
require('common/vue-filter')(Vue);
filter(Vue);
Vue.use(lazyload, { preLoad: 3 });
Vue.use(infinitScroll);
new Vue({
el: '#channel',
components: {
channel
}
render: h => h(channel)
});
... ...
const Vue = require('vue');
const lazyload = require('vue-lazyload');
import Vue from 'vue';
import lazyload from 'vue-lazyload';
const sidebar = require('channel/sidebar.vue');
import sidebar from 'channel/sidebar.vue';
import filter from 'common/vue-filter';
require('common/vue-filter')(Vue);
filter(Vue);
Vue.use(lazyload, { preLoad: 3 });
... ...
... ... @@ -4,7 +4,7 @@
*
*/
const $ = require('jquery');
import $ from 'jquery';
(function backTop() {
const $doc = $(document);
... ...
... ... @@ -4,18 +4,16 @@
* @date 2016-07-27
*/
'use strict';
let Vue = require('vue');
import Vue from 'vue';
Vue.directive('countDown', {
acceptStatement: true,
params: ['left-time', 'callback', 'end-time'],
update: function() {
bind: function(el, binding) {
// 结束时间
let value = this.params.endTime || 0;
let callbackFn = this.params.callback;
let value = binding.value.endTime || 0;
let callbackFn = binding.value.callback;
// 如果不为0的话根据剩余的秒数计算时间
let leftTime = parseInt(this.params.leftTime, 10);
let leftTime = parseInt(binding.value.leftTime, 10);
let newValue;
if (leftTime !== 0) {
... ... @@ -32,7 +30,6 @@ Vue.directive('countDown', {
return console.error('The param of directive "v-time-down" must be a date string!');
}
let timerSS = null;
let el = this.el;
let hDom = document.createElement('span');
hDom.setAttribute('class', 'timeDown-H');
... ...
var yoho = require('yoho');
var $ = require('jquery');
var interceptClick = require('common/intercept-click');
import yoho from 'yoho';
import $ from 'jquery';
import interceptClick from 'common/intercept-click';
yoho.ready(() => {
const header = Object.assign({}, interceptClick.defaultTitleMap[1]);
... ...
... ... @@ -2,8 +2,8 @@
* 拦截跳转, 在这里给将要打开的页面设置一下 header 样式
* @return {[type]}
*/
const yoho = require('yoho');
const parse = require('yoho-qs/parse'); // 提供解析函数
import yoho from 'yoho';
import parse from 'yoho-qs/parse'; // 提供解析函数
const origin = location.origin;
... ... @@ -322,7 +322,7 @@ const intercept = (url) => {
}
};
module.exports = {
export default {
defaultTitleMap,
intercept
};
... ...
... ... @@ -7,9 +7,9 @@
'use strict';
const $ = require('jquery');
const Overlay = require('./overlay');
const template = require('components/loading.hbs');
import $ from 'jquery';
import Overlay from './overlay';
import template from 'components/loading.hbs';
const AJAX_LOADING_ENABLED = false; // 全局控制
... ... @@ -103,4 +103,4 @@ if (AJAX_LOADING_ENABLED) {
});
}
module.exports = instance;
export default instance;
... ...
... ... @@ -7,9 +7,9 @@
'use strict';
const $ = require('jquery');
const template = require('components/modal.hbs');
const Overlay = require('./overlay');
import $ from 'jquery';
import template from 'components/modal.hbs';
import Overlay from './overlay';
class Modal {
/**
... ... @@ -105,4 +105,4 @@ Object.assign(Modal, {
});
module.exports = Modal;
export default Modal;
... ...
... ... @@ -7,7 +7,7 @@
'use strict';
const $ = require('jquery');
import $ from 'jquery';
const ANIMATIONS = {
none: {
... ... @@ -118,4 +118,4 @@ class Overlay {
}
}
module.exports = Overlay;
export default Overlay;
... ...
... ... @@ -7,9 +7,9 @@
'use strict';
const $ = require('jquery');
const template = require('components/select.hbs');
const Overlay = require('./overlay');
import $ from 'jquery';
import template from 'components/select.hbs';
import Overlay from './overlay';
function Select(items) {
if (!$.isArray(items) || items.length === 0) {
... ... @@ -71,4 +71,4 @@ function Select(items) {
};
}
module.exports = Select;
export default Select;
... ...
... ... @@ -5,7 +5,7 @@
* Time: 16:55
*/
const $ = require('jquery');
import $ from 'jquery';
const jsApiList = [
'checkJsApi',
'onMenuShareTimeline',
... ... @@ -55,7 +55,7 @@ if (/MicroMessenger/i.test(navigator.userAgent)) {
}
});
}
module.exports = (data) => {
export default (data) => {
shareData = data;
if (window.wx) {
... ...
... ... @@ -12,7 +12,7 @@
* })
*/
const $ = require('jquery');
import $ from 'jquery';
function tip(param, cb) {
let timer;
... ... @@ -49,4 +49,4 @@ function tip(param, cb) {
}, viewData.delay));
}
module.exports = tip;
export default tip;
... ...
const yoho = require('yoho');
const interceptClick = require('common/intercept-click');
const Modal = require('common/modal');
import yoho from 'yoho';
import interceptClick from 'common/intercept-click';
import Modal from 'common/modal';
const getImgHost = function(url, bucket = 'goodsimg') {
let urlArr = url.split('/'),
... ... @@ -84,7 +84,7 @@ const applySuccuss = function(type, applyId) {
modal.show();
};
module.exports = {
export default {
getImgHost,
getImgUrl,
applySuccuss,
... ...
const Vue = require('vue');
import Vue from 'vue';
let vue = new Vue();
module.exports = vue;
export default vue;
... ...
... ... @@ -5,11 +5,16 @@
* @Last Modified time: 2016-08-02 17:42:26
*/
module.exports = (Vue) => {
Vue.directive('lazy-html', function(html) {
// TODO 首屏幕不使用
html = html.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, '<img v-bind:src="\'$1\'">').replace(/https?:/gi, '');
this.el.innerHTML = html;
this.vm.$compile(this.el);
export default (Vue) => {
Vue.directive('lazy-html', {
bind(el, binding) {
// TODO 首屏幕不使用
let html = binding.value
.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, '<img v-bind:src="\'$1\'">')
.replace(/https?:/gi, '');
this.el.innerHTML = html;
// this.vm.$compile(this.el);
}
});
};
... ...
const util = require('common/util');
import util from 'common/util';
module.exports = (Vue) => {
export default (Vue) => {
/**
* 替换参数
*
... ... @@ -252,13 +252,13 @@ module.exports = (Vue) => {
ageLevel: 'Age'
};
Vue.filter('filter-cn', (value, prefix) => {
Vue.filter('filterCn', (value, prefix) => {
prefix = prefix || '';
value = zhDict[value] || '';
return prefix + value || '';
});
Vue.filter('filter-en-cn', value => {
Vue.filter('filterEnCn', value => {
const cn = zhDict[value] || '';
const en = enDict[value] || '';
... ...
... ... @@ -28,7 +28,7 @@ const editorial = {
all: '87e3b7ff41132fde5e061fb1c3899f84'
};
module.exports = {
export default {
channel,
brand,
cate,
... ...
const Vue = require('vue');
const lazyload = require('vue-lazyload');
const directive = require('common/vue-directive');
const app = require('editorial/detail.vue');
const yoho = require('yoho');
import Vue from 'vue';
import lazyload from 'vue-lazyload';
import directive from 'common/vue-directive';
import app from 'editorial/detail.vue';
import yoho from 'yoho';
import filter from 'common/vue-filter';
require('common/vue-filter')(Vue);
filter(Vue);
Vue.use(lazyload, {
preLoad: 3
preLoad: 3
});
Vue.use(directive);
yoho.ready(() => {
new Vue({
el: '#app',
components: {
app
}
});
});
\ No newline at end of file
new Vue({
el: '#app',
components: {
app
}
});
});
... ...
... ... @@ -4,15 +4,17 @@
* Date: 2016/7/26
* Time: 17:37
*/
const Vue = require('vue');
const lazyload = require('vue-lazyload');
const infinitScroll = require('vue-infinite-scroll');
import Vue from 'vue';
import lazyload from 'vue-lazyload';
import infinitScroll from 'vue-infinite-scroll';
import filter from 'common/vue-filter';
Vue.use(lazyload, { preLoad: 3 });
Vue.use(infinitScroll);
require('common/vue-filter')(Vue);
const indexBox = require('editorial/index-box.vue');
filter(Vue);
import indexBox from 'editorial/index-box.vue';
new Vue({
el: '#index',
... ...
... ... @@ -5,10 +5,10 @@
* Time: 20:20
*/
const Vue = require('vue');
const lazyload = require('vue-lazyload');
import Vue from 'vue';
import lazyload from 'vue-lazyload';
const appBox = require('example/app-box.vue');
import appBox from 'example/app-box.vue';
new Vue({
el: '#app',
... ...
var Vue = require('vue');
import Vue from 'vue';
var app = require('example/home.vue');
var tpl = require('example/hello.hbs');
var tip = require('common/tip');
import app from 'example/home.vue';
import tpl from 'example/hello.hbs';
import tip from 'common/tip';
var vm = new Vue({
el: '#app',
... ... @@ -15,14 +15,14 @@ console.log(vm);
/* eslint-disable */
// 私有包测试
var $ = require('jquery');
var qs = require('yoho-qs');
import $ from 'jquery';
import qs from 'yoho-qs';
console.log(qs);
var parse = require('yoho-qs/parse'); // 提供解析函数
import parse from 'yoho-qs/parse'; // 提供解析函数
console.log(parse('q=w&e=r')); // { q: 'w', e: 'r' }
var cookie = require('yoho-cookie');
import cookie from 'yoho-cookie';
console.log(cookie.all());
... ... @@ -48,10 +48,10 @@ tipBtn.addEventListener('click', function(){
});
var Overlay = require('common/overlay');
var Modal = require('common/modal');
var customModal = require('example/custom-modal.hbs');
var loading = require('common/loading');
import Overlay from 'common/overlay';
import Modal from 'common/modal';
import customModal from 'example/custom-modal.hbs';
import loading from 'common/loading';
var overlay = new Overlay();
... ...
... ... @@ -3,9 +3,9 @@
* @author: feng.chen<feng.chen@yoho.cn>
* @date: 2017/03/15
*/
const $ = require('jquery');
const cookie = require('yoho-cookie');
const yoho = require('yoho');
import $ from 'jquery';
import cookie from 'yoho-cookie';
import yoho from 'yoho';
// 初始化
... ...
... ... @@ -15,13 +15,13 @@
* 1. localStorage 操作请使用 yoho-store 文档:https://github.com/marcuswestin/store.js
* 2. 查询字符串读取 请使用 yoho-qs
*/
const $ = require('jquery');
const yoho = require('yoho');
const Vue = require('vue');
const util = require('common/util');
const interceptClick = require('common/intercept-click');
const bus = require('common/vue-bus');
const FastClick = require('fastclick');
import $ from 'jquery';
import yoho from 'yoho';
import Vue from 'vue';
import util from 'common/util';
import interceptClick from 'common/intercept-click';
import bus from 'common/vue-bus';
import FastClick from 'fastclick';
/**
* iOS 7 不支持 Promise, vue-lazyload 有用到,所以全局申明
... ...
var yoho = require('yoho');
var interceptClick = require('common/intercept-click');
import yoho from 'yoho';
import interceptClick from 'common/intercept-click';
yoho.ready(() => {
const header = Object.assign({}, interceptClick.defaultTitleMap[1]);
... ...
const Vue = require('vue');
const cancelReason = require('me/cancel-reason.vue');
const yoho = require('yoho');
import Vue from 'vue';
import cancelReason from 'me/cancel-reason.vue';
import yoho from 'yoho';
yoho.ready(() => {
new Vue({
... ...
... ... @@ -6,13 +6,14 @@
'use strict';
const Vue = require('vue');
const coin = require('me/coin-detail.vue');
const infiniteScroll = require('vue-infinite-scroll');
import Vue from 'vue';
import coin from 'me/coin-detail.vue';
import infiniteScroll from 'vue-infinite-scroll';
import filter from 'common/vue-filter';
Vue.use(infiniteScroll);
require('common/vue-filter')(Vue);
filter(Vue);
new Vue({
el: '#coin-detail-list',
... ...
const Vue = require('vue');
const lazyload = require('vue-lazyload');
import Vue from 'vue';
import lazyload from 'vue-lazyload';
const exchange = require('me/exchange.vue');
import exchange from 'me/exchange.vue';
require('common/vue-filter')(Vue);
import filter from 'common/vue-filter';
filter(Vue);
Vue.use(lazyload, { preLoad: 3 });
... ...
const Vue = require('vue');
const infiniteScroll = require('vue-infinite-scroll');
const favArticleList = require('me/fav-article-list.vue');
const VueTouch = require('vue-touch');
const yoho = require('yoho');
import Vue from 'vue';
import infiniteScroll from 'vue-infinite-scroll';
import favArticleList from 'me/fav-article-list.vue';
import VueTouch from 'vue-touch';
import yoho from 'yoho';
import filter from 'common/vue-filter';
require('common/vue-filter')(Vue);
filter(Vue);
Vue.use(VueTouch);
Vue.use(infiniteScroll);
... ...
const Vue = require('vue');
const infiniteScroll = require('vue-infinite-scroll');
const favBrandList = require('me/fav-brand-list.vue');
const VueTouch = require('vue-touch');
const yoho = require('yoho');
import Vue from 'vue';
import infiniteScroll from 'vue-infinite-scroll';
import favBrandList from 'me/fav-brand-list.vue';
import VueTouch from 'vue-touch';
import yoho from 'yoho';
import filter from 'common/vue-filter';
require('common/vue-filter')(Vue);
filter(Vue);
Vue.use(VueTouch);
Vue.use(infiniteScroll);
... ...
const Vue = require('vue');
const infiniteScroll = require('vue-infinite-scroll');
const favProductList = require('me/fav-product-list.vue');
const VueTouch = require('vue-touch');
const yoho = require('yoho');
import Vue from 'vue';
import infiniteScroll from 'vue-infinite-scroll';
import favProductList from 'me/fav-product-list.vue';
import VueTouch from 'vue-touch';
import yoho from 'yoho';
import filter from 'common/vue-filter';
require('common/vue-filter')(Vue);
filter(Vue);
Vue.use(VueTouch);
Vue.use(infiniteScroll);
... ...
... ... @@ -3,11 +3,10 @@
* @author: Lixia Zhang<lixia.zhang@yoho.cn>
* @date: 2016/07/20
*/
var $ = require('jquery'),
tip = require('common/tip'),
yoho = require('yoho'),
interceptClick = require('common/intercept-click');
import $ from 'jquery';
import tip from 'common/tip';
import yoho from 'yoho';
import interceptClick from 'common/intercept-click';
$(() => {
setTimeout(() => {
... ...
const Vue = require('vue');
const home = require('me/home.vue');
const yoho = require('yoho');
import Vue from 'vue';
import home from 'me/home.vue';
import yoho from 'yoho';
yoho.ready(() => {
new Vue({
... ...
const Vue = require('vue');
const Logistics = require('me/refund/logistics.vue');
const LogisticsCompany = require('me/refund/logistics-company.vue');
import Vue from 'vue';
import Logistics from 'me/refund/logistics.vue';
import LogisticsCompany from 'me/refund/logistics-company.vue';
new Vue({
el: '#logistics',
... ...
const Vue = require('vue');
const Mydetails = require('me/mydetails.vue');
import Vue from 'vue';
import Mydetails from 'me/mydetails.vue';
new Vue({
el: '#details',
... ...
... ... @@ -5,12 +5,13 @@
*/
'use strict';
const Vue = require('vue');
const OrderDetail = require('me/order-detail.vue');
const yoho = require('yoho');
import Vue from 'vue';
import OrderDetail from 'me/order-detail.vue';
import yoho from 'yoho';
import filter from 'common/vue-filter';
import 'common/count-down';
require('common/vue-filter')(Vue);
require('common/count-down');
filter(Vue);
yoho.ready(() => {
new Vue({
... ...
const Vue = require('vue');
const orderLogistic = require('me/order-logistic.vue');
import Vue from 'vue';
import orderLogistic from 'me/order-logistic.vue';
import filter from 'common/vue-filter';
require('common/vue-filter')(Vue);
filter(Vue);
new Vue({
el: '#order-logistic',
... ...
... ... @@ -5,14 +5,15 @@
*/
'use strict';
const Vue = require('vue');
const Order = require('me/order.vue');
const infiniteScroll = require('vue-infinite-scroll');
import Vue from 'vue';
import Order from 'me/order.vue';
import infiniteScroll from 'vue-infinite-scroll';
import filter from 'common/vue-filter';
import 'common/count-down';
Vue.use(infiniteScroll);
require('common/vue-filter')(Vue);
require('common/count-down');
filter(Vue);
new Vue({
el: '#home-order-list',
... ...
const Vue = require('vue');
const prefers = require('me/prefers.vue');
const yoho = require('yoho');
const VueTouch = require('vue-touch');
import Vue from 'vue';
import prefers from 'me/prefers.vue';
import yoho from 'yoho';
import VueTouch from 'vue-touch';
Vue.use(VueTouch);
... ...
const yoho = require('yoho');
const $ = require('jquery');
import yoho from 'yoho';
import $ from 'jquery';
$('.go-back-btn').click(function() {
yoho.goBack({}, function() {}, function() {});
... ...
const Vue = require('vue');
const records = require('me/records.vue');
const yoho = require('yoho');
const VueTouch = require('vue-touch');
import Vue from 'vue';
import records from 'me/records.vue';
import yoho from 'yoho';
import VueTouch from 'vue-touch';
Vue.use(VueTouch);
VueTouch.config.swipe = {
... ...
... ... @@ -5,13 +5,15 @@
*/
'use strict';
const Vue = require('vue');
const refundOrder = require('me/refund-order.vue');
const infiniteScroll = require('vue-infinite-scroll');
import Vue from 'vue';
import refundOrder from 'me/refund-order.vue';
import infiniteScroll from 'vue-infinite-scroll';
import filter from 'common/vue-filter';
filter(Vue);
Vue.use(infiniteScroll);
require('common/vue-filter')(Vue);
new Vue({
el: '#refund-order-list',
... ...
const Vue = require('vue');
const lazyload = require('vue-lazyload');
import Vue from 'vue';
import lazyload from 'vue-lazyload';
const refund = require('me/refund.vue');
import refund from 'me/refund.vue';
import filter from 'common/vue-filter';
require('common/vue-filter')(Vue);
filter(Vue);
Vue.use(lazyload, { preLoad: 3 });
... ...
const Vue = require('vue');
const Status = require('me/refund-status.vue');
import Vue from 'vue';
import Status from 'me/refund-status.vue';
import filter from 'common/vue-filter';
require('common/vue-filter')(Vue);
filter(Vue);
new Vue({
el: '#status',
... ...
const Vue = require('vue');
const vipGrade = require('me/vip-grade.vue');
import Vue from 'vue';
import vipGrade from 'me/vip-grade.vue';
new Vue({
el: '#vipGrade',
... ...
const Vue = require('vue');
const lazyload = require('vue-lazyload');
const directive = require('common/vue-directive');
const app = require('product/detail/index.vue');
const yoho = require('yoho');
import Vue from 'vue';
import lazyload from 'vue-lazyload';
import directive from 'common/vue-directive';
import app from 'product/detail/index.vue';
import yoho from 'yoho';
import filter from 'common/vue-filter';
require('common/vue-filter')(Vue);
filter(Vue);
Vue.use(lazyload, {
preLoad: 3
});
... ...
const Vue = require('vue');
const $ = require('jquery');
const search = require('product/list/index.vue');
import Vue from 'vue';
import $ from 'jquery';
import search from 'product/list/index.vue';
$(function() {
const buildOrder = function() {
... ...
const Vue = require('vue');
const newProduct = require('product/new/index.vue');
import Vue from 'vue';
import lazyload from 'vue-lazyload';
import infinitScroll from 'vue-infinite-scroll';
import vuefilter from 'common/vue-filter';
import Component from 'product/new/index.vue';
new Vue(newProduct);
vuefilter(Vue);
Vue.use(lazyload, { preLoad: 3 });
Vue.use(infinitScroll);
new Vue({
el: '#product-new',
render: h => h(Component)
});
... ...
const Vue = require('vue');
const $ = require('jquery');
const search = require('product/search/index.vue');
import Vue from 'vue';
import $ from 'jquery';
import search from 'product/search/index.vue';
$(function() {
const buildOrder = function() {
... ...
... ... @@ -5,11 +5,12 @@
* Time: 14:30
*/
const Vue = require('vue');
const lazyload = require('vue-lazyload');
const shareBox = require('product/shop/share-box.vue');
import Vue from 'vue';
import lazyload from 'vue-lazyload';
import shareBox from 'product/shop/share-box.vue';
import filter from 'common/vue-filter';
require('common/vue-filter')(Vue);
filter(Vue);
Vue.use(lazyload, {
preLoad: 3
});
... ...
... ... @@ -4,17 +4,18 @@
* Date: 2016/7/19
* Time: 16:05
*/
const Vue = require('vue');
const lazyload = require('vue-lazyload');
const infinitScroll = require('vue-infinite-scroll');
import Vue from 'vue';
import lazyload from 'vue-lazyload';
import infinitScroll from 'vue-infinite-scroll';
import filter from 'common/vue-filter';
require('common/vue-filter')(Vue);
filter(Vue);
Vue.use(lazyload, {
preLoad: 3
});
Vue.use(infinitScroll);
const shopBox = require('product/shop/shop-box.vue');
import shopBox from 'product/shop/shop-box.vue';
new Vue({
el: '#shop',
... ...
... ... @@ -8,9 +8,9 @@
*
* 希望能与 微信 JS-SDK 一样方便
*/
const cookie = require('yoho-cookie');
const store = require('yoho-store');
const tip = require('common/tip');
import cookie from 'yoho-cookie';
import store from 'yoho-store';
import tip from 'common/tip';
/* 空方法 */
const nullFun = () => {};
... ... @@ -369,4 +369,4 @@ const yoho = {
}
};
module.exports = yoho;
export default yoho;
... ...
<template>
<tab :page="'cate'"></tab>
<brand-cate :category="category" :jump="true" :gender="gender"></brand-cate>
<div>
<tab :page="'cate'"></tab>
<brand-cate :category="category" :jump="true" :gender="gender"></brand-cate>
</div>
</template>
<script>
const tip = require('common/tip');
const brandCate = require('channel/brand-cate.vue');
const tab = require('channel/tab.vue');
const $ = require('jquery');
const bus = require('common/vue-bus');
const qs = require('yoho-qs');
const cookie = require('yoho-cookie');
import tip from 'common/tip';
import brandCate from 'channel/brand-cate.vue';
import tab from 'channel/tab.vue';
import $ from 'jquery';
import bus from 'common/vue-bus';
import qs from 'yoho-qs';
import cookie from 'yoho-cookie';
const channelTrans = {
men: {
... ... @@ -26,7 +28,7 @@
}
};
module.exports = {
export default {
data() {
const detaultChannel = qs.channel || cookie.get('_Channel') || 'men';
... ...
... ... @@ -3,20 +3,20 @@
<div class="cate-container clearfix">
<div class="content">
<ul class="primary-level">
<li v-for="(index, ca) in cateNavLeftData" class="ellipsis" :class="{focus: index === leftcurrent}" class="p-level-item" @click='cateNavLeftFun(index, ca.relation_parameter.sort, ca.category_name)'>
<li v-for="(ca, index) in cateNavLeftData" :key="index" class="ellipsis p-level-item" :class="{focus: index === leftcurrent}" @click='cateNavLeftFun(index, ca.relation_parameter.sort, ca.category_name)'>
{{ca.category_name}}
</li>
</ul>
<div class="sub-level-container">
<ul class="sub-level">
<li class="ellipsis">
<a v-if="jump" href="/product/list?sort={{rightAll.sortId || '' }}&sort_name=全部{{rightAll.categoryName || ''}}&gender={{gender}}">全部{{rightAll.categoryName}}</a>
<a v-if="jump" :href="`/product/list?sort=${rightAll.sortId || ''}&sort_name=全部${rightAll.categoryName || ''}&gender=${gender}`">全部{{rightAll.categoryName}}</a>
<a v-else @click="noJumpReturn(rightAll.sortId, '全部' + rightAll.categoryName)">全部{{rightAll.categoryName}}</a>
</li>
</ul>
<ul class="sub-level">
<li v-for="sub in cateNavRightData" class="ellipsis">
<a v-if="jump" href="/product/list?sort={{sub.relation_parameter.sort}}&sort_name={{sub.category_name}}&gender={{gender}}">{{sub.category_name}}</a>
<li v-for="sub in cateNavRightData" :key="sub.category_name" class="ellipsis">
<a v-if="jump" :href="`/product/list?sort=${sub.relation_parameter.sort}&sort_name=${sub.category_name}&gender=${gender}`">{{sub.category_name}}</a>
<a v-else @click="noJumpReturn(sub.relation_parameter.sort, sub.category_name)">{{sub.category_name}}</a>
</li>
</ul>
... ... @@ -213,9 +213,9 @@
}
</style>
<script>
const $ = require('jquery');
import $ from 'jquery';
module.exports = {
export default {
props: {
category: {
type: Array
... ...
<template>
<tab :page="page"></tab>
<brand-search></brand-search>
<resources :content-code.sync="contentCode"></resources>
<brand-list :channel="channel"></brand-list>
<div>
<tab :page="page"></tab>
<brand-search></brand-search>
<resources :content-code.sync="contentCode"></resources>
<brand-list :channel="channel"></brand-list>
</div>
</template>
<script>
const contentCode = require('content-code');
const qs = require('yoho-qs');
const cookie = require('yoho-cookie');
import contentCode from 'content-code';
import qs from 'yoho-qs';
import cookie from 'yoho-cookie';
const tab = require('channel/tab.vue');
const resources = require('component/resources/index.vue');
const brandList = require('channel/brand-list.vue');
const brandSearch = require('channel/brand-search.vue');
import tab from 'channel/tab.vue';
import resources from 'component/resources/index.vue';
import brandList from 'channel/brand-list.vue';
import brandSearch from 'channel/brand-search.vue';
const detaultChannel = qs.channel || cookie.get('_Channel') || 'men';
module.exports = {
export default {
data() {
return {
page: 'brand',
... ...
<template>
<div class="brand-list-box">
<div v-for="item in brandList" class="per-brand-box">
<div class="index"><a href="#{{item.index}}" name="{{item.index}}">{{item.index}}</a></div>
<div class="brand-big-box clearfix">
<div class="brand-box" v-for="brand in item.brands">
<a href="{{brand.domain | brandUrl}}">
<div class="brand-logo">
<img v-bind:src="brand.logo | resize 136 136" alt="{{brand.name}}">
</div>
<span class="brand-name">{{brand.name}}</span>
</a>
<div>
<div class="brand-list-box">
<div v-for="(item, index) in brandList" :key="index" class="per-brand-box">
<div class="index"><a :href="'#' + item.index" :name="item.index">{{item.index}}</a></div>
<div class="brand-big-box clearfix">
<div class="brand-box" v-for="brand in item.brands" :key="brand.name">
<a :href="brand.domain | brandUrl">
<div class="brand-logo">
<img :src="brand.logo | resize(136, 136)" :alt="brand.name">
</div>
<span class="brand-name">{{brand.name}}</span>
</a>
</div>
</div>
</div>
</div>
<index-list class="index-list" :index-list="indexList"></index-list>
</div>
<index-list class="index-list" :index-list="indexList"></index-list>
</template>
<style>
.brand-list-box {
... ... @@ -83,12 +85,12 @@
}
</style>
<script>
const $ = require('jquery');
const bus = require('common/vue-bus');
const tip = require('common/tip');
const indexList = require('component/tool/index-list.vue');
import $ from 'jquery';
import bus from 'common/vue-bus';
import tip from 'common/tip';
import indexList from 'component/tool/index-list.vue';
module.exports = {
export default {
props: ['channel'],
data() {
return {
... ...
<template>
<div class="search">
<div v-else class="input" @click='yoho.goSearch()'>
<div class="input" @click='yoho.goSearch()'>
<span class="icon icon-search"></span><span class="search-text">Search</span>
</div>
</div>
... ... @@ -31,9 +31,9 @@
}
</style>
<script>
const yoho = require('yoho');
import yoho from 'yoho';
module.exports = {
export default {
data() {
return {
yoho
... ...
<template>
<div class="tab-top-fixed">
<tab :page="page"></tab>
<div>
<div class="tab-top-fixed">
<tab :page="page"></tab>
</div>
<resources :content-code.sync="contentCode"></resources>
</div>
<resources :content-code.sync="contentCode"></resources>
</template>
<style>
.tab-top-fixed {
... ... @@ -26,16 +28,16 @@
}
</style>
<script>
const contentCode = require('content-code');
const qs = require('yoho-qs');
const cookie = require('yoho-cookie');
import contentCode from 'content-code';
import qs from 'yoho-qs';
import cookie from 'yoho-cookie';
const tab = require('channel/tab.vue');
const resources = require('component/resources/index.vue');
import tab from 'channel/tab.vue';
import resources from 'component/resources/index.vue';
const detaultChannel = qs.channel || cookie.get('_Channel') || 'men';
module.exports = {
export default {
data() {
return {
page: 'cate',
... ...
<template>
<tab :page="page"></tab>
<resources :content-code="contentCode"></resources>
<div>
<tab :page="page" :current="currentChannel"></tab>
<resources :content-code="contentCode"></resources>
</div>
</template>
<script>
const qs = require('yoho-qs');
const cookie = require('yoho-cookie');
const contentCode = require('content-code');
const bus = require('common/vue-bus');
import qs from 'yoho-qs';
import cookie from 'yoho-cookie';
import contentCode from 'content-code';
import bus from 'common/vue-bus';
const tab = require('channel/tab.vue');
const resources = require('component/resources/index.vue');
import tab from 'channel/tab.vue';
import resources from 'component/resources/index.vue';
const detaultChannel = qs.channel || cookie.get('_Channel') || 'men';
module.exports = {
export default {
data() {
return {
page: 'channel',
contentCode: contentCode.channel[detaultChannel]
};
},
computed: {
currentChannel() {
return +cookie.get('_ChannelIndex') || 0;
}
},
components: {
tab,
resources
... ...
<template>
<div class="sidebar">
<template v-for="(index, item) in list">
<template v-for="(item, index) in list">
<template v-if="item.separative_sign === 'Y'">
<div class="sep">
<!-- 分割线 -->
... ... @@ -16,10 +16,10 @@
</template>
<script>
const $ = require('jquery');
const interceptClick = require('common/intercept-click');
import $ from 'jquery';
import interceptClick from 'common/intercept-click';
module.exports = {
export default {
data() {
return {
selectedIndex: '',
... ...
<template>
<div v-if="channel.length" class="channel-tab">
<div class="channel ellipsis" v-for="(index, item) in channel" :class="{focus: index === current}"
<div class="channel ellipsis" v-for="(item, index) in channel" :key="index" :class="{focus: index === currentChannel}"
@click="changeChannel(index)" :style="{width: (1 / channel.length) * 100 + '%'}">
<span class="name">{{item.name | uppercase}}</span>
<span class="name">{{item.name.toUpperCase()}}</span>
</div>
</div>
</template>
<script>
const $ = require('jquery');
const cookie = require('yoho-cookie');
const qs = require('yoho-qs');
const bus = require('common/vue-bus');
import $ from 'jquery';
import cookie from 'yoho-cookie';
import qs from 'yoho-qs';
import bus from 'common/vue-bus';
const channelMap = {
301: 'men',
... ... @@ -19,11 +19,11 @@
303: 'lifestyle'
};
module.exports = {
export default {
props: {
current: {
type: Number,
default: +cookie.get('_ChannelIndex') || 0
default: 0
},
page: {
type: String,
... ... @@ -32,7 +32,8 @@
},
data() {
return {
channel: []
channel: [],
currentChannel: this.current,
};
},
created() {
... ... @@ -49,7 +50,7 @@
});
if (qs.channel === channelMap[c.channel_id]) {
this.current = index;
this.currentChannel = index;
bus.$emit('channel.change', this.page, qs.channel);
}
});
... ... @@ -64,11 +65,16 @@
objY[this.page + '_' + this.channel[this.current].channel] = window.scrollY;
this.current = index;
this.currentChannel = index;
bus.$emit('channel.change', this.page, this.channel[index].channel, objY);
cookie.set('_Channel', this.channel[index].channel);
cookie.set('_ChannelIndex', index);
}
},
watch: {
current(val) {
this.currentChannel = val;
}
}
};
</script>
... ...
<template>
<div class="blk-header-wrap" :class="[class, {'is-fixed': fixed}]">
<div class="blk-header-wrap" :class="[{'is-fixed': fixed}, className]">
<div class="blk-header">
<div class="blk-header-left">
<slot name="left">
... ... @@ -17,12 +17,12 @@
</div>
</template>
<script>
const yoho = require('yoho');
import yoho from 'yoho';
module.exports = {
export default {
props: {
title: String,
class: [String, Object, Array],
className: [String, Object, Array],
fixed: Boolean,
scrollFix: Boolean
},
... ...
<template>
<div class="items" v-for="item in list" v-if="item.show" v-touch:swipeleft="showbutton($index)"
v-touch:swiperight="hidebutton($index)" :class="{showbtn:item.isshowbtn,xiajia:!item.status,shouwan:!item.storage}" v-touch-options:swipe="{ direction: 'horizontal', threshold: 10}">
<div class="wrap">
<a :href="item.goodsUrl">
<img :src='item.image'>
<div class="right">
<div class="main-title">{{item.product_name}}</div>
<div class="price">
<span class="market" :class="{underline:item.sales_price}">¥{{item.market_price}}</span><span class="sales" v-if="item.sales_price">¥{{item.sales_price}}</span>
<div>
<div class="items"
v-if="item.show"
v-for="(item, index) in list"
:key="index"
v-touch:swipeleft="showbutton(index)"
v-touch:swiperight="hidebutton(index)"
:class="{showbtn:item.isshowbtn,xiajia:!item.status,shouwan:!item.storage}"
v-touch-options:swipe="{ direction: 'horizontal', threshold: 10}">
<div class="wrap">
<a :href="item.goodsUrl">
<img :src='item.image'>
<div class="right">
<div class="main-title">{{item.product_name}}</div>
<div class="price">
<span class="market" :class="{underline:item.sales_price}">¥{{item.market_price}}</span><span class="sales" v-if="item.sales_price">¥{{item.sales_price}}</span>
</div>
</div>
</div>
</a>
</a>
</div>
<div class="delete" v-touch:tap="deleteskn(index)"><span><i></i>删除</span></div>
</div>
<div class="delete" v-touch:tap="deleteskn($index)"><span><i></i>删除</span></div>
</div>
</template>
<script>
module.exports = {
export default {
props: ['list', 'showbutton', 'hidebutton', 'deleteskn']
};
</script>
... ...
... ... @@ -30,7 +30,7 @@
* @author: Aiden Xu<aiden.xu@yoho.cn>
* @date: 2016/07/20
*/
module.exports = {
export default {
props: {
options: Array,
name: String,
... ...
... ... @@ -2,7 +2,7 @@
<div class="feature-selector" :class="{ 'slide-in': isVisible }">
<div class="header">
<div id="image-box" class="image-box">
<img :src="selection.thumbnail | resize 90 120"/>
<img :src="selection.thumbnail | resize(90, 120)"/>
</div>
<div class="text-box">
<h3 class="line-clamp-2">{{entity.product_name}}</h3>
... ... @@ -173,9 +173,10 @@
* @author: Aiden Xu<aiden.xu@yoho.cn>
* @date: 2016/07/20
*/
const $ = require('jquery');
const tip = require('common/tip');
const Overlay = require('common/overlay');
import $ from 'jquery';
import tip from 'common/tip';
import Overlay from 'common/overlay';
import FeatureOptions from './feature-options.vue';
/**
* 颜色尺码选择组件
... ... @@ -184,7 +185,7 @@
* @event feature:color.select 选择颜色
* @event feature:size.select 选择尺码
*/
module.exports = {
export default {
init() {
},
data() {
... ... @@ -304,7 +305,7 @@
}
},
components: {
featureOptions: require('./feature-options.vue')
featureOptions: FeatureOptions
},
created() {
const self = this;
... ...
... ... @@ -9,25 +9,26 @@
<ul class="filter-cates">
<li class="filter-cate"
v-for="classify in itemArr"
:key="classify"
v-if="showItem(classify)"
@click="entrySub(classify)"
>
<i class="icon icon-right right"></i>
<span class="filter-cate-label">{{classify | filter-en-cn }}</span>
<span class="filter-cate-label">{{classify | filterEnCn }}</span>
<span class="filter-cate-val">{{showLabel(classify)}}</span>
</li>
</ul>
</div>
</div>
<filter-sub :type="subType" :data="config && config[subType]" v-ref:filter-sub @select="setParams"></filter-sub>
<filter-sub :type="subType" :data="config && config[subType]" ref="filter-sub" @select="setParams"></filter-sub>
</div>
</template>
<script>
const $ = require('jquery');
const bus = require('common/vue-bus');
const Overlay = require('common/overlay');
const filterSub = require('./filter/filter-sub.vue');
const qs = require('yoho-qs/parse');
import $ from 'jquery';
import bus from 'common/vue-bus';
import Overlay from 'common/overlay';
import filterSub from './filter/filter-sub.vue';
import qs from 'yoho-qs/parse';
let locationQuery = qs(decodeURIComponent(location.search.replace(/^\?/, '')));
let hasSort = !!locationQuery.sort;
... ... @@ -38,7 +39,8 @@
discount: 'p_d'
};
module.exports = {
export default {
name: 'filter',
props: {
config: Object,
isVisible: Boolean,
... ...
... ... @@ -3,9 +3,9 @@
<div class="item" @click="select({id: ''})">
<div class="item-inner">所有品牌</div>
</div>
<dl v-for="key in orderKeys">
<dt class="index" id="{{key}}">{{key}}</dt>
<dd class="item" v-for="brand in data[key]" :class="{'active': brand.id === val}" @click="select(brand)">
<dl v-for="key in orderKeys" :key="key">
<dt class="index" :id="key">{{key}}</dt>
<dd class="item" v-for="brand in data[key]" :key="brand.id" :class="{'active': brand.id === val}" @click="select(brand)">
<div class="item-inner">{{brand.name}}</div>
</dd>
</dl>
... ... @@ -20,10 +20,10 @@
* index: [{}....]
* }
*/
const $ = require('jquery');
const indexList = require('component/tool/index-list.vue');
import $ from 'jquery';
import indexList from 'component/tool/index-list.vue';
module.exports = {
export default {
props: {
val: Number,
data: {
... ...
<template>
<div class="filter-sub" :class="{'filter-sub-open': isVisible}">
<c-header class="filter-sub-header" :title="type | filter-cn '选择'">
<c-header class="filter-sub-header" :title="type | filterCn('选择')">
<i class="icon icon-left" slot="left" @click="hide"></i>
</c-header>
<div class="filter-sub-select">
... ... @@ -11,12 +11,12 @@
</div>
</template>
<script>
const cHeader = require('component/header.vue');
const brandFilter = require('./brand.vue');
const normalFilter = require('./normal.vue');
const sortFilter = require('channel/brand-cate.vue');
import cHeader from 'component/header.vue';
import brandFilter from './brand.vue';
import normalFilter from './normal.vue';
import sortFilter from 'channel/brand-cate.vue';
module.exports = {
export default {
components: {cHeader, brandFilter, normalFilter, sortFilter},
props: ['type', 'data'],
data() {
... ...
<template>
<div class="filter-detail">
<div class="item">
<div class="item-inner" @click="select({id:''})">{{type | filter-cn '所有'}}</div>
<div class="item-inner" @click="select({id:''})">{{type | filterCn('所有')}}</div>
</div>
<div class="item" v-for="item in data" :class="{active: item.id === val}" @click="select(item)">
<div class="item" v-for="item in data" :key="item.name" :class="{active: item.id === val}" @click="select(item)">
<div class="item-inner">
{{item.name}}
</div>
... ... @@ -12,7 +12,7 @@
</div>
</template>
<script>
module.exports = {
export default {
props: ['data', 'type', 'val'],
computed: {},
methods: {
... ... @@ -21,4 +21,4 @@ module.exports = {
}
}
};
</script>
</script>
\ No newline at end of file
... ...
<template>
<div class="goods-box" v-infinite-scroll="fetch()" infinite-scroll-disable="disableFetch" infinite-scroll-distance="1200">
<ul class="cardlist card-large clearfix">
<li class="card" v-for="item in data">
<li class="card" v-for="(item, index) in data" :key="index">
<div class="card-pic">
<a href="{{item | goodsUrl}}">
<img v-bind:src="item.default_images | resize 372 499" alt="{{item.product_name}}">
<a :href="item | goodsUrl">
<img v-bind:src="item.default_images | resize(372, 499)" :alt="item.product_name">
</a>
</div>
<div class="card-bd">
<h2 class="card-label">
<a href="{{item | goodsUrl}}" class="line-clamp-2">{{item.product_name}}</a>
<a :href="item | goodsUrl" class="line-clamp-2">{{item.product_name}}</a>
</h2>
<h2 class="card-label-desc" v-if="item.product_name1">
<a href="{{item | goodsUrl}}" class="line-clamp-2">{{item.product_name}}</a>
<a :href="item | goodsUrl" class="line-clamp-2">{{item.product_name}}</a>
</h2>
<span class="good-price" :class="{'old-price': item.market_price}" v-if="item.market_price">¥ {{item.market_price | toFixed}}</span>
<span class="good-price" :class="{'sale-price': item.market_price}">¥ {{item.sales_price | toFixed}}</span>
... ... @@ -30,16 +30,16 @@
</div>
</template>
<script>
const Vue = require('vue');
const lazyload = require('vue-lazyload');
const infinitScroll = require('vue-infinite-scroll');
import Vue from 'vue';
import lazyload from 'vue-lazyload';
import infinitScroll from 'vue-infinite-scroll';
Vue.use(lazyload, { preLoad: 3 });
Vue.use(infinitScroll);
let bus = require('common/vue-bus');
import bus from 'common/vue-bus';
module.exports = {
export default {
props: {
/* 开启滚动加载 */
disableFetch: Boolean,
... ...
... ... @@ -9,11 +9,11 @@
</ul>
</template>
<script>
const bus = require('common/vue-bus');
const simple = require('./order/simple.vue');
const updown = require('./order/updown.vue');
import bus from 'common/vue-bus';
import simple from './order/simple.vue';
import updown from './order/updown.vue';
module.exports = {
export default {
props: {
/**
* order 配置
... ...
... ... @@ -4,7 +4,7 @@
</li>
</template>
<script>
module.exports = {
export default {
props: ['txt', 'val'],
computed: {
active: function() {
... ...
... ... @@ -16,7 +16,7 @@
}
</style>
<script>
module.exports = {
export default {
props: {
txt: String,
vals: Array // [asc, desc]
... ...
<template>
<div class='title-wrap'>{{title}}</div>
<div class="list-wrap">
<div class="item-list" v-for="item in list">
<a :href="item.goodsUrl">
<img :src="item.default_images">
<h3>{{item.product_name}}</h3>
</a>
<div class="price">
<span class="market" :class="{underline:item.sales_price}">¥{{item.market_price}}</span><span class="sales" v-if="item.sales_price">¥{{item.sales_price}}</span>
<div>
<div class='title-wrap'>{{title}}</div>
<div class="list-wrap">
<div class="item-list" v-for="item in list">
<a :href="item.goodsUrl">
<img :src="item.default_images">
<h3>{{item.product_name}}</h3>
</a>
<div class="price">
<span class="market" :class="{underline:item.sales_price}">¥{{item.market_price}}</span><span class="sales" v-if="item.sales_price">¥{{item.sales_price}}</span>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
module.exports = {
export default {
props: ['list', 'title']
};
</script>
... ...
<template>
<div class="focus-left-right">
<a v-for="item in floor" :href="item.url | transformBlk" :title="item.title">
<img v-bind:src="item.src | resize 250 250">
<a v-for="item in floor" :key="item.src" :href="item.url | transformBlk" :title="item.title">
<img v-bind:src="item.src | resize(250, 250)">
</a>
</div>
</template>
<script>
module.exports = {
export default {
props: ['floor']
};
</script>
... ...
<template>
<div class="focus-floor">
<swipe class="swipe swipe-{{floor.length}}">
<swipe-item v-for="item in floor" :style="{backgroundColor: item.bgColor}">
<swipe :class="`swipe swipe-${floor.length}`">
<swipe-item v-for="item in floor" :key="item.src" :style="{backgroundColor: item.bgColor}">
<a :href="item.url | transformBlk" :title="item.title">
<img :src="item.src | resize 750 365">
<img :src="item.src | resize(750, 365)">
</a>
</swipe-item>
</swipe>
... ... @@ -11,14 +11,13 @@
</template>
<script>
require('vue-swipe/dist/vue-swipe.css');
const swipe = require('vue-swipe');
module.exports = {
import 'vue-swipe/dist/vue-swipe.css';
import { Swipe, SwipeItem } from 'vue-swipe';
export default {
props: ['floor'],
components: {
swipe: swipe.Swipe,
swipeItem: swipe.SwipeItem
swipe: Swipe,
swipeItem: SwipeItem
}
};
</script>
... ...
... ... @@ -5,13 +5,13 @@
</template>
<script>
const $ = require('jquery');
const productList = require('component/product/list.vue');
const bus = require('common/vue-bus');
import $ from 'jquery';
import productList from 'component/product/list.vue';
import bus from 'common/vue-bus';
const dataCache = {};
module.exports = {
export default {
data() {
return {
productList: [],
... ...
<template>
<div class="resources">
<template v-for="floor in resources">
<div v-for="(floor, index) in resources" :key="index">
<focus v-if="floor.focus && floor.focus_type === '1'" :floor="floor.data" :style="{height: '9.1rem'}">
<!-- 轮播图,通栏 -->
</focus>
... ... @@ -19,26 +19,26 @@
<goods v-if="floor.goods" :floor="floor.data">
<!-- 商品 -->
</goods>
</template>
</div>
</div>
</template>
<script>
const $ = require('jquery');
const tip = require('common/tip');
const bus = require('common/vue-bus');
const contentCode = require('content-code');
import $ from 'jquery';
import tip from 'common/tip';
import bus from 'common/vue-bus';
import contentCode from 'content-code';
const focus = require('./focus.vue');
const focusLeftRight = require('./focus-left-right.vue');
const titleImage = require('./title-image.vue');
const titleFloor = require('./title-floor.vue');
const recommendContentFive = require('./recommend-content-five.vue');
const goods = require('./goods.vue');
import focus from './focus.vue';
import focusLeftRight from './focus-left-right.vue';
import titleImage from './title-image.vue';
import titleFloor from './title-floor.vue';
import recommendContentFive from './recommend-content-five.vue';
import goods from './goods.vue';
const dataCache = {};
module.exports = {
export default {
props: {
contentCode: {
type: String,
... ... @@ -49,7 +49,8 @@
return {
scroll_y: 0,
objY: {},
resources: []
resources: [],
currentContentCode: this.contentCode,
};
},
components: {
... ... @@ -61,20 +62,24 @@
goods
},
watch: {
contentCode() {
contentCode(val) {
this.currentContentCode = val;
this.load();
}
},
methods: {
load() {
this.getResourcesData();
bus.$emit('contentCode.change', this.contentCode);
bus.$emit('contentCode.change', this.currentContentCode);
setTimeout(()=> {
window.scrollTo(0, this.scroll_y);
}, 1);
}
},
methods: {
},
getResourcesData() {
let data = {};
if (this.contentCode) {
data.contentCode = this.contentCode;
if (this.currentContentCode) {
data.contentCode = this.currentContentCode;
}
let param = $.param(data);
... ... @@ -109,7 +114,8 @@
this.objY = Object.assign(this.objY, objY);
}
this.scroll_y = this.objY[page + '_' + channel] || 0;
this.contentCode = contentCode[page][channel];
this.currentContentCode = contentCode[page][channel];
this.load();
});
}
};
... ...
<template>
<div class="recommend-content-five">
<a v-for="item in floor" :href="item.url | transformBlk" :title="item.title">
<img v-bind:src="item.src | resize 375 375">
<a v-for="item in floor" :key="item.src" :href="item.url | transformBlk" :title="item.title">
<img v-bind:src="item.src | resize(375, 375)">
</a>
</div>
</template>
<script>
module.exports = {
export default {
props: ['floor']
};
</script>
... ...
... ... @@ -4,13 +4,13 @@
<a class="more" :href="title.more_url | transformBlk">
<span v-if="title.more_name === '···' || '···'" class="icon icon-more"></span>
<span v-else>{{{title.more_name}}}</span>
<span v-else>{{title.more_name}}</span>
</a>
</div>
</template>
<script>
module.exports = {
export default {
props: ['title']
};
</script>
... ...
... ... @@ -2,15 +2,15 @@
<div class="title-image">
<title-floor :title="{name: floor.title, more_name: floor.more_name, more_url: floor.more_url}"></title-floor>
<a class="image" :href="floor.image.url | transformBlk">
<img v-bind:src="floor.image.src | resize 750 364">
<img v-bind:src="floor.image.src | resize(750, 364)">
</a>
</div>
</template>
<script>
const titleFloor = require('component/resources/title-floor.vue');
import titleFloor from 'component/resources/title-floor.vue';
module.exports = {
export default {
props: ['floor'],
components: {
titleFloor: titleFloor
... ...
<template>
<ul class="list-box">
<li v-for="item in items"><a class="no-intercept" href="#{{item.index}}">{{item.name}}</a></li>
<li v-for="item in items" :key="item.index"><a class="no-intercept" :href="'#' + item.index">{{item.name}}</a></li>
</ul>
</template>
<style>
... ... @@ -30,7 +30,7 @@
</style>
<script>
module.exports = {
export default {
props: {
indexList: Array
},
... ...
... ... @@ -58,7 +58,7 @@
}
</style>
<script>
module.exports = {
export default {
data() {
return {
close: false
... ...
<template>
<div class="upload">
<form v-el:form @change="upload">
<input id="{{inputId}}" type="file" name="filename" accept="image/*">
<input :id="inputId" type="file" name="filename" accept="image/*">
</form>
</div>
</template>
<script>
const yoho = require('yoho');
const $ = require('jquery');
const modal = require('common/modal');
const tip = require('common/tip');
import yoho from 'yoho';
import $ from 'jquery';
import modal from 'common/modal';
import tip from 'common/tip';
module.exports = {
export default {
props: ['imageList', 'bucket'],
data() {
return {
... ...
<template>
<div v-if="block.text" class="text-block a" v-lazy-html="block.text.data.text">
</div>
<div>
<div v-if="block.text" class="text-block a" v-lazy-html="block.text.data.text">
</div>
<div v-if="block.singleImage">
<div v-for="(index, item) in block.singleImage.data">
<img :title="item.title"
:alt="item.alt"
v-bind:src="item.src | resize 750 469" width="375"/>
<div v-if="block.singleImage">
<div v-for="(item, index) in block.singleImage.data" :key="index">
<img :title="item.title"
:alt="item.alt"
v-bind:src="item.src | resize(750, 469)" width="375"/>
</div>
</div>
</div>
</template>
<style></style>
<script>
module.exports = {
export default {
props: {
block: Object
}
... ...
<template>
<top-nav :id="id" :article="article" v-if="isApp"></top-nav>
<div class="show-box no-padding first-box">
<div class="editorial-box">
<h1 class="editorial-article-title">{{article.article_title}}</h1>
<div class="status-bar">
<span class="icon icon-timeshare"></span><span class="label">{{article.publishTime}}</span>
<span class="icon icon-read"></span><span class="label">{{article.pageViews}}</span>
<div>
<top-nav :id="id" :article="article" v-if="isApp"></top-nav>
<div class="show-box no-padding first-box">
<div class="editorial-box">
<h1 class="editorial-article-title">{{article.article_title}}</h1>
<div class="status-bar">
<span class="icon icon-timeshare"></span><span class="label">{{article.publishTime}}</span>
<span class="icon icon-read"></span><span class="label">{{article.pageViews}}</span>
</div>
</div>
</div>
<div class="content-box">
<div v-for="(index, block) in content">
<content-block :block="block"></content-block>
<div class="content-box">
<div v-for="(block, index) in content" :key="index">
<content-block :block="block"></content-block>
</div>
</div>
</div>
</div>
<div class="show-box no-padding" v-if="recommendProducts && recommendProducts.length">
<h2 class="editorial-relate-title">相关推荐</h2>
<product-list :data="recommendProducts"></product-list>
</div>
<div class="show-box no-padding" v-if="recommendProducts && recommendProducts.length">
<h2 class="editorial-relate-title">相关推荐</h2>
<div class="brand-list show-box" v-if="brands && brands.length">
<h2 class="editorial-relate-title">相关品牌</h2>
<ul>
<li v-for="item in brands">
<a :href="'/product/shop/' + item.brandDomain">
<img :src="item.thumb | resize 136 136">
<span class="brand-name"> {{item.name}}</span>
</a>
</li>
</ul>
</div>
<product-list :data="recommendProducts"></product-list>
</div>
<div class="show-box" v-if="other && other.length">
<h2 class="editorial-relate-title">相关文章</h2>
<div class="other-box" v-for="item in other">
<div>
<div class="image-box">
<a :href="'/editorial/' + item.id + '.html'">
<img :src="item.thumb | resize 213 134"/>
<div class="brand-list show-box" v-if="brands && brands.length">
<h2 class="editorial-relate-title">相关品牌</h2>
<ul>
<li v-for="item in brands" :key="item.name">
<a :href="'/product/shop/' + item.brandDomain">
<img :src="item.thumb | resize(136, 136)">
<span class="brand-name"> {{item.name}}</span>
</a>
</li>
</ul>
</div>
<div class="show-box" v-if="other && other.length">
<h2 class="editorial-relate-title">相关文章</h2>
<div class="other-box" v-for="item in other" :key="item.id">
<div>
<div class="image-box">
<a :href="'/editorial/' + item.id + '.html'">
<img :src="item.thumb | resize(213, 134)"/>
</a>
</div>
<h3><a class="line-clamp-2" :href="'/editorial/' + item.id + '.html'">{{item.title}}</a></h3>
<div class="sub-time">
<span class="icon icon-timeshare"></span><span class="label">{{item.publishTime}}</span>
</div>
<div class="clearfix"></div>
</div>
<h3><a class="line-clamp-2" :href="'/editorial/' + item.id + '.html'">{{item.title}}</a></h3>
<div class="sub-time">
<span class="icon icon-timeshare"></span><span class="label">{{item.publishTime}}</span>
</div>
<div class="clearfix"></div>
</div>
</div>
<share-bottom v-if="!isApp"></share-bottom>
</div>
<share-bottom v-if="!isApp"></share-bottom>
</template>
<style>
$bgcolor: #fff;
... ... @@ -196,15 +198,19 @@
}
</style>
<script>
const $ = require('jquery');
const yoho = require('yoho');
module.exports = {
import $ from 'jquery';
import yoho from 'yoho';
import ContentBlock from './content-block.vue';
import ProductList from 'component/product/list.vue';
import TopNav from './top-nav.vue';
import ShareBottom from 'component/tool/share-bottom.vue';
export default {
components: {
contentBlock: require('./content-block.vue'),
productList: require('component/product/list.vue'),
topNav: require('./top-nav.vue'),
shareBottom: require('component/tool/share-bottom.vue')
contentBlock: ContentBlock,
productList: ProductList,
topNav: TopNav,
shareBottom: ShareBottom
},
data() {
return {
... ...
<template>
<resources :content-code.sync="contentCode"></resources>
<div v-infinite-scroll="getNewsList()">
<div v-for="editorial in editorialList" class="editorial-box">
<div class="img">
<a href='{{"/editorial/" + editorial.id + ".html"}}'>
<img v-bind:src="editorial.src | resize 750 469" alt="" />
</a>
</div>
<div class="title">
<a class="line-clamp-2" href='{{"/editorial/" + editorial.id + ".html"}}'>{{editorial.title}}</a>
</div>
<div class="editorial-des">
<p class="line-clamp-2">{{editorial.intro}}</p>
</div>
<hr>
<div class="bottom clearfix">
<span class="icon icon-timeshare"></span>
<span class="time">{{editorial.publish_time}}</span>
<span class="icon icon-share share" @click="share(editorial.title, editorial.intro, editorial.src, editorial.id)"></span>
<div>
<resources :content-code.sync="contentCode"></resources>
<div v-infinite-scroll="getNewsList()">
<div v-for="editorial in editorialList" :key="editorial.id" class="editorial-box">
<div class="img">
<a :href='"/editorial/" + editorial.id + ".html"'>
<img v-bind:src="editorial.src | resize(750, 469)" alt="" />
</a>
</div>
<div class="title">
<a class="line-clamp-2" :href='"/editorial/" + editorial.id + ".html"'>{{editorial.title}}</a>
</div>
<div class="editorial-des">
<p class="line-clamp-2">{{editorial.intro}}</p>
</div>
<hr>
<div class="bottom clearfix">
<span class="icon icon-timeshare"></span>
<span class="time">{{editorial.publish_time}}</span>
<span class="icon icon-share share" @click="share(editorial.title, editorial.intro, editorial.src, editorial.id)"></span>
</div>
</div>
</div>
<div v-if="!scrollDisabled" class="is-loading">loading...</div>
</div>
<div v-if="!scrollDisabled" class="is-loading">loading...</div>
</template>
<style>
.editorial-box {
... ... @@ -87,15 +89,15 @@
}
</style>
<script>
const util = require('common/util');
const contentCode = require('content-code');
const resources = require('component/resources/index.vue');
const qs = require('yoho-qs');
const $ = require('jquery');
const tip = require('common/tip');
const yoho = require('yoho');
import util from 'common/util';
import contentCode from 'content-code';
import resources from 'component/resources/index.vue';
import qs from 'yoho-qs';
import $ from 'jquery';
import tip from 'common/tip';
import yoho from 'yoho';
module.exports = {
export default {
data() {
return {
contentCode: contentCode.editorial.all,
... ...
... ... @@ -35,18 +35,19 @@
}
</style>
<script>
const $ = require('jquery');
const yoho = require('yoho');
const tip = require('common/tip');
const util = require('common/util');
import $ from 'jquery';
import yoho from 'yoho';
import tip from 'common/tip';
import util from 'common/util';
import Header from 'component/header.vue';
module.exports = {
export default {
props: {
id: Number,
article: Object
},
components: {
navbar: require('component/header.vue')
navbar: Header
},
data() {
return {
... ...
<template>
<button class="button" @click='yoho.goTap({"index":2})'>TAP</button>
<button class="button" @click="yoho.goLogin()">登录</button>
<button class="button" @click="yoho.goLogout()">退出登录</button>
<button class="button" @click='yoho.goShopingKey({"shoppingkey":"123456789"})'>设置ShopingKey</button>
<button class="button" @click="yoho.goShopingCart()">跳转购物车</button>
<button class="button" @click='yoho.goAddress({"type":"1"}, addressCallback)'>地址选择页面</button>
<button class="button" @click='yoho.goAddress({"type":"2"}, addressCallback)'>地址管理页面</button>
<button class="button" @click='yoho.goImageBrowser({"images":["http://7xwj52.com1.z0.glb.clouddn.com/brandbg.jpg"], "index": "1"})'>图片浏览</button>
<button class="button" @click='yoho.goNewPage({"url":"http://m.yohoblk.com"})'>新页面</button>
<button class="button" @click="yoho.goPay()">支付</button>
<button class="button" @click="yoho.goBack()">返回</button>
<button class="button" @click='yoho.goShare({"title":"标题","des":"描述","img":"http://7xwj52.com1.z0.glb.clouddn.com/brandbg.jpg","url":"http://m.yohoblk.com/example/app"})'>分享</button>
<button class="button" @click='yoho.goSearch()'>搜索</button>
<button class="button" @click='yoho.goSetting()'>设置</button>
<button class="button" @click='yoho.goSetAvatar()'>设置头像</button>
<div>
<button class="button" @click='yoho.goTap({"index":2})'>TAP</button>
<button class="button" @click="yoho.goLogin()">登录</button>
<button class="button" @click="yoho.goLogout()">退出登录</button>
<button class="button" @click='yoho.goShopingKey({"shoppingkey":"123456789"})'>设置ShopingKey</button>
<button class="button" @click="yoho.goShopingCart()">跳转购物车</button>
<button class="button" @click='yoho.goAddress({"type":"1"}, addressCallback)'>地址选择页面</button>
<button class="button" @click='yoho.goAddress({"type":"2"}, addressCallback)'>地址管理页面</button>
<button class="button" @click='yoho.goImageBrowser({"images":["http://7xwj52.com1.z0.glb.clouddn.com/brandbg.jpg"], "index": "1"})'>图片浏览</button>
<button class="button" @click='yoho.goNewPage({"url":"http://m.yohoblk.com"})'>新页面</button>
<button class="button" @click="yoho.goPay()">支付</button>
<button class="button" @click="yoho.goBack()">返回</button>
<button class="button" @click='yoho.goShare({"title":"标题","des":"描述","img":"http://7xwj52.com1.z0.glb.clouddn.com/brandbg.jpg","url":"http://m.yohoblk.com/example/app"})'>分享</button>
<button class="button" @click='yoho.goSearch()'>搜索</button>
<button class="button" @click='yoho.goSetting()'>设置</button>
<button class="button" @click='yoho.goSetAvatar()'>设置头像</button>
</div>
</template>
<style>
body {
... ... @@ -25,11 +27,11 @@
}
</style>
<script>
const yoho = require('yoho');
const modal = require('common/modal');
const share = require('common/share');
import yoho from 'yoho';
import modal from 'common/modal';
import share from 'common/share';
module.exports = {
export default {
data() {
return {
yoho
... ...
<template>
<div class="test">
{{message}}
</div>
<div class="test2">
{{message2}}
<div>
<div class="test">
{{message}}
</div>
<div class="test2">
{{message2}}
</div>
</div>
</template>
<script>
var s = 1; // 测试代码检查
module.exports = {
export default {
data() {
return {
message: 'test',
... ...
... ... @@ -7,11 +7,11 @@
<script>
'use strict';
const $ = require('jquery');
const yoho = require('yoho');
const tip = require('common/tip');
import $ from 'jquery';
import yoho from 'yoho';
import tip from 'common/tip';
module.exports = {
export default {
data() {
return {
options: [],
... ...
... ... @@ -15,10 +15,10 @@
<script>
'use strict';
const $ = require('jquery');
const tip = require('common/tip');
import $ from 'jquery';
import tip from 'common/tip';
module.exports = {
export default {
data() {
return {
page: 0,
... ...
... ... @@ -33,19 +33,19 @@
</template>
<script>
const $ = require('jquery');
const qs = require('yoho-qs');
const tip = require('common/tip');
const bus = require('common/vue-bus');
const Modal = require('common/modal');
const returnUtil = require('common/util');
const yoho = require('yoho');
const productList = require('me/return/list.vue');
const featureSelector = require('component/product/feature-selector.vue');
const reasonConfig = require('me/return/reason');
module.exports = {
import $ from 'jquery';
import qs from 'yoho-qs';
import tip from 'common/tip';
import bus from 'common/vue-bus';
import Modal from 'common/modal';
import returnUtil from 'common/util';
import yoho from 'yoho';
import productList from 'me/return/list.vue';
import featureSelector from 'component/product/feature-selector.vue';
import reasonConfig from 'me/return/reason';
export default {
el: '#exchange',
data() {
return {
... ...
... ... @@ -20,11 +20,11 @@
* 2. 更换产品 款式
* 3. 换货 原因
*/
const product = require('me/return/item.vue');
const reason = require('me/return/reason.vue');
const bus = require('common/vue-bus');
import product from 'me/return/item.vue';
import reason from 'me/return/reason.vue';
import bus from 'common/vue-bus';
module.exports = {
export default {
props: {
product: Object,
readyonly: Boolean,
... ...
<template>
<div class="fav-type" v-infinite-scroll="loadMore()" infinite-scroll-disabled="busy" infinite-scroll-distance="10">
<ul class="fav-article-list">
<li v-for="item in articleData" track-by="fav_id" id="li-{{item.fav_id}}" v-touch-options:pan="{ direction: 'horizontal', threshold: 100}" v-touch:panstart="panstart(item.fav_id)" v-touch:panmove="panmove(item.fav_id)" v-touch:panend="panend(item.fav_id)">
<div class="fav-del-left {{editmodel ? 'delshow': ''}}" @click="showDelBtn(item.fav_id)">
<li v-for="item in articleData"
:key="item.fav_id"
:id="'li-' + item.fav_id"
v-touch-options:pan="{ direction: 'horizontal', threshold: 100}"
v-touch:panstart="panstart(item.fav_id)"
v-touch:panmove="panmove(item.fav_id)"
v-touch:panend="panend(item.fav_id)">
<div :class="'fav-del-left ' + editmodel ? 'delshow': ''" @click="showDelBtn(item.fav_id)">
<span class="fav-del-span"><span class="icon icon-edit-del"></span></span>
</div>
<div class="editorial-box">
<a href="/editorial/{{item.fav_id}}.html">
<div class="img"><img :src="item.src | resize 750 469"/></div>
<a :href="'/editorial/' + item.fav_id + '.html'">
<div class="img"><img :src="item.src | resize(750, 469)"/></div>
<div class="title">{{item.title}}</div>
<div class="editorial-des"><p class="line-clamp-2">{{item.intro}}</p></div>
<hr>
... ... @@ -18,7 +24,7 @@
</div>
</a>
</div>
<div class="fav-del-right hide" id="del-{{item.fav_id}}" @click="delItem($index, item.fav_id)">
<div class="fav-del-right hide" :id="'del-' + item.fav_id" @click="delItem($index, item.fav_id)">
<div class="span-delete">
<span class="icon icon-delete"></span>
<br/>
... ... @@ -27,7 +33,7 @@
</div>
</li>
</ul>
<div class="fav-null-box {{ nullbox }}">
<div :class="'fav-null-box ' + nullbox">
<span class="fav-null">您暂无收藏任何资讯</span>
<a class="go-shopping" href="/editorial/list">随便逛逛</a>
</div>
... ... @@ -35,13 +41,13 @@
</template>
<script>
const $ = require('jquery');
const tip = require('common/tip');
const interceptClick = require('common/intercept-click');
const yoho = require('yoho');
const bus = require('common/vue-bus');
import $ from 'jquery';
import tip from 'common/tip';
import interceptClick from 'common/intercept-click';
import yoho from 'yoho';
import bus from 'common/vue-bus';
module.exports = {
export default {
data() {
return {
nullbox: 'hide',
... ...