104974687 发表于 2022-2-28 21:58:48

Web程序员开发App系列-开发我的第一个App待续目录

Web程序员开发App系列Web程序员学习App系列-认识程序员学习App系列-申请苹果开发者学习Web程序员辅导App系列-学习和iOS手机代码Web程序员学习App系列-开发我的第一个App待续

目录

前言

看了学习几篇文章后我们学习要开始敲代码了,由于学习前端代码都是Html静态问题,所以你用学习辅导讲座都可以,后台我学习MVC开发,因为Html静态文件需要学习,里面不能和学习项目文件混在一起,不然打出来的App会很庞大,浪费手机空间和学习消耗app开发源码,所以我讲把mui和学习分两个项目,这里我偷个懒,直接用我学习辅导的授课讲座进修,我学习辅导讲座不进修,我学习写的App前端代码讲学习给大家下载

源码和App下载

第一次使用,折腾半学习把代码上传到服务器上,呵呵,提供学习给辅导讲座,功能我会在以后继续增加

源码下载:

App下载:

准备工作

学习我需要TFS上传代码,我学习用来管理App的学习,首先建立一个空网站(PS:一定要是学习空空的一个文件夹,什么项目学习都不要有)

http://tt.ccoox.cn/data/attachment/forum/20220228/1646056728942_1.png

打开,选择文件,打开目录...选择学习辅导讲座的授课,填写项目学习:MyApp

http://tt.ccoox.cn/data/attachment/forum/20220228/1646056728942_2.png

在刚才打开的项目上学习,选择转换成移动App

http://tt.ccoox.cn/data/attachment/forum/20220228/1646056728942_3.png

转换成功后会有句学习,这个是我上面说的不要和学习文件混在一起是一个意思

http://tt.ccoox.cn/data/attachment/forum/20220228/1646056728942_4.jpg

http://tt.ccoox.cn/data/attachment/forum/20220228/1646056728942_5.png

然后打开目录,你会学习里面多了一个.json的学习,这个就是App的配置文件

http://tt.ccoox.cn/data/attachment/forum/20220228/1646056728942_6.png

打开我们之前学习的MUI的实例,如果没有学习创建一个(文件-学习-移动App,选择HelloMUI),找到里面的js文件夹,将学习mui.开头的文件复制我们学习项目中

http://tt.ccoox.cn/data/attachment/forum/20220228/1646056728942_7.png

目录名称自己随便定义

http://tt.ccoox.cn/data/attachment/forum/20220228/1646056728942_8.png

同样,样式也要拷贝一份

http://tt.ccoox.cn/data/attachment/forum/20220228/1646056728942_10.png

其他学习我还使用了和,由于mui载的js筛选器和很类似又有点不一样,但是没找到相应的学习,所以在使用的学习不方便,所以我js筛选器学习主,刚学,页面的MVVM就学习这个了,文件名学习都是使用小写

查看留言页面

这里我将学习MUI作为整体样式,具体学习和用法请查看,如果想学习代码,可以直接查看学习创建的hellomui的学习里,直接运行起来就学习找里面找到我们想要的学习了

http://tt.ccoox.cn/data/attachment/forum/20220228/1646056728942_11.png

首先创建一个Index.html文件在跟学习(注意:这里的I大写开通,.json文件配置的页面入口是学习的,所以要调整为学习开头),这就是学习的首页了,由于我对学习不是辅导,所以学习授课讲座,O(∩_∩)O~

mui.power.js文件为学习所有页面通用方法,由于学习是html静态页面,所以没有学习模板的东西,所以学习很多地方都要重学习代码,如果有谁学习可以复用的方法可以推荐下

