- 进度条组件progress百分比字体大小如何调?
请教:微信小程序中进度条组件progress百分比字体大小如何调?
2018-02-06 - 小程序组件swiper问题
小程序swiper组件卡顿 出现的机型:魅族魅蓝note5,魅族pro7。 index.html [代码]<!--index.wxml-->[代码][代码]<[代码][代码]swiper[代码] [代码]style[代码][代码]=[代码][代码]"text-align:center;"[代码] [代码]indicator-dots[代码][代码]=[代码][代码]"{{indicatorDots}}"[代码] [代码]autoplay[代码][代码]=[代码][代码]"{{autoplay}}"[代码] [代码]interval[代码][代码]=[代码][代码]"{{interval}}"[代码] [代码]duration[代码][代码]=[代码][代码]"{{duration}}"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]block[代码] [代码]wx:for[代码][代码]=[代码][代码]"{{imgUrls}}"[代码] [代码]wx:key[代码][代码]=[代码][代码]"index"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]swiper-item[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]navigator[代码] [代码]url[代码][代码]=[代码][代码]'javascript:;'[代码] [代码]style[代码][代码]=[代码][代码]"background-image:url({{item.src}})"[代码][代码]></[代码][代码]navigator[代码][代码]>[代码][代码] [代码][代码]</[代码][代码]swiper-item[代码][代码]>[代码][代码] [代码][代码]</[代码][代码]block[代码][代码]>[代码][代码] [代码][代码]</[代码][代码]swiper[代码][代码]>[代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"container"[代码][代码]>[代码][代码] [代码][代码]<!-- <view class="userinfo">[代码][代码] [代码][代码]<button wx:if="{{!hasUserInfo && canIUse}}" open-type="getUserInfo" bindgetuserinfo="getUserInfo"> 获取头像昵称 </button>[代码][代码] [代码][代码]<block wx:else>[代码][代码] [代码][代码]<image bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" background-size="cover"></image>[代码][代码] [代码][代码]<text class="userinfo-nickname">{{userInfo.nickName}}</text>[代码][代码] [代码][代码]</block>[代码][代码] [代码][代码]</view>[代码][代码] [代码][代码]<view class="usermotto">[代码][代码] [代码][代码]<text class="user-motto">{{motto}}</text>[代码][代码] [代码][代码]</view> -->[代码][代码] [代码][代码]<[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]text[代码][代码]>经度:{{latitude}}</[代码][代码]text[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]text[代码][代码]>纬度:{{longitude}}</[代码][代码]text[代码][代码]>[代码][代码] [代码][代码]</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]button[代码] [代码]bindtap[代码][代码]=[代码][代码]"scan"[代码][代码]>扫一扫</[代码][代码]button[代码][代码]>[代码][代码]</[代码][代码]view[代码][代码]>[代码]index.js [代码]//index.js[代码][代码]//获取应用实例[代码][代码]const app = getApp()[代码] [代码]Page({[代码][代码] [代码][代码]data: {[代码][代码] [代码][代码]motto: [代码][代码]'Hello World'[代码][代码],[代码][代码] [代码][代码]userInfo: {},[代码][代码] [代码][代码]hasUserInfo: [代码][代码]false[代码][代码],[代码][代码] [代码][代码]canIUse: wx.canIUse([代码][代码]'button.open-type.getUserInfo'[代码][代码]),[代码][代码] [代码][代码]latitude: 0,[代码][代码] [代码][代码]longitude: 0,[代码][代码] [代码][代码]imgUrls: [[代码][代码] [代码][代码]{ src: [代码][代码]'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg'[代码][代码], index: 0 },[代码][代码] [代码][代码]{ src: [代码][代码]'http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg'[代码][代码], index: 1 },[代码][代码] [代码][代码]{ src: [代码][代码]'http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg'[代码][代码], index: 2 }[代码][代码] [代码][代码]],[代码][代码] [代码][代码]indicatorDots: [代码][代码]true[代码][代码],[代码][代码] [代码][代码]autoplay: [代码][代码]false[代码][代码],[代码][代码] [代码][代码]interval: 4000,[代码][代码] [代码][代码]duration: 300[代码][代码] [代码][代码]},[代码][代码] [代码][代码]//事件处理函数[代码][代码] [代码][代码]bindViewTap: [代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]wx.navigateTo({[代码][代码] [代码][代码]url: [代码][代码]'../logs/logs'[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]onLoad: [代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]wx.getLocation({[代码][代码] [代码][代码]type: [代码][代码]'wgs84'[代码][代码],[代码][代码] [代码][代码]altitude: [代码][代码]true[代码][代码],[代码][代码] [代码][代码]success: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]var[代码] [代码]latitude = res.latitude [代码][代码]// 经度[代码][代码] [代码][代码]var[代码] [代码]longitude = res.longitude [代码][代码]// 纬度[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]latitude: latitude,[代码][代码] [代码][代码]longitude: longitude[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail: [代码][代码]function[代码] [代码](res) { },[代码][代码] [代码][代码]complete: [代码][代码]function[代码] [代码](res) { },[代码][代码] [代码][代码]})[代码][代码] [代码][代码]if[代码] [代码](app.globalData.userInfo) {[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]userInfo: app.globalData.userInfo,[代码][代码] [代码][代码]hasUserInfo: [代码][代码]true[代码][代码] [代码][代码]})[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]if[代码] [代码]([代码][代码]this[代码][代码].data.canIUse) {[代码][代码] [代码][代码]// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回[代码][代码] [代码][代码]// 所以此处加入 callback 以防止这种情况[代码][代码] [代码][代码]app.userInfoReadyCallback = res => {[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]userInfo: res.userInfo,[代码][代码] [代码][代码]hasUserInfo: [代码][代码]true[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]{[代码][代码] [代码][代码]// 在没有 open-type=getUserInfo 版本的兼容处理[代码][代码] [代码][代码]wx.getUserInfo({[代码][代码] [代码][代码]success: res => {[代码][代码] [代码][代码]app.globalData.userInfo = res.userInfo[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]userInfo: res.userInfo,[代码][代码] [代码][代码]hasUserInfo: [代码][代码]true[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]},[代码][代码] [代码][代码]getUserInfo: [代码][代码]function[代码] [代码](e) {[代码][代码] [代码][代码]console.log(e)[代码][代码] [代码][代码]app.globalData.userInfo = e.detail.userInfo[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]userInfo: e.detail.userInfo,[代码][代码] [代码][代码]hasUserInfo: [代码][代码]true[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]/*扫一扫 */[代码][代码] [代码][代码]scan: [代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]wx.scanCode({[代码][代码] [代码][代码]success: (res) => {[代码][代码] [代码][代码]console.log(res)[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]/**转发 */[代码][代码] [代码][代码]onShareAppMessage: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]if[代码] [代码](res.from === [代码][代码]'button'[代码][代码]) {[代码][代码] [代码][代码]// 来自页面内转发按钮[代码][代码] [代码][代码]console.log(res.target)[代码][代码] [代码][代码]}[代码][代码] [代码][代码]return[代码] [代码]{[代码][代码] [代码][代码]title: [代码][代码]'Wendy的小程序'[代码][代码],[代码][代码] [代码][代码]success: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]// 转发成功[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]// 转发失败[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}[代码][代码]})[代码]index.wxss [代码]/**index.wxss**/[代码][代码].userinfo {[代码][代码] [代码][代码]display[代码][代码]: flex;[代码][代码] [代码][代码]flex-[代码][代码]direction[代码][代码]: column;[代码][代码] [代码][代码]align-items: [代码][代码]center[代码][代码];[代码][代码]}[代码] [代码].userinfo-avatar {[代码][代码] [代码][代码]width[代码][代码]: [代码][代码]128[代码][代码]rpx;[代码][代码] [代码][代码]height[代码][代码]: [代码][代码]128[代码][代码]rpx;[代码][代码] [代码][代码]margin[代码][代码]: [代码][代码]20[代码][代码]rpx;[代码][代码] [代码][代码]border-radius: [代码][代码]50%[代码][代码];[代码][代码]}[代码] [代码].userinfo-nickname {[代码][代码] [代码][代码]color[代码][代码]: [代码][代码]#aaa[代码][代码];[代码][代码]}[代码] [代码].usermotto {[代码][代码] [代码][代码]margin-top[代码][代码]: [代码][代码]200px[代码][代码];[代码][代码]}[代码][代码]swiper{[代码][代码] [代码][代码]width[代码][代码]: [代码][代码]100%[代码][代码];[代码][代码] [代码][代码]height[代码][代码]: [代码][代码]420[代码][代码]rpx;[代码][代码]}[代码][代码]swiper navigator{[代码][代码] [代码][代码]width[代码][代码]: [代码][代码]100%[代码][代码];[代码][代码] [代码][代码]height[代码][代码]: [代码][代码]100%[代码][代码];[代码][代码] [代码][代码]background-repeat[代码][代码]: [代码][代码]no-repeat[代码][代码];[代码][代码] [代码][代码]background-position[代码][代码]: [代码][代码]center[代码][代码];[代码][代码] [代码][代码]background-[代码][代码]size[代码][代码]: cover;[代码][代码]}[代码]
2018-02-05 - 需求,wxss可以提供编写less的能力吗
需求,wxss可以提供编写less的能力吗?可以弄成可编写less再解析成wxss啊,现在基本没多少人去用css直接编写了啊。或者弄成可以配置的选择编写css还是less啊。
2018-02-05