Skip to content

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

Merged
merged 7 commits into from
Mar 18, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions miniprogram/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,15 @@
"pages/view/sticky/sticky-section/sticky-section",
"pages/view/movable-view/movable-view",
"pages/view/cover-view/cover-view",
"pages/view/cover-image/cover-image",
"pages/view/match-media/match-media",
"pages/view/page-container/page-container",
"pages/view/sticky/sticky",
"pages/content/text/text",
"pages/content/icon/icon",
"pages/content/progress/progress",
"pages/content/rich-text/rich-text",
"pages/content/selection/selection",
"pages/form/button/button",
"pages/form/checkbox/checkbox",
"pages/form/form/form",
Expand Down
3 changes: 2 additions & 1 deletion miniprogram/components/popup/index.wxss
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ root-portal {
.popup {
position: absolute;
bottom: 0;
top: 0;
z-index: 5000;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
width: 100vw;
height: 200px;
/* height: 200px; */
background: rgba(51, 51, 51, 0.65);
opacity: 1;
transform: scale3d(1, 1, 1);
Expand Down
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
Expand Up @@ -3,7 +3,6 @@

<view class="container page" data-weui-theme="{{theme}}">
<template is="head" data="{{title: 'progress'}}"/>

<view class="page-body">
<view class="page-section page-section-gap">

Expand Down
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
@@ -1,14 +1,15 @@
<import src="../../../../common/head.wxml" />
<import src="../../../../common/foot.wxml" />

<mp-navigation-bar title="rich-text" 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: 'rich-text'}}"/>

<view class="page-body">
<view class="page-section">
<view class="page-section-title">通过HTML String渲染</view>
<view class="page-content">
<scroll-view scroll-y>{{htmlSnip}}</scroll-view>
<scroll-view class="page-scroll" scroll-y>{{htmlSnip}}</scroll-view>
<button type="primary" bindtap="renderHtml">渲染HTML</button>
<block wx:if="{{renderedByHtml}}">
<rich-text nodes="{{htmlSnip}}"></rich-text>
Expand All @@ -19,7 +20,7 @@
<view class="page-section">
<view class="page-section-title">通过节点渲染</view>
<view class="page-content">
<scroll-view scroll-y>{{nodeSnip}}</scroll-view>
<scroll-view class="page-scroll" scroll-y>{{nodeSnip}}</scroll-view>
<button type="primary" bindtap="renderNode">渲染Node</button>
<block wx:if="{{renderedByNode}}">
<rich-text nodes="{{nodes}}"></rich-text>
Expand All @@ -30,3 +31,4 @@

<template is="foot" />
</view>
</scroll-view>
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@import "../../../../common/reset.wxss";
.page-content {
width: auto;
margin: 15px 0;
Expand Down Expand Up @@ -25,7 +26,7 @@
width: 5px;
}

scroll-view {
.page-scroll {
height: 325px;
border: 1px solid #1AAD19;
white-space: pre;
Expand Down
72 changes: 72 additions & 0 deletions miniprogram/packageComponent/pages/content/selection/selection.js
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&nbsp;<i>like</i>&nbsp;a box of
<b>&nbsp;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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个文件的缩进有问题

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>
Copy link
Contributor

Choose a reason for hiding this comment

The 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;
Copy link
Contributor

Choose a reason for hiding this comment

The 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;
}
1 change: 0 additions & 1 deletion miniprogram/packageComponent/pages/content/text/text.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<block wx:for="{{extraLine}}">
<text>{{item}}</text>
</block>
<!-- <text>{{text}}</text> -->
</view>
<button disabled="{{!canAdd}}" bindtap="add">add line</button>
<button disabled="{{!canRemove}}" bindtap="remove">remove line</button>
Expand Down
10 changes: 8 additions & 2 deletions miniprogram/packageComponent/pages/form/button/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ const pageObject = {
}
})
},
handleChooseavatar(e) {
console.log('handleChooseavatar', e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里没有从界面显示出来的话,可以加个 showModel 把 url 提示出来

},
launchAppError(e) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个也连同去掉吧

console.log('launchAppError', e.detail.errMsg)
},
onUnload() {
if (wx.offThemeChange) {
wx.offThemeChange()
Expand All @@ -70,8 +76,8 @@ const pageObject = {
})

if (wx.onThemeChange) {
wx.onThemeChange(({theme}) => {
this.setData({theme})
wx.onThemeChange(({ theme }) => {
this.setData({ theme })
})
}
if (wx.getUserProfile) {
Expand Down
3 changes: 3 additions & 0 deletions miniprogram/packageComponent/pages/form/button/button.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Copy link
Contributor

Choose a reason for hiding this comment

The 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>
Expand Down
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"
}
59 changes: 30 additions & 29 deletions miniprogram/packageComponent/pages/form/checkbox/checkbox.wxml
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;
}
6 changes: 4 additions & 2 deletions miniprogram/packageComponent/pages/form/form/form.json
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"
}
Loading