HBuilderX

HBuilderX

极客开发工具
uni-app

uni-app

开发一次,多端覆盖
uniCloud

uniCloud

云开发平台
HTML5+

HTML5+

增强HTML5的功能体验
MUI

MUI

上万Star的前端框架

团队开发uniapp、软硬件对接结合开发

App 5+App开发 移动APP uniapp

团队开发uniapp、软硬件对接结合开发
uniapp定制开发
1.需求项目沟通明确

  1. 工期和报价明确
  2. UI设计图确认
  3. 前端切图样式调整编写代码
  4. 后台搭建
  5. 上线前内部测试
  6. 填充内容
    一⑤八叁2壹1伍0九玖

团队开发uniapp、软硬件对接结合开发
uniapp定制开发
1.需求项目沟通明确

  1. 工期和报价明确
  2. UI设计图确认
  3. 前端切图样式调整编写代码
  4. 后台搭建
  5. 上线前内部测试
  6. 填充内容
    一⑤八叁2壹1伍0九玖

main.js Vue.prototype 全局变量的挂载与动态赋值

Vue 全局变量

在main.js中,Vue.prototype.$appName = “XXX” 可以用来定义一些我们不常变化的全局属性或者方法的。
但是有时候我们想动态改变它。特别是从远程获取最新的json信息,然后动态更新这个main,js里面定义的东西。
所以在定义、挂载这些变量的时候,可以这样写:
Vue.prototype.$appName = {'value':'XXXX'}
调用的时候,我们用var abc = this.$appName.value 进行调用
然后再从远程获取新的信息时,可以动态更新此值
this.$appName.value = 'YYYY'

继续阅读 »

在main.js中,Vue.prototype.$appName = “XXX” 可以用来定义一些我们不常变化的全局属性或者方法的。
但是有时候我们想动态改变它。特别是从远程获取最新的json信息,然后动态更新这个main,js里面定义的东西。
所以在定义、挂载这些变量的时候,可以这样写:
Vue.prototype.$appName = {'value':'XXXX'}
调用的时候,我们用var abc = this.$appName.value 进行调用
然后再从远程获取新的信息时,可以动态更新此值
this.$appName.value = 'YYYY'

收起阅读 »

《重点是:#FFF级的小白用uniapp,50就能做出一个通用社交app》

今儿数据丢了,必须强颜欢笑啊。。。掐指一算,而今迈步刚好50天

回顾历史啊,,,想当天。。。。

50天前,我连js的全拼都记不住,就像脑袋里没那属性,或者是给冒泡了

但是50天后的现在,,,世事变幻莫测,天旋地转,物是人非,哈哈,我有了一个自己写的,能注册、登录、改资料、发布、回复、聚合等等的社交小app!

我要感谢uniApp,感谢builderX,感谢uniCloud,感谢ccTv。。。嗯,连这cctv不用驼峰都觉着别扭。。。

当然,我这离回梦、林举那些高人还有十万八千里路,,,但是,至少现在,嗯,以后app那点事儿可就蒙不了我了哈。。。

毕竟哥也算是个程序员了诶巴扎黑

so,千言万语汇成一句话,uniApp、uniApp、uni——App!

继续阅读 »

今儿数据丢了,必须强颜欢笑啊。。。掐指一算,而今迈步刚好50天

回顾历史啊,,,想当天。。。。

50天前,我连js的全拼都记不住,就像脑袋里没那属性,或者是给冒泡了

但是50天后的现在,,,世事变幻莫测,天旋地转,物是人非,哈哈,我有了一个自己写的,能注册、登录、改资料、发布、回复、聚合等等的社交小app!

我要感谢uniApp,感谢builderX,感谢uniCloud,感谢ccTv。。。嗯,连这cctv不用驼峰都觉着别扭。。。

当然,我这离回梦、林举那些高人还有十万八千里路,,,但是,至少现在,嗯,以后app那点事儿可就蒙不了我了哈。。。

毕竟哥也算是个程序员了诶巴扎黑

so,千言万语汇成一句话,uniApp、uniApp、uni——App!

收起阅读 »

贡献一个知识点,文档里肯定不会告诉你的东西

