将Qr代码与sencha touch集成

时间:2012-12-21 06:06:50

标签: sencha-touch-2 barcode phonegap-plugins

我需要在我的sencha touch项目中实现qr代码。 这是我过去常用的教程。 http://simonmacdonald.blogspot.com/2011/12/installing-barcode-plugin-for-phonegap.html

我按照教程操作,手机插件在我的手机中运行良好。但是我有一个问题。我可以自定义布局并将插件实现到我的sencha触摸项目中吗?

例如,当我点击会员资料按钮时,会出现条形码扫描程序。

这是我的代码。

Ext.define('bluebutton.view.BlueButton.MemberPopUp', {
extend: 'Ext.Panel',
xtype: 'memberpopup',

requires: [
    'Ext.form.Panel',
    'Ext.form.FieldSet',
    'Ext.field.Text',
     'bluebutton.view.BlueButton.MemberDetail'

],

config: {


    items: [
                 {
                     docked: 'top',
                     xtype: 'titlebar',
                     items: [
                         {
                             xtype: 'button',
                             text: 'Member Profile'
                         },
                          {
                              xtype: 'button',
                              text: 'Transaction History'
                          }
                      ]
                 },
                 {
                    html : '<div align="center"> <img src="/bluebutton/resources/images/user2.png" alt="Smiley face" height="150" width="150" border="5"> </div>'


                 }
             ]

}

});

请帮忙。提前致谢

1 个答案:

答案 0 :(得分:1)

1)您可以使用导航视图

例如:

var view = Ext.create('Ext.NavigationView', {
fullscreen: true,

items: [{
    title: 'First',
    items: [{
        xtype: 'button',
        text: 'Push a new view!',
        handler: function() {
            //use the push() method to push another view. It works much like
            //add() or setActiveItem(). it accepts a view instance, or you can give it
            //a view config.
            view.push({
                title: 'Second',
                html: 'Second view!'
            });
        }
    }]
}]

});

将Scanner放入第二视图

或使用卡片布局

将按钮放在第一项中,将扫描仪放在第二项中 在按钮处理程序

中使用Ext.getCmp(cardlayoutid).animateActiveItem( Object/Number activeItem, Object/Ext.fx.layout.Card animation)
相关问题