You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ji...@apache.org on 2017/02/20 06:41:06 UTC
[17/50] [abbrv] incubator-weex git commit: V0.10.0 stable gitlab
(#178)
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/examples/vue/include/tabbar.vue
----------------------------------------------------------------------
diff --git a/examples/vue/include/tabbar.vue b/examples/vue/include/tabbar.vue
new file mode 100644
index 0000000..fbaa29f
--- /dev/null
+++ b/examples/vue/include/tabbar.vue
@@ -0,0 +1,92 @@
+<template>
+ <div class="wrapper">
+ <embed
+ v-for="item in tabItems"
+ :src="item.src"
+ type="weex"
+ :style="{ visibility: item.visibility }"
+ class="content"
+ ></embed>
+ <div class="tabbar" append="tree">
+ <tabitem
+ v-for="item in tabItems"
+ :index="item.index"
+ :icon="item.icon"
+ :title="item.title"
+ :titleColor="item.titleColor"
+ @tabItemOnClick="tabItemOnClick"
+ ></tabItem>
+ </div>
+ </div>
+</template>
+
+<style>
+ .wrapper {
+ width: 750;
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ }
+ .content {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ margin-top: 0;
+ margin-bottom: 88;
+ }
+ .tabbar {
+ flex-direction: row;
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ height: 88;
+ }
+</style>
+
+<script>
+ module.exports = {
+ props: {
+ tabItems: { default: [] },
+ selectedColor: { default: '#ff0000' },
+ unselectedColor: { default: '#000000' }
+ },
+ data: function () {
+ return {
+ selectedIndex: 0
+ }
+ },
+ components: {
+ tabitem: require('./tabitem.vue')
+ },
+ created: function () {
+ this.select(this.selectedIndex);
+ },
+ methods: {
+ tabItemOnClick: function (e) {
+ this.selectedIndex = e.index;
+ this.select(e.index);
+ this.$emit('tabBarOnClick', e);
+ },
+ select: function(index) {
+ for(var i = 0; i < this.tabItems.length; i++) {
+ var tabItem = this.tabItems[i];
+ if(i == index){
+ tabItem.icon = tabItem.selectedImage;
+ tabItem.titleColor = this.selectedColor;
+ tabItem.visibility = 'visible';
+ }
+ else {
+ tabItem.icon = tabItem.image;
+ tabItem.titleColor = this.unselectedColor;
+ tabItem.visibility = 'hidden';
+ }
+ }
+ },
+ }
+ }
+</script>
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/examples/vue/include/tabitem.vue
----------------------------------------------------------------------
diff --git a/examples/vue/include/tabitem.vue b/examples/vue/include/tabitem.vue
new file mode 100644
index 0000000..ee41ced
--- /dev/null
+++ b/examples/vue/include/tabitem.vue
@@ -0,0 +1,63 @@
+<template>
+ <div
+ :style="{ backgroundColor: backgroundColor }"
+ class="container"
+ @click="onclickitem">
+ <image
+ src="http://gtms03.alicdn.com/tps/i3/TB1mdsiMpXXXXXpXXXXNw4JIXXX-640-4.png"
+ class="top-line"></image>
+ <image
+ :src="icon"
+ class="tab-icon"></image>
+ <text
+ :style="{ color: titleColor }"
+ class="tab-text">{{title}}</text>
+ </div>
+</template>
+
+<style>
+ .container {
+ flex: 1;
+ flex-direction: column;
+ align-items:center;
+ justify-content:center;
+ height: 88;
+ }
+ .top-line {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ height: 2;
+ }
+ .tab-icon {
+ margin-top: 5;
+ width: 40;
+ height: 40
+ }
+ .tab-text {
+ margin-top: 5;
+ text-align: center;
+ font-size: 20;
+ }
+</style>
+
+<script>
+ module.exports = {
+ props: {
+ index: { default: 0 },
+ title: { default: '' },
+ titleColor: { default: '#000000' },
+ icon: { default: '' },
+ backgroundColor: { default: '#ffffff' }
+ },
+ methods: {
+ onclickitem: function (e) {
+ var params = {
+ index: this.index
+ };
+ this.$emit('tabItemOnClick', params);
+ }
+ }
+ }
+</script>
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/examples/vue/include/tip.vue
----------------------------------------------------------------------
diff --git a/examples/vue/include/tip.vue b/examples/vue/include/tip.vue
new file mode 100644
index 0000000..11f74b4
--- /dev/null
+++ b/examples/vue/include/tip.vue
@@ -0,0 +1,65 @@
+<!-- Inspired by bootstrap http://getbootstrap.com/ -->
+<template>
+ <div :class="['tip', 'tip-' + type]">
+ <text :class="['tip-txt', 'tip-txt-' + type]">{{value}}</text>
+ </div>
+</template>
+
+<script>
+ module.exports = {
+ props: {
+ type: { default: 'success' },
+ value: { default: '' }
+ }
+ }
+</script>
+
+<style>
+ .tip {
+ padding-left: 36px;
+ padding-right: 36px;
+ padding-top: 36px;
+ padding-bottom: 36px;
+ border-radius: 10px;
+ }
+
+ .tip-txt{
+ font-size: 28px;
+ }
+
+ .tip-success {
+ background-color: #dff0d8;
+ border-color: #d6e9c6;
+ }
+
+ .tip-txt-success {
+ color: #3c763d;
+ }
+
+ .tip-info {
+ background-color: #d9edf7;
+ border-color: #bce8f1;
+ }
+
+ .tip-txt-info {
+ color: #31708f;
+ }
+
+ .tip-warning {
+ background-color: #fcf8e3;
+ border-color: #faebcc;
+ }
+
+ .tip-txt-warning {
+ color: #8a6d3b;
+ }
+
+ .tip-danger {
+ background-color: #f2dede;
+ border-color: #ebccd1;
+ }
+
+ .tip-txt-danger {
+ color: #a94442;
+ }
+</style>
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/examples/vue/index.vue
----------------------------------------------------------------------
diff --git a/examples/vue/index.vue b/examples/vue/index.vue
index 94498c5..413565d 100644
--- a/examples/vue/index.vue
+++ b/examples/vue/index.vue
@@ -4,43 +4,45 @@
<script>
module.exports = {
- data: {
- items: [
- // common
- {name: 'vue/syntax/hello-world', title: 'Hello World'},
- {name: 'vue/style/index', title: 'Common Style'},
- {name: 'vue/animation', title: 'Animation'},
+ data: function () {
+ return {
+ items: [
+ // common
+ {name: 'vue/syntax/hello-world', title: 'Hello World'},
+ {name: 'vue/style/index', title: 'Common Style'},
+ {name: 'vue/animation', title: 'Animation'},
- // component
- {name: 'vue/components/text', title: 'Text'},
- {name: 'vue/components/image', title: 'Image'},
- {name: 'vue/components/input', title: 'Input'},
- {name: 'vue/components/scroller', title: 'Scroller'},
- {name: 'vue/components/list', title: 'List'},
- {name: 'vue/components/slider', title: 'Slider'},
- {name: 'vue/components/a', title: 'A'},
- {name: 'vue/components/video', title: 'Video'},
- {name: 'vue/components/countdown', title: 'Countdown'},
- {name: 'vue/components/marquee', title: 'Marquee'},
- {name: 'vue/components/web', title: 'Web'},
- {name: 'vue/components/navigator', title: 'Navigator'},
- {name: 'vue/components/tabbar', title: 'Tabbar'},
+ // component
+ {name: 'vue/components/text', title: 'Text'},
+ {name: 'vue/components/image', title: 'Image'},
+ {name: 'vue/components/input', title: 'Input'},
+ {name: 'vue/components/scroller', title: 'Scroller'},
+ {name: 'vue/components/list', title: 'List'},
+ {name: 'vue/components/slider', title: 'Slider'},
+ {name: 'vue/components/a', title: 'A'},
+ {name: 'vue/components/video', title: 'Video'},
+ {name: 'vue/components/countdown', title: 'Countdown'},
+ {name: 'vue/components/marquee', title: 'Marquee'},
+ {name: 'vue/components/web', title: 'Web'},
+ {name: 'vue/components/navigator', title: 'Navigator'},
+ {name: 'vue/components/tabbar', title: 'Tabbar'},
- // module
- {name: 'vue/modules/instance-api', title: 'Instance API'},
- {name: 'vue/modules/modal', title: 'Modal'},
- {name: 'vue/modules/stream', title: 'Stream'},
- {name: 'vue/modules/storage',title:'Storage'},
- // {name: 'module/clipboard', title: 'Clipboard'}, // 0.8 , developing
+ // module
+ {name: 'vue/modules/instance-api', title: 'Instance API'},
+ {name: 'vue/modules/modal', title: 'Modal'},
+ {name: 'vue/modules/stream', title: 'Stream'},
+ {name: 'vue/modules/storage',title:'Storage'},
+ // {name: 'module/clipboard', title: 'Clipboard'}, // 0.8 , developing
- // showcase
- {name: 'vue/showcase/progress', title: 'Progress Bar'},
- {name: 'vue/showcase/itemlist', title: 'List (Advanced)'},
- {name: 'vue/showcase/calculator', title: 'Calculator'},
- // {name: 'vue/showcase/minesweeper', title: 'Minesweeper'},
- // {name: 'vue/showcase/ui', title: 'UI Gallery'},
- // {name: 'vue/showcase/dropdown/dropdown-demo', title: 'Dropdown'}
- ]
+ // showcase
+ {name: 'vue/showcase/progress', title: 'Progress Bar'},
+ {name: 'vue/showcase/itemlist', title: 'List (Advanced)'},
+ {name: 'vue/showcase/calculator', title: 'Calculator'},
+ // {name: 'vue/showcase/minesweeper', title: 'Minesweeper'},
+ // {name: 'vue/showcase/ui', title: 'UI Gallery'},
+ // {name: 'vue/showcase/dropdown/dropdown-demo', title: 'Dropdown'}
+ ]
+ }
},
components: {
exampleList: require('./include/example-list.vue')
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/examples/vue/modules/clipboard.vue
----------------------------------------------------------------------
diff --git a/examples/vue/modules/clipboard.vue b/examples/vue/modules/clipboard.vue
index 94f17f8..014bb7a 100644
--- a/examples/vue/modules/clipboard.vue
+++ b/examples/vue/modules/clipboard.vue
@@ -3,12 +3,12 @@
<panel title="Clipboard" type="primary">
<panel title="Copy to clipboard5">
<text style="line-height: 40px; font-size: 28px">{{textToCopy}}</text>
- <button type="info" size="middle" value="Copy" @click="doCopy"></button>
+ <button type="info" size="middle" value="Copy" @click.native="doCopy"></button>
</panel>
<panel title="Paste from clipboard">
<text style="line-height: 40px; font-size: 28px">{{textFromPaste}}</text>
- <button type="info" size="middle" value="Paste" @click="doPaste"></button>
+ <button type="info" size="middle" value="Paste" @click.native="doPaste"></button>
</panel>
<panel title="Result">
@@ -23,31 +23,32 @@
var modal = require('@weex-module/modal')
var clipboard = require('@weex-module/clipboard')
module.exports = {
- data: {
- textToCopy : '',
- textFromPaste: '',
- tips : '',
+ data: function () {
+ return {
+ textToCopy : '',
+ textFromPaste: '',
+ tips : ''
+ }
},
components: {
- panel: require('weex-vue-components/panel.vue'),
- tip: require('weex-vue-components/tip.vue'),
- button: require('weex-vue-components/button.vue')
+ panel: require('../include/panel.vue'),
+ tip: require('../include/tip.vue'),
+ button: require('../include/button.vue')
},
- ready : function() {
+ mounted: function() {
this.tips = "1. Just click COPY button. It will auto generate a string with random text, and copy to system clipboard. \n 2. do copy in another app, then come back and click PASTE button."
},
methods: {
- clicked: function() {
- modal.toast({'message': 'clicked!', duration: 0.5})
- },
doCopy: function() {
+ modal.toast({'message': 'doCopy!', duration: 0.5})
textToCopy = "autoGenerateTextToCopy" + Math.random()
clipboard.setString(textToCopy)
this.textToCopy = textToCopy
- this.tips = "copy done. Now system clipboard has string of '" + textToCopy + "', try PASTE button, or paste in another app."
+ this.tips = "copy done. Now system clipboard has string of '" + textToCopy + "', try PASTE button, or paste in another app."
},
doPaste: function() {
var me = this
+ modal.toast({'message': 'doPaste!', duration: 0.5})
clipboard.getString(function(ret) {
console.log("paste result is " + JSON.stringify(ret))
me.textFromPaste = ret.data
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/examples/vue/modules/instance-api.vue
----------------------------------------------------------------------
diff --git a/examples/vue/modules/instance-api.vue b/examples/vue/modules/instance-api.vue
index b605841..d5dbf51 100644
--- a/examples/vue/modules/instance-api.vue
+++ b/examples/vue/modules/instance-api.vue
@@ -8,11 +8,13 @@
<script>
module.exports = {
- data: {
- config: ''
+ data: function () {
+ return {
+ config: ''
+ }
},
components: {
- panel: require('weex-vue-components/panel.vue')
+ panel: require('../include/panel.vue')
},
created: function() {
var config = this.$getConfig();
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/examples/vue/modules/modal.vue
----------------------------------------------------------------------
diff --git a/examples/vue/modules/modal.vue b/examples/vue/modules/modal.vue
index 2369757..7552a7b 100644
--- a/examples/vue/modules/modal.vue
+++ b/examples/vue/modules/modal.vue
@@ -15,10 +15,12 @@
<script>
var modal = require('@weex-module/modal')
module.exports = {
- data: {},
+ data: function () {
+ return {}
+ },
components: {
- panel: require('weex-vue-components/panel.vue'),
- button: require('weex-vue-components/button.vue')
+ panel: require('../include/panel.vue'),
+ button: require('../include/button.vue')
},
methods: {
toast: function(msg, duration) {
@@ -54,7 +56,7 @@
'okTitle': okTitle,
'cancelTitle': cancelTitle
}, function(result) {
- modal.toast({ message: "Click Confirm " + result })
+ modal.toast({ message: "Click Confirm " + JSON.stringify(result) })
})
},
prompt: function() {
@@ -63,7 +65,7 @@
'okTitle': 'ok',
'cancelTitle': 'cancel'
}, function(result) {
- modal.toast({ message: "Click Prompt " + result })
+ modal.toast({ message: "Click Prompt " + JSON.stringify(result) })
})
}
}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/examples/vue/modules/storage.vue
----------------------------------------------------------------------
diff --git a/examples/vue/modules/storage.vue b/examples/vue/modules/storage.vue
index 22b39b7..0ca10fb 100644
--- a/examples/vue/modules/storage.vue
+++ b/examples/vue/modules/storage.vue
@@ -24,15 +24,17 @@
<script>
var storage = require('@weex-module/storage')
module.exports = {
- data: {
- setItemResult:'loading',
- getItemResult:'loading',
- removeItemResult:'loading',
- lengthResult:'loading',
- getAllKeysResult:'loading'
+ data: function () {
+ return {
+ setItemResult:'loading',
+ getItemResult:'loading',
+ removeItemResult:'loading',
+ lengthResult:'loading',
+ getAllKeysResult:'loading'
+ }
},
components: {
- panel: require('weex-vue-components/panel.vue')
+ panel: require('../include/panel.vue')
},
created: function() {
var me = this
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/examples/vue/modules/stream.vue
----------------------------------------------------------------------
diff --git a/examples/vue/modules/stream.vue b/examples/vue/modules/stream.vue
index 6ede1c9..575aaff 100644
--- a/examples/vue/modules/stream.vue
+++ b/examples/vue/modules/stream.vue
@@ -29,17 +29,19 @@
<script>
var stream = require('@weex-module/stream');
module.exports = {
- data: {
- getJsonpResult: 'loading...',
- getResult: 'loading...',
- postResult: 'loading...',
- putResult: 'loading...',
- deleteResult: 'loading...',
- headResult: 'loading...',
- patchResult: 'loading...',
+ data: function () {
+ return {
+ getJsonpResult: 'loading...',
+ getResult: 'loading...',
+ postResult: 'loading...',
+ putResult: 'loading...',
+ deleteResult: 'loading...',
+ headResult: 'loading...',
+ patchResult: 'loading...'
+ }
},
components: {
- panel: require('weex-vue-components/panel.vue')
+ panel: require('../include/panel.vue')
},
created: function() {
var me = this;
@@ -50,7 +52,7 @@
var DELETE_URL = 'http://httpbin.org/delete';
var HEAD_URL = 'http://httpbin.org/status/418';
var PATCH_URL = 'http://httpbin.org/patch';
-
+
stream.fetch({
method: 'GET',
url: GET_URL_JSONP,
@@ -131,7 +133,7 @@
console.log('get in progress:'+response.length);
me.deleteResult = "bytes received:"+response.length;
});
-
+
stream.fetch({
method: 'HEAD',
url: HEAD_URL,
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/examples/vue/showcase/calculator.vue
----------------------------------------------------------------------
diff --git a/examples/vue/showcase/calculator.vue b/examples/vue/showcase/calculator.vue
index 8f8868b..f0cabc1 100644
--- a/examples/vue/showcase/calculator.vue
+++ b/examples/vue/showcase/calculator.vue
@@ -62,13 +62,17 @@
<script>
var OP = ['+', '-', '*', '/'];
+ var modal = require('@weex-module/modal')
module.exports = {
- data: {
- result: '',
- inputs: []
+ data: function () {
+ return {
+ result: '',
+ inputs: []
+ }
},
methods: {
input: function(e) {
+ modal.toast({ message: 'input: ' + e.target.attr.value, duration: 1 })
var value = e.target.attr['value'];
var inputs = this.inputs;
var lastOne = inputs.length ? inputs[inputs.length - 1] : '';
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/examples/vue/showcase/itemlist.vue
----------------------------------------------------------------------
diff --git a/examples/vue/showcase/itemlist.vue b/examples/vue/showcase/itemlist.vue
index 28fe542..fc7a1a4 100644
--- a/examples/vue/showcase/itemlist.vue
+++ b/examples/vue/showcase/itemlist.vue
@@ -219,308 +219,310 @@
<script>
var modal = require('@weex-module/modal')
module.exports = {
- data: {
- shopList: [
- {
- id: 1,
- scopeValue: 1,
- PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
- PersonName: 'Mendeleyev',
- PersonVisitTime: 'today',
- shopDesc: 'Genius only means hard-working all one\'s life',
- shopImgList: [{
- shopImgWidth: 220,
- shopImgHeight: 220,
- shopImg: 'https://gd2.alicdn.com/bao/uploaded/i2/TB1rtOnHpXXXXXLaXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
- }, {
- shopImgWidth: 220,
- shopImgHeight: 220,
- shopImg: 'https://gd4.alicdn.com/bao/uploaded/i4/TB15KrfFVXXXXXJXXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
- }, {
- shopImgWidth: 220,
- shopImgHeight: 220,
- shopImg: 'https://gd2.alicdn.com/bao/uploaded/i2/TB1t5YBGVXXXXXcaXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
- }],
- shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
- shopLikeText: '6',
- shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
- shopCommentText: '97',
- shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
- shopLookText: '1003',
- shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
- shareText: "10",
+ data: function () {
+ return {
+ shopList: [
+ {
+ id: 1,
+ scopeValue: 1,
+ PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
+ PersonName: 'Mendeleyev',
+ PersonVisitTime: 'today',
+ shopDesc: 'Genius only means hard-working all one\'s life',
+ shopImgList: [{
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd2.alicdn.com/bao/uploaded/i2/TB1rtOnHpXXXXXLaXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd4.alicdn.com/bao/uploaded/i4/TB15KrfFVXXXXXJXXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd2.alicdn.com/bao/uploaded/i2/TB1t5YBGVXXXXXcaXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
+ }],
+ shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopLikeText: '6',
+ shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopCommentText: '97',
+ shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
+ shopLookText: '1003',
+ shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
+ shareText: "10",
- },
- {
- id: 2,
- scopeValue: 2,
- PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
- PersonName: 'Napoleon',
- PersonVisitTime: 'yesterday',
- shopDesc: 'The man who has made up his mind to win will never say "impossible "',
- shopImgList: [{
- shopImgWidth: 220,
- shopImgHeight: 220,
- shopImg: 'https://gd1.alicdn.com/imgextra/i1/2655929383/TB2.qITjpXXXXcIXXXXXXXXXXXX_!!2655929383.jpg_220x220.jpg'
- }, {
- shopImgWidth: 220,
- shopImgHeight: 220,
- shopImg: 'https://gd3.alicdn.com/imgextra/i3/2655929383/TB2eWwZjpXXXXbHXXXXXXXXXXXX_!!2655929383.jpg_220x220.jpg'
- }, {
- shopImgWidth: 220,
- shopImgHeight: 220,
- shopImg: 'https://gd2.alicdn.com/imgextra/i2/2655929383/TB2tgQWjpXXXXbZXXXXXXXXXXXX_!!2655929383.jpg_220x220.jpg'
- }],
- shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
- shopLikeText: '6',
- shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
- shopCommentText: '97',
- shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
- shopLookText: '1003',
- shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
- shareText: "10",
+ },
+ {
+ id: 2,
+ scopeValue: 2,
+ PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
+ PersonName: 'Napoleon',
+ PersonVisitTime: 'yesterday',
+ shopDesc: 'The man who has made up his mind to win will never say "impossible "',
+ shopImgList: [{
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd1.alicdn.com/imgextra/i1/2655929383/TB2.qITjpXXXXcIXXXXXXXXXXXX_!!2655929383.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd3.alicdn.com/imgextra/i3/2655929383/TB2eWwZjpXXXXbHXXXXXXXXXXXX_!!2655929383.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd2.alicdn.com/imgextra/i2/2655929383/TB2tgQWjpXXXXbZXXXXXXXXXXXX_!!2655929383.jpg_220x220.jpg'
+ }],
+ shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopLikeText: '6',
+ shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopCommentText: '97',
+ shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
+ shopLookText: '1003',
+ shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
+ shareText: "10",
- },
- {
- id: 3,
- scopeValue: 3,
- PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
- PersonName: 'Balzac',
- PersonVisitTime: 'yesterday',
- shopDesc: 'There is no such thing as a great talent without great will - power',
- shopImgList: [{
- shopImgWidth: 220,
- shopImgHeight: 220,
- shopImg: 'https://gd1.alicdn.com/imgextra/i1/TB1AFz9LXXXXXbrXVXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
- }, {
- shopImgWidth: 220,
- shopImgHeight: 220,
- shopImg: 'https://gd2.alicdn.com/imgextra/i2/2557954751/TB2is2njXXXXXatXpXXXXXXXXXX_!!2557954751.jpg_220x220.jpg'
- }, {
- shopImgWidth: 220,
- shopImgHeight: 220,
- shopImg: 'https://gd2.alicdn.com/imgextra/i2/2557954751/TB2PNYGjXXXXXbXXXXXXXXXXXXX_!!2557954751.jpg_220x220.jpg'
- }],
- shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
- shopLikeText: '6',
- shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
- shopCommentText: '97',
- shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
- shopLookText: '1003',
- shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
- shareText: "10",
+ },
+ {
+ id: 3,
+ scopeValue: 3,
+ PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
+ PersonName: 'Balzac',
+ PersonVisitTime: 'yesterday',
+ shopDesc: 'There is no such thing as a great talent without great will - power',
+ shopImgList: [{
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd1.alicdn.com/imgextra/i1/TB1AFz9LXXXXXbrXVXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd2.alicdn.com/imgextra/i2/2557954751/TB2is2njXXXXXatXpXXXXXXXXXX_!!2557954751.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd2.alicdn.com/imgextra/i2/2557954751/TB2PNYGjXXXXXbXXXXXXXXXXXXX_!!2557954751.jpg_220x220.jpg'
+ }],
+ shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopLikeText: '6',
+ shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopCommentText: '97',
+ shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
+ shopLookText: '1003',
+ shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
+ shareText: "10",
- },
- {
- id: 4,
- scopeValue: 4,
- PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
- PersonName: 'Thomas Carlyle',
- PersonVisitTime: '3 day ago',
- shopDesc: 'Cease to struggle and you cease to live',
- shopImgList: [{
- shopImgWidth: 220,
- shopImgHeight: 220,
- shopImg: 'https://gd4.alicdn.com/imgextra/i4/69426324/TB2zbwdfXXXXXa4XpXXXXXXXXXX_!!69426324.jpg_220x220.jpg'
- }, {
- shopImgWidth: 220,
- shopImgHeight: 220,
- shopImg: 'https://gd4.alicdn.com/imgextra/i4/69426324/TB2L7ZAfXXXXXXOXXXXXXXXXXXX_!!69426324.jpg_220x220.jpg'
- }, {
- shopImgWidth: 220,
- shopImgHeight: 220,
- shopImg: 'https://gd4.alicdn.com/imgextra/i4/69426324/TB2p9wufXXXXXbiXXXXXXXXXXXX_!!69426324.jpg_220x220.jpg'
- }],
- shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
- shopLikeText: '6',
- shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
- shopCommentText: '97',
- shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
- shopLookText: '1003',
- shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
- shareText: "10",
+ },
+ {
+ id: 4,
+ scopeValue: 4,
+ PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
+ PersonName: 'Thomas Carlyle',
+ PersonVisitTime: '3 day ago',
+ shopDesc: 'Cease to struggle and you cease to live',
+ shopImgList: [{
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd4.alicdn.com/imgextra/i4/69426324/TB2zbwdfXXXXXa4XpXXXXXXXXXX_!!69426324.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd4.alicdn.com/imgextra/i4/69426324/TB2L7ZAfXXXXXXOXXXXXXXXXXXX_!!69426324.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd4.alicdn.com/imgextra/i4/69426324/TB2p9wufXXXXXbiXXXXXXXXXXXX_!!69426324.jpg_220x220.jpg'
+ }],
+ shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopLikeText: '6',
+ shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopCommentText: '97',
+ shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
+ shopLookText: '1003',
+ shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
+ shareText: "10",
- },
- {
- id: 5,
- scopeValue: 5,
- PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
- PersonName: 'Addison',
- PersonVisitTime: 'yesterday',
- shopDesc: 'A strong man will struggle with the storms of fate',
- shopImgList: [{
- shopImgWidth: 220,
- shopImgHeight: 220,
- shopImg: 'https://gd3.alicdn.com/bao/uploaded/i3/TB1MQ8_KVXXXXaLXVXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
- }, {
- shopImgWidth: 220,
- shopImgHeight: 220,
- shopImg: 'https://gd2.alicdn.com/imgextra/i2/53218032/TB2bGSqiXXXXXXyXpXXXXXXXXXX_!!53218032.jpg_220x220.jpg'
- }, {
- shopImgWidth: 220,
- shopImgHeight: 220,
- shopImg: 'https://gd2.alicdn.com/bao/uploaded/i2/TB1kP2zKFXXXXbIXXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
- }],
- shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
- shopLikeText: '6',
- shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
- shopCommentText: '97',
- shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
- shopLookText: '1003',
- shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
- shareText: "10",
+ },
+ {
+ id: 5,
+ scopeValue: 5,
+ PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
+ PersonName: 'Addison',
+ PersonVisitTime: 'yesterday',
+ shopDesc: 'A strong man will struggle with the storms of fate',
+ shopImgList: [{
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd3.alicdn.com/bao/uploaded/i3/TB1MQ8_KVXXXXaLXVXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd2.alicdn.com/imgextra/i2/53218032/TB2bGSqiXXXXXXyXpXXXXXXXXXX_!!53218032.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd2.alicdn.com/bao/uploaded/i2/TB1kP2zKFXXXXbIXXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
+ }],
+ shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopLikeText: '6',
+ shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopCommentText: '97',
+ shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
+ shopLookText: '1003',
+ shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
+ shareText: "10",
- },
- {
- id: 6,
- scopeValue: 1,
- PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
- PersonName: 'Ruskin',
- PersonVisitTime: 'yesterday',
- shopDesc: 'Living without an aim is like sailing without a compass',
- shopImgList: [{
- shopImgWidth: 220,
- shopImgHeight: 220,
- shopImg: 'https://gd4.alicdn.com/bao/uploaded/i4/TB11yFnHXXXXXakaXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
- }, {
- shopImgWidth: 220,
- shopImgHeight: 220,
- shopImg: 'https://gd4.alicdn.com/imgextra/i4/32720628/TB2CRJUcXXXXXXwXpXXXXXXXXXX_!!32720628.jpg_220x220.jpg'
- }, {
- shopImgWidth: 220,
- shopImgHeight: 220,
- shopImg: 'https://gd2.alicdn.com/bao/uploaded/i2/TB17LUzHXXXXXcEaXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
- }],
- shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
- shopLikeText: '6',
- shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
- shopCommentText: '97',
- shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
- shopLookText: '1003',
- shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
- shareText: "10",
+ },
+ {
+ id: 6,
+ scopeValue: 1,
+ PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
+ PersonName: 'Ruskin',
+ PersonVisitTime: 'yesterday',
+ shopDesc: 'Living without an aim is like sailing without a compass',
+ shopImgList: [{
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd4.alicdn.com/bao/uploaded/i4/TB11yFnHXXXXXakaXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd4.alicdn.com/imgextra/i4/32720628/TB2CRJUcXXXXXXwXpXXXXXXXXXX_!!32720628.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd2.alicdn.com/bao/uploaded/i2/TB17LUzHXXXXXcEaXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
+ }],
+ shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopLikeText: '6',
+ shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopCommentText: '97',
+ shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
+ shopLookText: '1003',
+ shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
+ shareText: "10",
- },
- {
- id: 7,
- scopeValue: 2,
- PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
- PersonName: 'Yiming',
- PersonVisitTime: 'today',
- shopDesc: 'Live a noble and honest life. Reviving past times in your old age will help you to enjoy your life again',
- shopImgList: [{
- shopImgWidth: 220,
- shopImgHeight: 220,
- shopImg: 'https://gd4.alicdn.com/bao/uploaded/i4/TB1hvNoJXXXXXaMaXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
- }, {
- shopImgWidth: 220,
- shopImgHeight: 220,
- shopImg: 'https://gd4.alicdn.com/imgextra/i4/2058567235/TB2V8iygFXXXXaRXpXXXXXXXXXX_!!2058567235.jpg_220x220.jpg'
- }, {
- shopImgWidth: 220,
- shopImgHeight: 220,
- shopImg: 'https://gd2.alicdn.com/imgextra/i2/2058567235/TB2im1QgFXXXXX8XXXXXXXXXXXX_!!2058567235.jpg_220x220.jpg'
- }],
- shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
- shopLikeText: '6',
- shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
- shopCommentText: '97',
- shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
- shopLookText: '1003',
- shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
- shareText: "10",
+ },
+ {
+ id: 7,
+ scopeValue: 2,
+ PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
+ PersonName: 'Yiming',
+ PersonVisitTime: 'today',
+ shopDesc: 'Live a noble and honest life. Reviving past times in your old age will help you to enjoy your life again',
+ shopImgList: [{
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd4.alicdn.com/bao/uploaded/i4/TB1hvNoJXXXXXaMaXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd4.alicdn.com/imgextra/i4/2058567235/TB2V8iygFXXXXaRXpXXXXXXXXXX_!!2058567235.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd2.alicdn.com/imgextra/i2/2058567235/TB2im1QgFXXXXX8XXXXXXXXXXXX_!!2058567235.jpg_220x220.jpg'
+ }],
+ shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopLikeText: '6',
+ shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopCommentText: '97',
+ shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
+ shopLookText: '1003',
+ shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
+ shareText: "10",
- },
- {
- id: 8,
- scopeValue: 3,
- PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
- PersonName: 'Brown',
- PersonVisitTime: 'yesterday',
- shopDesc: 'Behind every successful man there\'s a lot u unsuccessful years',
- shopImgList: [{
- shopImgWidth: 220,
- shopImgHeight: 220,
- shopImg: 'https://gd1.alicdn.com/bao/uploaded/i1/TB18BZ2KFXXXXb8XFXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
- }, {
- shopImgWidth: 220,
- shopImgHeight: 220,
- shopImg: 'https://gd1.alicdn.com/imgextra/i1/2775383848/TB2r012jVXXXXXHXpXXXXXXXXXX_!!2775383848.jpg_220x220.jpg'
- }, {
- shopImgWidth: 220,
- shopImgHeight: 220,
- shopImg: 'https://gd3.alicdn.com/imgextra/i3/2775383848/TB2iI9VjVXXXXaoXpXXXXXXXXXX_!!2775383848.jpg_220x220.jpg'
- }],
- shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
- shopLikeText: '6',
- shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
- shopCommentText: '97',
- shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
- shopLookText: '1003',
- shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
- shareText: "10",
+ },
+ {
+ id: 8,
+ scopeValue: 3,
+ PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
+ PersonName: 'Brown',
+ PersonVisitTime: 'yesterday',
+ shopDesc: 'Behind every successful man there\'s a lot u unsuccessful years',
+ shopImgList: [{
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd1.alicdn.com/bao/uploaded/i1/TB18BZ2KFXXXXb8XFXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd1.alicdn.com/imgextra/i1/2775383848/TB2r012jVXXXXXHXpXXXXXXXXXX_!!2775383848.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd3.alicdn.com/imgextra/i3/2775383848/TB2iI9VjVXXXXaoXpXXXXXXXXXX_!!2775383848.jpg_220x220.jpg'
+ }],
+ shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopLikeText: '6',
+ shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopCommentText: '97',
+ shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
+ shopLookText: '1003',
+ shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
+ shareText: "10",
- },
- {
- id: 9,
- scopeValue: 4,
- PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
- PersonName: 'YIMING',
- PersonVisitTime: 'today',
- shopDesc: 'Enrich your life today,. yesterday is history.tomorrow is mystery',
- shopImgList: [{
- shopImgWidth: 220,
- shopImgHeight: 220,
- shopImg: 'https://gd1.alicdn.com/bao/uploaded/i1/TB1JB.rLpXXXXXLXXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
- }, {
- shopImgWidth: 220,
- shopImgHeight: 220,
- shopImg: 'https://gd4.alicdn.com/imgextra/i4/2702739128/TB2JdvmjVXXXXXjXXXXXXXXXXXX_!!2702739128.jpg_220x220.jpg'
- }, {
- shopImgWidth: 220,
- shopImgHeight: 220,
- shopImg: 'https://gd2.alicdn.com/imgextra/i2/2702739128/TB2A.e6jVXXXXXGXpXXXXXXXXXX_!!2702739128.jpg_220x220.jpg'
- }],
- shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
- shopLikeText: '6',
- shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
- shopCommentText: '97',
- shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
- shopLookText: '1003',
- shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
- shareText: "10",
+ },
+ {
+ id: 9,
+ scopeValue: 4,
+ PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
+ PersonName: 'YIMING',
+ PersonVisitTime: 'today',
+ shopDesc: 'Enrich your life today,. yesterday is history.tomorrow is mystery',
+ shopImgList: [{
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd1.alicdn.com/bao/uploaded/i1/TB1JB.rLpXXXXXLXXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd4.alicdn.com/imgextra/i4/2702739128/TB2JdvmjVXXXXXjXXXXXXXXXXXX_!!2702739128.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd2.alicdn.com/imgextra/i2/2702739128/TB2A.e6jVXXXXXGXpXXXXXXXXXX_!!2702739128.jpg_220x220.jpg'
+ }],
+ shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopLikeText: '6',
+ shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopCommentText: '97',
+ shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
+ shopLookText: '1003',
+ shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
+ shareText: "10",
- },
- {
- id: 10,
- scopeValue: 5,
- PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
- PersonName: 'YIMING',
- PersonVisitTime: 'yesterday',
- shopDesc: 'The secret of success is constancy to purpose',
- shopImgList: [{
- shopImgWidth: 220,
- shopImgHeight: 220,
- shopImg: 'https://gd3.alicdn.com/bao/uploaded/i3/TB17zXOGXXXXXbEXVXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
- }, {
- shopImgWidth: 220,
- shopImgHeight: 220,
- shopImg: 'https://gd1.alicdn.com/imgextra/i1/2265445951/TB22ACTbFXXXXXBXXXXXXXXXXXX_!!2265445951.jpg_220x220.jpg'
- }, {
- shopImgWidth: 220,
- shopImgHeight: 220,
- shopImg: 'https://gd3.alicdn.com/imgextra/i3/2265445951/TB2oXqUbFXXXXXIXXXXXXXXXXXX_!!2265445951.jpg_220x220.jpg'
- }],
- shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
- shopLikeText: '6',
- shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
- shopCommentText: '97',
- shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
- shopLookText: '1003',
- shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
- shareText: "10",
- }
- ],
+ },
+ {
+ id: 10,
+ scopeValue: 5,
+ PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
+ PersonName: 'YIMING',
+ PersonVisitTime: 'yesterday',
+ shopDesc: 'The secret of success is constancy to purpose',
+ shopImgList: [{
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd3.alicdn.com/bao/uploaded/i3/TB17zXOGXXXXXbEXVXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd1.alicdn.com/imgextra/i1/2265445951/TB22ACTbFXXXXXBXXXXXXXXXXXX_!!2265445951.jpg_220x220.jpg'
+ }, {
+ shopImgWidth: 220,
+ shopImgHeight: 220,
+ shopImg: 'https://gd3.alicdn.com/imgextra/i3/2265445951/TB2oXqUbFXXXXXIXXXXXXXXXXXX_!!2265445951.jpg_220x220.jpg'
+ }],
+ shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopLikeText: '6',
+ shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
+ shopCommentText: '97',
+ shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
+ shopLookText: '1003',
+ shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
+ shareText: "10",
+ }
+ ],
+ }
},
methods: {
loadmore: function(e) {
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/examples/vue/showcase/progress.vue
----------------------------------------------------------------------
diff --git a/examples/vue/showcase/progress.vue b/examples/vue/showcase/progress.vue
index 7824f1f..8311bcf 100644
--- a/examples/vue/showcase/progress.vue
+++ b/examples/vue/showcase/progress.vue
@@ -22,12 +22,14 @@
<script>
var INC = 20;
module.exports = {
- data: {
- fullW: 600,
- w: 40
+ data: function () {
+ return {
+ fullW: 600,
+ w: 40
+ }
},
components: {
- panel: require('weex-vue-components/panel.vue')
+ panel: require('../include/panel.vue')
},
created: function() {
var me = this;
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/examples/vue/style/index.vue
----------------------------------------------------------------------
diff --git a/examples/vue/style/index.vue b/examples/vue/style/index.vue
index ece5f49..dafa348 100644
--- a/examples/vue/style/index.vue
+++ b/examples/vue/style/index.vue
@@ -32,7 +32,7 @@
<script>
module.exports = {
components: {
- panel: require('weex-vue-components/panel.vue'),
+ panel: require('../include/panel.vue'),
styleBox: require('./style-box.vue'),
styleFlex: require('./style-flex.vue'),
styleItem: require('./style-item.vue')
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/examples/vue/style/style-box.vue
----------------------------------------------------------------------
diff --git a/examples/vue/style/style-box.vue b/examples/vue/style/style-box.vue
index 90edc3d..ac2e290 100644
--- a/examples/vue/style/style-box.vue
+++ b/examples/vue/style/style-box.vue
@@ -62,8 +62,8 @@
<script>
module.exports = {
components: {
- panel: require('weex-vue-components/panel.vue'),
- tip: require('weex-vue-components/tip.vue'),
+ panel: require('../include/panel.vue'),
+ tip: require('../include/tip.vue'),
styleItem: require('./style-item.vue')
}
}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/examples/vue/style/style-flex.vue
----------------------------------------------------------------------
diff --git a/examples/vue/style/style-flex.vue b/examples/vue/style/style-flex.vue
index 5c34b10..fc8b7b1 100644
--- a/examples/vue/style/style-flex.vue
+++ b/examples/vue/style/style-flex.vue
@@ -118,7 +118,7 @@
<script>
module.exports = {
components: {
- panel: require('weex-vue-components/panel.vue'),
+ panel: require('../include/panel.vue'),
styleItem: require('./style-item.vue')
}
}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/examples/vue/syntax/hello-world.vue
----------------------------------------------------------------------
diff --git a/examples/vue/syntax/hello-world.vue b/examples/vue/syntax/hello-world.vue
index 7dbe838..e4f4826 100644
--- a/examples/vue/syntax/hello-world.vue
+++ b/examples/vue/syntax/hello-world.vue
@@ -38,6 +38,7 @@
methods: {
update: function (e) {
this.target = 'Weex'
+ console.log('target:', this.target)
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/examples/vue/syntax/script-component.vue
----------------------------------------------------------------------
diff --git a/examples/vue/syntax/script-component.vue b/examples/vue/syntax/script-component.vue
index d8f8af5..1a29561 100644
--- a/examples/vue/syntax/script-component.vue
+++ b/examples/vue/syntax/script-component.vue
@@ -15,12 +15,14 @@
<script>
module.exports = {
- data: {
- items: [
- {title: 'A', url: 'a'},
- {title: 'B', url: 'b'},
- {title: 'C', url: 'c'}
- ]
+ data: function () {
+ return {
+ items: [
+ {title: 'A', url: 'a'},
+ {title: 'B', url: 'b'},
+ {title: 'C', url: 'c'}
+ ]
+ }
},
components: {
item: require('./include/sub.vue')
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/examples/vue/syntax/script-data.vue
----------------------------------------------------------------------
diff --git a/examples/vue/syntax/script-data.vue b/examples/vue/syntax/script-data.vue
index 09743c6..be65fa5 100644
--- a/examples/vue/syntax/script-data.vue
+++ b/examples/vue/syntax/script-data.vue
@@ -54,14 +54,17 @@
// }
module.exports = {
- data: {
- firstName: 'John',
- lastName: 'Smith',
- date: Date.now()
+ data: function () {
+ return {
+ firstName: 'John',
+ lastName: 'Smith',
+ date: Date.now()
+ }
},
methods: {
update: function () {
this.today = '2016-01-01'
+ console.log('today:', this.today)
}
},
computed: {
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/examples/vue/syntax/script-events.vue
----------------------------------------------------------------------
diff --git a/examples/vue/syntax/script-events.vue b/examples/vue/syntax/script-events.vue
index 95963bb..a4e437d 100644
--- a/examples/vue/syntax/script-events.vue
+++ b/examples/vue/syntax/script-events.vue
@@ -16,12 +16,15 @@
<script>
module.exports = {
- data: {
- list: []
+ data: function () {
+ return {
+ list: []
+ }
},
mounted: function () {
function custom(e) {
this.list.push('custom: ' + JSON.stringify(e))
+ console.log(this.list)
}
this.$emit('custom', {x: 1})
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/examples/vue/syntax/script-instance.vue
----------------------------------------------------------------------
diff --git a/examples/vue/syntax/script-instance.vue b/examples/vue/syntax/script-instance.vue
index 8448bd8..792f900 100644
--- a/examples/vue/syntax/script-instance.vue
+++ b/examples/vue/syntax/script-instance.vue
@@ -21,9 +21,11 @@
<script>
module.exports = {
- data: {
- x: 1,
- y: 2
+ data: function () {
+ return {
+ x: 1,
+ y: 2
+ }
},
methods: {
foo: function () {
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/examples/vue/syntax/script-lifecycle.vue
----------------------------------------------------------------------
diff --git a/examples/vue/syntax/script-lifecycle.vue b/examples/vue/syntax/script-lifecycle.vue
index 2863a7b..3c5c731 100644
--- a/examples/vue/syntax/script-lifecycle.vue
+++ b/examples/vue/syntax/script-lifecycle.vue
@@ -11,18 +11,23 @@
<script>
var initMessage
module.exports = {
- data: {
- list: ['Lifecycle List']
+ data: function () {
+ return {
+ list: ['Lifecycle List']
+ }
},
init: function () {
initMessage = 'component init: nothing more happen even the data initialization'
+ console.log('init:', this.list)
},
created: function () {
this.list.push(initMessage)
this.list.push('component created: data observed')
+ console.log('created:', this.list)
},
mounted: function () {
this.list.push('component mounted: virtual dom generated')
+ console.log('mounted:', this.list)
}
}
</script>
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/examples/vue/syntax/template-class.vue
----------------------------------------------------------------------
diff --git a/examples/vue/syntax/template-class.vue b/examples/vue/syntax/template-class.vue
index 85aa31b..55d50e1 100644
--- a/examples/vue/syntax/template-class.vue
+++ b/examples/vue/syntax/template-class.vue
@@ -23,6 +23,7 @@
methods: {
update: function (e) {
this.x = 'b'
+ console.log('x', this.x)
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/examples/vue/syntax/template-event.vue
----------------------------------------------------------------------
diff --git a/examples/vue/syntax/template-event.vue b/examples/vue/syntax/template-event.vue
index f55db76..034cf02 100644
--- a/examples/vue/syntax/template-event.vue
+++ b/examples/vue/syntax/template-event.vue
@@ -20,16 +20,20 @@
<script>
module.exports = {
- data: {
- name: 'Steve',
- temp: 'Mike'
+ data: function () {
+ return {
+ name: 'Steve',
+ temp: 'Mike'
+ }
},
methods: {
update: function (e) {
this.setName('David')
+ console.log('setName', this.name)
},
setName: function (value) {
this.name = value
+ console.log('name', this.name)
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/examples/vue/syntax/template-if.vue
----------------------------------------------------------------------
diff --git a/examples/vue/syntax/template-if.vue b/examples/vue/syntax/template-if.vue
index 8570f25..c0951b7 100644
--- a/examples/vue/syntax/template-if.vue
+++ b/examples/vue/syntax/template-if.vue
@@ -23,6 +23,7 @@
methods: {
toggle: function (e) {
this.flag = !this.flag
+ console.log('this.flag:', this.flag)
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/examples/vue/syntax/template-repeat-update.vue
----------------------------------------------------------------------
diff --git a/examples/vue/syntax/template-repeat-update.vue b/examples/vue/syntax/template-repeat-update.vue
index 7bed982..c320dc9 100644
--- a/examples/vue/syntax/template-repeat-update.vue
+++ b/examples/vue/syntax/template-repeat-update.vue
@@ -7,7 +7,7 @@
<template>
<div>
<text class="title">Track by</text>
- <text class="subtitle" v-for="item in list" track-by="item.key">{{$index}}-{{item.text}}</text>
+ <text class="subtitle" v-for="(item, k, $index) in list" track-by="item.key">{{$index}}-{{item.text}}</text>
<text class="btn" @click="update">Update</text>
<text class="btn" @click="mutate">Mutate</text>
</div>
@@ -21,21 +21,24 @@
<script>
module.exports = {
- data: {
- list: [
- {key: 1, text: 'a'},
- {key: 2, text: 'a'},
- {key: 3, text: 'b'},
- {key: 4, text: 'c'},
- {key: 5, text: 'a'}
- ],
- flag: true
+ data: function () {
+ return {
+ list: [
+ {key: 1, text: 'a'},
+ {key: 2, text: 'a'},
+ {key: 3, text: 'b'},
+ {key: 4, text: 'c'},
+ {key: 5, text: 'a'}
+ ],
+ flag: true
+ }
},
methods: {
update: function (e) {
// equals to `this.list.text = 'foo'`
// DO NOT USE: `this.list[2] = {key: 3, text: 'foo'}}`
Vue.set(this.list, 2, {key: 3, text: 'foo'})
+ console.log('this.list', this.list)
},
mutate: function (e) {
if (this.list.length % 2) {
@@ -44,6 +47,7 @@
else {
this.list.pop()
}
+ console.log('this.list', this.list)
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/examples/vue/syntax/template-repeat.vue
----------------------------------------------------------------------
diff --git a/examples/vue/syntax/template-repeat.vue b/examples/vue/syntax/template-repeat.vue
index 3c062ff..e52f3c4 100644
--- a/examples/vue/syntax/template-repeat.vue
+++ b/examples/vue/syntax/template-repeat.vue
@@ -6,11 +6,11 @@
<template>
<div>
<text class="title">Custom item</text>
- <text class="subtitle" v-for="item in list">{{$index}}-{{item}}</text>
+ <text class="subtitle" v-for="item in list">{{item}}</text>
<text class="title">Custom key and item</text>
<text class="subtitle" v-for="(i,v) in list">{{i}}-{{v}}</text>
<text class="title">Array of Object</text>
- <text class="subtitle" v-for="item in list2">{{$index}}-{{item.text}}</text>
+ <text class="subtitle" v-for="(item, k, index) in list2">> {{index}}-{{item.text}}</text>
</div>
</template>
@@ -21,21 +21,23 @@
<script>
module.exports = {
- data: {
- list: [
- 'a',
- 'b',
- 'c',
- 'd',
- 'e'
- ],
- list2: [
- {text: 'a'},
- {text: 'b'},
- {text: 'c'},
- {text: 'd'},
- {text: 'e'}
- ]
+ data: function () {
+ return {
+ list: [
+ 'a',
+ 'b',
+ 'c',
+ 'd',
+ 'e'
+ ],
+ list2: [
+ {text: 'a'},
+ {text: 'b'},
+ {text: 'c'},
+ {text: 'd'},
+ {text: 'e'}
+ ]
+ }
}
}
</script>
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/examples/vue/syntax/template-style.vue
----------------------------------------------------------------------
diff --git a/examples/vue/syntax/template-style.vue b/examples/vue/syntax/template-style.vue
index dadc13a..c150919 100644
--- a/examples/vue/syntax/template-style.vue
+++ b/examples/vue/syntax/template-style.vue
@@ -11,13 +11,16 @@
<script>
module.exports = {
- data: {
- size: 32,
- color: '#ff0000'
+ data: function () {
+ return {
+ size: 32,
+ color: '#ff0000'
+ }
},
methods: {
update: function (e) {
this.size = 48
+ console.log('this.size', this.size)
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/examples/vue/template.vue
----------------------------------------------------------------------
diff --git a/examples/vue/template.vue b/examples/vue/template.vue
index 729ed84..ece8af9 100644
--- a/examples/vue/template.vue
+++ b/examples/vue/template.vue
@@ -3,9 +3,9 @@
<panel title="Dialog" type="primary">
<tip type="success" value="It's a weex example template." style="margin-bottom: 20px;"></tip>
<hn level="1" value="H1"></hn>
- <button type="primary" @click="toast" value="Toast"></button>
+ <button type="primary" @click.native="toast" value="Toast"></button>
<hn level="2" value="H3"></hn>
- <button type="warning" @click="toast" value="Toast"></button>
+ <button type="warning" @click.native="toast" value="Toast"></button>
</panel>
<panel title="Image" type="primary">
<tip type="warning" value="Weex screen width is 750" style="margin-bottom: 20px;"></tip>
@@ -18,18 +18,18 @@
</template>
<script>
- var getBaseURL = require('./include/base-url.js').getBaseURL
- var baseURL = getBaseURL(this)
var modal = require('@weex-module/modal')
module.exports = {
- data: {
- img: '//gw.alicdn.com/tps/i2/TB1DpsmMpXXXXabaXXX20ySQVXX-512-512.png_400x400.jpg'
+ data: function () {
+ return {
+ img: '//gw.alicdn.com/tps/i2/TB1DpsmMpXXXXabaXXX20ySQVXX-512-512.png_400x400.jpg'
+ }
},
components: {
- panel: require('weex-vue-components/panel.vue'),
- hn: require('weex-vue-components/hn.vue'),
- tip: require('weex-vue-components/tip.vue'),
- button: require('weex-vue-components/button.vue')
+ panel: require('./include/panel.vue'),
+ hn: require('./include/hn.vue'),
+ tip: require('./include/tip.vue'),
+ button: require('./include/button.vue')
},
methods: {
toast: function() {
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/examples/vue/test.vue
----------------------------------------------------------------------
diff --git a/examples/vue/test.vue b/examples/vue/test.vue
deleted file mode 100644
index e47e331..0000000
--- a/examples/vue/test.vue
+++ /dev/null
@@ -1,16 +0,0 @@
-<template>
- <foo>
- <text>{{x}}</text>
- </foo>
-</template>
-
-<script>
- module.exports = {
- data: {
- x: 'xxx'
- },
- components: {
- foo: require('./test2.vue')
- }
- }
-</script>
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/examples/vue/test2.vue
----------------------------------------------------------------------
diff --git a/examples/vue/test2.vue b/examples/vue/test2.vue
deleted file mode 100644
index ce7cb34..0000000
--- a/examples/vue/test2.vue
+++ /dev/null
@@ -1,6 +0,0 @@
-<template>
- <div>
- <text>World</text>
- <slot></slot>
- </div>
-</template>
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/html5/frameworks/index.js
----------------------------------------------------------------------
diff --git a/html5/frameworks/index.js b/html5/frameworks/index.js
index 1b21251..1e3d409 100644
--- a/html5/frameworks/index.js
+++ b/html5/frameworks/index.js
@@ -1,9 +1,11 @@
import * as Vanilla from './vanilla/index'
import * as Vue from 'weex-vue-framework'
import * as Weex from './legacy/index'
+import Rax from 'weex-rax-framework'
export default {
Vanilla,
Vue,
+ Rax,
Weex
}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/html5/frameworks/legacy/api/methods.js
----------------------------------------------------------------------
diff --git a/html5/frameworks/legacy/api/methods.js b/html5/frameworks/legacy/api/methods.js
index 6a26119..29449c6 100644
--- a/html5/frameworks/legacy/api/methods.js
+++ b/html5/frameworks/legacy/api/methods.js
@@ -1,15 +1,6 @@
/**
* @fileOverview The api for invoking with "$" prefix
*/
-import config from '../config'
-
-const { nativeComponentMap } = config
-
-/**
- * ==========================================================
- * common
- * ==========================================================
- */
/**
* @deprecated use $vm instead
@@ -26,25 +17,6 @@ export function $ (id) {
}
}
-function addComponentMethods (app, el) {
- if (el && el.type) {
- const component = nativeComponentMap[el.type]
- if (component && component.methods) {
- component.methods.forEach((method) => {
- el[method] = (...args) => {
- app.callTasks({
- component: component.type,
- ref: el.ref,
- method: method,
- args: args
- })
- }
- })
- }
- }
- return el
-}
-
/**
* find the element by id
* Note: there is only one id in whole component
@@ -54,7 +26,7 @@ function addComponentMethods (app, el) {
export function $el (id) {
const info = this._ids[id]
if (info) {
- return addComponentMethods(info.vm._app || {}, info.el)
+ return info.el
}
}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/html5/frameworks/legacy/app/bundle/bootstrap.js
----------------------------------------------------------------------
diff --git a/html5/frameworks/legacy/app/bundle/bootstrap.js b/html5/frameworks/legacy/app/bundle/bootstrap.js
index a2980cf..b6d0cac 100644
--- a/html5/frameworks/legacy/app/bundle/bootstrap.js
+++ b/html5/frameworks/legacy/app/bundle/bootstrap.js
@@ -1,6 +1,7 @@
import semver from 'semver'
import Vm from '../../vm/index'
import * as downgrade from '../downgrade'
+import { setViewport } from '../viewport'
import {
requireCustomComponent
} from '../register'
@@ -61,6 +62,11 @@ export function bootstrap (app, name, config, data) {
return new Error(`Downgrade[${downgradeResult.code}]: ${downgradeResult.errorMessage}`)
}
+ // set viewport
+ if (config.viewport) {
+ setViewport(app, config.viewport)
+ }
+
// 3. create a new Vm with custom component name and data
app.vm = new Vm(cleanName, null, { _app: app }, null, data)
}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/html5/frameworks/legacy/app/ctrl/init.js
----------------------------------------------------------------------
diff --git a/html5/frameworks/legacy/app/ctrl/init.js b/html5/frameworks/legacy/app/ctrl/init.js
index a3fb93a..0e5d0be 100644
--- a/html5/frameworks/legacy/app/ctrl/init.js
+++ b/html5/frameworks/legacy/app/ctrl/init.js
@@ -22,7 +22,7 @@ import { updateActions } from './misc'
* @param {string} code
* @param {object} data
*/
-export function init (app, code, data) {
+export function init (app, code, data, services) {
console.debug('[JS Framework] Intialize an instance with:\n', data)
let result
@@ -49,6 +49,17 @@ export function init (app, code, data) {
/* istanbul ignore next */
const bundleRequireModule = name => app.requireModule(removeWeexPrefix(name))
+ const weexGlobalObject = {
+ config: app.options,
+ define: bundleDefine,
+ bootstrap: bundleBootstrap,
+ requireModule: bundleRequireModule,
+ document: bundleDocument,
+ Vm: bundleVm
+ }
+
+ Object.freeze(weexGlobalObject)
+
// prepare code
let functionBody
/* istanbul ignore if */
@@ -61,30 +72,28 @@ export function init (app, code, data) {
else if (code) {
functionBody = code.toString()
}
-
// wrap IFFE and use strict mode
- functionBody = `(function(global){"use strict"; ${functionBody} })(Object.create(this))`
+ functionBody = `(function(global){\n\n"use strict";\n\n ${functionBody} \n\n})(Object.create(this))`
// run code and get result
const { WXEnvironment } = global
+ const timerAPIs = {}
/* istanbul ignore if */
if (WXEnvironment && WXEnvironment.platform !== 'Web') {
// timer APIs polyfill in native
const timer = app.requireModule('timer')
- const timerAPIs = {
+ Object.assign(timerAPIs, {
setTimeout: (...args) => {
const handler = function () {
args[0](...args.slice(2))
}
timer.setTimeout(handler, args[1])
- return app.uid.toString()
},
setInterval: (...args) => {
const handler = function () {
args[0](...args.slice(2))
}
timer.setInterval(handler, args[1])
- return app.uid.toString()
},
clearTimeout: (n) => {
timer.clearTimeout(n)
@@ -92,73 +101,42 @@ export function init (app, code, data) {
clearInterval: (n) => {
timer.clearInterval(n)
}
- }
-
- const fn = new Function(
- 'define',
- 'require',
- 'document',
- 'bootstrap',
- 'register',
- 'render',
- '__weex_define__', // alias for define
- '__weex_bootstrap__', // alias for bootstrap
- '__weex_document__', // alias for bootstrap
- '__weex_require__',
- '__weex_viewmodel__',
- 'setTimeout',
- 'setInterval',
- 'clearTimeout',
- 'clearInterval',
- functionBody
- )
-
- fn(
- bundleDefine,
- bundleRequire,
- bundleDocument,
- bundleBootstrap,
- bundleRegister,
- bundleRender,
- bundleDefine,
- bundleBootstrap,
- bundleDocument,
- bundleRequireModule,
- bundleVm,
- timerAPIs.setTimeout,
- timerAPIs.setInterval,
- timerAPIs.clearTimeout,
- timerAPIs.clearInterval)
+ })
}
- else {
- const fn = new Function(
- 'define',
- 'require',
- 'document',
- 'bootstrap',
- 'register',
- 'render',
- '__weex_define__', // alias for define
- '__weex_bootstrap__', // alias for bootstrap
- '__weex_document__', // alias for bootstrap
- '__weex_require__',
- '__weex_viewmodel__',
- functionBody
- )
+ // run code and get result
+ const globalObjects = Object.assign({
+ define: bundleDefine,
+ require: bundleRequire,
+ bootstrap: bundleBootstrap,
+ register: bundleRegister,
+ render: bundleRender,
+ __weex_define__: bundleDefine, // alias for define
+ __weex_bootstrap__: bundleBootstrap, // alias for bootstrap
+ __weex_document__: bundleDocument,
+ __weex_require__: bundleRequireModule,
+ __weex_viewmodel__: bundleVm,
+ weex: weexGlobalObject
+ }, timerAPIs, services)
+ callFunction(globalObjects, functionBody)
- fn(
- bundleDefine,
- bundleRequire,
- bundleDocument,
- bundleBootstrap,
- bundleRegister,
- bundleRender,
- bundleDefine,
- bundleBootstrap,
- bundleDocument,
- bundleRequireModule,
- bundleVm)
+ return result
+}
+
+/**
+ * Call a new function body with some global objects.
+ * @param {object} globalObjects
+ * @param {string} code
+ * @return {any}
+ */
+function callFunction (globalObjects, body) {
+ const globalKeys = []
+ const globalValues = []
+ for (const key in globalObjects) {
+ globalKeys.push(key)
+ globalValues.push(globalObjects[key])
}
+ globalKeys.push(body)
- return result
+ const result = new Function(...globalKeys)
+ return result(...globalValues)
}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/html5/frameworks/legacy/app/ctrl/misc.js
----------------------------------------------------------------------
diff --git a/html5/frameworks/legacy/app/ctrl/misc.js b/html5/frameworks/legacy/app/ctrl/misc.js
index b1940d2..847cb16 100644
--- a/html5/frameworks/legacy/app/ctrl/misc.js
+++ b/html5/frameworks/legacy/app/ctrl/misc.js
@@ -10,7 +10,6 @@
* corresponded with the API of instance manager (framework.js)
*/
import { extend, typof } from '../../util/index'
-import renderer from '../../config'
/**
* Refresh an app with data to its root component options.
@@ -22,16 +21,14 @@ export function refresh (app, data) {
`in instance[${app.id}]`)
const vm = app.vm
if (vm && data) {
- // app.doc.close()
if (typeof vm.refreshData === 'function') {
vm.refreshData(data)
}
else {
extend(vm, data)
}
- updateActions(app)
- app.doc.listener.refreshFinish()
- // app.doc.open()
+ app.differ.flush()
+ app.doc.taskCenter.send('dom', { action: 'refreshFinish' }, [])
return
}
return new Error(`invalid data "${data}"`)
@@ -52,11 +49,11 @@ export function destroy (app) {
app.options = null
app.blocks = null
app.vm = null
+ app.doc.taskCenter.destroyCallback()
app.doc.destroy()
app.doc = null
app.customComponentMap = null
app.commonModules = null
- app.callbacks = null
}
/**
@@ -131,11 +128,9 @@ export function fireEvent (app, ref, type, e, domChanges) {
}
const el = app.doc.getRef(ref)
if (el) {
- // app.doc.close()
const result = app.doc.fireEvent(el, type, e, domChanges)
- updateActions(app)
- app.doc.listener.updateFinish()
- // app.doc.open()
+ app.differ.flush()
+ app.doc.taskCenter.send('dom', { action: 'updateFinish' }, [])
return result
}
return new Error(`invalid element reference "${ref}"`)
@@ -151,19 +146,10 @@ export function fireEvent (app, ref, type, e, domChanges) {
export function callback (app, callbackId, data, ifKeepAlive) {
console.debug(`[JS Framework] Invoke a callback(${callbackId}) with`, data,
`in instance(${app.id})`)
- const callback = app.callbacks[callbackId]
- if (typeof callback === 'function') {
- // app.doc.close()
- callback(data)
- if (typeof ifKeepAlive === 'undefined' || ifKeepAlive === false) {
- app.callbacks[callbackId] = undefined
- }
- updateActions(app)
- app.doc.listener.updateFinish()
- // app.doc.open()
- return
- }
- return new Error(`invalid callback id "${callbackId}"`)
+ const result = app.doc.taskCenter.callback(callbackId, data, ifKeepAlive)
+ updateActions(app)
+ app.doc.taskCenter.send('dom', { action: 'updateFinish' }, [])
+ return result
}
/**
@@ -172,14 +158,6 @@ export function callback (app, callbackId, data, ifKeepAlive) {
*/
export function updateActions (app) {
app.differ.flush()
- const tasks = []
- if (app.doc && app.doc.listener && app.doc.listener.updates.length) {
- tasks.push(...app.doc.listener.updates)
- app.doc.listener.updates = []
- }
- if (tasks.length) {
- return callTasks(app, tasks)
- }
}
/**
@@ -188,50 +166,23 @@ export function updateActions (app) {
* @param {array} tasks
*/
export function callTasks (app, tasks) {
+ let result
+
/* istanbul ignore next */
if (typof(tasks) !== 'array') {
tasks = [tasks]
}
- tasks.forEach((task) => {
- task.args = task.args.map(arg => normalize(arg, app))
+ tasks.forEach(task => {
+ result = app.doc.taskCenter.send(
+ 'module',
+ {
+ module: task.module,
+ method: task.method
+ },
+ task.args
+ )
})
- return renderer.sendTasks(app.id, tasks, '-1')
-}
-
-/**
- * Normalize a value. Specially, if the value is a function, then generate a function id
- * and save it to `app.callbacks`, at last return the function id.
- * @param {any} v
- * @param {object} app
- * @return {primitive}
- */
-function normalize (v, app) {
- const type = typof(v)
-
- switch (type) {
- case 'undefined':
- case 'null':
- return ''
- case 'regexp':
- return v.toString()
- case 'date':
- return v.toISOString()
- case 'number':
- case 'string':
- case 'boolean':
- case 'array':
- case 'object':
- if (v instanceof renderer.Element) {
- return v.ref
- }
- return v
- case 'function':
- app.callbacks[++app.uid] = v
- return app.uid.toString()
- /* istanbul ignore next */
- default:
- return JSON.stringify(v)
- }
+ return result
}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/html5/frameworks/legacy/app/index.js
----------------------------------------------------------------------
diff --git a/html5/frameworks/legacy/app/index.js b/html5/frameworks/legacy/app/index.js
index cb646fb..c54d3f4 100644
--- a/html5/frameworks/legacy/app/index.js
+++ b/html5/frameworks/legacy/app/index.js
@@ -18,14 +18,14 @@ App.prototype.requireModule = function (name) {
* @deprecated
*/
App.prototype.updateActions = function () {
- updateActions(this)
+ return updateActions(this)
}
/**
* @deprecated
*/
App.prototype.callTasks = function (tasks) {
- callTasks(this, tasks)
+ return callTasks(this, tasks)
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/html5/frameworks/legacy/app/instance.js
----------------------------------------------------------------------
diff --git a/html5/frameworks/legacy/app/instance.js b/html5/frameworks/legacy/app/instance.js
index f2edb82..dda49ce 100644
--- a/html5/frameworks/legacy/app/instance.js
+++ b/html5/frameworks/legacy/app/instance.js
@@ -17,7 +17,8 @@ export default function App (id, options) {
this.vm = null
this.customComponentMap = {}
this.commonModules = {}
- this.callbacks = {}
+
+ // document
this.doc = new renderer.Document(
id,
this.options.bundleUrl,
@@ -25,5 +26,4 @@ export default function App (id, options) {
renderer.Listener
)
this.differ = new Differ(id)
- this.uid = 0
}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/html5/frameworks/legacy/app/register.js
----------------------------------------------------------------------
diff --git a/html5/frameworks/legacy/app/register.js b/html5/frameworks/legacy/app/register.js
index 7df649f..a7075e3 100644
--- a/html5/frameworks/legacy/app/register.js
+++ b/html5/frameworks/legacy/app/register.js
@@ -59,8 +59,6 @@ export function initMethods (Vm, apis) {
}
}
-// for app
-
/**
* get a module of methods for an app instance
*/
@@ -68,10 +66,25 @@ export function requireModule (app, name) {
const methods = nativeModules[name]
const target = {}
for (const methodName in methods) {
- target[methodName] = (...args) => app.callTasks({
- module: name,
- method: methodName,
- args: args
+ Object.defineProperty(target, methodName, {
+ configurable: true,
+ enumerable: true,
+ get: function moduleGetter () {
+ return (...args) => app.callTasks({
+ module: name,
+ method: methodName,
+ args: args
+ })
+ },
+ set: function moduleSetter (value) {
+ if (typeof value === 'function') {
+ return app.callTasks({
+ module: name,
+ method: methodName,
+ args: [value]
+ })
+ }
+ }
})
}
return target
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/html5/frameworks/legacy/app/viewport.js
----------------------------------------------------------------------
diff --git a/html5/frameworks/legacy/app/viewport.js b/html5/frameworks/legacy/app/viewport.js
new file mode 100644
index 0000000..3d0a6c1
--- /dev/null
+++ b/html5/frameworks/legacy/app/viewport.js
@@ -0,0 +1,38 @@
+export function setViewport (app, configs = {}) {
+ /* istanbul ignore if */
+ if (process.env.NODE_ENV === 'development') {
+ console.debug(`[JS Framework] Set viewport (width: ${configs.width}) for app#${app.id}.`)
+ validateViewport(configs)
+ }
+
+ // Send viewport configs to native
+ if (app && app.callTasks) {
+ return app.callTasks([{
+ module: 'meta',
+ method: 'setViewport',
+ args: [configs]
+ }])
+ }
+
+ /* istanbul ignore next */
+ else if (process.env.NODE_ENV === 'development') {
+ console.warn(`[JS Framework] Can't find "callTasks" method on current app.`)
+ }
+}
+
+/**
+ * Validate the viewport config.
+ * @param {Object} configs
+ */
+export function validateViewport (configs = {}) {
+ const { width } = configs
+ if (width) {
+ if (typeof width !== 'number' && width !== 'device-width') {
+ console.warn(`[JS Framework] Not support to use ${width} as viewport width.`)
+ return false
+ }
+ return true
+ }
+ console.warn('[JS Framework] the viewport config should contain the "width" property.')
+ return false
+}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/html5/frameworks/legacy/static/create.js
----------------------------------------------------------------------
diff --git a/html5/frameworks/legacy/static/create.js b/html5/frameworks/legacy/static/create.js
index 5411903..b81c9d3 100644
--- a/html5/frameworks/legacy/static/create.js
+++ b/html5/frameworks/legacy/static/create.js
@@ -8,10 +8,13 @@ import { resetTarget } from '../core/dep'
*
* @param {string} id
* @param {string} code
- * @param {object} [options] option `HAS_LOG` enable print log
- * @param {object} [data]
+ * @param {object} options
+ * option `HAS_LOG` enable print log
+ * @param {object} data
+ * @param {object} info { created, ... services }
*/
-export function createInstance (id, code, options, data) {
+export function createInstance (id, code, options, data, info) {
+ const { services } = info || {}
resetTarget()
let instance = instanceMap[id]
/* istanbul ignore else */
@@ -21,7 +24,7 @@ export function createInstance (id, code, options, data) {
if (!instance) {
instance = new App(id, options)
instanceMap[id] = instance
- result = initApp(instance, code, data)
+ result = initApp(instance, code, data, services)
}
else {
result = new Error(`invalid instance id "${id}"`)
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/html5/frameworks/legacy/vm/directive.js
----------------------------------------------------------------------
diff --git a/html5/frameworks/legacy/vm/directive.js b/html5/frameworks/legacy/vm/directive.js
index 7268dd4..b1c2527 100644
--- a/html5/frameworks/legacy/vm/directive.js
+++ b/html5/frameworks/legacy/vm/directive.js
@@ -192,7 +192,7 @@ export function setId (vm, el, id, target) {
if (typeof id === 'function') {
const handler = id
id = handler.call(vm)
- if (id) {
+ if (id || id === 0) {
vm._ids[id] = map
}
watch(vm, handler, (newId) => {
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/html5/frameworks/vanilla/index.js
----------------------------------------------------------------------
diff --git a/html5/frameworks/vanilla/index.js b/html5/frameworks/vanilla/index.js
index b26e05c..b5ed952 100644
--- a/html5/frameworks/vanilla/index.js
+++ b/html5/frameworks/vanilla/index.js
@@ -17,9 +17,10 @@ function registerMethods (apis) {}
function prepareInstance (id, options, data) {}
-function createInstance (id, code, options, data) {
+function createInstance (id, code, options, data, serviceObjects) {
const document = new config.Document(id, options.bundleUrl)
const callbacks = {}
+
let lastCallbackId = 0
document.addCallback = func => {
lastCallbackId++
@@ -34,27 +35,25 @@ function createInstance (id, code, options, data) {
return callback(data)
}
instanceMap[id] = document
- const result = new Function(
- 'Document',
- 'Element',
- 'Comment',
- 'sendTasks',
- 'id',
- 'options',
- 'data',
- 'document',
- code
- )
- return result(
- config.Document,
- config.Element,
- config.Comment,
- config.sendTasks,
- id,
- options,
- data,
- document
- )
+
+ const globalObjects = Object.assign({
+ Document: config.Document,
+ Element: config.Element,
+ Comment: config.Comment,
+ sendTasks: config.sendTasks,
+ id, options, data, document
+ }, serviceObjects)
+
+ const globalKeys = []
+ const globalValues = []
+ for (const key in globalObjects) {
+ globalKeys.push(key)
+ globalValues.push(globalObjects[key])
+ }
+ globalKeys.push(code)
+
+ const result = new Function(...globalKeys)
+ return result(...globalValues)
}
function refreshInstance (id, data) {}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5123119/html5/render/native/index.js
----------------------------------------------------------------------
diff --git a/html5/render/native/index.js b/html5/render/native/index.js
index 58ed57a..f989ba0 100644
--- a/html5/render/native/index.js
+++ b/html5/render/native/index.js
@@ -1,14 +1,18 @@
import { subversion } from '../../../package.json'
import runtime from '../../runtime'
import frameworks from '../../frameworks/index'
+import services from '../../services/index'
const { init, config } = runtime
config.frameworks = frameworks
const { native, transformer } = subversion
+for (const serviceName in services) {
+ runtime.service.register(serviceName, services[serviceName])
+}
+
runtime.freezePrototype()
runtime.setNativeConsole()
-runtime.setNativeTimer()
// register framework meta info
global.frameworkVersion = native