where查询和聚合不能一起用。

比如:想连表查询的话只能用match+lookup。

至于为什么,应该是国家机密吧。毕竟连where和聚合不能一起用都要保密。。。这天气真是热了

so,鉴于聚合是民生刚需,所以请大家奔走相告,早用match早超生。

where查询和聚合不能一起用。

比如:想连表查询的话只能用match+lookup。

至于为什么,应该是国家机密吧。毕竟连where和聚合不能一起用都要保密。。。这天气真是热了

so,鉴于聚合是民生刚需,所以请大家奔走相告,早用match早超生。

tailwind.css 对于小程序按钮样式的影响

微信小程序
/* 罪魁祸首 */  
/**  
 * Correct the inability to style clickable types in iOS and Safari.  
 */  
button,  
[type="button"],  
[type="reset"],  
[type="submit"] {  
  -webkit-appearance: button;  
}  
/** 解决方案 */  
button, [type="button"], [type="reset"], [type="submit"] {  
    -moz-appearance: none;  
    -webkit-appearance: none;  
}  

tailwind.css 对于小程序按钮样式的影响,前两天发现小程序按钮的默认样式一直去不掉,今天才发现是因为 tailwind.css 导致的。 他有一段上面那样的 css 采用了系统自定义的按钮样式导致你怎么覆盖 button::after 都没有用

》》》》 原文地址
》》》》 demo代码

崮生的 uni-app 最佳实践

继续阅读 »
/* 罪魁祸首 */  
/**  
 * Correct the inability to style clickable types in iOS and Safari.  
 */  
button,  
[type="button"],  
[type="reset"],  
[type="submit"] {  
  -webkit-appearance: button;  
}  
/** 解决方案 */  
button, [type="button"], [type="reset"], [type="submit"] {  
    -moz-appearance: none;  
    -webkit-appearance: none;  
}  

tailwind.css 对于小程序按钮样式的影响,前两天发现小程序按钮的默认样式一直去不掉,今天才发现是因为 tailwind.css 导致的。 他有一段上面那样的 css 采用了系统自定义的按钮样式导致你怎么覆盖 button::after 都没有用

》》》》 原文地址
》》》》 demo代码

崮生的 uni-app 最佳实践

收起阅读 »

基于uni-app的高颜值极速记账小程序

微信小程序

【项目背景】

日常生活中,多少都会有记账的需求。(今天请客花了多少钱?今天工资收了多少?....本月有几张信用卡要还?还款日期、还款金额分别是多少?...)
通常的记账软件,80%都要求下载APP,并且操作较为繁琐。

故开发此小程序,名曰“小熙记账”。熙通“禧”,意为:幸福;吉祥。

记一笔收入,买一份礼物,给自己一个小确幸。

【开发背景】基于uni-app,用最优雅的代码敏捷开发

【产品目标】行云流水般的极速记账体验

【功能列表】

1、极速记账:三秒记账,打完收枪

2、收支统计:按月查统计图

3、多账户管理:储蓄账户、信用账户、其他账户,支持账户之间转账

4、流水查询:查看所有记账流水

5、账目总览:累计、当月收支情况,还款任务列表,近三月大额支出

【产品截图】

【即刻体验】

继续阅读 »

【项目背景】

日常生活中,多少都会有记账的需求。(今天请客花了多少钱?今天工资收了多少?....本月有几张信用卡要还?还款日期、还款金额分别是多少?...)
通常的记账软件,80%都要求下载APP,并且操作较为繁琐。

故开发此小程序,名曰“小熙记账”。熙通“禧”,意为:幸福;吉祥。

记一笔收入,买一份礼物,给自己一个小确幸。

【开发背景】基于uni-app,用最优雅的代码敏捷开发

【产品目标】行云流水般的极速记账体验

【功能列表】

1、极速记账:三秒记账,打完收枪

2、收支统计:按月查统计图

3、多账户管理:储蓄账户、信用账户、其他账户,支持账户之间转账

4、流水查询:查看所有记账流水

5、账目总览:累计、当月收支情况,还款任务列表,近三月大额支出

【产品截图】

【即刻体验】

收起阅读 »

图片并排排版、src中使用js等小代码

