提交 c0bd179c 编写于 作者: H hulinNeil

更新部分示例

上级 cb3739e3
...@@ -62,9 +62,10 @@ ...@@ -62,9 +62,10 @@
} }
.uni-input { .uni-input {
height: 80px; height: 50px;
min-height: 80px; min-height: 50px;
line-height: 80px; padding: 15px 0;
line-height: 50px;
} }
.uni-label { .uni-label {
...@@ -78,7 +79,7 @@ ...@@ -78,7 +79,7 @@
/*数字角标 */ /*数字角标*/
.uni-badge { .uni-badge {
padding: 4px 14px; padding: 4px 14px;
...@@ -724,13 +725,18 @@ ...@@ -724,13 +725,18 @@
.feedback-textare { .feedback-textare {
height: 200px; height: 200px;
font-size: 34px; font-size: 34px;
line-height: 50px;
width: 100%;
box-sizing: border-box;
padding: 20px 30px 0; padding: 20px 30px 0;
} }
.feedback-input { .feedback-input {
height: 80px;
font-size: 34px; font-size: 34px;
padding-left: 20px; height: 50px;
min-height: 50px;
padding: 15px 20px;
line-height: 50px;
} }
.feedback-uploader { .feedback-uploader {
......
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
"navigationBarTitleText": "发起支付" "navigationBarTitleText": "发起支付"
} }
}, { }, {
"path": "platforms/app-plus/share/share", "path": "pages/API/share/share",
"style": { "style": {
"navigationBarTitleText": "分享" "navigationBarTitleText": "分享"
} }
......
...@@ -169,17 +169,17 @@ ...@@ -169,17 +169,17 @@
name: '发起支付', name: '发起支付',
url: 'request-payment' url: 'request-payment'
}] }]
} }, {
//#ifdef APP-PLUS
, {
id: 'share', id: 'share',
name: '分享', name: '分享',
open: false, open: false,
pages: [{ pages: [{
name: '分享', name: '分享',
url: '/platforms/app-plus/share/share' url: 'share'
}] }]
}, { }
//#ifdef APP-PLUS
, {
id: 'speech', id: 'speech',
name: '语音', name: '语音',
open: false, open: false,
...@@ -204,7 +204,7 @@ ...@@ -204,7 +204,7 @@
}, },
onShareAppMessage() { onShareAppMessage() {
return { return {
title: '欢迎体验uniapp', title: '欢迎体验uni-app',
path: '/pages/API/API' path: '/pages/API/API'
} }
}, },
......
...@@ -21,7 +21,11 @@ ...@@ -21,7 +21,11 @@
uni.showActionSheet({ uni.showActionSheet({
itemList: ['item1', 'item2', 'item3', 'item4'], itemList: ['item1', 'item2', 'item3', 'item4'],
success: (e) => { success: (e) => {
console.log(e.tapIndex) console.log(e.tapIndex);
uni.showToast({
title:"点击了第" + e.tapIndex + "个选项",
icon:"none"
})
} }
}) })
} }
......
...@@ -32,6 +32,9 @@ ...@@ -32,6 +32,9 @@
networkType: '' networkType: ''
} }
}, },
onUnload:function(){
this.networkType = '',this.hasNetworkType = false;
},
methods: { methods: {
getNetworkType: function () { getNetworkType: function () {
uni.getNetworkType({ uni.getNetworkType({
......
...@@ -70,6 +70,9 @@ ...@@ -70,6 +70,9 @@
systemInfo: {} systemInfo: {}
} }
}, },
onUnload:function(){
this.systemInfo = {};
},
methods: { methods: {
getSystemInfo: function () { getSystemInfo: function () {
uni.getSystemInfo({ uni.getSystemInfo({
......
...@@ -24,6 +24,9 @@ ...@@ -24,6 +24,9 @@
result: '' result: ''
} }
}, },
onUnload:function(){
this.result = '';
},
methods: { methods: {
scanCode: function () { scanCode: function () {
var that = this var that = this
...@@ -46,7 +49,7 @@ ...@@ -46,7 +49,7 @@
@import "../../../common/uni.css"; @import "../../../common/uni.css";
.uni-input { .uni-input {
padding: 0 30px; padding: 15px 30px;
word-break: break-all; word-break: break-all;
} }
</style> </style>
...@@ -8,12 +8,14 @@ ...@@ -8,12 +8,14 @@
<textarea class="textarea" v-model="shareText" /> <textarea class="textarea" v-model="shareText" />
</view> </view>
</view> </view>
<!-- #ifdef APP-PLUS -->
<view class="page-section-title">分享链接</view> <view class="page-section-title">分享链接</view>
<view class="page-section"> <view class="page-section">
<view class="textarea-wrp"> <view class="textarea-wrp">
<input class="uni-input" type="text" v-model="href"> <input class="uni-input" type="text" v-model="href">
</view> </view>
</view> </view>
<!-- #endif -->
<view class="page-section-title">分享图片:</view> <view class="page-section-title">分享图片:</view>
<view class="page-section"> <view class="page-section">
<view class="uni-uploader-body"> <view class="uni-uploader-body">
...@@ -21,11 +23,18 @@ ...@@ -21,11 +23,18 @@
<image class="uni-uploader__img" v-if="image" :src="image"></image> <image class="uni-uploader__img" v-if="image" :src="image"></image>
</view> </view>
</view> </view>
<!-- #ifdef APP-PLUS -->
<view class="btn-area" v-if="providerList.length > 0"> <view class="btn-area" v-if="providerList.length > 0">
<block v-for="(value,index) in providerList" :key="index"> <block v-for="(value,index) in providerList" :key="index">
<button type="primary" v-if="value" @tap="share(value)">{{value.name}}</button> <button type="primary" v-if="value" @tap="share(value)">{{value.name}}</button>
</block> </block>
</view> </view>
<!-- #endif -->
<!-- #ifdef MP-WEIXIN -->
<view class="btn-area">
<button type="primary" open-type="share">分享</button>
</view>
<!-- #endif -->
</view> </view>
</view> </view>
...@@ -43,11 +52,19 @@ ...@@ -43,11 +52,19 @@
providerList: [] providerList: []
} }
}, },
onShareAppMessage() {
return {
title: this.shareText ? this.shareText : "欢迎体验uni-app",
path: '/pages/component/component',
imageUrl:this.image ? this.image : 'https://img-cdn-qiniu.dcloud.net.cn/uniapp/app/share-logo@3.png'
}
},
onUnload:function(){ onUnload:function(){
this.shareText='uni-app可以同时发布成原生App、微信小程序,邀请你一起体验!', this.shareText='uni-app可以同时发布成原生App、微信小程序,邀请你一起体验!',
this.href = "https://uniapp.dcloud.io", this.href = "https://uniapp.dcloud.io",
this.image=''; this.image='';
}, },
// #ifdef APP-PLUS
onLoad: function () { onLoad: function () {
uni.getProvider({ uni.getProvider({
service: "share", service: "share",
...@@ -100,6 +117,7 @@ ...@@ -100,6 +117,7 @@
} }
}); });
}, },
// #endif
methods: { methods: {
async share(e) { async share(e) {
console.log("分享通道:", e.id); console.log("分享通道:", e.id);
...@@ -211,7 +229,7 @@ ...@@ -211,7 +229,7 @@
.textarea { .textarea {
border: 2px solid #D8D8D8; border: 2px solid #D8D8D8;
padding: 10px; padding: 10px;
height: 90px; height: 100px;
width: 690px; width: 690px;
} }
.uni-input{ .uni-input{
......
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
<view class="index"> <view class="index">
<view class="index-hd"> <view class="index-hd">
<image class="index-logo" src="../../static/componentIndex.png"></image> <image class="index-logo" src="../../static/componentIndex.png"></image>
<view class="page-section-title">以下将展示uni-app官方组件能力,组件样式仅供参考,开发者可根据自身需求自定义组件样式,具体属性参数详见uni-app开发文档。</view> <view class="page-section-title">
以下将展示uni-app官方组件能力,组件样式仅供参考,开发者可根据自身需求自定义组件样式,具体属性参数详见uni-app开发文档。
</view>
</view> </view>
<view class="uni-card" v-for="(list,index) in lists" :key="index"> <view class="uni-card" v-for="(list,index) in lists" :key="index">
<view class="uni-list"> <view class="uni-list">
...@@ -67,7 +69,7 @@ ...@@ -67,7 +69,7 @@
}, },
onShareAppMessage() { onShareAppMessage() {
return { return {
title: '欢迎体验uniapp', title: '欢迎体验uni-app',
path: '/pages/component/component' path: '/pages/component/component'
} }
}, },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view> <view>
<page-head :title="title"></page-head> <page-head :title="title"></page-head>
<view class="page-body"> <view class="page-body">
<form catchsubmit="formSubmit" catchreset="formReset"> <form @submit="formSubmit" @reset="formReset">
<view class="page-section page-section-gap"> <view class="page-section page-section-gap">
<view class="page-section-title">switch</view> <view class="page-section-title">switch</view>
<switch name="switch" /> <switch name="switch" />
...@@ -73,10 +73,10 @@ ...@@ -73,10 +73,10 @@
this.pickerHidden = false this.pickerHidden = false
}, },
formSubmit: function (e) { formSubmit: function (e) {
console.log('form发生了submit事件,携带数据为:', e.target.value) console.log('form发生了submit事件,携带数据为:' + JSON.stringify(e.detail.value))
}, },
formReset: function (e) { formReset: function (e) {
console.log('form发生了reset事件,携带数据为:', e.target.value) console.log("清空数据")
this.chosen = '' this.chosen = ''
} }
}, },
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<view class="page-section-title">控制输入的input</view> <view class="page-section-title">控制输入的input</view>
<view class="uni-list"> <view class="uni-list">
<view class="uni-list-cell"> <view class="uni-list-cell">
<input class="uni-input" @input="bindReplaceInput" placeholder="连续的两个1会变成2" /> <input class="uni-input" @input="bindReplaceInput" v-model="changeValue" placeholder="连续的两个1会变成2" />
</view> </view>
</view> </view>
</view> </view>
...@@ -106,6 +106,7 @@ ...@@ -106,6 +106,7 @@
inputValue: '', inputValue: '',
showClearIcon: false, showClearIcon: false,
inputClearValue: "", inputClearValue: "",
changeValue:"",
showPassword: true, showPassword: true,
src: "../../../static/eye-1.png" src: "../../../static/eye-1.png"
} }
...@@ -115,24 +116,10 @@ ...@@ -115,24 +116,10 @@
this.inputValue = e.target.value this.inputValue = e.target.value
}, },
bindReplaceInput: function (e) { bindReplaceInput: function (e) {
var value = e.target.value var value = e.target.value;
var pos = e.target.cursor if(value === '11'){
var left this.changeValue = "2";
if (pos !== -1) {
// 光标在中间
left = e.target.value.slice(0, pos)
// 计算光标的位置
pos = left.replace(/11/g, '2').length
} }
// 直接返回对象,可以对输入进行过滤处理,同时可以控制光标的位置
return {
value: value.replace(/11/g, '2'),
cursor: pos
}
// 或者直接返回字符串,光标在最后边
// return value.replace(/11/g,'2'),
}, },
bindHideKeyboard: function (e) { bindHideKeyboard: function (e) {
if (e.target.value === '123') { if (e.target.value === '123') {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</view> </view>
</view> </view>
<view class="btn-area"> <view class="btn-area">
<button @tap="bindSendDanmu" class="page-body-button" formType="submit">发送弹幕</button> <button @tap="bindSendDanmu" class="page-body-button">发送弹幕</button>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
url: 'https://spider.dcloud.net.cn/api/news/36kr/' + this.banner.post_id, url: 'https://spider.dcloud.net.cn/api/news/36kr/' + this.banner.post_id,
success: (data) => { success: (data) => {
if (data.statusCode == 200) { if (data.statusCode == 200) {
this.htmlString = data.data.content.replace(/\\/g, ""); this.htmlString = data.data.content.replace(/\\/g, "").replace(/<img/g,"<img width='100%'");
} }
}, },
fail: () => { fail: () => {
......
...@@ -62,12 +62,10 @@ ...@@ -62,12 +62,10 @@
name: '选项卡', name: '选项卡',
url: 'tabbar' url: 'tabbar'
}, },
//
// { // {
// name: '问题反馈', // name: '问题反馈',
// url: '/platforms/app-plus/feedback/feedback' // url: '/platforms/app-plus/feedback/feedback'
// }, // },
//
{ {
name: '数字选择框', name: '数字选择框',
url: 'number-box' url: 'number-box'
...@@ -80,7 +78,7 @@ ...@@ -80,7 +78,7 @@
}, },
onShareAppMessage() { onShareAppMessage() {
return { return {
title: '欢迎体验uniapp', title: '欢迎体验uni-app',
path: '/pages/template/template' path: '/pages/template/template'
} }
}, },
......
...@@ -5,8 +5,7 @@ ...@@ -5,8 +5,7 @@
<text class="feedback-quick" @tap="chooseMsg">快速键入</text> <text class="feedback-quick" @tap="chooseMsg">快速键入</text>
</view> </view>
<view class="feedback-body"> <view class="feedback-body">
<textarea auto-focus="true" placeholder="请详细描述你的问题和意见..." v-model="sendDate.content" class="feedback-textare" placeholder-class="input-view" <textarea auto-focus="true" placeholder="请详细描述你的问题和意见..." v-model="sendDate.content" class="feedback-textare" />
/>
</view> </view>
<view class='feedback-title'> <view class='feedback-title'>
<text>图片(选填,提供问题截图,总大小10M以下)</text> <text>图片(选填,提供问题截图,总大小10M以下)</text>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册