Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

更换使用字段 #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 64 additions & 64 deletions WeexOne/src/modules/movie.we
Original file line number Diff line number Diff line change
@@ -1,65 +1,65 @@
<template>
<div>
<nav-bar-normal title="电影"></nav-bar-normal>
<list>
<cell repeat="{{movieItems}}">
<div>
<image src="{{cover}}" class="movie-item" movieid="{{id}}" onclick="onMovieItemClick"></image>
<text style="position:absolute;bottom:20px;right:20px;color:#f0595d;font-weight:bold;font-size:60px">
{{score}}
</text>
</div>
</cell>
</list>
</div>
</template>

<style>
.movie-item {
width: 750px;
height: 320px;
border-style: solid;
border-bottom-width: 1px;
border-color: #ddd;
margin-top: 20px;
}
</style>

<script>
require('weex-components');
var modal = require('@weex-module/modal');
var navigator = require('@weex-module/navigator');
var apis = require('../common/api');
module.exports = {
data: {
index: 0,
movieItems: [],
baseURL: ''
},
created: function () {
var self = this;
//请求数据
apis.getMovieList(self.index, function (ret) {
self.movieItems = ret.data;
});

var bundleUrl = this.$getConfig().bundleUrl;
this.baseURL = apis.getBaseUrl(bundleUrl,true);

},
methods: {
onMovieItemClick: function (e) {
var self = this;
var itemid = e.target.attr.movieid;

var params = {
'url': this.baseURL + 'modules/movie-detail.js?id=' + itemid,
'animated': 'true'
};
navigator.push(params, function (e) {
//callback
});
}
}
}
<template>
<div>
<nav-bar-normal title="电影"></nav-bar-normal>
<list>
<cell repeat="{{movieItems}}">
<div>
<image src="{{cover}}" class="movie-item" movieid="{{id}}" onclick="onMovieItemClick"></image>
<text style="position:absolute;bottom:20px;right:20px;color:#f0595d;font-weight:bold;font-size:60px">
{{title}}
</text>
</div>
</cell>
</list>
</div>
</template>
<style>
.movie-item {
width: 750px;
height: 320px;
border-style: solid;
border-bottom-width: 1px;
border-color: #ddd;
margin-top: 20px;
}
</style>
<script>
require('weex-components');
var modal = require('@weex-module/modal');
var navigator = require('@weex-module/navigator');
var apis = require('../common/api');
module.exports = {
data: {
index: 0,
movieItems: [],
baseURL: ''
},
created: function () {
var self = this;
//请求数据
apis.getMovieList(self.index, function (ret) {
self.movieItems = ret.data;
});
var bundleUrl = this.$getConfig().bundleUrl;
this.baseURL = apis.getBaseUrl(bundleUrl,true);
},
methods: {
onMovieItemClick: function (e) {
var self = this;
var itemid = e.target.attr.movieid;
var params = {
'url': this.baseURL + 'modules/movie-detail.js?id=' + itemid,
'animated': 'true'
};
navigator.push(params, function (e) {
//callback
});
}
}
}
</script>