
uni-app笔记
曲浩_
这个作者很懒,什么都没留下…
展开
-
uni-app rich-text图片自适应 宽度100%
info = info.replace(/\<img/g, "<img style='width: 100%;'")原创 2021-05-21 18:52:04 · 1869 阅读 · 0 评论 -
uni-app APP支付 uni.requestPayment APP微信支付
JS部分代码zhifu(){//APP支付// #ifdef APP-PLUS uni.showLoading({title: '加载中',}) uni.request({ url: getApp().globalData.https + '/wap.php/Order/pay_course_order',//支付订单接口链接 data: { oid:data.oid,//订单号 }, method: 'POST', header: getApp().global原创 2020-07-03 23:08:22 · 6103 阅读 · 0 评论 -
uni-app 微信支付 uni.requestPayment小程序支付
JS代码部分zhifu(){ //支付方法//微信支付// #ifdef MP-WEIXINuni.showLoading({title: '加载中',})uni.request({ url: getApp().globalData.https + '/wap.php/Order/pay_course_order',//支付订单接口链接 data: { oid:data.oid,//订单ID }, method: 'POST', header: getApp().global原创 2020-07-03 23:00:53 · 13758 阅读 · 2 评论 -
uni-app设置缓存,读取缓存
JS部分代码uni.setStorageSync('uid', '1'); //设置缓存var uid = uni.getStorageSync('uid');//读取缓存原创 2020-06-22 08:55:09 · 7100 阅读 · 0 评论 -
uni-app引入的组件、子组件onLoad事件无效
JS部分代码export default { data() { return { } }, mounted() {//此处代替onLoad var that = this; that.fangfa(); }, methods: { fangfa() { }, },}原创 2020-06-22 08:52:23 · 3029 阅读 · 0 评论 -
uni-app,image标签外面的view标签高度与image标签高度相同
Html部分代码<view class="login-body"> <image :src="https + '/img/wap/login_bg.png'" class="login-bg" mode="widthFix"></image></view>CSS部分代码.login-body{ width:100%;}.login-bg { width: 100%; display: block;//重点是这行代码}...原创 2020-06-19 10:50:21 · 1360 阅读 · 0 评论 -
uni-app加载中,加载结束
JS部分代码methods: { fangfa(){ var that = this; uni.showLoading({title: '加载中',mask:true}); uni.request({ url:'', data: {}, method: 'POST', header: '', dataType: 'json', success: function (res) { //关闭加载中 setTimeout(funct原创 2020-06-12 17:05:48 · 13178 阅读 · 0 评论 -
uni-app页面内设置title
JS部分代码onLoad(e) { var that = this; uni.setNavigationBarTitle({ title: '首页' });},原创 2020-06-12 17:00:03 · 4094 阅读 · 0 评论 -
uni-app设置背景图片,backgroundImage
HTML部分代码<view class="shangpin_teacher_pic" :style="{backgroundImage: 'url(' + pic_url + ')'}">原创 2020-06-10 17:07:48 · 12537 阅读 · 1 评论 -
uni-app去掉页面顶部的导航栏
找到文件 pages.json,增加代码"style":{ "navigationStyle":"custom", "app-plus":{ "titleNView":false }}没去掉前去掉后原创 2020-06-10 14:23:15 · 2564 阅读 · 1 评论