调用系统相册中图片js:
<script language="javascript">
document.getElementById('img_ho').src = plus.io.resolveLocalFileSystemURL("_www/hengping.jpg");
document.getElementById('img_vo').src = plus.io.resolveLocalFileSystemURL("_www/shuping.jpg");
</script>

并排显示在页面上:

 <table><tr>                                                      
        <td><a href="vo.html" target="_parent" title="点击获取"><img id="img_vo" src="?" onerror="this.src='images/nopic.png';this.οnerrοr=null" border=0/></a></td>                                                                                                  
        <td><a href="ho.html" target="_parent" title="点击获取"><img id="img_ho" src="?"  onerror="this.src='images/nopic.png';this.οnerrοr=null" border=0/></a></td>     
</tr></table>
继续阅读 »

调用系统相册中图片js:
<script language="javascript">
document.getElementById('img_ho').src = plus.io.resolveLocalFileSystemURL("_www/hengping.jpg");
document.getElementById('img_vo').src = plus.io.resolveLocalFileSystemURL("_www/shuping.jpg");
</script>

并排显示在页面上:

 <table><tr>                                                      
        <td><a href="vo.html" target="_parent" title="点击获取"><img id="img_vo" src="?" onerror="this.src='images/nopic.png';this.οnerrοr=null" border=0/></a></td>                                                                                                  
        <td><a href="ho.html" target="_parent" title="点击获取"><img id="img_ho" src="?"  onerror="this.src='images/nopic.png';this.οnerrοr=null" border=0/></a></td>     
</tr></table>
收起阅读 »

js_to_APP手机不能下载base格式图片的处理

js在pc端正常下载base图片,使用HBuilder生成APP后下载失败,原因是手机浏览器不能直接下载base64位图片的文件,使用plus进行直接转存,代码如下:
image对象为base64对象,调用方法为 saveBasePic(base,"ceshi.jpg"),切记在使用HB生成APP时注意在配置文件中修改runmode为liberate模式,normal测试是有问题的。
"runmode" : "liberate", /应用的首次启动运行模式,可取liberate或normal,liberate模式在第一次启动时将解压应用资源(Android平台File API才可正常访问_www目录)/

function saveBasePic (image,imageName){           
        var b = new plus.nativeObj.Bitmap();  
        var path = plus.io.convertLocalFileSystemURL("_www/"+imageName);//将文件短路径转换成本地完整路径   
        alert(path);  
        b.loadBase64Data(image,function(){  
            //alert("创建成功");  
            b.save("_www/"+imageName,{overwrite:true},function(){  
                //console.log("保存成功");  
                plus.gallery.save("_www/"+imageName, function () {  
                    alert( "保存图片到相册成功" );  
                    event_b(true,path);  
                },function(){  
                    alert( "保存图片到相册失败" );  
                    event_b(false,path);  
                });                   
            },function(){  
                alert("保存图片失败!");  
                event_b(false,path);  
            });               
        },function(){  
            alert("写入文件失败,确认APP是否具有权限!");  
            event_b(false,path);  
        });  
}     
继续阅读 »

js在pc端正常下载base图片,使用HBuilder生成APP后下载失败,原因是手机浏览器不能直接下载base64位图片的文件,使用plus进行直接转存,代码如下:
image对象为base64对象,调用方法为 saveBasePic(base,"ceshi.jpg"),切记在使用HB生成APP时注意在配置文件中修改runmode为liberate模式,normal测试是有问题的。
"runmode" : "liberate", /应用的首次启动运行模式,可取liberate或normal,liberate模式在第一次启动时将解压应用资源(Android平台File API才可正常访问_www目录)/

function saveBasePic (image,imageName){           
        var b = new plus.nativeObj.Bitmap();  
        var path = plus.io.convertLocalFileSystemURL("_www/"+imageName);//将文件短路径转换成本地完整路径   
        alert(path);  
        b.loadBase64Data(image,function(){  
            //alert("创建成功");  
            b.save("_www/"+imageName,{overwrite:true},function(){  
                //console.log("保存成功");  
                plus.gallery.save("_www/"+imageName, function () {  
                    alert( "保存图片到相册成功" );  
                    event_b(true,path);  
                },function(){  
                    alert( "保存图片到相册失败" );  
                    event_b(false,path);  
                });                   
            },function(){  
                alert("保存图片失败!");  
                event_b(false,path);  
            });               
        },function(){  
            alert("写入文件失败,确认APP是否具有权限!");  
            event_b(false,path);  
        });  
}     
收起阅读 »

