HTML <scroll-view class="todaysDeal-scroll" :scroll-x="true" enable-flex="true" @scrolltolower="scorllClick"> <view class="todaysDeal-list" v-for="(item,index) in todaysDeal" :key=
/common/free-lib/chat.js import $U from "./util.js"; import $H from './request.js'; import $store from '@/store/index.js'; class chat { constructor(arg) { this.url = arg.url this.isOnline = false this.socket = null t
下图是我测试截图 app/controller/group.js 'use strict'; const Controller = require('egg').Controller; class GroupController extends Controller { // 获取群聊列表 async list() { const { ctx, app } = this; let current_user_id = c
下图是我测试的截图 /pages/find/add-moment/add-moment.vue <template> <view class="px-3"> <!-- 导航栏 --> <free-nav-bar showBack :showRight="true"> <free-main-button name="发表" slot="right" @cli
个人中心页面 <template> <view> <view class="u-m-t-20"> <view class="center"> <view class="u-m-t-12 u-m-l-60"> <!-- <u-avatar :src="src" mode="circle" size=
使用uni时,引用图片image时,初加载时会闪一下,很影响体验,官网的介绍方法是image{will-change: transform}就可以了。 其实还不行,因为image默认都是有宽高的。把它宽高变成auto就可以了 image { will-change: transform; width: auto; height: auto;}
如下是我测试的截图 /components/free-ui/free-upload-image.vue <template> <view class="flex flex-wrap"> <view style="width: 230rpx;" v-for="(item,index) in imageList" :key='index' class="flex align-cen
/pages/find/moments/moments.vue <template> <view> <free-transparent-bar :scrollTop="scrollTop" @clickRight="clickRight"></free-transparent-bar> <view class="position-relative" style="heig
引用插件:App平台的授权判断方式,另见:App权限判断和提示 - DCloud 插件市场 import permision from '../../js_sdk/wa-permission/permission'; onload onLoad(option) { // #ifdef APP-PLUS this.isIos = plus.os.name == 'iOS'; // #endif }, method //安卓的判
我们有这样一个需求,就是初次进入页面我们不需要登录,但是如果进入到某个详情页,需要下单,或者填写收发货地址等,我们需要返回到登录页去登录,登录成功之后,再次返回对应的下单页面或者收发货地址页面 比如我们有这样四个页面,一个是首页,一个是首页详情页,一个订单页,一个是登录页(注意登
项目需求 项目生成订单,需要用户通过小程序进行支付。 解决方案 使用uni.requestPayment(),调用小程序中的付款功能。 <script> export default { data() { return { request:{ id:xxxxx, info:'xxxx' } } }, onLoad() { },
控件: 1、navigator页面跳转 //关闭当前页面,返回上一页面或多级页面 <navigator open-type="navigateBack"> </navigator> 2、将 data 存储在本地缓存中指定的 key 中,从本地缓存中异步获取指定 key 对应的内容 //data存储本地缓存key uni.setStorageSync(KEY,DATA) 例: uni.
uni-app检测版本升级并显示下载进度 一、检测版本 1、自动检测 即打开应用是就检测应用版本,检测方法需要写在app.vue文件中,代码如下 //APP更新 import configService from '@/common/service/config.service.js' import store from '@/store' console.log('configService', confi
uni-app获取上层路由的方法 var pages = getCurrentPages();//获取页面 var beforePage = pages[pages.length - 2];//上个页面 调上个页面方法 // #ifdef H5 beforePage.submitAct() // #endif 但是,在uni-app中是适配多端的,beforePage.submitAct()只在h5中有效,在app端和微信小
<view class="img" @tap="getUploadImg"> <image :src='list.logo'></image> </view> getUploadImg(e) { uni.chooseImage({ count: 1, // 默认9 sizeType: ['compressed'], sour
中国所有城市json数据,通过uniapp打开,直接运行项目 项目源码: <template> <view class="content"> <!-- <view class="top-view"></view> --> <ss-select-city :hotCitys="hotCitys" v-model="locationValue" :loc
HBuilder,H是HTML的缩写,Builder是建设者 它是为前端开发者服务的通用IDE,或者称为编辑器。与vscode、sublime、webstorm类似 它可以开发普通web项目,也可以开发DCloud出品的uni-app项目、5+App项目、wap2app项目 目前有800万开发者在使用HBuilder 老版的HBuilder是红色logo,已于
1、需求: 使用uni-app,实现点击页面里面的某一个版块,(滚动到)跳转到当前同一个页面的指定位置 2、代码示例: //定制目标按钮 <button class="custom-btn" @click="totarget">定制目标</button> //12月挑战版块,设置id类名 <view id="chanllge-month"> <swiper class="challenge-
1.在uniapp的manifest.json文件中勾选 2.支付宝支付代码 uni.request({ method: "POST", url: this.httpUrl + '5fe', header: { 'content-type': "application/x-www-form-urlencoded"
1、创建项目安装组件 npm install uview-ui 2、配置 引入uView主JS库 在项目src目录中的main.js中,引入并使用uView的JS库,注意这两行要放在import Vue之后。 // main.js import uView from "uview-ui"; Vue.use(uView); 在引入uView的全局SCSS主题文件 在项目src目录的uni.s
uni-app 网络通信API 发起请求uni.request(OBJECT)uni.configMTLS(OBJECT) 上传、下载uni.uploadFile(OBJECT)uni.downloadFile(OBJECT) WebSocketuni.connectSocket(OBJECT)uni.onSocketOpen(CALLBACK)uni.onSocketError(CALLBACK)uni.sendSocketMessage(OBJECT)uni.onSoc
uni-app API概述 标准js和浏览器js的区别各端特色API调用说明API `Promise 化`Vue 2 和 Vue 3 的 API `Promise 化`Vue 2Vue 3Vue 2 写法转 Vue 3 写法Vue 3 写法转 Vue 2 写法 API 列表网络发起请求上传、下载WebSocketSocketTask 媒体图片文件录音管理背景音频播放管理
前言 项目一直使用uniapp来打包APP,但是每次发布测试或者上线,都要使用官方的云打包…有大小限制不说,周五等时间等待的时间比打包的时间更加长,所以就想着能不能热更新呢?说干就干 调研阶段 首先在官网的文档上找了一下,发现原来官方就有热更新的平台,这不巧了嘛官方文档
获取 uni.getStorage({ key:'username', }).then(res => { // 如果返回数组为两位就是正确 if(res.length==2){ this.username = res[1].data; } return uni.getStorage({ key:'password', }) }).then(res => { i
h5端使用webview时,苹果手机浏览网页时空了一截,使用 iframe 框架 ,获取当前可视网页大小