我正在使用媒体捕获插件cordova仅从前置摄像头捕获视频.当它打开相机时,可以选择切换后置或后置摄像头,任何人都可以指导,如何禁用切换到后置摄像头.我在插件中做了以下修改并重新添加到应用程序,但没有运气.
intent.putExtra("android.intent.extras.LENS_FACING_BACK", 0);
intent.putExtra("android.intent.extra.USE_BACK_CAMERA", false);
Run Code Online (Sandbox Code Playgroud) 在我的离子应用程序中,我正在连接到条纹支付网关。
我有一个firebase在更新客户时会触发的功能。
exports.updateStripeCustomer = functions.database.ref("/Customers/{userId}")
.onUpdate((snapshot, context) => {
const data = snapshot.after.val();
return stripe.customers.createSource(data.payment_sources.customer_id, {
source: data.payment_sources.source
}).then(customer => {
console.log("Update Stripe Customer");
return customer;
},
error => {
return error;
}
);
});
Run Code Online (Sandbox Code Playgroud)
这是我在更新客户的应用程序端中的代码。更新firebase中调用的触发器时,如何在下面的代码中获取触发器(firebase函数)返回的数据?
this.angularDb.object('/Customers/' + firebase.auth().currentUser.uid).update({
cardsetup: 1,
payment_sources: {
customer_id: this.user.customer_id,
source: this.card.source.id
}
}).then((res) => {
loading.dismiss();
alert("card details has been successfully updated.");
this.navCtrl.push(LoginPage);
}, (error) => {
loading.dismiss();
console.log("=========>", error.message)
alert(JSON.stringify(error))
});
Run Code Online (Sandbox Code Playgroud)
如果firebase函数返回错误,则需要显示触发器返回的错误消息。有什么办法吗?
也许这个问题看起来重复,但我有自己的场景,ASP.NET MVC应用程序,当我单击签出时,它会抛出以下错误。
跨源请求被阻止:同源策略不允许读取 http://servicelink?order=%5Bobject%20Object%5D处的远程资源。(原因:CORS 标头“Access-Control-Allow-Origin”丢失)。
是否可以使用CSS来实现与以下在JavaScript中完成的示例相同的输出.我想只在CSS中执行此操作.
HTML
<div class="first-div" id="black"></div>
<div class="second-div" id="blue" ></div>
<div class="third-div" id="green"></div>
<div class="forth-div" id="yellow"></div>
<br>
<input type="radio" value="Black" name="clr" onClick="f(this.value)">Black
<input type="radio" value="Blue" name="clr" onClick="f(this.value)" >Blue
<input type="radio"value="Green" name="clr" onClick="f(this.value)" >Green
<input type="radio"value="Yellow" name="clr" onClick="f(this.value)">Yellow
Run Code Online (Sandbox Code Playgroud)
CSS
div{
position:absolute;
background-color:red;
height:150px;
width:150px;
margin:10px;
}
.first-div{background-color:black;}
.second-div{background-color:blue;}
.third-div{background-color:green;}
.forth-div{background-color:yellow;}
Run Code Online (Sandbox Code Playgroud)
JavaScript 我想在没有JavaScript代码的情况下执行相同的功能.只是应用CSS,黑客单选按钮强制它改变点击div的颜色
function f(IncValue)
{
if(IncValue=="Black")
{
document.getElementById('black').style.visibility="visible";
document.getElementById('blue').style.visibility="hidden";
document.getElementById('green').style.visibility="hidden";
document.getElementById('yellow').style.visibility="hidden";
}
else if(IncValue=="Blue")
{
document.getElementById('blue').style.visibility="visible";
document.getElementById('black').style.visibility="hidden";
document.getElementById('green').style.visibility="hidden";
document.getElementById('yellow').style.visibility="hidden";
}
else if(IncValue=="Green")
{
document.getElementById('green').style.visibility="visible";
document.getElementById('black').style.visibility="hidden";
document.getElementById('blue').style.visibility="hidden";
document.getElementById('yellow').style.visibility="hidden";
}
else if(IncValue=="Yellow")
{
document.getElementById('yellow').style.visibility="visible"; …Run Code Online (Sandbox Code Playgroud) 这是我的场景,创建了一个divwith CSS并X在之前添加了一个右上角pseudo-class.如何通过在帮助下单击X来关闭此div javascript?
CSS
.validation-summary-errors{
position: absolute;
width: 260px;
padding: 20px;
box-sizing: border-box;
top: 50%;
left: 50%;
background-color: #fff;
text-align: center;
font-size: 14px;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
border-radius: 4px;
border: #000 solid 1px;
box-shadow: #232323 1px 1px 6px;
}
.validation-summary-errors:before {
display: block;
content: "X";
position: absolute;
right: -15px;
top: -15px;
background-color: rgba(0, 0, 0, 0.85);
padding: 5px;
border-radius: 50%;
font-size: 16px;
color: #fff;
width: 29px;
box-sizing: border-box;
}
Run Code Online (Sandbox Code Playgroud)
视图中的HTML(编辑) …
我在MS Access中有表:
Id | name | code | ttime | total | type ----------------------------------------------------------- 1 | Abc | 123 | 10-Feb-18 4:04:48 PM | 2.01 | RS 2 | Abd | 122 | 11-Feb-18 4:04:48 PM | 3.90 | RS 3 | Abe | 125 | 12-Feb-18 4:04:48 PM | 23.00 | WS //other type 4 | Abf | 124 | 13-Feb-18 4:04:48 PM | 2.11 | RS 5 | Abg | 126 | 13-Feb-18 5:04:48 PM | 8.01 | …
我想TextBox在ASP.NET中绑定它可以容纳的最大值int.MaxValue.以下代码引发错误.
using (SqlConnection scon = new SqlConnection(cs))
{
SqlCommand cmd = new SqlCommand("spDelete", scon);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@id", TextBox6.Text);
scon.Open();
if (TextBox6.Text != null && TextBox6.Text <= int.MaxValue)
{
int del = cmd.ExecuteNonQuery();
if (del == 0)
{
Label2.Visible = true;
Label2.ForeColor = System.Drawing.Color.Red;
Label2.Text = TextBox6.Text + " Record not found";
}
else
{
Label2.Visible = true;
Label2.ForeColor = System.Drawing.Color.Red;
Label2.Text = TextBox6.Text + " Deleted Successfully";
LoadGV();
}
}
else
{
Label2.Visible = true; …Run Code Online (Sandbox Code Playgroud) 我将如何得到相同的结果LINQ,ASP.Net如下面的SQL查询
如果
select *, case
when
gender = 1 then 'Male' else 'Female' end
as gen from info
Run Code Online (Sandbox Code Playgroud)
在iif
select iif(gender = 1, 'Male', 'Female') as gen, * from info
Run Code Online (Sandbox Code Playgroud)
我尝试使用建议,但抛出错误
InfoDataContext db = new InfoDataContext();
var data = from y in db.infos
db.infos.Select(i => new info{info = i, i.gender == 1 ? "Male" : "Female"}).ToList()
select y;
GridView1.DataSource = data;
GridView1.DataBind();
Run Code Online (Sandbox Code Playgroud)
还有一个是,第一个查询将新结果作为表中的最后一列返回,第二个查询作为表中的第一列返回.如何gen用gender柱重新排列或替换色谱柱
如何将数组的内容存储在 cookie、会话或本地存储中,然后再次恢复或推送到数组中以正常使用。它应该设置为特定时间,并且在该时间之后,它不应该恢复值。
编辑 我尝试了此方法来获取本地存储和会话存储以及数组所需的cookie
var date = new Date();
var minutes = 30;
date.setTime(date.getTime() + (minutes * 60 * 1000));
$.cookie("example", "foo", { expires: date });
Run Code Online (Sandbox Code Playgroud)