uniapp数字键盘

uniapp

github地址,喜欢的可以star下哦

插件预览图

使用教程

1.插件代码拷贝

  • 下载后把components目录下/digitKeyboard/digitKeyboard.vue文件拷贝到自己项目目录下

2.插件全局配置

  • 在项目里main.js中配置如下代码
import digitKeyboard from './components/digitKeyboard/digitKeyboard.vue'  

Vue.component('digitKeyboard', digitKeyboard)  

3.插件使用

  • vue页面使用
<template>  
    <view>  
        <!-- 数字键盘 -->  
        <digitKeyboard v-if="isShowKeyboardWindow" :inputVal="inputVal" :label="label" @cancel="isShowKeyboardWindow = false" @confirm="keyboardConfirm"/>  
    </view>  
</template>  
<script>  
    export default {  
        data() {  
            return {  
                inputVal:'1',  
                label:'现金支付',  
                isShowKeyboardWindow:true,//是否显示键盘窗口  
            };  
        },  
        methods:{  
            keyboardConfirm(val){  
                console.log(val)  
                uni.showToast({  
                    title:'当前输入的值:'+val,  
                    icon:'none',  
                    duration:4000  
                })  
            }  
        }  
    }  
</script>  
<style lang="less">  

</style>  
兼容性

uni-app项目中使用都兼容

继续阅读 »

github地址,喜欢的可以star下哦

插件预览图

使用教程

1.插件代码拷贝

  • 下载后把components目录下/digitKeyboard/digitKeyboard.vue文件拷贝到自己项目目录下

2.插件全局配置

  • 在项目里main.js中配置如下代码
import digitKeyboard from './components/digitKeyboard/digitKeyboard.vue'  

Vue.component('digitKeyboard', digitKeyboard)  

3.插件使用

  • vue页面使用
<template>  
    <view>  
        <!-- 数字键盘 -->  
        <digitKeyboard v-if="isShowKeyboardWindow" :inputVal="inputVal" :label="label" @cancel="isShowKeyboardWindow = false" @confirm="keyboardConfirm"/>  
    </view>  
</template>  
<script>  
    export default {  
        data() {  
            return {  
                inputVal:'1',  
                label:'现金支付',  
                isShowKeyboardWindow:true,//是否显示键盘窗口  
            };  
        },  
        methods:{  
            keyboardConfirm(val){  
                console.log(val)  
                uni.showToast({  
                    title:'当前输入的值:'+val,  
                    icon:'none',  
                    duration:4000  
                })  
            }  
        }  
    }  
</script>  
<style lang="less">  

</style>  
兼容性

uni-app项目中使用都兼容

收起阅读 »

uni-app编译为小程序的时候报,v-slot 不支持动态插槽名

uni-app编译为小程序的时候报,v-slot 不支持动态插槽名,我记得我写微信小程序的时候slot是支持slot动态切换的呀?h5下正常

uni-app编译为小程序的时候报,v-slot 不支持动态插槽名,我记得我写微信小程序的时候slot是支持slot动态切换的呀?h5下正常

图片添加文字水印-安卓

