Commit 376b4247 authored by Facius's avatar Facius
parents b4d6820e 4ba29899
...@@ -55,7 +55,10 @@ export default [{ ...@@ -55,7 +55,10 @@ export default [{
"cat": 10 "cat": 10
}, },
{ {
"fieldsTitle": "连衣裙", "fieldsTitle": "充电桩编码",
"fieldsName": "scan",
"fieldsType": "scan",
"required": true,
"key": "连衣裙", "key": "连衣裙",
"icon": "https://cdn.uviewui.com/uview/common/classify/1/7.jpg", "icon": "https://cdn.uviewui.com/uview/common/classify/1/7.jpg",
"cat": 10 "cat": 10
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
// 直接打开相册 // 直接打开相册
let config = { let config = {
options:{ options:{
consourceType:['album'],//['album', 'camera'] sourceType:['album'],//['album', 'camera']
} }
} }
await this.chooseImage('qiniu',config) await this.chooseImage('qiniu',config)
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<script> <script>
import objMixin from './objMixin' import objMixin from './objMixin'
export default { export default {
name: 'XhRadio', name: 'XhLocation',
components: {}, components: {},
mixins: [objMixin], mixins: [objMixin],
props: {}, props: {},
......
<template>
<view class="">
<view class="u-flex">
请输入:<u-input class="u-flex-1" v-model="dataValue" @input="valueChange" type="text" />
</view>
<view class="u-flex" @click="scanCode">
<view class="txt u-flex-1">扫描二维码(仅挚达充电桩可扫描)</view>
<u-icon name="arrow-right" color="#666" size="28"></u-icon>
</view>
</view>
</template>
<script>
import stringMixin from './stringMixin'
export default {
name: 'XhScan',
components: {},
mixins: [stringMixin],
props: {},
filters:{},
data() {
return {}
},
computed: {
valueTxt() {
let str = ''
const dataValue = this.dataValue
if(dataValue && dataValue.length>1){
str = '经度:'+dataValue[0]+','+'维度:'+dataValue[1]
}
return str
}
},
watch: {},
mounted() {},
methods: {
scanCode(type){
const self = this
// qrCode 二维码;barCode 条形码
let scanType = type && [type] || ['qrCode']
uni.scanCode({
// scanType: scanType,
success: function (res) {
self.dataValue = res.result
self.valueChange(res.result)
// console.log('条码类型:' + res.scanType);
// console.log('条码内容:' + res.result);
}
});
},
// setValue(txt) {
// this.valueChange(this.dataValue)
// }
}
}
</script>
<style lang="scss" scoped>
.required {
padding-right: 10rpx;
font-size: 28rpx;
line-height: 40rpx;
color: #fa3534;
}
</style>
...@@ -48,6 +48,9 @@ ...@@ -48,6 +48,9 @@
<xh-location v-else-if="toLowerCase(item.fieldsType)==='location'" :groupIndex="groupIndex" <xh-location v-else-if="toLowerCase(item.fieldsType)==='location'" :groupIndex="groupIndex"
:itemIndex="itemIndex" :item="item" @value-change="fieldValueChange"> :itemIndex="itemIndex" :item="item" @value-change="fieldValueChange">
</xh-location> </xh-location>
<xh-scan v-else-if="toLowerCase(item.fieldsType)==='scan'" :groupIndex="groupIndex"
:itemIndex="itemIndex" :item="item" @value-change="fieldValueChange">
</xh-scan>
</template> </template>
</u-form-item> </u-form-item>
</view> </view>
...@@ -67,6 +70,7 @@ ...@@ -67,6 +70,7 @@
import XhSelect from '@/components/createCom/XhSelect.vue' import XhSelect from '@/components/createCom/XhSelect.vue'
import XhFiles from '@/components/createCom/XhFiles.vue' import XhFiles from '@/components/createCom/XhFiles.vue'
import XhLocation from '@/components/createCom/XhLocation.vue' import XhLocation from '@/components/createCom/XhLocation.vue'
import XhScan from '@/components/createCom/XhScan.vue'
// import XhRadio from '@/components/createCom/XhRadio.vue' // import XhRadio from '@/components/createCom/XhRadio.vue'
export default { export default {
data() { data() {
...@@ -120,7 +124,8 @@ ...@@ -120,7 +124,8 @@
XhCheckbox, XhCheckbox,
XhSelect, XhSelect,
XhFiles, XhFiles,
XhLocation XhLocation,
XhScan
// formCom // formCom
}, },
created() { created() {
......
...@@ -16,6 +16,7 @@ export const randomChar = function(l, url = "") { ...@@ -16,6 +16,7 @@ export const randomChar = function(l, url = "") {
} }
//图片选择 //图片选择
export const chooseImage = function(data) { export const chooseImage = function(data) {
console.log(data,'data-chooseImage')
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.chooseImage({ uni.chooseImage({
count: data.count || 9, //默认9 count: data.count || 9, //默认9
......
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