dcloudio / hello-uniapp Goto Github PK
View Code? Open in Web Editor NEWuni-app框架演示示例
Home Page: https://uniapp.dcloud.net.cn
License: MIT License
uni-app框架演示示例
Home Page: https://uniapp.dcloud.net.cn
License: MIT License
ipad 小程序上input输入框只能点击一次,且数字键不能取消,适配是不是有问题
/pages/API/pull-down-refresh/pull-down-refresh.vue
line 59: this function name "setDate" maybe change "setData"
如题,Error: ENOENT: no such file or directory, open '...\app.json', ENOENT
钉钉小程序安卓机无法显示,运行的是uniapp的官方demo,底部tabar能显示,中间的白屏
用官方的 hello-uniapp,蓝牙连接,能搜索到,但是连接不了,一连接就断开。自己尝试写了一份蓝牙连接的代码也是一连接上就断开,这是怎么回事呢?
同理的,用 react native 写了蓝牙,是能够连接并且发数据的(说明我的硬件没问题)。
// #ifdef APP-PLUS
if (err['code'] && err.code !== 0 && this.sourceTypeIndex === 2) {
this.checkPermission(err.code);
..................
..................
array (
0 => 'u',
1 => 's',
2 => 'e',
3 => 'r',
4 => 'n',
5 => 'a',
6 => 'm',
...
)
本来是 username=...
非v3版本可以
给uni.request传递的config为
{
baseUrl: "http://xxx.xxx.x.xxx/api/"
complete: ƒ (response)
data: "username=xxx&password=xxx&type=xxx&captcha="
dataType: "json"
fail: ƒ fail()
header: {Content-Type: "application/x-www-form-urlencoded;charset=UTF-8", X-AUTH-DEVICE: ""}
method: "POST"
responseType: "text"
silence: false
success: ƒ success()
url: "http://xxx.xxx.x.xxx/api/user/signin"
}
❯ npm run serve
[email protected] serve /mnt/d/projects/my-project
npm run dev:h5
[email protected] dev:h5 /mnt/d/projects/my-project
cross-env NODE_ENV=development UNI_PLATFORM=h5 vue-cli-service uni-serve
请注意运行模式下,因日志输出、sourcemap以及未压缩源码等原因,性能和包体积,均不及发行模式。
INFO Starting development server...
ERROR Failed to compile with 1 error 10:54:26 AM
Failed to resolve loader: sass-loader
You may need to install it.
v3版本图片裁剪案例失效,不能用了
easyinput clearable 不显示
iOS下载没有黑夜模式。请问安卓为啥没有黑夜模式,需要配置其他的吗?下载的App就有,自己编译master没有
这个api根本无法移动地图呀,
<template>
<view>
<page-head :title="title"></page-head>
<view class="uni-common-mt">
<view style="position: relative;">
<map :id="deviceMap" :latitude="latitude" :longitude="longitude" :markers="covers" :show-location="true":rotate="rotate">
</map>
<text class="location-btn" @click="location">定位</text>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: 'map',
latitude: 22.549226,
longitude: 113.944649,
rotate: 0,
covers: [{
latitude: 39.9085,
longitude: 116.39747,
// #ifdef APP-PLUS
iconPath: '../../../static/app-plus/[email protected]',
// #endif
// #ifndef APP-PLUS
iconPath: '../../../static/location.png',
// #endif
}, {
latitude: 39.90,
longitude: 116.39,
// #ifdef APP-PLUS
iconPath: '../../../static/app-plus/[email protected]',
// #endif
// #ifndef APP-PLUS
iconPath: '../../../static/location.png',
// #endif
}]
}
},
onReady: function(res) {
this.mapContext = uni.createMapContext('deviceMap', this);
},
methods: {
getMyLocation() {
let that = this;
uni.getLocation({
type: 'gcj02',
success: function(res) {
that.myLatitude = res.latitude;
that.myLongitude = res.longitude;
console.log('myLatitude为' + that.myLatitude);
console.log('myLongitude为' + that.myLongitude);
},
fail: function(e) {
console.log(e);
}
});
},
location() {
let that = this;
that.getMyLocation();
console.log(that.mapContext);
// this.rotate = this.rotate == 90 ? 0 : 90;
that.mapContext.moveToLocation({
success: function(res) {
console.log('刷新成功');
},
fail: function(e) {
console.log('调用失败');
console.log(e);
},
complete: function() {
console.log('调用结束');
}
});
},
}
}
</script>
/pages/component/picker/picker.vue的多列选择器取消无效, 而且确定按钮也没有相关事件
只能用那什么 builder 软件开发吗?没有在 package.json 中发现依赖配置,能否支持命令启动,而不是玩自己的那一套。
[ app.json 文件内容错误] app.json: app.json 未找到(env: Windows,mp,1.05.2105170; lib: 2.0.4)
按官方文档写了蓝牙发送,也返回了write成功信息,但硬件没有收到。很奇怪。
官方演示了
求助大神。
运行 -> 运行到浏览器 -> Chrome,然后出现下面的报错内容。
17:13:48.722 项目 'pro-h5' 开始编译...
17:13:56.910 INFO Starting development server...
17:14:12.212 _http_outgoing.js:494
17:14:12.216 throw new TypeError('The header content contains invalid characters');
17:14:12.216 ^
17:14:12.221 TypeError: The header content contains invalid characters
17:14:12.221 at validateHeader (_http_outgoing.js:494:11)
17:14:12.225 at ServerResponse.setHeader (_http_outgoing.js:498:3)
17:14:12.225 at setHeader (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\http-proxy\lib\http-proxy\passes\web-outgoing.js:98:15)
17:14:12.230 at D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\http-proxy\lib\http-proxy\passes\web-outgoing.js:124:7
17:14:12.230 at Array.forEach ()
17:14:12.256 at Array.writeHeaders (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\http-proxy\lib\http-proxy\passes\web-outgoing.js:119:35)
17:14:12.257 at ClientRequest. (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\http-proxy\lib\http-proxy\passes\web-incoming.js:175:22)
17:14:12.261 at emitOne (events.js:116:13)
17:14:12.262 at ClientRequest.emit (events.js:211:7)
17:14:12.267 at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:551:21)
17:14:12.267 at HTTPParser.parserOnHeadersComplete (_http_common.js:115:23)
17:14:12.271 at Socket.socketOnData (_http_client.js:440:20)
17:14:12.278 at emitOne (events.js:116:13)
17:14:12.282 at Socket.emit (events.js:211:7)
17:14:12.287 at addChunk (_stream_readable.js:263:12)
17:14:12.292 at readableAddChunk (_stream_readable.js:250:11)
AdFeatureImpl 这个类的变量 : registerHandler 空指针判断错误
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.Set java.util.LinkedHashMap.entrySet()' on a null object reference at io.dcloud.feature.ad.dcloud.AdFeatureImpl.doForFeature(AdFeatureImpl.java:94) at io.dcloud.feature.ad.AdFeatureImplMgr.doForFeature(AdFeatureImplMgr.java:24) at io.dcloud.a.a(AdMgr.java:38) at io.dcloud.b.checkAndRequestStoragePermission(BaseActivity.java:180) at io.dcloud.WebAppActivity.checkAndRequestStoragePermission(WebAppActivity.java:82) at io.dcloud.b.onCreate(BaseActivity.java:127) at io.dcloud.WebAppActivity.onCreate(WebAppActivity.java:124) at android.app.Activity.performCreate(Activity.java:7327) at android.app.Activity.performCreate(Activity.java:7318) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
`
public static Object doForFeature(String var0, Object var1) {
Iterator var3;
if ("onAppCreate".equals(var0)) {
Context var2 = (Context)var1;
Logger.p("doForFeature", "AdFeatureImpl onAppCreate");
if (registerHandler == null || registerHandler.size() <= 0) {
registerHandler = new LinkedHashMap();
var3 = splashHandler.entrySet().iterator();
while(var3.hasNext()) {
Entry var4 = (Entry)var3.next();
try {
Class var5 = Class.forName((String)var4.getValue());
registerHandler.put(var4.getKey(), (ADBaseHandler)var5.newInstance());
} catch (Exception var9) {
}
}
}
StringBuilder var11 = new StringBuilder();
Iterator var13 = registerHandler.entrySet().iterator();
while(var13.hasNext()) {
Entry var16 = (Entry)var13.next();
((ADBaseHandler)var16.getValue()).onCreate(var2);
var11.append((String)var16.getKey()).append(",");
}
if (var11.length() > 0 && var11.lastIndexOf(",") == var11.length() - 1) {
var11 = var11.deleteCharAt(var11.length() - 1);
}
HashMap var14 = new HashMap();
var14.put("pspType", var11.toString());
AdSplashUtil.saveOperate(var14);
} else {
Object[] var10;
final Context var12;
final String var15;
if ("pull".equals(var0)) {
mAdHandler = null;
isSplashClose = false;
var10 = (Object[])((Object[])var1);
var12 = (Context)var10[0];
var15 = (String)var10[1];
Logger.p("doForFeature", "AdFeatureImpl pull");
Iterator var17 = registerHandler.entrySet().iterator();
while(var17.hasNext()) {
Entry var6 = (Entry)var17.next();
if (((String)var6.getKey()).equalsIgnoreCase("gdt")) {
((ADBaseHandler)var6.getValue()).onCreate(var12);
} else {
((ADBaseHandler)var6.getValue()).pullAds(var12);
}
}
ADHandler.pull(var12, var15, false, new IADReceiver[]{new ADReceiver(var12), new IADReceiver() {
public void onReceiver(JSONObject var1) {
if (var1.has("psp")) {
HashMap var2 = new HashMap();
var2.put("ad_list_order", var1.optString("psp"));
AdSplashUtil.saveOperate(var2);
} else {
SP.removeBundleData(ADHandler.AdTag, "ad_list_order");
}
AdFeatureImpl.isRequestSuccess = true;
if (var12 instanceof WebAppActivity) {
(new Handler(Looper.getMainLooper())).post(new Runnable() {
public void run() {
((WebAppActivity)var12).onCreateAdSplash(var12);
}
});
}
try {
JSONObject var15x = var1.optJSONObject("data");
HashMap var3 = new HashMap();
JSONObject var4 = new JSONObject();
if (var15x == null) {
var3.put("uniad", "");
var3.put("cad", "");
} else {
if (var15x.has("uniad")) {
var3.put("uniad", var15x.optString("uniad"));
} else {
var3.put("uniad", "");
}
if (!var15x.has("cad")) {
var3.put("cad", "");
} else {
JSONObject var5 = var15x.optJSONObject("cad");
if (var5 != null) {
Iterator var6 = var5.keys();
while(true) {
if (!var6.hasNext()) {
var3.put("cad", var4.length() > 0 ? var4.toString() : "");
break;
}
String var7 = (String)var6.next();
JSONObject var8 = var5.getJSONObject(var7);
JSONArray var9 = var8.getJSONArray("cls-a");
for(int var10 = 0; var10 < var9.length(); ++var10) {
String var11 = var9.getString(var10);
try {
Class.forName(var11);
JSONObject var12x = new JSONObject();
var12x.put("r", "1");
var4.put(var7, var12x);
} catch (Exception var13) {
break;
}
}
}
}
}
}
AdSplashUtil.saveOperate(var3);
if (var4.length() > 0) {
ADHandler.pullRad(var12, new IADReceiver[]{new ADReceiver(var12), new IADReceiver() {
public void onReceiver(JSONObject var1) {
if (var1.has("data")) {
final JSONArray var2 = var1.optJSONArray("data");
if (var2 != null && var2.length() > 0) {
((Activity)var12).runOnUiThread(new Runnable() {
public void run() {
checkPromptData(var2);
}
});
}
}
}
public void checkPromptData(JSONArray var1) {
try {
if (var1.length() > 0) {
for(int var2 = 0; var2 < var1.length(); ++var2) {
JSONObject var3 = var1.getJSONObject(var2);
if (var3 != null && var3.length() > 0) {
if (var3.optString("action").equals("prompt")) {
final String var4 = var3.optString("onclose");
AlertDialog var5 = (new Builder(var12)).setTitle(var3.optString("title")).setMessage(var3.optString("message")).setCancelable(false).setPositiveButton(17039370, new OnClickListener() {
public void onClick(DialogInterface var1, int var2) {
if (var4.equals("exit")) {
Process.killProcess(Process.myPid());
} else {
var1.dismiss();
}
}
}).create();
var5.setCanceledOnTouchOutside(false);
var5.show();
} else if (var3.optString("action").equals("toast")) {
b var11 = new b((Activity)var12, "");
TextView var12x = new TextView(var12);
var12x.setAutoLinkMask(15);
var12x.setClickable(true);
var12x.setText(a.a(var12).a(var3.optString("message")));
LinearLayout var6 = new LinearLayout(var12);
var6.addView(var12x);
var11.a(var6, var12x);
var11.setDuration(1);
var11.setGravity(80, var11.getXOffset(), var11.getYOffset());
int var7 = CanvasHelper.dip2px(var12, 10.0F);
int var8 = CanvasHelper.dip2px(var12, 8.0F);
var6.setPadding(var7, var8, var7, var8);
GradientDrawable var9 = new GradientDrawable();
var9.setCornerRadius((float)var8);
var9.setShape(0);
var9.setColor(-1308622848);
var6.setBackground(var9);
var12x.setGravity(17);
var12x.setTextColor(Color.parseColor("#ffffffff"));
var11.show();
}
}
}
}
} catch (Exception var10) {
}
}
public void onError(String var1, String var2) {
}
}});
}
} catch (Exception var14) {
}
}
public void onError(String var1, String var2) {
HashMap var3 = new HashMap();
var3.put("uniad", "");
AdSplashUtil.saveOperate(var3);
Logger.p("request Fail", "type:" + var1 + ";message:" + var2);
AdFeatureImpl.mHandler.postDelayed(new Runnable() {
public void run() {
io.dcloud.a.a(var12, var15, "pull", (Object)null);
}
}, 60000L);
}
}});
} else if ("save".equals(var0)) {
var10 = (Object[])((Object[])var1);
var12 = (Context)var10[0];
var15 = (String)var10[1];
HashMap var20 = (HashMap)var10[2];
Logger.p("doForFeature", "AdFeatureImpl save");
AdSplashUtil.saveOperate(var12, var15, var20);
} else {
if ("formatUrl_wanka".equals(var0)) {
var10 = (Object[])((Object[])var1);
Object[] var21 = (Object[])((Object[])var10[2]);
var15 = (String)var21[0];
JSONObject var25 = (JSONObject)var21[1];
Logger.p("doForFeature", "AdFeatureImpl formatUrl_wanka");
return ADHandler.formatUrl(var15, var25);
}
if ("handleArgs_wanka".equals(var0)) {
var10 = (Object[])((Object[])var1);
JSONObject var18 = (JSONObject)var10[2];
Logger.p("doForFeature", "AdFeatureImpl handleArgs_wanka");
return ADHandler.getArgsJsonData(var18);
}
if ("onWillCloseSplash".equals(var0)) {
isSplashClose = true;
isRequestSuccess = false;
var10 = (Object[])((Object[])var1);
Logger.p("doForFeature", "AdFeatureImpl onWillCloseSplash");
if (var10[2] != null && var10[2] instanceof View && mAdHandler != null) {
mAdHandler.onSplashClose((View)var10[2]);
}
var3 = registerHandler.values().iterator();
while(var3.hasNext()) {
ADBaseHandler var19 = (ADBaseHandler)var3.next();
var19.clearListener();
}
mAdHandler = null;
} else if ("onCreateAdSplash".equals(var0)) {
if (!isRequestSuccess) {
return null;
}
if (mAdHandler != null) {
return null;
}
if (isSplashClose) {
return null;
}
var10 = (Object[])((Object[])var1);
var12 = (Context)var10[0];
if (!ADHandler.SplashAdIsEnable(var12)) {
return null;
}
ICallBack var22 = (ICallBack)var10[1];
String var23 = (String)var10[2];
var23 = TextUtils.isEmpty(var23) ? ADHandler.appid(var12) : var23;
String var24 = ADHandler.get("uniad");
if (TextUtils.isEmpty(var24)) {
mAdHandler = new DcloudHandler();
return mAdHandler.onCreateSplash(var12, var23, var22);
}
String var8 = AdSplashUtil.getSplashAdpId((IApp)null, "_psp_", (String)null);
Object var7;
if (TextUtils.isEmpty(var8)) {
var7 = AdSplashUtil.getAdOrder();
} else {
var7 = new ArrayList(Arrays.asList(var8.split(",")));
}
((List)var7).remove("");
if (((List)var7).contains("dcloud") && registerHandler.get("dcloud") != null && registerHandler.get("dcloud") instanceof DcloudHandler) {
((DcloudHandler)registerHandler.get("dcloud")).initAdData(var12, var23);
}
Logger.p("doForFeature", "AdFeatureImpl onCreateAdSplash");
if (((List)var7).size() > 0) {
if (PermissionUtil.isEMUIRom((Activity)var12) && VERSION.SDK_INT >= 26 && ((List)var7).size() > 1 && ((String)((List)var7).get(0)).equals("csj") && PermissionUtil.checkSelfPermission((Activity)var12, "android.permission.READ_PHONE_STATE") != 0) {
Collections.shuffle((List)var7);
}
mAdHandler = checkSplashView((List)var7, var12);
if (mAdHandler != null) {
return mAdHandler.onCreateSplash(var12, var23, var22);
}
}
} else if ("onAppAttachBaseContext".equals(var0)) {
Logger.p("doForFeature", "AdFeatureImpl onAppAttachBaseContext");
}
}
}
return null;
}
`
这里的 registerHandler 判断空指针的 if else 错误
你好,扫码下载了"[email protected]",安装打开之后,底部tab栏是"社区"、“实例”、“我的”,但是在本项目代码里没找到相关代码,是有另外一个项目地址吗?
uniapp有根据不同的登录用户,限制tabBar的显示与隐藏 相关的动态路由挂载吗?
原生首页底部Tabbar,【社区】【实例】【我的】,没有找到源码,能否分享下,谢谢
项目怎么改动能支持yarn@berry
iphone6s,软件版本 14.2,查看微信小程序示例,模板中的列表到详情页,页面布局错乱,顶部大图也没有出来
官方的线上hello-app可以,但是hbuilderX里下载的示例hello不行,不知道是不是环境问题。
设置mpvuePicker.vue展示时,点击确定按钮直接关闭,而不改变初始值,就会报错,请帮忙确认一下,谢谢。
错误如下:
01:57:21.526 57:20.752 6039 6039 I console : TypeError: Cannot read property 'label' of undefined
01:57:21.546 57:20.752 6039 6039 I console : at VueComponent._getPickerLabelAndValue (uni-app:///components/mpvue-picker/mpvuePicker.vue?vue&type=script&lang=js&?0594:326:57)
01:57:21.570 (Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/mpvue/index.js:249:36)
01:57:21.590 57:20.752 6039 6039 I console : at VueComponent.pickerConfirm (uni-app:///components/mpvue-picker/mpvuePicker.vue?vue&type=script&lang=js&?0594:244:21)
01:57:21.610 57:20.752 6039 6039 I console : at Array.boundFn (Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/mpvue/index.js:249:63)
01:57:21.633 (Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/mpvue/index.js:5550:40)
01:57:21.655 57:20.752 6039 6039 I console : at e.handleProxy (Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/mpvue-page-factory/index.js:76:24)
服务端的包装实现代码是否能开放出来学习一下的?
小程序端会不会有swiper-list的计划
谢谢
IOS下,nvue页面用webview原生,webview加载的网页中如果有a标签,且target=_blank,这样的链接无法打开,是不是生成的源码中WKWebView在创建策略上没有设置为在同一webview中打开新页面。
Android没有此问题。
能不能改成在当前光标下插入。每次都是添加内容到最后,这样岂不是不支持修改内容。想要修改的话还得删除掉后面的内容。
不做当前光标下插入,是uni无法获取到当前光标位置吗?
package.json中
"uni-app": {
"scripts": {
"mp-doctor": {
"title": "医生",
"env": {
"UNI_PLATFORM": "mp-weixin"
},
"define": {
"MP-DOCTOR": true
}
},
"mp-patient": {
"title": "患者",
"env": {
"UNI_PLATFORM": "mp-weixin"
},
"define": {
"MP-PATIENT": true
}
},
在js中区分这两个环境, 想添加OR的条件, 但是下面的用法不好使, 应该如何使用?
// #ifdef MP-DOCTOR || MP-PATIENT
// #endif
uniapp生产wgt包在APP里面胶囊按钮点击无法像在开发者工具里面看到性能面板。无法查看性能数据,天天吹自己怎么怎么好 我要看数据就不给开发者看了?
由于用uniapp开发pda扫描枪 ,不太需要键盘输入,都是input框聚焦由扫描枪扫条形码输入值。目前问题是:input框聚焦 不管是手动点软键盘收起按钮 还是Uni.hidekeyboard() 都会失去焦点,这是为什么,可不可以有收起软键盘同时,还不失去焦点仍然聚焦的情况?
希望可以增加弹出后禁止页面滚动的选项
还有个bug就是页面过长的时候 popup 会出现在顶部....
在app nvue页面使用 文本字符串太长会导致闪退
代码和样式都是按照例子写的,但是点击checkbox后,对号并没有显示出来。我对比了一下官网的例子,我的html Element中选中后 div的class中 缺少一个类 那就是.uni-checkbox-input-checked::before。我没有找到原因
自己使用mpvuepicker组件时发现选中后,经常会出现值没有修改的情况,点了确定,选择的还是原来的值。
尝试官方picker组件,发现picker组件也有这样的问题,所以觉得是官方框架封装的问题。
你好,此文的第4号// #ifndef VUE3 应该是VUE2
参考自https://uniapp.dcloud.io/migration-to-vue3
摇一摇报错,不能用ios iphone7
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.