文档开发者中心
我的

#快应用代码征集令#华为快应用开发:酒司令

1.快应用场景:
       聚餐在生活中必不可少,小伙伴们在饭桌上把酒言欢,通过划拳游戏更能助兴取乐。为了让划拳更有趣,我们推出快应用--酒司令。

2.展示:
1)已完成:
      
      点击 开始后,2侧拳头 不断变化,点 停止后 显示输赢状况
2)将丰富功能:
【1】加入语音识别技术,对着手机说第1个名字“大师兄”,则左边代表大师兄;说第2个名字“二师弟”,则右边代表二师弟。
【2】猜拳结束后,界面展示表情 并 配声音。表情和声音,用户均可选择或自定义。
【3】用户可以预设 出拳速度、出拳类型(剪刀、石头、布每个出几次,怎么出)。
    小清新版表情:
      
  DIY版表情,用户可以选择自己的照片或头像:
   

3. 开发过程:
1)了解快应用的开发流程及应用的框架
2)学习各项技术
3)选择开发的快应用:酒司令 并 做相关设计
4)端云联调,完成开发。

4. 使用感受
希望后续能够丰富此快应用的各项功能。


点赞
收藏
回复
2
分享
举报
浏览931 编辑于2018-08-25 12:43未知归属地
全部评论
最多点赞
最新发布
最早发布
代码: 1、hello.js /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 2); /******/ }) /************************************************************************/ /******/ ([ /* 0 */, /* 1 */, /* 2 */ /***/ (function(module, exports, __webpack_require__) { var $app_template$ = __webpack_require__(3) var $app_style$ = __webpack_require__(4) var $app_script$ = __webpack_require__(5) $app_define$('@app-component/hello', [], function($app_require$, $app_exports$, $app_module$){ $app_script$($app_module$, $app_exports$, $app_require$) if ($app_exports$.__esModule && $app_exports$.default) { $app_module$.exports = $app_exports$.default } $app_module$.exports.template = $app_template$ $app_module$.exports.style = $app_style$ }) $app_bootstrap$('@app-component/hello',{ packagerName:'fa-toolkit', packagerVersion: '1.0.4-Stable.300'}) /***/ }), /* 3 */ /***/ (function(module, exports) { module.exports = { "type": "div", "attr": {}, "classList": [ "container" ], "children": [ { "type": "div", "attr": {}, "children": [ { "type": "image", "attr": { "src": "/Common/cheer.gif", "show": function () {return this.showCheer} }, "classList": [ "image-cheer" ] }, { "type": "div", "attr": {}, "classList": [ "item" ], "children": [ { "type": "image", "attr": { "src": function () {return this.leftExpression} }, "classList": [ "image-expression" ] }, { "type": "image", "attr": { "src": function () {return this.imgUser} }, "classList": [ "image-gesture" ] } ] }, { "type": "text", "attr": { "value": "PK" }, "classList": [ "pk-text" ] }, { "type": "div", "attr": {}, "classList": [ "item" ], "children": [ { "type": "image", "attr": { "src": function () {return this.rightExpression} }, "classList": [ "image-expression" ] }, { "type": "image", "attr": { "src": function () {return this.imgAi} }, "classList": [ "image-gesture" ] } ] } ] }, { "type": "text", "attr": { "value": function () {return this.btnText} }, "classList": [ "start-btn" ], "events": { "click": "startOrPause" } } ] } /***/ }), /* 4 */ /***/ (function(module, exports) { module.exports = { ".container": { "flexDirection": "column", "justifyContent": "center", "alignContent": "center", "alignItems": "center" }, ".title": { "fontSize": "100px" }, ".item": { "flexDirection": "column", "justifyContent": "center", "alignContent": "center", "alignItems": "center" }, ".image-cheer": { "position": "fixed", "marginTop": "0px", "marginRight": "0px", "marginBottom": "0px", "marginLeft": "0px", "left": "50px", "right": "50px", "top": "300px", "bottom": "300px" }, ".image-expression": { "width": "100px", "height": "100px" }, ".image-gesture": { "marginTop": "50px", "marginRight": "50px", "marginBottom": "50px", "marginLeft": "50px", "borderRadius": "5px", "width": "200px", "height": "188px" }, ".pk-text": { "fontSize": "50px", "fontWeight": "bold" }, ".start-btn": { "marginTop": "50px", "paddingTop": "10px", "paddingRight": "10px", "paddingBottom": "10px", "paddingLeft": "10px", "fontSize": "50px", "fontWeight": "bold" } } /***/ }), /* 5 */ /***/ (function(module, exports) { module.exports = function(module, exports, $app_require$){'use strict'; var _system = $app_require$('@app-module/system.audio'); var _system2 = _interopRequireDefault(_system); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } module.exports = { data: { title: 'World', srcs: ['/Common/fist.png', '/Common/scissors.png', '/Common/cloth.png'], imgAi: '/Common/fist.png', imgUser: '/Common/scissors.png', aiNum: 0, userNum: 1, started: false, timer: null, btnText: '准备喝', leftExpression: '', rightExpression: '', showCheer: false, result: 0, audioSrc: '', t: null }, onInit: function onInit() { this.$page.setTitleBar({ text: '小游戏', textColor: '#ffffff', backgroundColor: '#007DFF', backgroundOpacity: 0.5 }); }, startOrPause: function startOrPause() { if (this.started) { this.started = false; if (null !== this.timer) { clearInterval(this.timer); } this.leftExpression = ''; this.rightExpression = ''; this.btnText = '准备喝'; var dif = this.userNum - this.aiNum; switch (dif) { case 0: this.result = 0; break; case 1: this.result = -1; break; case 2: this.result = 1; break; case -1: this.result = 1; break; case -2: this.result = -1; break; } switch (this.result) { case -1: this.rightExpression = '/Common/laugh.png'; this.leftExpression = '/Common/cry.png'; this.audioSrc = '/Common/失败.wav'; this.t = setTimeout(function () { this.audioPause(); }.bind(this), 2000); break; case 0: this.leftExpression = ''; this.rightExpression = ''; this.audioSrc = '/Common/干杯.wav'; this.showCheer = true; this.t = setTimeout(function () { this.showCheer = false; this.audioPause(); }.bind(this), 3000); break; case 1: this.leftExpression = '/Common/laugh.png'; this.rightExpression = '/Common/cry.png'; this.audioSrc = '/Common/奸笑.wav'; this.t = setTimeout(function () { this.audioPause(); }.bind(this), 2000); break; } this.audioPlay(); } else { this.started = true; this.leftExpression = ''; this.rightExpression = ''; clearTimeout(this.t); this.showCheer = false; this.audioPause(); this.timer = setInterval(function () { this.aiNum = parseInt(Math.random() * 3); this.userNum = parseInt(Math.random() * 3); this.imgAi = this.srcs[this.aiNum]; this.imgUser = this.srcs[this.userNum]; }.bind(this), 100); this.btnText = '开始喝'; } }, audioPlay: function audioPlay() { _system2.default.src = this.audioSrc; _system2.default.autoplay = true; _system2.default.loop = false; _system2.default.currentTime = 0; _system2.default.play(); }, audioPause: function audioPause() { _system2.default.pause(); } }; var moduleOwn = exports.default || module.exports; var accessors = ['public', 'protected', 'private']; if (moduleOwn.data && accessors.some(function (acc) { return moduleOwn[acc]; })) { throw new Error('页面VM对象中属性data不可与public, protected, private同时存在,请使用public替代data!'); } else if (!moduleOwn.data) { moduleOwn.data = {}; moduleOwn._descriptor = {}; accessors.forEach(function(acc) { var accType = typeof moduleOwn[acc]; if (accType === 'object') { moduleOwn.data = Object.assign(moduleOwn.data, moduleOwn[acc]); for (var name in moduleOwn[acc]) { moduleOwn._descriptor[name] = {access : acc}; } } else if (accType === 'function') { console.warn('页面VM对象中的属性' + acc + '的值不能使函数,请使用对象'); } }); }} /***/ }) /******/ ]); 2.hello.ux
展开全部
2楼回复于2018-09-11 13:56 未知归属地
这个好玩哎,楼主爱喝酒咩?红的白的洋的?@quanmaotou
1楼回复于2018-08-27 02:37 未知归属地
写回答
新增插入模板功能
一键使用模板,快速填写内容,轻松发帖~
知道了
  • 为了保障您的信息安全,请勿上传您的敏感个人信息(如您的密码等信息)和您的敏感资产信息(如关键源代码、签名私钥、调试安装包、业务日志等信息),且您需自行承担由此产生的信息泄露等安全风险。
  • 如您发布的内容为转载内容,请注明内容来源。

我要发帖子

了解社区公约,与您携手共创和谐专业的开发者社区。