Skip to content

Commit ec2e519

Browse files
author
翊晨
committed
更新部分配置
1 parent 0ffe328 commit ec2e519

File tree

9 files changed

+58
-53
lines changed

9 files changed

+58
-53
lines changed

.babelrc

+1-7
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@
55
"transform-react-display-name",
66
"transform-class-properties",
77
"transform-decorators-legacy",
8-
["transform-react-jsx", { "pragma": "createElement" }],
9-
["transform-imports", {
10-
"nuke": {
11-
"transform": "nuke/lib/${member}/index.js",
12-
"preventFullImport": true
13-
},
14-
}]
8+
["transform-react-jsx", { "pragma": "createElement" }]
159
]
1610
}

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
2-
"name": "demo",
3-
"version": "0.1.0",
2+
"name": "example-qap-plugin",
3+
"version": "2.0.1",
44
"readmeFilename": "README.md",
55
"scripts": {
66
"start": "./node_modules/.bin/gulp start",
77
"build": "./node_modules/.bin/gulp build"
88
},
99
"dependencies": {
1010
"QAP-SDK": "^1.0.11",
11-
"nuke": "^0.6.31",
12-
"rax": "^0.2.11"
11+
"nuke": "^0.6.60",
12+
"rax": "^0.3.8"
1313
},
1414
"devDependencies": {
1515
"babel-cli": "~6.7.5",

qap.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"appKey": "23588507",
3-
"version": "2.0",
3+
"version": "2.0.1",
44
"pages": [
55
{
66
"default": true,
@@ -24,7 +24,7 @@
2424
}
2525
],
2626
"WebRootPath": "https://www.taobao.com/",
27-
"min_qn_android": "5.8.8",
27+
"min_qn_android": "5.8.2",
2828
"min_qn_ios": "5.8.2",
29-
"jssdk": "1.0.14"
29+
"jssdk": "1.0.19"
3030
}

src/home/index.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {View, Text, ScrollView} from 'nuke';
55
import CommonModule from './mods/CommonModule';
66
import QuickModule from './mods/QuickModule';
77
import UserInfo from './mods/UserInfo';
8-
import FeedModule from './mods/FeedModule';
8+
import AppInfo from './mods/AppInfo';
99

1010
class Home extends Component {
1111
constructor(props) {
@@ -18,7 +18,7 @@ class Home extends Component {
1818
<UserInfo></UserInfo>
1919
<CommonModule></CommonModule>
2020
<QuickModule></QuickModule>
21-
<FeedModule></FeedModule>
21+
<AppInfo></AppInfo>
2222
</ScrollView>
2323
);
2424
}

src/home/mods/AppInfo.jsx

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
'use strict';
2+
import {createElement, Component,render} from 'rax';;
3+
import {View, Text, Image,Env} from 'nuke';
4+
import IconFont from '$root/components/icon/iconFont';
5+
import styles from './AppInfo.less';
6+
7+
class AppInfo extends Component {
8+
constructor(props) {
9+
super(props);
10+
}
11+
12+
state = {
13+
v: Env.isWeex ? __weex_options__.QAPAppVersion : null
14+
}
15+
16+
17+
18+
render() {
19+
return (
20+
<View style={styles.container}>
21+
{ this.state.v ? <Text style={styles.info}>插件版本号:{this.state.v}</Text> : null }
22+
</View>
23+
);
24+
}
25+
}
26+
27+
export default AppInfo;

src/home/mods/AppInfo.less

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.container{
2+
margin-top: 10;
3+
align-items:center;
4+
}
5+
.info{
6+
font-size: 28;
7+
color: #999999;
8+
}

src/index.jsx

+5-8
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ class Index extends BaseModule {
3030
}
3131
}
3232

33-
// getUrl(url, param) {
34-
// let hasParam = url.match(/\?/);
35-
// let query = QAP.uri.toQueryString(param);
36-
// return `${url}${hasParam ? '&' : '?'}${query}`;
37-
// }
3833

3934
menus = [
4035
{
@@ -45,7 +40,6 @@ class Index extends BaseModule {
4540
}, {
4641
name: 'order',
4742
title: '订单',
48-
// src: this.getUrl('qap://order/index.js', this.state.tradeStatus ? {tradeStatus: this.state.tradeStatus} : {}),
4943
src: 'qap://order/index.js',
5044
icon: 'order'
5145
}
@@ -63,7 +57,7 @@ class Index extends BaseModule {
6357
return (
6458
<View>
6559
<View><IconFont iconStyle={[style.icon, color]} name={menu.icon}/></View>
66-
<Text style={color}>{menu.title}</Text>
60+
<Text style={[style.text,color]}>{menu.title}</Text>
6761
</View>
6862
)
6963
}} title={menu.title} tabKey={menu.name} src={menu.src}></Tabbar.Item>
@@ -87,11 +81,14 @@ const style = {
8781
borderTopColor: '#ccc'
8882
},
8983
icon: {
90-
fontSize: '48rem'
84+
fontSize: '28rem'
9185
},
9286
itemUnSelectorColor: {
9387
color: '#3d4145'
9488
},
89+
text:{
90+
fontSize: '28rem'
91+
},
9592
itemSelectorColor: {
9693
color: '#0894ec'
9794
}

template.html

+3-24
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,13 @@
44
<meta charset="UTF-8">
55
<title>H5版本</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/>
7-
<meta name="apple-mobile-web-app-capable" content="yes"/>
8-
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
9-
<meta name="format-detection" content="telephone=no"/>
10-
<style>
11-
*{padding: 0; margin: 0}
12-
html, body {
13-
width: 100%;
14-
height: 100%;
15-
margin: 0px;
16-
padding: 0px;
17-
font-size: 12px;
18-
color: #333;
19-
}
20-
body{
21-
margin: 0 auto;
22-
min-width: 320px;
23-
max-width: 640px;
24-
}
7+
<link rel="stylesheet" href="//g.alicdn.com/nuke/style-normalize/0.1.4/index.css">
258

26-
body > div {
27-
height: 100%
28-
}
29-
</style>
309
</head>
3110
<body>
3211

33-
<script src="https://os.alipayobjects.com/qapprod/9b3e1635-ba26-4441-8d51-4a0ac999d58d/index.js"></script>
12+
<script src="//os.alipayobjects.com/qapprod/b62ed72a-834f-49eb-a9bb-6cfb6686592b/index.js"></script>
3413
<script id="script" type="text/javascript" src="<%= bundleJs %>"></script>
3514

3615
</body>
37-
</html>
16+
</html>

webpack.config.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ var config = {
6161

6262
},
6363

64-
// "externals": [{
65-
// "rax": "commonjs rax",
66-
// "nuke": "commonjs nuke",
67-
// "QAP-SDK": "commonjs QAP-SDK",
68-
// }],
64+
"externals": [{
65+
"rax": "commonjs rax",
66+
"nuke": "commonjs nuke",
67+
"QAP-SDK": "commonjs QAP-SDK",
68+
}],
6969

7070
module: {
7171
loaders: [{

0 commit comments

Comments
 (0)