Commit e5ed18c2 authored by JingChao's avatar JingChao

From

parent 7ca56cb3
......@@ -6,7 +6,7 @@ import Select from '../../components/select/index'
import Notify from '../../components/Dialog/plugins/index'
import HlsModal from '../../components/Modal/index'
import numberKeyboard from '../../components/NumberKeyboard/index'
import NumberKeyboard from '../../components/NumberKeyboard/index'
Vue.use(ToastPlugin)
Vue.use(AlertPlugin)
......@@ -16,7 +16,7 @@ Vue.use(DatetimePlugin)
Vue.use(ActionSheet)
Vue.use(ShowPicture)
Vue.use(Select)
Vue.use(numberKeyboard)
Vue.use(NumberKeyboard)
Vue.use(Notify)
Vue.use(HlsModal)
Vue.prototype.HlsModal = window.HlsModal = HlsModal
......@@ -210,11 +210,11 @@ export default {
}
Vue.$vux.confirm.show(def)
} else {
var alertDismissed = function (index) {
let alertDismissed = function (index) {
confirmObject.onConfirm()
}
let title = confirmObject.title || '提示'
var message = confirmObject.content || ''
let message = confirmObject.content || ''
navigator.notification.alert(
message, // message
alertDismissed, // callback
......@@ -306,6 +306,8 @@ export default {
ShowPicture.show({
imgUrl: imgObject.imgUrl,
width: imgObject.width,
imgList: imgObject.imgList,
startPosition: imgObject.startPosition,
})
}
},
......@@ -364,7 +366,7 @@ export default {
*/
showNumberKeyborad: function (keyboardObject) {
if (typeof keyboardObject === 'object') {
numberKeyboard.show({
NumberKeyboard.show({
title: keyboardObject.title,
closeButtonText: keyboardObject.closeButtonText,
extraKey: keyboardObject.extraKey || '.',
......
......@@ -44,7 +44,7 @@
max-width: 14em;
min-height: 3em !important;
top: 38% !important;
border-radius: 0.14rem !important;
border-radius: 0.3rem !important;
}
.weui-toast.vux-toast-top {
......@@ -73,7 +73,7 @@
.weui-toast_text .weui-toast__content {
border-radius: 0.2rem !important;
padding: 0.12rem 0.14rem;
padding: 0.12rem 0.14rem !important;
}
.weui-toast.vux-toast-bottom {
......
<template>
<section :class="[c(),cusClass,overFlow]" >
<section :class="[cusClass,overFlow]" class="hls-switch-tab" >
<section :style="transform" class="tab-content">
<slot/>
</section>
......@@ -10,7 +10,7 @@ import { base } from '../../common/mixins'
import stabItem from './tab-item'
export default {
name: 'SwitchTab',
name: 'STab',
mixins: [base],
component: { stabItem },
props: {
......
......@@ -98,11 +98,6 @@
.hls-swipe-item {
display: flex;
justify-content: center;
img {
width: auto;
height: auto;
}
}
}
}
......@@ -190,7 +185,7 @@ export default {
this.imgUrl = _options.imgUrl
this.imgTitle = _options.imgTitle
this.width = _options.width
this.imgList = _options.imgList
this.imgList = _options.imgList || []
this.startPosition = _options.startPosition
this.state = 1
if (!this.width) {
......
......@@ -11,7 +11,7 @@
<script>
export default {
name: 'Switch',
name: 'HSwitch',
props: {
value: {
type: Boolean,
......
......@@ -75,7 +75,7 @@ Vue.prototype.$routeGo = routeGo
let hlsExit = function () {
if (vum.Platform.isIOS()) {
cordova.exec(null, null, 'BridgePlugin', 'closeWebView', [])
} else if (vum.Platform.isIOS()) {
} else {
var dict = {
'className': 'WebBridge',
'function': 'close',
......
......@@ -29,7 +29,7 @@ export default {
name: 'FileTest',
data () {
return {
fileList: [{'file': '', content: 'xxx'}], // 文件数组 必填
fileList: [], // 文件数组 必填
disable: false, // 是否禁用文件上传 默认false 可选
accept: 'image/png,image/jpeg', // 接受的文件类型 可选
upload: false, // 选取完成是否自动上传 默认 false 可选
......@@ -37,7 +37,7 @@ export default {
maxCount: 5, // 文件上传数量限制 可选超过数量自动隐藏选择按钮
deleteImage: true, // 是否删除文件 默认true 可选
previewImage: true, // 是否在选取完成后展示预览图 默认true 可选
resultType: 'dataUrl', // 文件读取结果类型 默认base64 可选值为text
resultType: 'dataUrl', // 文件读取结果类型 dataUrl 可选值为text
uploadConfig: { // 文件上传配置
uploadUrl: $config.rootPath + '/app/fileUploadSvc?sysName=HLS_APP&apiName=attachment_upload', // 上传的URL
params: { // 上传的额外参数
......
/**
* @Author think
* @Date 2019-07-16 20:00
*/
<template>
<h-view>
<h-header>
<div slot="left" class="h-header-btn" @click="$hlsExit()">
<i class="ion-ios-arrow-back"/>
</div>
<div slot="center">From</div>
<div slot="right" class="h-header-btn">右边</div>
</h-header>
<h-content>
<section v-for="(com, index) in component" :key="index">
<section v-if="com.name=='tab'">
<s-tab v-if="com.item" :class="com.class">
<tab-item v-for="(tab,key) in com.item" :key="key">{{ tab.name }}</tab-item>
</s-tab>
</section>
<section v-else-if="com.name=='form'">
<list-item v-if="com.fileds" :class="com.class">
<item v-for="(filed, index) in com.fileds" :key="index" :class="filed.class">
<div slot="name" :class="{'required':filed.request}">{{ filed.description }}</div>
<div slot="content">
<input
v-if="filed.type=='input'" v-model="data[com.dataName][filed.name]" :request="filed.request"
:readonly="filed.readonly"
:placeholder="filed.placeholder">
<input
v-if="filed.type=='select'" v-model="data[com.dataName][filed.name+'_n']" readonly="true"
@click="showSelect(filed.selectList,filed.name,com.dataName)">
<input
v-if="filed.type=='time'" v-model="data[com.dataName][filed.name]" readonly="true"
@click="showTime(com.dataName,filed)">
</div>
</item>
</list-item>
</section>
</section>
</h-content>
</h-view>
</template>
<script>
export default {
name: 'Form',
data () {
return {
component: [
{
name: 'tab',
class: '',
item: [
{
name: 'APP',
}, {
name: 'WeiXin',
}, {
name: 'Vue',
},
],
},
{
name: 'form',
readonly: false,
class: '',
dataName: 'person',
fileds: [
{
class: '',
type: 'input',
description: '手机号',
name: 'phone',
defaultValue: '',
request: false,
readonly: false,
placeholder: '请输入手机号',
}, {
class: '',
type: 'input',
description: '姓名',
name: 'name',
defaultValue: 'li',
request: true,
readonly: false,
}, {
class: '',
type: 'select',
description: '性别',
name: 'sex',
defaultValue: 'N',
defaultValueN: '男',
request: false,
readonly: false,
selectList: [{
code: 'man',
code_name: '男',
}, {
code: 'woman',
code_name: '女',
}],
}, {
class: '',
type: 'time',
description: '出生时间',
name: 'brithDay',
defaultValue: '2003-05-26',
request: true,
format: 'yyyy-mm-dd',
},
],
},
],
data: {},
}
},
created () {
let vm = this
vm.component.forEach((com, index) => {
if (com.name === 'form') {
let form = com
let temp = {
readonly: form['readonly'],
}
if (form.fileds.length) {
let fileds = form.fileds
fileds.forEach((filed, index) => {
temp[filed.name] = filed.defaultValue
if (filed.type === 'select') {
temp[filed.name + '_n'] = filed.defaultValueN
}
})
vm.$set(this.data, [form.dataName], temp)
}
}
})
},
methods: {
showSelect (list, code, dataName) {
let vm = this
vm.hlsPopup.selectList({
list: list,
code: code,
object: {},
returnItem (index, obj) {
vm.data[dataName][code] = list[index].code
vm.data[dataName][code + '_n'] = list[index].code_name
},
})
},
showTime (dataName, filed) {
let vm = this
vm.hlsPopup.showTime({
format: filed.format,
callback (value) {
vm.data[dataName][filed.name] = value
},
})
},
},
}
</script>
<style scoped lang="less">
</style>
......@@ -365,13 +365,13 @@ export default {
this.hlsPopup.hideLoading()
},
showLongTop () {
this.hlsPopup.showLongTop('操作成功操作成功操作成功操作成功操作成功操作成功操作成功操作成功操作成功')
this.hlsPopup.showLongTop('操作成功操作成功')
},
showLongCenter () {
this.hlsPopup.showLongCenter('操作成功操作成功操作成功')
this.hlsPopup.showLongCenter('操作成功操作成功')
},
showLongBottom () {
this.hlsPopup.showLongBottom('操作成功操作成功操作成功操作成功')
this.hlsPopup.showLongBottom('操作成功操作成功')
},
showSuccess () {
this.hlsPopup.showSuccess('操作成功')
......
......@@ -7,6 +7,7 @@ import Home from '@/pages/home'
import HlsPopup from '@/pages/hlsPopup'
import Radio from '@/pages/radioTest'
import HFile from '@/pages/fileTest'
import Form from '@/pages/form'
Vue.use(Router)
......@@ -21,6 +22,7 @@ export default new Router({
{path: '/hls-popup', component: HlsPopup, name: 'HlsPopup', meta: {keepAlive: false}},
{path: '/Radio', component: Radio, name: 'Radio', meta: {keepAlive: true}},
{path: '/HFile', component: HFile, name: 'HFile', meta: {keepAlive: true}},
{path: '/Form', component: Form, name: 'Form', meta: {keepAlive: true}},
],
scrollBehavior (to, from, savedPosition) {
if (to.hash) {
......
......@@ -298,6 +298,8 @@ export default {
ShowPicturePlugin.show({
imgUrl: imgObject.imgUrl,
width: imgObject.width,
imgList: imgObject.imgList || [],
startPosition: imgObject.startPosition,
})
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment