From 9ab6b38c098f857f2ce0772693142c930e4f9b6d Mon Sep 17 00:00:00 2001 From: whycq <913841844@qq.com> Date: 星期六, 30 三月 2024 10:44:03 +0800 Subject: [PATCH] # --- pages/common/mat/matPick.vue | 148 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 144 insertions(+), 4 deletions(-) diff --git a/pages/common/mat/matPick.vue b/pages/common/mat/matPick.vue index 8183fd0..03807ae 100644 --- a/pages/common/mat/matPick.vue +++ b/pages/common/mat/matPick.vue @@ -1,5 +1,27 @@ <template> <view> + <view class="box"> + <view class="item" v-for="item in data" v-show="!item.hide"> + <!-- key --> + <view class="item-key">{{item.title}}</view> + <!-- value --> + <view class="item-text" v-if="item.type == 'text'">{{mat[item.field]}}</view> + <!-- <view class="item-text" v-if="item.type == 'text'">{{item.value}}</view> --> + <view class="item-input" v-if="item.type == 'input'" :style="'text-align:'+ float"> + <input type="text" @blur="blur" @focus="focus" v-model="inputData"> + </view> + <view class="item-input" v-if="item.type == 'number-box'"> + <uni-number-box v-model="numberData" :max="99999999" :step='1' color="#747474" @change="changeValue" /> + </view> + <view class="item-input" v-if="item.type == 'select'"> + <riko-combox @input="select" :candidates="candidates" :value="city" :inputFlag="true"></riko-combox> + </view> + </view> + </view> + + <view class="z-floor"> + <view class="z-primary" @click="back">鎻愬彇</view> + </view> </view> </template> @@ -8,15 +30,133 @@ export default { data() { return { - + candidates: [{name: 'box',id:1},{name: 'plan',id: 2}], + city: null, + data: [ + { + title: '鍟嗗搧鍚嶇О', + field: 'maktx', + hied: false, + value: '123456', + type: 'text' + }, + { + title: '鍟嗗搧缂栧彿', + field: 'matnr', + hied: false, + value: '娓╁害銆傜┖璋�', + type: 'text' + }, + { + title: '瑙勬牸', + field: 'specs', + hied: false, + value: '蠁160*45蠁160*45蠁160*45蠁160*45蠁160*45蠁160*45蠁160*45蠁160*45蠁160*45蠁160*45', + type: 'text' + }, + { + title: '鎵瑰彿', + field: 'batch', + hied: false, + value: '鐗╂枡鍚嶇О鐗�', + type: 'input' + }, + { + title: '鏁伴噺', + field: 'count', + hied: false, + value: '鐗╂枡鍚嶇О鐗�', + type: 'number-box' + }, + // { + // title: '璐т富', + // field: 'maktx', + // hied: false, + // value: '鐗╂枡鍚嶇О鐗�', + // type: 'select' + // }, + ], + mat: '', + float: 'left', + inputData: '', + numberData: '' } }, + onLoad(option) { + let _this = this + const eventChannel = this.getOpenerEventChannel(); + // 鐩戝惉acceptDataFromOpenerPage浜嬩欢锛岃幏鍙栦笂涓�椤甸潰閫氳繃eventChannel浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹� + eventChannel.on('mat', function(data) { + _this.mat = data.mat + }) + }, methods: { - + blur() { + this.float = 'right' + }, + focus() { + let newData = this.inputData + this.inputData = '' + this.float = 'left' + this.inputData = newData + }, + changeValue() { + }, + select(e){ + console.log(e); + }, + back() { + if (this.mat.anfme === 0) { + uni.showToast({title: '璇疯緭鍏ユ暟閲�', icon: "none", position: 'top'}); + return; + } + this.getOpenerEventChannel().emit('matList', {data: this.mat}); + uni.navigateBack({ + + }) + } } } </script> -<style> - +<style scoped> + .box { + min-height: 60rpx; + /* background-color: #202124; */ + /* color: #FFF; */ + background-color: #FFF; + margin: 16rpx; + padding: 64rpx 32rpx 1rpx 32rpx; + } + .item { + display: flex; + min-height: 60rpx; + margin: 20rpx 0; + border-bottom: 1px solid #efeef2; + vertical-align: bottom; + padding: 0 10rpx; + line-height: 1.3; + } + .item:last-child { + border-bottom: none; + margin: 10rpx 0; + } + .item-key{ + min-width: 6em; + max-width: 6em; + align-self: center; + vertical-align: bottom; + font-weight: bold; + } + .item-text { + flex: 1; + align-self: center; + text-align: right; + word-break: break-all + } + .item-input { + padding: 4rpx; + flex: 1; + align-self: center; + } </style> -- Gitblit v1.9.1