NJS
export function addWatermark(tempFilePath, gText) {  
        let Resources = plus.android.importClass('android.content.res.Resources')  
    let Bitmap = plus.android.importClass('android.graphics.Bitmap')  
    let BitmapFactory = plus.android.importClass('android.graphics.BitmapFactory')  
    let Canvas = plus.android.importClass('android.graphics.Canvas')  
    let Paint = plus.android.importClass('android.graphics.Paint')  
    let Color = plus.android.importClass('android.graphics.Color')  
    let TextPaint = plus.android.importClass('android.text.TextPaint')  
    let Layout = plus.android.importClass('android.text.Layout')  
    let StaticLayout = plus.android.importClass('android.text.StaticLayout')  
    let BufferedOutputStream = plus.android.importClass('java.io.BufferedOutputStream')  
    let File = plus.android.importClass('java.io.File')  
    let FileOutputStream = plus.android.importClass('java.io.FileOutputStream')  

    let filePath = plus.io.convertLocalFileSystemURL(tempFilePath)  
    let options = new BitmapFactory.Options()  
    options.inPreferredConfig = Bitmap.Config.ARGB_8888;  
    let bitmap = BitmapFactory.decodeFile(filePath, options);  

    // 画图  
    let main =  plus.android.runtimeMainActivity()  
    let application = main.getApplication()  
    let resources =  application.getResources()  
    let displayMetrics = resources.getDisplayMetrics()  
    let scale =  plus.android.getAttribute(displayMetrics, 'density' )   
    let bitmapConfig = bitmap.getConfig();  
    bitmapConfig = Bitmap.Config.ARGB_8888;  
    bitmap = bitmap.copy(bitmapConfig, true);  
    let canvas = new Canvas(bitmap);  
    let paint = new TextPaint(Paint.ANTI_ALIAS_FLAG);  
    // 设置颜色  
    paint.setColor(Color.WHITE);  
    paint.setTextSize((16 * scale));  
    paint.setShadowLayer(1, 0, 1, Color.WHITE);  
    let textWidth = canvas.getWidth() - (16 * scale);  
    // text-align: ALIGN_NORMAL,ALIGN_OPPOSITE,ALIGN_CENTER,ALIGN_LEFT,ALIGN_RIGHT;  
    let textLayout = new StaticLayout(  
        gText, paint, textWidth, Layout.Alignment.ALIGN_CENTER, 1, 0, false);  
    let textHeight = textLayout.getHeight();  
    canvas.save();  
    // 计算画的位置  
    canvas.translate(0, canvas.getHeight() - textHeight);  
    textLayout.draw(canvas);  
    canvas.restore();  
    let file = new File(filePath);  
    let bos = new BufferedOutputStream(new FileOutputStream(file));  
    bitmap.compress(Bitmap.CompressFormat.JPEG, 100, bos);  
    bos.flush();  
    bos.close();  
}  

叠加地址和日期 使用\n可以折行,叠加位置可以自己计算

        addWaterMark(tempFilePath) {  
            return new Promise((resolve, reject) => {  
                uni.getLocation({  
                    geocode: true,  
                    success: ({ address: { city, district, street, streetNum, poiName } }) => {  
                        const address = city + district + street + streetNum + poiName  
                        const date = dayjs().format('YYYY-MM-DD HH:mm')  
                        addWatermark(tempFilePath, `${address}\n${date}`)  
                        resolve(tempFilePath)  
                    }  
                })  
            })  
        }