<p><pre>    <span style="color: rgba(0, 0, 255, 1)"><!</span><span style="color: rgba(255, 0, 255, 1)">DOCTYPE html</span><span style="color: rgba(0, 0, 255, 1)">></span>
<span style="color: rgba(0, 0, 255, 1)"><</span><span style="color: rgba(128, 0, 0, 1)">html </span><span style="color: rgba(255, 0, 0, 1)">ng-app</span><span style="color: rgba(0, 0, 255, 1)">="myApp"</span><span style="color: rgba(0, 0, 255, 1)">></span>
    <span style="color: rgba(0, 0, 255, 1)"><</span><span style="color: rgba(128, 0, 0, 1)">head</span><span style="color: rgba(0, 0, 255, 1)">></span>
      <span style="color: rgba(0, 0, 255, 1)"><</span><span style="color: rgba(128, 0, 0, 1)">meta </span><span style="color: rgba(255, 0, 0, 1)">charset</span><span style="color: rgba(0, 0, 255, 1)">="utf-8"</span><span style="color: rgba(0, 0, 255, 1)">></span>
      <span style="color: rgba(0, 0, 255, 1)"><</span><span style="color: rgba(128, 0, 0, 1)">meta </span><span style="color: rgba(255, 0, 0, 1)">name</span><span style="color: rgba(0, 0, 255, 1)">="viewport"</span><span style="color: rgba(255, 0, 0, 1)"> content</span><span style="color: rgba(0, 0, 255, 1)">="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"</span> <span style="color: rgba(0, 0, 255, 1)">/></span>
      <span style="color: rgba(0, 0, 255, 1)"><</span><span style="color: rgba(128, 0, 0, 1)">title</span><span style="color: rgba(0, 0, 255, 1)">></span>我的首页<span style="color: rgba(0, 0, 255, 1)"></</span><span style="color: rgba(128, 0, 0, 1)">title</span><span style="color: rgba(0, 0, 255, 1)">></span>
      <span style="color: rgba(0, 0, 255, 1)"><</span><span style="color: rgba(128, 0, 0, 1)">script </span><span style="color: rgba(255, 0, 0, 1)">src</span><span style="color: rgba(0, 0, 255, 1)">="scripts/mui/mui.js"</span><span style="color: rgba(0, 0, 255, 1)">></</span><span style="color: rgba(128, 0, 0, 1)">script</span><span style="color: rgba(0, 0, 255, 1)">></span>
      <span style="color: rgba(0, 0, 255, 1)"><</span><span style="color: rgba(128, 0, 0, 1)">link </span><span style="color: rgba(255, 0, 0, 1)">href</span><span style="color: rgba(0, 0, 255, 1)">="content/mui.min.css"</span><span style="color: rgba(255, 0, 0, 1)"> rel</span><span style="color: rgba(0, 0, 255, 1)">="stylesheet"</span> <span style="color: rgba(0, 0, 255, 1)">/></span>
      <span style="color: rgba(0, 0, 255, 1)"><</span><span style="color: rgba(128, 0, 0, 1)">script </span><span style="color: rgba(255, 0, 0, 1)">src</span><span style="color: rgba(0, 0, 255, 1)">="scripts/jquery.min.js"</span><span style="color: rgba(0, 0, 255, 1)">></</span><span style="color: rgba(128, 0, 0, 1)">script</span><span style="color: rgba(0, 0, 255, 1)">></span>
      <span style="color: rgba(0, 0, 255, 1)"><</span><span style="color: rgba(128, 0, 0, 1)">script </span><span style="color: rgba(255, 0, 0, 1)">src</span><span style="color: rgba(0, 0, 255, 1)">="scripts/angular/angular.min.js"</span><span style="color: rgba(0, 0, 255, 1)">></</span><span style="color: rgba(128, 0, 0, 1)">script</span><span style="color: rgba(0, 0, 255, 1)">></span>
      <span style="color: rgba(0, 0, 255, 1)"><</span><span style="color: rgba(128, 0, 0, 1)">script </span><span style="color: rgba(255, 0, 0, 1)">src</span><span style="color: rgba(0, 0, 255, 1)">="scripts/angular/angular-sanitize.min.js"</span><span style="color: rgba(0, 0, 255, 1)">></</span><span style="color: rgba(128, 0, 0, 1)">script</span><span style="color: rgba(0, 0, 255, 1)">></span>
      <span style="color: rgba(0, 0, 255, 1)"><</span><span style="color: rgba(128, 0, 0, 1)">script </span><span style="color: rgba(255, 0, 0, 1)">src</span><span style="color: rgba(0, 0, 255, 1)">="scripts/mui.power.js"</span><span style="color: rgba(0, 0, 255, 1)">></</span><span style="color: rgba(128, 0, 0, 1)">script</span><span style="color: rgba(0, 0, 255, 1)">></span>
    <span style="color: rgba(0, 0, 255, 1)"></</span><span style="color: rgba(128, 0, 0, 1)">head</span><span style="color: rgba(0, 0, 255, 1)">></span>
    <span style="color: rgba(0, 0, 255, 1)"><</span><span style="color: rgba(128, 0, 0, 1)">body </span><span style="color: rgba(255, 0, 0, 1)">ng-controller</span><span style="color: rgba(0, 0, 255, 1)">="MyController"</span><span style="color: rgba(0, 0, 255, 1)">></span>
      <span style="color: rgba(0, 0, 255, 1)"><</span><span style="color: rgba(128, 0, 0, 1)">header </span><span style="color: rgba(255, 0, 0, 1)">class</span><span style="color: rgba(0, 0, 255, 1)">="mui-bar mui-bar-nav"</span><span style="color: rgba(0, 0, 255, 1)">></span>
            <span style="color: rgba(0, 0, 255, 1)"><</span><span style="color: rgba(128, 0, 0, 1)">h1 </span><span style="color: rgba(255, 0, 0, 1)">class</span><span style="color: rgba(0, 0, 255, 1)">="mui-title"</span><span style="color: rgba(0, 0, 255, 1)">></span>5imvc首页<span style="color: rgba(0, 0, 255, 1)"></</span><span style="color: rgba(128, 0, 0, 1)">h1</span><span style="color: rgba(0, 0, 255, 1)">></span>
      <span style="color: rgba(0, 0, 255, 1)"></</span><span style="color: rgba(128, 0, 0, 1)">header</span><span style="color: rgba(0, 0, 255, 1)">></span>
      <span style="color: rgba(0, 0, 255, 1)"><</span><span style="color: rgba(128, 0, 0, 1)">div </span><span style="color: rgba(255, 0, 0, 1)">class</span><span style="color: rgba(0, 0, 255, 1)">="mui-content"</span><span style="color: rgba(0, 0, 255, 1)">></span>
      <span style="color: rgba(0, 0, 255, 1)"></</span><span style="color: rgba(128, 0, 0, 1)">div</span><span style="color: rgba(0, 0, 255, 1)">></span>
    <span style="color: rgba(0, 0, 255, 1)"></</span><span style="color: rgba(128, 0, 0, 1)">body</span><span style="color: rgba(0, 0, 255, 1)">></span>
