提交 82062827 编写于 作者: W wanganxp

微调

上级 3834c04f
......@@ -715,21 +715,21 @@
}
},
{
"path": "pages/component/list-news/list",
"path": "pages/template/list-news/list-news",
"style": {
"navigationBarTitleText": "列表到详情示例"
}
},
{
"path": "pages/API/get-network-type/get-network-type",
"path": "pages/template/list-news/detail/detail",
"style": {
"navigationBarTitleText": ""
"navigationBarTitleText": "详情示例"
}
},
{
"path": "pages/component/list-news/detail/detail",
"path": "pages/API/get-network-type/get-network-type",
"style": {
"navigationBarTitleText": "详情示例"
"navigationBarTitleText": ""
}
},
{
......
......@@ -4,8 +4,7 @@
<view class="uni-list">
<radio-group @change="radioChange">
<radio class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in items" :key="item.value"
:class="index < items.length - 1 ? 'uni-list-cell-line': ''" :value="item.value"
:checked="index === current">
:class="index < items.length - 1 ? 'uni-list-cell-line': ''" :value="item.value" :checked="index === current">
{{item.name}}
</radio>
</radio-group>
......@@ -13,15 +12,15 @@
<view class="uni-list">
<view class="uni-list-cell uni-list-cell-pd">
<view class="uni-list-cell-db">自定义itemColor</view>
<switch :checked="itemColorCustom" @change="itemColorChange"/>
<switch :checked="itemColorCustom" @change="itemColorChange" />
</view>
<view class="uni-list-cell uni-list-cell-pd">
<view class="uni-list-cell-db">超长列表文本</view>
<switch :checked="itemContentLarge" @change="itemContentLargeChange"/>
<view class="uni-list-cell-db">超长文本和空文本item</view>
<switch :checked="itemContentLarge" @change="itemContentLargeChange" />
</view>
<view class="uni-list-cell uni-list-cell-pd">
<view class="uni-list-cell-db">大量选项</view>
<switch :checked="itemNumLargeSelect" @change="itemNumLargeChange"/>
<view class="uni-list-cell-db">超过6个item</view>
<switch :checked="itemNumLargeSelect" @change="itemNumLargeChange" />
</view>
</view>
<view class="uni-padding-wrap">
......@@ -40,9 +39,9 @@
data() {
return {
title: 'action-sheet',
itemColorCustom:false,
itemContentLarge:false,
itemNumLargeSelect:false,
itemColorCustom: false,
itemContentLarge: false,
itemNumLargeSelect: false,
items: [{
value: '标题',
name: '有标题'
......@@ -57,20 +56,8 @@
}
] as ItemType[],
current: 0,
// #ifdef H5
buttonRect: {},
// #endif
}
},
// #ifdef H5
onReady() {
this.getNodeInfo()
window.addEventListener('resize', this.getNodeInfo)
},
beforeDestroy() {
window.removeEventListener('resize', this.getNodeInfo)
},
// #endif
methods: {
radioChange(e : RadioGroupChangeEvent) {
for (let i = 0; i < this.items.length; i++) {
......@@ -93,9 +80,9 @@
let itemInfo = ['item1', 'item2', 'item3', 'item4']
if(this.itemContentLarge){
if (this.itemContentLarge) {
itemInfo = ['两个黄鹂鸣翠柳,一行白鹭上青天。窗含西岭千秋雪,门泊东吴万里船', '水光潋滟晴方好,山色空蒙雨亦奇。 欲把西湖比西子,淡妆浓抹总相宜', '']
}else if(this.itemNumLargeSelect){
} else if (this.itemNumLargeSelect) {
// 大量选项测试,不能超过6个元素 https://uniapp.dcloud.net.cn/api/ui/prompt.html#showactionsheet
itemInfo = []
for (var i = 1; i <= 10; i++) {
......@@ -104,18 +91,11 @@
}
const that = this
if(this.itemColorCustom){
if (this.itemColorCustom) {
uni.showActionSheet({
title: this.items[this.current].value,
itemList: itemInfo,
itemColor:"#ff00ff",
// #ifdef H5
popover: {
// 104: navbar + topwindow 高度,暂时 fix createSelectorQuery 在 pc 上获取 top 不准确的 bug
top: that.buttonRect.top + 104 + that.buttonRect.height,
left: that.buttonRect.left + that.buttonRect.width / 2
},
// #endif
itemColor: "#ff00ff",
success: (e) => {
console.log(e.tapIndex);
uni.showToast({
......@@ -127,17 +107,10 @@
console.log(e);
}
})
}else{
} else {
uni.showActionSheet({
title: this.items[this.current].value,
itemList: itemInfo,
// #ifdef H5
popover: {
// 104: navbar + topwindow 高度,暂时 fix createSelectorQuery 在 pc 上获取 top 不准确的 bug
top: that.buttonRect.top + 104 + that.buttonRect.height,
left: that.buttonRect.left + that.buttonRect.width / 2
},
// #endif
success: (e) => {
console.log(e.tapIndex);
uni.showToast({
......@@ -154,20 +127,7 @@
}
})
}
},
// #ifdef H5
getNodeInfo() {
uni.createSelectorQuery().select('.target').boundingClientRect().exec((ret) => {
const rect = ret[0]
if (rect) {
this.buttonRect = rect
}
});
}
// #endif
}
}
</script>
......@@ -3,7 +3,7 @@
<scroll-view>
<!-- #endif -->
<view>
<page-head :title="title"></page-head>
<page-head title="rich-text-complex"></page-head>
<view class="uni-padding-wrap uni-common-mt">
<rich-text :nodes="htmlString" @itemclick="itemClick"></rich-text>
</view>
......@@ -17,21 +17,21 @@
export default {
data() {
return {
title: 'rich-text-complex',
htmlString: '<p><a href="https://www.dcloud.io/hbuilderx.html">HBuilderX</a><br/><img src="https://web-assets.dcloud.net.cn/unidoc/zh/uni@2x.png"></img><h1>HBuilderX,轻巧、极速,极客编辑器</h1><p style="color:red;"><small>HBuilderX,轻巧、极速,极客编辑器 </small><big>HBuilderX,轻巧、极速,极客编辑器</big><strong>HBuilderX,轻巧、极速,极客编辑器</strong><i>HBuilderX,轻巧、极速,极客编辑器 </i><u>HBuilderX,轻巧、极速,极客编辑器</u><del>HBuilderX,轻巧、极速,极客编辑器</del></p><h2>uni-app x,终极跨平台方案</h2>、<p style="background-color: yellow;"><small>uni-app x,终极跨平台方案 </small><big>uni-app x,终极跨平台方案</big><strong>uni-appx,终极跨平台方案 </strong><i>uni-app x,终极跨平台方案 </i><u>uni-app x,终极跨平台方案 </u><del>uni-appx,终极跨平台方案</del></p><h3>uniCloud,js serverless云服务</h3><p style="text-decoration: line-through;"><small>uniCloud,js serverless云服务 </small><big>uniCloud,jsserverless云服务</big><strong>uniCloud,js serverless云服务 </strong><i>uniCloud,js serverless云服务 </i><u>uniCloud,jsserverless云服务</u><del>uniCloud,js serverless云服务</del></p><h4>uts,大一统语言</h4><p style="text-align: center;"><small>uts,大一统语言 </small><big>uts,大一统语言 </big><strong>uts,大一统语言</strong><i>uts,大一统语言</i><u>uts,大一统语言 </u><del>uts,大一统语言</del></p><h5>uniMPSdk,让你的App具备小程序能力</h5><h6>uni-admin,开源、现成的全端管理后台</h6><ul><li style="color: red; text-align: left;">uni-app x,终极跨平台方案</li><li style="color: green; text-align: center;">uni-app x,终极跨平台方案</li><li style="color: blue; text-align: right;">uni-app x,终极跨平台方案</li></ul><a href="https://uniapp.dcloud.net.cn">uni-app</a><br/><img src="https://web-assets.dcloud.net.cn/unidoc/zh/uni@2x.png"></img></p>'
}
},
methods: {
itemClick(e : RichTextItemClickEvent) {
console.log(JSON.stringify(e.detail));
let title = '';
let clicktext = '';
if (e.detail.src != null) {
title = '点击了图片,src = ' + e.detail.src;
clicktext = '点击了图片,src = ' + e.detail.src;
} else if (e.detail.href != null) {
title = '点击了链接,href = ' + e.detail.href;
clicktext = '点击了链接,href = ' + e.detail.href;
}
uni.showModal({
title: title
content:clicktext,
showCancel:false
});
}
}
......
......@@ -2,7 +2,7 @@
<!-- #ifdef APP -->
<scroll-view>
<!-- #endif -->
<page-head :title="title"></page-head>
<page-head title="rich-text-tags"></page-head>
<view class="uni-padding-wrap uni-common-mt">
<view class="uni-title">
<text class="uni-title-text">支持的HTML标签</text>
......@@ -23,7 +23,6 @@
export default {
data() {
return {
title: 'rich-text-tags',
data: [
{
name: '<br/>',
......@@ -301,14 +300,15 @@
methods: {
itemClick(e : RichTextItemClickEvent) {
console.log(JSON.stringify(e.detail));
let title = '';
let clicktext = '';
if (e.detail.src != null) {
title = '点击了图片,src = ' + e.detail.src;
clicktext = '点击了图片,src = ' + e.detail.src;
} else if (e.detail.href != null) {
title = '点击了链接,href = ' + e.detail.href;
clicktext = '点击了链接,href = ' + e.detail.href;
}
uni.showModal({
title: title
content:clicktext,
showCancel:false
});
}
}
......
......@@ -130,10 +130,9 @@
{
id: 'network',
name: '网络',
open: false,
pages: [
{
name: '发起一个请求',
name: '发起请求request',
url: 'request',
},
{
......@@ -158,10 +157,6 @@
url: 'websocket-global',
api: ["connectSocket", "onSocketOpen", "onSocketError", "sendSocketMessage", "onSocketMessage", "closeSocket", "onSocketClose"]
},
{
name: '请求云函数',
url: 'call-function',
},
] as Page[],
},
{
......@@ -348,7 +343,6 @@
{
id: 'location',
name: '位置',
open: false,
pages: [
{
name: '获取当前位置',
......@@ -375,7 +369,6 @@
{
id: 'storage',
name: '数据存储',
open: false,
pages: [
{
name: 'storage(key-value存储)',
......@@ -384,6 +377,16 @@
},
] as Page[],
},
{
id: 'unicloud',
name: 'uniCloud',
pages: [
{
name: '云函数',
url: 'call-function',
},
] as Page[],
},
/* {
id: "rewarded-video-ad",
url: "rewarded-video-ad",
......
......@@ -87,14 +87,6 @@ export default {
enable: false
},
*/
{
name: 'list(新闻)',
url: '/pages/component/list-news/list',
},
// {
// name: 'list',
// url: '/pages/component/long-list/long-list',
// },
{
name: 'list-view',
},
......
......@@ -88,6 +88,13 @@ export default {
enable: true,
pages: [] as Page[],
},
{
id: 'list-news',
url: 'list-news',
name: '列表到详情',
open: false,
pages: [] as Page[],
},
{
id: 'scroll-fold-nav',
url: 'scroll-fold-nav',
......@@ -100,16 +107,16 @@ export default {
url: 'swiper-list',
name: 'swiper-list',
open: false,
enable: true,
pages: [] as Page[],
pages: [
{
name: '下划线样式',
url:'swiper-list'
},
{
id: 'swiper-list2',
url: 'swiper-list2',
name: 'swiper-list2',
open: false,
enable: true,
pages: [] as Page[],
name: '字体放大样式',
url:'swiper-list2'
},
] as Page[],
},
{
id: 'custom-refresher',
......
......@@ -122,7 +122,7 @@
const cover = detail.cover;
const title = detail.title;
uni.navigateTo({
url: '/pages/component/list-news/detail/detail?post_id=' + post_id + "&cover=" + cover + "&title=" + title
url: '/pages/template/list-news/detail/detail?post_id=' + post_id + "&cover=" + cover + "&title=" + title
});
},
bannerClick(e:Banner){
......@@ -131,7 +131,7 @@
const cover = detail.cover;
const title = detail.title;
uni.navigateTo({
url: '/pages/component/list-news/detail/detail?post_id=' + post_id + "&cover=" + cover + "&title=" + title
url: '/pages/template/list-news/detail/detail?post_id=' + post_id + "&cover=" + cover + "&title=" + title
});
},
setTime(items: UTSJSONObject[]): Item[] {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册