继续阅读 »
export function addWatermark(tempFilePath, gText) {  
        let Resources = plus.android.importClass('android.content.res.Resources')  
    let Bitmap = plus.android.importClass('android.graphics.Bitmap')  
    let BitmapFactory = plus.android.importClass('android.graphics.BitmapFactory')  
    let Canvas = plus.android.importClass('android.graphics.Canvas')  
    let Paint = plus.android.importClass('android.graphics.Paint')  
    let Color = plus.android.importClass('android.graphics.Color')  
    let TextPaint = plus.android.importClass('android.text.TextPaint')  
    let Layout = plus.android.importClass('android.text.Layout')  
    let StaticLayout = plus.android.importClass('android.text.StaticLayout')  
    let BufferedOutputStream = plus.android.importClass('java.io.BufferedOutputStream')  
    let File = plus.android.importClass('java.io.File')  
    let FileOutputStream = plus.android.importClass('java.io.FileOutputStream')  

    let filePath = plus.io.convertLocalFileSystemURL(tempFilePath)  
    let options = new BitmapFactory.Options()  
    options.inPreferredConfig = Bitmap.Config.ARGB_8888;  
    let bitmap = BitmapFactory.decodeFile(filePath, options);  

    // 画图  
    let main =  plus.android.runtimeMainActivity()  
    let application = main.getApplication()  
    let resources =  application.getResources()  
    let displayMetrics = resources.getDisplayMetrics()  
    let scale =  plus.android.getAttribute(displayMetrics, 'density' )   
    let bitmapConfig = bitmap.getConfig();  
    bitmapConfig = Bitmap.Config.ARGB_8888;  
    bitmap = bitmap.copy(bitmapConfig, true);  
    let canvas = new Canvas(bitmap);  
    let paint = new TextPaint(Paint.ANTI_ALIAS_FLAG);  
    // 设置颜色  
    paint.setColor(Color.WHITE);  
    paint.setTextSize((16 * scale));  
    paint.setShadowLayer(1, 0, 1, Color.WHITE);  
    let textWidth = canvas.getWidth() - (16 * scale);  
    // text-align: ALIGN_NORMAL,ALIGN_OPPOSITE,ALIGN_CENTER,ALIGN_LEFT,ALIGN_RIGHT;  
    let textLayout = new StaticLayout(  
        gText, paint, textWidth, Layout.Alignment.ALIGN_CENTER, 1, 0, false);  
    let textHeight = textLayout.getHeight();  
    canvas.save();  
    // 计算画的位置  
    canvas.translate(0, canvas.getHeight() - textHeight);  
    textLayout.draw(canvas);  
    canvas.restore();  
    let file = new File(filePath);  
    let bos = new BufferedOutputStream(new FileOutputStream(file));  
    bitmap.compress(Bitmap.CompressFormat.JPEG, 100, bos);  
    bos.flush();  
    bos.close();  
}  

叠加地址和日期 使用\n可以折行,叠加位置可以自己计算

        addWaterMark(tempFilePath) {  
            return new Promise((resolve, reject) => {  
                uni.getLocation({  
                    geocode: true,  
                    success: ({ address: { city, district, street, streetNum, poiName } }) => {  
                        const address = city + district + street + streetNum + poiName  
                        const date = dayjs().format('YYYY-MM-DD HH:mm')  
                        addWatermark(tempFilePath, `${address}\n${date}`)  
                        resolve(tempFilePath)  
                    }  
                })  
            })  
        }

收起阅读 »

iOS开发者账号到期续费流程(2020)

iOS iOS打包

iOS开发者账号在到期的前一个月即可续费,如果到期没有续费APP将会下架,在App Store无法搜索

1、登录苹果开发者中心

有这个红色提示说明该续费了

会要求先到Apple Developer这个应用验证下资料才能进入续费页面。

2、在苹果手机App Store搜索Apple Developer并安装上(需要iOS12.4系统以上,不然搜不到这个app)

3、登录苹果账号填写相资料验证(先到手机设置那边登录开发者账号)

3、输入申请人姓名、身份证号、电话(中文输入)

人脸识别,拍个自拍照

4、验证好了资料返回苹果开发者中心

点击红色处,进入付款页面。

输入visa信用卡信息及地址信息!

确认付款提示下图,即完成了付款!

iOS上架辅助工具分享推荐

Appuploader可以辅助在Windows、linux或mac系统直接申请iOS证书p12,及上传ipa到App Store,最方便在Windows开发上架没有苹果Mac电脑的开发者!

继续阅读 »

iOS开发者账号在到期的前一个月即可续费,如果到期没有续费APP将会下架,在App Store无法搜索

1、登录苹果开发者中心

有这个红色提示说明该续费了

会要求先到Apple Developer这个应用验证下资料才能进入续费页面。

2、在苹果手机App Store搜索Apple Developer并安装上(需要iOS12.4系统以上,不然搜不到这个app)

3、登录苹果账号填写相资料验证(先到手机设置那边登录开发者账号)

3、输入申请人姓名、身份证号、电话(中文输入)

人脸识别,拍个自拍照

4、验证好了资料返回苹果开发者中心

点击红色处,进入付款页面。

输入visa信用卡信息及地址信息!

确认付款提示下图,即完成了付款!

iOS上架辅助工具分享推荐

Appuploader可以辅助在Windows、linux或mac系统直接申请iOS证书p12,及上传ipa到App Store,最方便在Windows开发上架没有苹果Mac电脑的开发者!

收起阅读 »