
微信小程序
老姥
这个作者很懒,什么都没留下…
展开
-
template在微信小程序应用
template在微信小程序应用 1、创建template 1、路径:\pages\template\cart 2、只有js,wxml,wxcss文件 1.1 wxml对应内容为: <!--miniprogram/pages/template/cart/index.wxml--> <template name="no-goods"> <view class="...原创 2019-12-16 15:35:04 · 375 阅读 · 0 评论 -
回调函数封装http之调用
回调函数封装http之调用 1、创建http.js 文件路径:miniprogram\utils\http.js 内容: import {config} from '../config.js' const tips = { 1: '抱歉,出现了错误' } class HTTP{ request(params){ if(!params.method){ par...原创 2019-12-12 14:08:49 · 459 阅读 · 0 评论 -
Promise封装http之调用
微信小程序Promise封装http之调用 1、创建http.js 1、路径:miniprogram\utils\http.js 2、相关内容: import { config } from '../config.js' const tips = { 1: '抱歉,出现一个错误', 3000: '数据不存', 405: 'METHOD NOT ALLOWED', 200: '提交成...原创 2019-12-12 12:00:52 · 811 阅读 · 0 评论 -
微信小程序中js通过wxs文件在wxml中应用
1、创建wxs文件: filters.wxs ( \miniprogram\utils\filters.wxs ) function dateToTime(unixtime) { //获取当前日期 var date = getDate(unixtime*1000) ; var y = date.getFullYear(); var m = date.getMonth() + 1;...原创 2019-12-12 11:29:48 · 1398 阅读 · 0 评论 -
微信小程序Require 加载 js文件中json数据
创建js文件 ----testmyorders.js const orders = [ { id: 1, title: '羊排接龙', goodsname: '羊排', goodspec: '2.5斤/袋', goodsunit: '袋', priceunit: '斤', price: '120', count: 1, total: 120 }, { id: 2, ti...原创 2019-12-12 11:11:10 · 1908 阅读 · 0 评论