I'm a frontend engineer,
js-newbee / taro-yanxuan Goto Github PK
View Code? Open in Web Editor NEW首个 Taro 多端统一实例 - 网易严选(小程序 + H5 + React Native) - By 趣店 FED
License: MIT License
首个 Taro 多端统一实例 - 网易严选(小程序 + H5 + React Native) - By 趣店 FED
License: MIT License
该项目能直接集成到android 应用中吗?有教程吗?
当我编译成小程序的时候终端提示 : 缺少npm包@constants/cate,开始安装... error~ 编译没有通过
编译成H5的时候编译也是失败的: Failed to compile.
./.temp/pages/cart/cart.js
Module not found: Can't resolve '@actions/cart' in 'F:\taro-yanxuan.temp\pages\cart'
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/11.10.0/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'run',
1 verbose cli 'dev:weapp' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'predev:weapp', 'dev:weapp', 'postdev:weapp' ]
5 info lifecycle [email protected]predev:weapp: [email protected]dev:weapp: [email protected]
6 info lifecycle [email protected]
7 verbose lifecycle [email protected]dev:weapp: unsafe-perm in lifecycle truedev:weapp: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/wangyong/opensource/taro-yanxuan/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Applications/Wireshark.app/Contents/MacOS:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home:/Users/wangyong/devsoftware/apache-maven-3.5.4/bin:/Users/wangyong/wisedoc/jtapp/build:/Users/wangyong/devsoftware/scala/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Applications/Wireshark.app/Contents/MacOS:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home:/Users/wangyong/devsoftware/apache-maven-3.5.4/bin:/Users/wangyong/wisedoc/jtapp/build:/Users/wangyong/devsoftware/scala/bin:/Users/wangyong/devsoftware/gradle-4.4.1/bin:/usr/local/Cellar/go/1.10.2/libexec/bin:/Users/wangyong/gopath/bin:/Users/wangyong/toolsoftware/jmeter-4.0/bin
8 verbose lifecycle [email protected]
9 verbose lifecycle [email protected]dev:weapp: CWD: /Users/wangyong/opensource/taro-yanxuandev:weapp: Args: [ '-c', 'npm run build:weapp -- --watch' ]
10 silly lifecycle [email protected]
11 silly lifecycle [email protected]dev:weapp: Returned: code: 1 signal: nulldev:weapp: Failed to exec dev:weapp script
12 info lifecycle [email protected]
13 verbose stack Error: [email protected] dev:weapp: npm run build:weapp -- --watch
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:197:13)
13 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:197:13)
13 verbose stack at maybeClose (internal/child_process.js:984:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
14 verbose pkgid [email protected]
15 verbose cwd /Users/wangyong/opensource/taro-yanxuan
16 verbose Darwin 16.7.0
17 verbose argv "/usr/local/Cellar/node/11.10.0/bin/node" "/usr/local/bin/npm" "run" "dev:weapp"
18 verbose node v11.10.0
19 verbose npm v6.7.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] dev:weapp: npm run build:weapp -- --watch
22 error Exit status 1
23 error Failed at the [email protected] dev:weapp script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
编译小程序
Error: Couldn't find preset "@babel/preset-env" relative to directory "/xxx"
并没有按照预期有所显示
请问什么时候支持多个规格选择
网易严选的接口文档地址可否共享下 遍寻网络 未找到该文档 对照接口看组件会更清楚 多谢
为了避免状态管理代码冗长,建议用mobx or dva or rematch
npm run dev:h5没问题,npm run build:h5显示不出来
个人中心未登入的情况下 最上面的div样式错了。
请问app.js中的import Index from './pages/index' 的index文件在pages里面看不到,为什么可以引入呢?是怎么处理的啊?
Cannot add a child that doesn't have a YogaNode to a parent without a measure function! (Trying to add a 'RCTRawText [text: ]' to a 'RCTView')
addChildAt
ReactShadowNodeImpl.java:279
addChildAt
ReactShadowNodeImpl.java:56
setChildren
UIImplementation.java:482
setChildren
UIManagerModule.java:441
invoke
Method.java
invoke
JavaMethodWrapper.java:372
invoke
JavaModuleWrapper.java:160
run
NativeRunnable.java
handleCallback
Handler.java:751
dispatchMessage
Handler.java:95
dispatchMessage
MessageQueueThreadHandler.java:29
loop
Looper.java:154
run
MessageQueueThreadImpl.java:192
run
Thread.java:761
目前是基于taro1.2.17的,那后续taro升级后,这个项目还有计划跟新吗?我升级taro的版本到最新(1.2.22),跑H5和RN都会报错😿
Module build failed (from ./node_modules/sass-loader/lib/loader.js):
@import "~taro-ui/dist/style/index.scss";
^
File to import not found or unreadable: ~taro-ui/dist/style/index.scss.
in /Users/zhengchaohua/Desktop/UI/parentGuard/.temp/app.scss (line 1, column 1)
用Taro在自己项目中使用过rich-text,发现微信小程序正常,支付宝小程序的rich-text显示有问题,本来想借鉴大佬的写法,结果看了源码发现商品详情全部为图片,还特地把img过滤出来,并没有使用rich-text,支付宝小程序的rich-text规定nodes只能接数组,使用它推荐的插件将字符串转换成数组发现导致其他错误,这个问题只能暂时搁置了,请好心人贡献demo
我按照README.md
的指示成功运行项目。
因为该项目使用了别名,但是没有添加jsconfig.json
文件。
所以我就自己在项目中添加了jsconfig.json
文件。
结果虽然别名引用跳转能够正常工作,但是在 vscode 下方面板的问题选项卡中显示
找不到文件“/Users/huang/Desktop/taro-test/taro-yanxuan/node_modules/mobile-detect/mobile-detect”。
jsconfig.json
代码{
"exclude": ["node_modules/"],
"target": "es6",
"checkJs": true,
"allowSyntheticDefaultImports": true,
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@actions/*": ["./src/actions/*"],
"@assets/*": ["./src/assets/*"],
"@components/*": ["./src/components/*"],
"@constants/*": ["./src/constants/*"],
"@reducers/*": ["./src/reducers/*"],
"@styles/*": ["./src/styles/*"],
"@utils/*": ["./src/utils/*"]
}
}
}
{
"resource": "/Users/huang/Desktop/taro-test/taro-yanxuan/jsconfig.json",
"owner": "typescript",
"severity": 8,
"message": "找不到文件“/Users/huang/Desktop/taro-test/taro-yanxuan/node_modules/mobile-detect/mobile-detect”。",
"source": "ts",
"startLineNumber": 1,
"startColumn": 1,
"endLineNumber": 1,
"endColumn": 2
}
终端打包时,并且没有提示任何报错
我看taro文档中说npm run dev:rn运行的是rn_tmp内的代码,后面还要克隆个taro-native-shell, 这个东西是个空壳, 要用react-native run-ios/android跑起来,但是这两个怎么关联起来呢? 运行哪个可以调其模拟器.
早上来面试,被你pass 掉了,有点不服,看了你的代码规范后,我现在服了,也多谢你的指导,如果可以的话,能否加下微信,以后能一起交流, 微信:muscle285768219 多谢了
24 |
25 |
26 | {list.filter(item => item.type === 1).map(({ id, categoryItem }) => (
| ^^^^^^^^^^^^^^^^^^^^
node版本v10.15.0 taro版本1.2.17 报这个结构问题,请问该如何解决
@js-newbee 您好,我在学习这个小程序的源码,但是目前微信登录和邮箱登录都无效了。主要想学习购物车的相关设计。
我想请问:加入购物车(dispatchAdd)、获取购物车商品数(dispatchCartNum)等接口的返回值都是一致吗?那么这些接口返回值(cartInfo)具体有哪些字段?可否贴个接口返回结果示例呢?谢谢!
编译小程序之后 在小程序中提示 如标题所示
在编译过程中提示 src/pages/home/home.js 没有被引用到,不会被编译
实际home 页面已在app.js 中注册
pages: [
'pages/home/home',
'pages/cate/cate',
'pages/cate-sub/cate-sub',
'pages/cart/cart',
'pages/user/user',
'pages/user-login/user-login',
'pages/user-login-email/user-login-email',
'pages/item/item',
'pages/webview/webview'
],
用一加3手机自带浏览器打开http://jsnewbee.com/taro-yanxuan/
npm run build :h5 和npm run dev :h5 命令的时候报错:
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'uglify' of undefined
In file included from
/Users/lizhen/Desktop/index/taro-native-shell/node_modules/react-native/third-party/glog-0.3.4/src/vlog_is_on.cc:35:
In file included from /Users/lizhen/Desktop/index/taro-native-shell/node_modules/react-native/third-party/glog-0.3.4/src/utilities.h:73:
/Users/lizhen/Desktop/index/taro-native-shell/node_modules/react-native/third-party/glog-0.3.4/src/base/mutex.h:105:10: fatal error: 'config.h' file not found
#include "config.h" // to figure out pthreads support
已将该项目clone下来,在本地10086端口运行h5。
想在局域网内的手机上查看,网站打不开。
新建的taro项目是可以在局域网内查看的,该项目不可以是做了什么处理吗?
环境:mac,[email protected],[email protected]
执行:npm i
npm run dev:h5
报错:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.