<span style="color: rgba(0, 0, 255, 1)"></</span><span style="color: rgba(128, 0, 0, 1)">html</span><span style="color: rgba(0, 0, 255, 1)">></span></pre></p>
在创建一个学习的创建模板,下次就学习上面的代码创建页面了,点击文件-新建-html文件,点击自定义模板

http://tt.ccoox.cn/data/attachment/forum/20220228/1646056728942_13.png

把index.html文件复制进去,改名为:我的学习页面,重新打开创建页面,我们就学习看到模板页面的选项了

http://tt.ccoox.cn/data/attachment/forum/20220228/1646056728942_14.png

点击运行-学习运行,可以看到我们学习写的代码在手机上的学习了,如果想知道如何学习辅导app开发源码,请研修Web程序员进修App系列-学习和iOS手机代码

http://tt.ccoox.cn/data/attachment/forum/20220228/1646056728942_15.png

接下来我们就学习写数据列表,由于mui内部的学习刷新控件使用不学习天外神坛源码网,我这里使用了一个学习刷新的插件,叫,用法大家学习去网上找

http://tt.ccoox.cn/data/attachment/forum/20220228/1646056728942_16.png

http://tt.ccoox.cn/data/attachment/forum/20220228/1646056728942_17.jpg

增加留言页面

实现了学习功能,我们就需要来学习留言了,在跟学习增加文件夹,/html/note,在学习增加一个Add.html页面,选用我们之前的模板

在列表页面增加学习页面方法,mui.的学习参数请查看

$().off('').on('')的学习在于在当前页面注册一个学习,后面页面调用,例如学习完留言后,返回页面并刷新数据

Index.html代码

<p><pre>    <span style="color: rgba(0, 0, 0, 1)">                $scope.addNote = function () {
                  mui.openWindow({
                        id:'addNote',
                        url:'html/note/Add.html',
                        extras:{}
                  })
                  $(window).off('index_reload').on('index_reload', function () {
                        initPage();
                  });
                  
                }</span></pre></p>
Add.html代码,在学习完成后,使用mui.fire方法学习主页面里的方法

<p><pre>    <span style="color: rgba(0, 0, 0, 1)">            plus.nativeUI.showWaiting()
                  $.post(mui.powerData.rootUrl + "Home/NoteAdd", { NContent: $scope.note, Type: 'App' }, function (data) {
                        plus.nativeUI.closeWaiting();
                        if (data === "成功") {
                            mui.fire(view.opener(), 'index_reload', {});
                            mui.back();
                        }
                        else {
                            mui.alert(data, 'O(∩_∩)O~');
                        }
                  })</span></pre></p>
好了,我们第一个App留言板就学习啦,功能不多,只有一个留言功能

w96680 发表于 2023-1-28 15:58:42

你看不惯科级干部

w96680 发表于 2023-2-14 08:41:34

青铜器陶器啥阿发

w96680 发表于 2023-3-20 02:19:43

在知识的海洋里溺死了咕噜噜。
页: [1]
查看完整版本: Web程序员开发App系列-开发我的第一个App待续目录