-
Notifications
You must be signed in to change notification settings - Fork 2.2k
fix: Swiper component modifies skyline rendering mode #162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
7c26c79
6664ec3
fef90e8
c12a241
b0a83ec
4cf213b
27e1c81
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"navigationBarTitleText": "progress", | ||
"navigationStyle": "custom" | ||
"navigationStyle": "default", | ||
"renderer": "webview" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
{ | ||
"navigationBarTitleText": "rich-text", | ||
"renderer": "webview" | ||
"componentFramework": "glass-easel", | ||
"renderer": "skyline", | ||
"navigationStyle": "custom" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
const htmlSnip = | ||
`<div class="div_class"> | ||
<h1>Title</h1> | ||
<p class="p"> | ||
Life is <i>like</i> a box of | ||
<b> chocolates</b>. | ||
</p> | ||
</div> | ||
` | ||
Page({ | ||
data: { | ||
theme: 'light', | ||
disableContextMenu: true, | ||
showBtn: false, | ||
btnX: 0, | ||
btnY: 0, | ||
selectedString: '', | ||
htmlSnip, | ||
}, | ||
onShareAppMessage() { | ||
return { | ||
title: 'selection', | ||
path: 'packageComponent/pages/content/selection/selection' | ||
} | ||
}, | ||
onUnload() { | ||
if (wx.offThemeChange) { | ||
wx.offThemeChange() | ||
} | ||
}, | ||
onLoad() { | ||
this.setData({ | ||
theme: wx.getSystemInfoSync().theme || 'light' | ||
}) | ||
|
||
if (wx.onThemeChange) { | ||
wx.onThemeChange(({theme}) => { | ||
this.setData({theme}) | ||
}) | ||
} | ||
}, | ||
selectionChangeHandler(e) { | ||
const selection = e.detail | ||
if (selection.isCollapsed === false) { | ||
this.setData({ | ||
showBtn: true, | ||
selectedString: e.detail.selectedString, | ||
btnX: e.detail.firstRangeRect.x, | ||
btnY: e.detail.firstRangeRect.y, | ||
}) | ||
} else { | ||
this.setData({ | ||
showBtn: false | ||
}) | ||
} | ||
}, | ||
copySelectedString() { | ||
wx.setClipboardData({ | ||
data: this.data.selectedString, | ||
success() { | ||
wx.getClipboardData({ | ||
success(res) { | ||
wx.showToast({ | ||
title: `复制成功:${res.data}` | ||
}) | ||
} | ||
}) | ||
} | ||
}) | ||
} | ||
}) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"navigationBarTitleText": "selection", | ||
"renderer": "webview" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<import src="../../../../common/head.wxml" /> | ||
<import src="../../../../common/foot.wxml" /> | ||
<view class="container page" data-weui-theme="{{theme}}"> | ||
<template is="head" data="{{title: 'selection'}}" /> | ||
<view class="content"> | ||
<scroll-view class="scroll-area" type="list"> | ||
<text id="before-text" user-select="{{true}}">在 wx-selection 之前的 text</text> | ||
<selection bind:selectionchange="selectionChangeHandler" disable-context-menu="{{false}}"> | ||
<text id="text-wrap" user-select="{{true}}"> | ||
<text id="text-1">2011年1月,微信1.0发布。同年5月,微信2.0语音对讲发布</text> | ||
<text id="text-2"> | ||
10月,微信3.0新增摇一摇功能 | ||
<text id="text-3">2012年3月,微信用户突破1亿。4月份,微信4.0朋友圈发布</text> | ||
</text> | ||
<text id="text-4">同年7月,微信4.2发布公众平台。2013年8月,微信5.0发布微信支付。</text> | ||
</text> | ||
<text id="text-wrap2" user-select="{{true}}">2014年9月,企业号发布。同月,发布微信卡包</text> | ||
<text id="text-wrap3" user-select="{{false}}"> | ||
<text id="text-31" user-select="{{true}}">2015年1月,微信第一条朋友圈广告</text> | ||
</text> | ||
<view> | ||
<text id="view-text" user-select="{{true}}">2016年1月,企业微信发布,2017年1月,小程序发布</text> | ||
</view> | ||
<rich-text id="rich-text-1" user-select="{{true}}">rich-text</rich-text> | ||
<rich-text id="rich-text-2" user-select="{{true}}" nodes="{{htmlSnip}}"></rich-text> | ||
</selection> | ||
<text id="before-text" user-select="{{true}}">在 wx-selection 之后的 text</text> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 去掉 wx-,正式组件名是 selection |
||
</scroll-view> | ||
</view> | ||
<view class="button" wx:if="{{showBtn}}" bind:tap="copySelectedString" style="top:{{btnY - 50}}px;left:{{btnX}}px"> | ||
点我复制到系统 | ||
</view> | ||
<template is="foot" /> | ||
</view> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
.scroll-area { | ||
flex: 1; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 代码缩进不对 |
||
overflow-y: hidden; | ||
} | ||
.content{ | ||
flex: 1; | ||
padding:0 20px | ||
} | ||
.intro { | ||
padding: 30px; | ||
text-align: center; | ||
} | ||
|
||
.button { | ||
position: absolute; | ||
background-color: #1aad19; | ||
color: white; | ||
width: 120px; | ||
padding: 10px 20px; | ||
font-size: 16px; | ||
border-radius: 5px; | ||
cursor: pointer; | ||
transition: background-color 0.3s; | ||
} | ||
|
||
.button:hover { | ||
background-color: #159e14; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,6 +59,12 @@ const pageObject = { | |
} | ||
}) | ||
}, | ||
handleChooseavatar(e) { | ||
console.log('handleChooseavatar', e); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这里没有从界面显示出来的话,可以加个 showModel 把 url 提示出来 |
||
}, | ||
launchAppError(e) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个也连同去掉吧 |
||
console.log('launchAppError', e.detail.errMsg) | ||
}, | ||
onUnload() { | ||
if (wx.offThemeChange) { | ||
wx.offThemeChange() | ||
|
@@ -70,8 +76,8 @@ const pageObject = { | |
}) | ||
|
||
if (wx.onThemeChange) { | ||
wx.onThemeChange(({theme}) => { | ||
this.setData({theme}) | ||
wx.onThemeChange(({ theme }) => { | ||
this.setData({ theme }) | ||
}) | ||
} | ||
if (wx.getUserProfile) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,8 +34,11 @@ | |
<button type="primary" open-type="contact" bindcontact="handleContact" show-message-card="{{true}}" send-message-title="临时会话">打开客服会话</button> | ||
<button type="primary" open-type="share">触发用户转发</button> | ||
<button type="primary" open-type="getPhoneNumber" bindgetphonenumber="handleGetPhoneNumber">获取用户手机号</button> | ||
<button type="primary" open-type="getRealtimePhoneNumber">用户手机号实时验证</button> | ||
<button wx:if="{{canIUseGetUserProfile}}" type="primary" lang="zh_CN" bindtap="handleGetUserProfile"> 获取用户信息 </button> | ||
<button wx:else type="primary" open-type="getUserInfo" lang="zh_CN" bindgetuserinfo="handleGetUserInfo">获取用户信息</button> | ||
<button type="primary" open-type="chooseAvatar" bindchooseavatar="handleChooseavatar">获取用户头像</button> | ||
<button type="primary" open-type="launchApp" app-parameter="wechat" binderror="launchAppError">打开APP</button> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个应该打开不了,可以去掉 |
||
<button type="primary" open-type="openSetting" bindopensetting="handleOpenSetting">打开设置授权页</button> | ||
<button type="primary" open-type="feedback">打开意见反馈</button> | ||
</view> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
{ | ||
"navigationBarTitleText": "checkbox", | ||
"renderer": "webview" | ||
} | ||
"componentFramework": "glass-easel", | ||
"renderer": "skyline", | ||
"disableScroll": true, | ||
"navigationStyle": "custom" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,35 @@ | ||
<import src="../../../../common/head.wxml" /> | ||
<import src="../../../../common/foot.wxml" /> | ||
|
||
<view class="container page" data-weui-theme="{{theme}}"> | ||
<template is="head" data="{{title: 'checkbox'}}"/> | ||
|
||
<view class="page-body"> | ||
<view class="page-section page-section-gap"> | ||
<view class="page-section-title">默认样式</view> | ||
<label class="checkbox"> | ||
<checkbox value="cb" checked="true"/>选中 | ||
</label> | ||
<label class="checkbox"> | ||
<checkbox value="cb" />未选中 | ||
</label> | ||
</view> | ||
|
||
<view class="page-section"> | ||
<view class="page-section-title">推荐展示样式</view> | ||
<view class="weui-cells weui-cells_after-title"> | ||
<checkbox-group bindchange="checkboxChange"> | ||
<label class="weui-cell weui-check__label" wx:for="{{items}}" wx:key="{{item.value}}"> | ||
<view class="weui-cell__hd"> | ||
<checkbox value="{{item.value}}" checked="{{item.checked}}"/> | ||
</view> | ||
<view class="weui-cell__bd">{{item.name}}</view> | ||
</label> | ||
</checkbox-group> | ||
<mp-navigation-bar title="checkbox" back="{{true}}"></mp-navigation-bar> | ||
<scroll-view class="page-scroll-view" scroll-y type="list"> | ||
<view class="container page" data-weui-theme="{{theme}}"> | ||
<template is="head" data="{{title: 'checkbox'}}" /> | ||
<view class="page-body"> | ||
<view class="page-section page-section-gap"> | ||
<view class="page-section-title">默认样式</view> | ||
<label class="checkbox"> | ||
<checkbox value="cb" checked="true" /> | ||
选中 | ||
</label> | ||
<label class="checkbox"> | ||
<checkbox value="cb" /> | ||
未选中 | ||
</label> | ||
</view> | ||
<view class="page-section"> | ||
<view class="page-section-title">推荐展示样式</view> | ||
<view class="weui-cells weui-cells_after-title"> | ||
<checkbox-group bindchange="checkboxChange"> | ||
<label class="weui-cell weui-check__label" wx:for="{{items}}" wx:key="{{item.value}}"> | ||
<view class="weui-cell__hd"> | ||
<checkbox value="{{item.value}}" checked="{{item.checked}}" /> | ||
</view> | ||
<view class="weui-cell__bd">{{item.name}}</view> | ||
</label> | ||
</checkbox-group> | ||
</view> | ||
</view> | ||
</view> | ||
<template is="foot" /> | ||
</view> | ||
|
||
<template is="foot" /> | ||
</view> | ||
</scroll-view> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
@import "../../../../common/reset.wxss"; | ||
@import '../../../../common//lib/weui.wxss'; | ||
.checkbox{ | ||
margin-right: 10px; | ||
} | ||
.page-section-content{ | ||
padding: 0 20px; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
{ | ||
"navigationBarTitleText": "form", | ||
"renderer": "webview" | ||
} | ||
"componentFramework": "glass-easel", | ||
"renderer": "skyline", | ||
"navigationStyle": "custom" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个文件的缩进有问题