| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <view> |
| | | <page-nav :title="pageTitle"></page-nav> |
| | | |
| | | |
| | | <!-- <view v-if="purchorderArrAll.length>0"> --> |
| | | |
| | | |
| | | <u-input prefixIcon="search" prefixIconStyle="font-size: 22px;color: #909399" placeholder="æ«ææ¨¡å
·ç¼ç /è¾å
¥æ¨¡å
·ä¿¡æ¯" |
| | | clearable border="surround" @clear='inputBoxValueClear' v-model="inputBoxValue" |
| | | @change="changeInputBoxValue"> |
| | | <template slot="suffix"> |
| | | <u-icon name="scan" color="#909399" size="24" @click="topScanClick"></u-icon> |
| | | </template> |
| | | </u-input> |
| | | |
| | | |
| | | |
| | | <u-alert :title="'模å
·æ°ï¼å
±'+title+'个ï¼'" type="primary"></u-alert> |
| | | |
| | | |
| | | |
| | | <scroll-view class="container" scroll-y="true" @scroll="scroll"> |
| | | <!-- èæå表æ»é«åº¦ --> |
| | | <view :style="{'height': `${totalHeight}rpx`, 'position': 'relative'}"> |
| | | <view :style="{'top': `${top}px`}" style="width: 100%;position:absolute"> |
| | | <!--å¨è¿éèªå®ä¹ä½ æ°æ®çå±ç¤ºç»æåæ ·å¼,itemHeight为è¿éçæ»é«åº¦--> |
| | | |
| | | <view class="radioGroupClass"> |
| | | <view v-for="(item,index) in purchorderArr" :key="item.code" class="item"> |
| | | <view @click="highlightClick(item.code)" :style="{color:selectedCode===item.code?'#fff':'#000', |
| | | background:selectedCode===item.code?'#3c9cff':'#fff' |
| | | }"> |
| | | |
| | | <view style="display: flex;"> |
| | | <view style="text-align: center;margin-right: 20rpx;">{{item.code}} |
| | | </view> |
| | | <view style="">{{item.name}}</view> |
| | | <view style="margin-left: 20rpx;">{{item.spec}}</view> |
| | | |
| | | </view> |
| | | |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | |
| | | </view> |
| | | </view> |
| | | </scroll-view> |
| | | |
| | | |
| | | |
| | | <view class="footer" style="min-height:62rpx;"> |
| | | <u-button type="primary" size='large' :hairline="true" @click="navigateTo" text="ä¸ä¸æ¥"></u-button> |
| | | </view> |
| | | <!-- </view> --> |
| | | |
| | | |
| | | <!-- <view v-if="purchorderArrAll.length===0"> |
| | | <div class="sacnBody"> |
| | | <div class="boxImg"></div> |
| | | <div class="scanText">ææ æ¨¡å
·ä¿¡æ¯</div> |
| | | </div> |
| | | </view> --> |
| | | |
| | | </view> |
| | | </template> |
| | | |
| | | |
| | | <script> |
| | | import { |
| | | ScanMouldQrCodeMessageData, |
| | | ScanMouldQrCodeMessageSubData |
| | | } from '../../config/api.js'; |
| | | export default { |
| | | props: { |
| | | pageTitle: { |
| | | type: String, |
| | | default: '' |
| | | }, |
| | | navigateToUrl: { |
| | | type: String, |
| | | default: '' |
| | | }, |
| | | |
| | | |
| | | }, |
| | | |
| | | onPullDownRefresh() { |
| | | setTimeout(() => { |
| | | this.init(() => { |
| | | uni.stopPullDownRefresh(); |
| | | }) |
| | | }, 1000); |
| | | }, |
| | | // çå¬ä¸æå·æ°å¨ä½ï¼UniApp åççå½å¨æï¼ |
| | | onPullDownRefresh() { |
| | | let that = this |
| | | uni.startPullDownRefresh({ |
| | | success() { |
| | | that.getScanMouldQrCodeMessageData() |
| | | uni.showToast({ |
| | | title: "䏿巿°", |
| | | icon: 'none' |
| | | }) |
| | | }, |
| | | complete() { |
| | | uni.stopPullDownRefresh() |
| | | } |
| | | }) |
| | | }, |
| | | data() { |
| | | return { |
| | | |
| | | inputBoxValue: '', //è¾å
¥æ¡å¼ |
| | | |
| | | title: 0, |
| | | |
| | | purchorderArr: [], |
| | | |
| | | purchorderArrAll: [], |
| | | |
| | | allList: [], //åå§æ°æ®å表 |
| | | //èæå表 |
| | | showList: [], //å¯è§åºåæ¾ç¤ºçæ°æ® |
| | | itemHeight: 100, //æ¯æ¡æ°æ®æå é«åº¦ |
| | | showNum: 0, //å¯è§åºåæ¾ç¤ºçæå¤§æ¡æ° |
| | | top: 0, //åç§»é |
| | | scrollTop: 0, //å·èµ·çé«åº¦ |
| | | startIndex: 0, //å¯è§åºåç¬¬ä¸æ¡æ°æ®çç´¢å¼ |
| | | endIndex: 0, //å¯è§åºåæå䏿¡æ°æ®çç´¢å¼+1ï¼ |
| | | |
| | | selectedCode: '' |
| | | |
| | | } |
| | | }, |
| | | |
| | | onShow() { |
| | | //ç¬¬ä¸æ¬¡æ¶è°ç¨ä¸ä¸,ä¸uni.createSelectorQuery()éè¦å¨çå½å¨æmountedä¹åä½¿ç¨ |
| | | // this.scroll() |
| | | }, |
| | | computed: { |
| | | totalHeight() { |
| | | return this.allList.length * this.itemHeight * 2 //å 为rpxåpxçå
³ç³» |
| | | } |
| | | }, |
| | | created() { |
| | | |
| | | }, |
| | | mounted() { |
| | | this.init() |
| | | |
| | | this.getScanMouldQrCodeMessageData() |
| | | }, |
| | | methods: { |
| | | |
| | | //èæå表 |
| | | getShowList() { |
| | | //å¯è§åºåè½åºç°çæ°æ®æ¡æ° |
| | | this.showNum = Math.ceil(this.contentHeight / this.itemHeight); |
| | | // console.log('å¯è§æ°é', this.showNum) |
| | | |
| | | //å¯è§åºåç¬¬ä¸æ¡æ°æ®çç´¢å¼ |
| | | this.startIndex = Math.floor(this.scrollTop / this.itemHeight); |
| | | // console.log('åå§ç´¢å¼',this.startIndex) |
| | | |
| | | //å¯è§åºåæå䏿¡æ°æ®çä¸ä¸æ¡æ°æ® |
| | | this.endIndex = this.startIndex + this.showNum; |
| | | |
| | | //å¯è§åºæ°æ®ï¼ä¼æ¯å®é
å¯è§å¤æ¸²æä¸æ¡ |
| | | this.showList = this.allList.slice(this.startIndex, this.endIndex) |
| | | // console.log(this.showList) |
| | | |
| | | //ä¿è¯æ»å¨æ¶ç¬¬ä¸æ¡æ°æ®å®æ´å±ç¤º |
| | | let offsetY = this.scrollTop - (this.scrollTop % this.itemHeight); |
| | | |
| | | this.top = offsetY; |
| | | }, |
| | | scroll() { |
| | | // å©ç¨uniappæä¾çæ¥å£è·åå¯è§åºåçé«åº¦åæ»å¨é«åº¦ |
| | | let query = uni.createSelectorQuery() |
| | | let container = query.select('.container'); |
| | | container.fields({ |
| | | // rect:true, //æ¯å¦è¿åèç¹å¸å±ä½ç½®ä¿¡æ¯{left,top,right,bottom} |
| | | size: true, //æ¯å¦è¿åèç¹å°ºå¯¸ä¿¡æ¯{widthï¼height} |
| | | scrollOffset: true //æ¯å¦è¿åèç¹æ»å¨ä¿¡æ¯{scrollLeft,scrollTop} |
| | | }, (res) => { |
| | | // console.log(res) |
| | | this.scrollTop = res.scrollTop |
| | | this.contentHeight = res.height |
| | | this.getShowList(); //å 为æå¨å½æ°æ¯å¼æ¥ |
| | | }).exec() |
| | | }, |
| | | highlightClick(code) { |
| | | this.selectedCode = code |
| | | }, |
| | | |
| | | |
| | | init() { |
| | | uni.stopPullDownRefresh(); |
| | | }, |
| | | // æ«ç å·¥ä½ çæ«ç æ¡ç¹å» |
| | | topScanClick() { |
| | | // if (this.topContent.length > 0) { |
| | | // return uni.$u.toast('请å
æäº¤æ¤ç»´ä¿®ç³è¯·ï¼') |
| | | // } |
| | | |
| | | let that = this; |
| | | uni.scanCode({ |
| | | onlyFromCamera: true, |
| | | // scanType: ['barCode', 'qrCode'], |
| | | scanType: ['qrCode'], |
| | | success: function(res) { |
| | | console.log('æ¡ç ç±»åï¼' + res.scanType); |
| | | console.log('æ¡ç å
容ï¼' + res.result); |
| | | that.scanContent = res.result; |
| | | that.inputBoxValue = res.result; |
| | | |
| | | //å¤çæ«ç äºä»¶ |
| | | that.changeInputBoxValue(that.scanContent); |
| | | |
| | | }, |
| | | complete: function(res) { |
| | | |
| | | }, |
| | | fail: function(res) { |
| | | console.log('æ¡ç ç±»åï¼' + res.scanType); |
| | | console.log('æ¡ç å
容ï¼' + res.result); |
| | | } |
| | | |
| | | }); |
| | | }, |
| | | changeInputBoxValue(val) { |
| | | this.purchorderArr = this.purchorderArrAll.filter((p) => { |
| | | return p.code.indexOf(val) !== -1 || p.name.indexOf(val) !== -1 || p.spec.indexOf(val) !== -1 |
| | | }) |
| | | this.selectedCode = this.purchorderArr[0].code |
| | | this.$forceUpdate() |
| | | }, |
| | | inputBoxValueClear() { |
| | | this.inputBoxValue = '' |
| | | }, |
| | | |
| | | navigateTo() { |
| | | uni.navigateTo({ |
| | | url: this.navigateToUrl + '?code=' + this.selectedCode |
| | | }); |
| | | }, |
| | | async getScanMouldQrCodeMessageData() { |
| | | const res = await ScanMouldQrCodeMessageData() |
| | | |
| | | this.purchorderArrAll = res.data |
| | | |
| | | this.purchorderArr = res.data |
| | | |
| | | this.title = res.data.length |
| | | |
| | | this.selectedCode = res.data[0].code |
| | | |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @import url('@/style/global.css'); |
| | | |
| | | .container { |
| | | width: 100%; |
| | | height: 70vh; |
| | | /*åçä¸å®å¾æè¿ä¸ªoverflowçhiddenææ,æ¤å¤ç¨äºscroll-viewæä»¥ä¸éè¦*/ |
| | | /*overflow:auto;*/ |
| | | } |
| | | |
| | | .item { |
| | | width: 100%; |
| | | height: 90rpx; |
| | | line-height: 90rpx; |
| | | border: 1px solid #c8c8c8; |
| | | } |
| | | |
| | | ::v-deep .uicon-arrow-left>span { |
| | | display: block; |
| | | } |
| | | |
| | | .u-input--square { |
| | | margin: 20rpx 10rpx; |
| | | border-radius: 40rpx; |
| | | background-color: #fff; |
| | | border: 1px solid #c8c8c8; |
| | | } |
| | | |
| | | ::v-deep .u-alert__text--primary--light { |
| | | margin-bottom: 0; |
| | | font-size: 32rpx !important; |
| | | } |
| | | |
| | | .radioGroupClass { |
| | | display: flex; |
| | | flex-direction: column; |
| | | background-color: #fff; |
| | | |
| | | overflow-y: auto; |
| | | max-height: 1100rpx; |
| | | margin-top: 20rpx; |
| | | } |
| | | |
| | | ::v-deep .u-radio-label--right { |
| | | height: 90rpx; |
| | | line-height: 90rpx; |
| | | width: 92%; |
| | | margin-left: 4%; |
| | | // padding: 0 50rpx; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <view> |
| | | <page-nav title="ç¯å¢é
ç½®"></page-nav> |
| | | |
| | | <div class="main"> |
| | | |
| | | <u-radio-group v-model="radioValue" style="display: flex;flex-direction: column;"> |
| | | <div class="block" v-for='(item,index) in contentArr'> |
| | | <div class="title">{{item.title}}</div> |
| | | <div> |
| | | <u--text type="info" :text="item.url"></u--text> |
| | | </div> |
| | | <u-divider></u-divider> |
| | | <div class="opertion"> |
| | | <view style="margin-right: 100rpx;width: 60%;"> |
| | | <u-radio label="设为é»è®¤" :name="item.id" @change="radioChange" :key="item.id"></u-radio> |
| | | </view> |
| | | |
| | | <view style="display: flex;width: 30%;"> |
| | | <u--text type="info" @click="edit(item,index)" text="ä¿®æ¹"></u--text> |
| | | <u--text type="info" @click="del(item,index)" text="å é¤"></u--text> |
| | | </view> |
| | | </div> |
| | | </div> |
| | | </u-radio-group> |
| | | |
| | | |
| | | <u-button hairline type="primary" text="ç¡®å®" @click="confirm"></u-button> |
| | | |
| | | <u-back-top icon="arrow-up" text="11"></u-back-top> |
| | | |
| | | |
| | | </div> |
| | | |
| | | |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import Vue from 'vue' |
| | | export default { |
| | | data() { |
| | | return { |
| | | radioValue: 2, |
| | | contentArr: [{ |
| | | id: 1, |
| | | title: 'ææ¯æ é¢1', |
| | | url: 'http://121.196.36.24:8000', |
| | | }, |
| | | { |
| | | id: 2, |
| | | title: 'ææ¯æ é¢2', |
| | | url: 'http://121.196.36.24:9090', |
| | | }, |
| | | { |
| | | id: 3, |
| | | title: 'ææ¯æ é¢3', |
| | | url: 'http://121.196.36.24:8019', |
| | | }, |
| | | { |
| | | id: 4, |
| | | title: 'ææ¯æ é¢4', |
| | | url: 'http://121.196.36.24:8047', |
| | | } |
| | | ] |
| | | |
| | | } |
| | | }, |
| | | |
| | | methods: { |
| | | radioChange(val) { |
| | | uni.$u.http.setConfig((config) => { |
| | | config.baseURL = this.contentArr.find(i => i.id === val).url + '/api' |
| | | return config |
| | | }) |
| | | }, |
| | | del(item, index) { |
| | | console.log(item) |
| | | this.contentArr.splice(index, 1) |
| | | }, |
| | | edit(item) { |
| | | |
| | | }, |
| | | // ç¡®å® |
| | | confirm() { |
| | | uni.navigateBack() |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | ::v-deep .u-icon--right { |
| | | display: none; |
| | | } |
| | | |
| | | .main { |
| | | width: 100vw; |
| | | height: 80vh; |
| | | background-color: #eee; |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | } |
| | | |
| | | .block { |
| | | width: 94vw; |
| | | height: 200rpx; |
| | | background-color: #fff; |
| | | border-radius: 10rpx; |
| | | margin-top: 10rpx; |
| | | padding: 10rpx; |
| | | } |
| | | |
| | | .title {} |
| | | |
| | | .opertion { |
| | | display: flex; |
| | | width: 100%; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | </template> |
| | | |
| | | <script> |
| | | </script> |
| | | |
| | | <style> |
| | | </style> |
| | |
| | | |
| | | <view class="body"> |
| | | |
| | | <view class="headClass">æ°å¯è¿ªäºå¶é </view> |
| | | <view class="headClass">æºè½å¶é äºå¹³å°</view> |
| | | <view class="main"> |
| | | <view class="circle"> |
| | | <view class="circleBg"></view> |
| | |
| | | :disabled="!(usercode.trim().length>0&&userpassword.trim().length>0)" text="ç«å³ç»å½" |
| | | :loading="isDisabledSubmitButton" loadingText="æ£å¨ç»å½,请ç¨ç..." class="loginClass" |
| | | @click="gotoIndex"></u-button> |
| | | |
| | | <!-- <u--text :block='false' color='#0659ff' :size='14' @click="envConfigClick" class='envConfig' |
| | | text="ç¯å¢é
ç½®"></u--text> --> |
| | | </view> |
| | | |
| | | <u-modal :show="isShow" :showCancelButton="isShowCancelButton" :showConfirmButton='false' title="" |
| | |
| | | this.getAppUpgrade() |
| | | }, |
| | | mounted() { |
| | | |
| | | console.log(this.$baseUrl) |
| | | }, |
| | | methods: { |
| | | getAppUpgrade() { |
| | |
| | | isShowCancel() { |
| | | this.isShow = false |
| | | }, |
| | | |
| | | |
| | | // ç¯å¢é
ç½®ç¹å» |
| | | envConfigClick() { |
| | | uni.navigateTo({ |
| | | url: './hjpz' |
| | | }); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | font-size: 16px !important; |
| | | line-height: 20px !important; |
| | | } |
| | | |
| | | .envConfig { |
| | | position: absolute; |
| | | right: 0rpx; |
| | | bottom: -120rpx; |
| | | } |
| | | </style> |
| | | <style> |
| | | page { |
| | |
| | | <template> |
| | | <view> |
| | | <page-nav title="模å
·ä¿å
»"></page-nav> |
| | | |
| | | |
| | | <!-- <view v-if="purchorderArrAll.length>0"> --> |
| | | |
| | | |
| | | <u-input prefixIcon="search" prefixIconStyle="font-size: 22px;color: #909399" placeholder="æ«ææ¨¡å
·ç¼ç /è¾å
¥æ¨¡å
·ä¿¡æ¯" |
| | | clearable border="surround" @clear='inputBoxValueClear' v-model="inputBoxValue" |
| | | @change="changeInputBoxValue"> |
| | | <template slot="suffix"> |
| | | <u-icon name="scan" color="#909399" size="24" @click="topScanClick"></u-icon> |
| | | </template> |
| | | </u-input> |
| | | |
| | | |
| | | |
| | | <u-alert :title="'模å
·æ°ï¼å
±'+title+'个ï¼'" type="primary"></u-alert> |
| | | |
| | | |
| | | |
| | | <scroll-view class="container" scroll-y="true" @scroll="scroll"> |
| | | <!-- èæå表æ»é«åº¦ --> |
| | | <view :style="{'height': `${totalHeight}rpx`, 'position': 'relative'}"> |
| | | <!-- å¯è§æ¸²æåº --> |
| | | <view :style="{'top': `${top}px`}" style="width: 100%;position:absolute"> |
| | | <!--å¨è¿éèªå®ä¹ä½ æ°æ®çå±ç¤ºç»æåæ ·å¼,itemHeight为è¿éçæ»é«åº¦--> |
| | | |
| | | <view class="radioGroupClass"> |
| | | <view v-for="(item,index) in purchorderArr" :key="item.code" class="item"> |
| | | <view @click="highlightClick(item.code)" :style="{color:selectedCode===item.code?'#fff':'#000', |
| | | background:selectedCode===item.code?'#3c9cff':'#fff' |
| | | }"> |
| | | |
| | | <view style="display: flex;"> |
| | | <view style="text-align: center;margin-right: 20rpx;">{{item.code}} |
| | | </view> |
| | | <view style="">{{item.name}}</view> |
| | | <view style="margin-left: 20rpx;">{{item.spec}}</view> |
| | | |
| | | </view> |
| | | |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | |
| | | </view> |
| | | </view> |
| | | </scroll-view> |
| | | |
| | | |
| | | |
| | | <view class="footer" style="min-height:62rpx;"> |
| | | <u-button type="primary" size='large' :hairline="true" @click="navigateTo" text="ä¸ä¸æ¥"></u-button> |
| | | </view> |
| | | <!-- </view> --> |
| | | |
| | | |
| | | <!-- <view v-if="purchorderArrAll.length===0"> |
| | | <div class="sacnBody"> |
| | | <div class="boxImg"></div> |
| | | <div class="scanText">ææ æ¨¡å
·ä¿¡æ¯</div> |
| | | </div> |
| | | </view> --> |
| | | <mold-list page-title="模å
·ä¿å
»" navigate-to-url="./mjby2"></mold-list> |
| | | |
| | | </view> |
| | | </template> |
| | | |
| | | |
| | | <script> |
| | | import { |
| | | ScanMouldQrCodeMessageData, |
| | | ScanMouldQrCodeMessageSubData |
| | | } from '../../config/api.js'; |
| | | export default { |
| | | import moldList from '@/components/mold-list/mold-list.vue' |
| | | |
| | | onPullDownRefresh() { |
| | | setTimeout(() => { |
| | | this.init(() => { |
| | | uni.stopPullDownRefresh(); |
| | | }) |
| | | }, 1000); |
| | | export default { |
| | | components: { |
| | | moldList |
| | | }, |
| | | |
| | | |
| | | |
| | | data() { |
| | | return { |
| | | |
| | | inputBoxValue: '', //è¾å
¥æ¡å¼ |
| | | |
| | | title: 0, |
| | | |
| | | purchorderArr: [], |
| | | |
| | | purchorderArrAll: [], |
| | | |
| | | allList: [], //åå§æ°æ®å表 |
| | | //èæå表 |
| | | showList: [], //å¯è§åºåæ¾ç¤ºçæ°æ® |
| | | itemHeight: 100, //æ¯æ¡æ°æ®æå é«åº¦ |
| | | showNum: 0, //å¯è§åºåæ¾ç¤ºçæå¤§æ¡æ° |
| | | top: 0, //åç§»é |
| | | scrollTop: 0, //å·èµ·çé«åº¦ |
| | | startIndex: 0, //å¯è§åºåç¬¬ä¸æ¡æ°æ®çç´¢å¼ |
| | | endIndex: 0, //å¯è§åºåæå䏿¡æ°æ®çç´¢å¼+1ï¼ |
| | | |
| | | selectedCode: '' |
| | | |
| | | } |
| | | }, |
| | |
| | | //ç¬¬ä¸æ¬¡æ¶è°ç¨ä¸ä¸,ä¸uni.createSelectorQuery()éè¦å¨çå½å¨æmountedä¹åä½¿ç¨ |
| | | // this.scroll() |
| | | }, |
| | | computed: { |
| | | totalHeight() { |
| | | return this.allList.length * this.itemHeight * 2 //å 为rpxåpxçå
³ç³» |
| | | } |
| | | }, |
| | | |
| | | created() { |
| | | |
| | | }, |
| | | mounted() { |
| | | this.init() |
| | | |
| | | this.getScanMouldQrCodeMessageData() |
| | | }, |
| | | methods: { |
| | | |
| | | //èæå表 |
| | | getShowList() { |
| | | //å¯è§åºåè½åºç°çæ°æ®æ¡æ° |
| | | this.showNum = Math.ceil(this.contentHeight / this.itemHeight); |
| | | // console.log('å¯è§æ°é', this.showNum) |
| | | |
| | | //å¯è§åºåç¬¬ä¸æ¡æ°æ®çç´¢å¼ |
| | | this.startIndex = Math.floor(this.scrollTop / this.itemHeight); |
| | | // console.log('åå§ç´¢å¼',this.startIndex) |
| | | |
| | | //å¯è§åºåæå䏿¡æ°æ®çä¸ä¸æ¡æ°æ® |
| | | this.endIndex = this.startIndex + this.showNum; |
| | | |
| | | //å¯è§åºæ°æ®ï¼ä¼æ¯å®é
å¯è§å¤æ¸²æä¸æ¡ |
| | | this.showList = this.allList.slice(this.startIndex, this.endIndex) |
| | | // console.log(this.showList) |
| | | |
| | | //ä¿è¯æ»å¨æ¶ç¬¬ä¸æ¡æ°æ®å®æ´å±ç¤º |
| | | let offsetY = this.scrollTop - (this.scrollTop % this.itemHeight); |
| | | |
| | | this.top = offsetY; |
| | | }, |
| | | scroll() { |
| | | // å©ç¨uniappæä¾çæ¥å£è·åå¯è§åºåçé«åº¦åæ»å¨é«åº¦ |
| | | let query = uni.createSelectorQuery() |
| | | let container = query.select('.container'); |
| | | container.fields({ |
| | | // rect:true, //æ¯å¦è¿åèç¹å¸å±ä½ç½®ä¿¡æ¯{left,top,right,bottom} |
| | | size: true, //æ¯å¦è¿åèç¹å°ºå¯¸ä¿¡æ¯{widthï¼height} |
| | | scrollOffset: true //æ¯å¦è¿åèç¹æ»å¨ä¿¡æ¯{scrollLeft,scrollTop} |
| | | }, (res) => { |
| | | // console.log(res) |
| | | this.scrollTop = res.scrollTop |
| | | this.contentHeight = res.height |
| | | this.getShowList(); //å 为æå¨å½æ°æ¯å¼æ¥ |
| | | }).exec() |
| | | }, |
| | | highlightClick(code) { |
| | | this.selectedCode = code |
| | | }, |
| | | |
| | | |
| | | init() { |
| | | uni.stopPullDownRefresh(); |
| | | }, |
| | | // æ«ç å·¥ä½ çæ«ç æ¡ç¹å» |
| | | topScanClick() { |
| | | // if (this.topContent.length > 0) { |
| | | // return uni.$u.toast('请å
æäº¤æ¤ç»´ä¿®ç³è¯·ï¼') |
| | | // } |
| | | |
| | | let that = this; |
| | | uni.scanCode({ |
| | | onlyFromCamera: true, |
| | | // scanType: ['barCode', 'qrCode'], |
| | | scanType: ['qrCode'], |
| | | success: function(res) { |
| | | console.log('æ¡ç ç±»åï¼' + res.scanType); |
| | | console.log('æ¡ç å
容ï¼' + res.result); |
| | | that.scanContent = res.result; |
| | | that.inputBoxValue = res.result; |
| | | |
| | | //å¤çæ«ç äºä»¶ |
| | | that.changeInputBoxValue(that.scanContent); |
| | | |
| | | }, |
| | | complete: function(res) { |
| | | |
| | | }, |
| | | fail: function(res) { |
| | | console.log('æ¡ç ç±»åï¼' + res.scanType); |
| | | console.log('æ¡ç å
容ï¼' + res.result); |
| | | } |
| | | |
| | | }); |
| | | }, |
| | | changeInputBoxValue(val) { |
| | | this.purchorderArr = this.purchorderArrAll.filter((p) => { |
| | | return p.code.indexOf(val) !== -1 || p.name.indexOf(val) !== -1 || p.spec.indexOf(val) !== -1 |
| | | }) |
| | | this.selectedCode = this.purchorderArr[0].code |
| | | this.$forceUpdate() |
| | | }, |
| | | inputBoxValueClear() { |
| | | this.inputBoxValue = '' |
| | | }, |
| | | |
| | | navigateTo() { |
| | | uni.navigateTo({ |
| | | url: './mjby2?code=' + this.selectedCode |
| | | }); |
| | | }, |
| | | async getScanMouldQrCodeMessageData() { |
| | | const res = await ScanMouldQrCodeMessageData() |
| | | |
| | | this.purchorderArrAll = res.data |
| | | |
| | | this.purchorderArr = res.data |
| | | |
| | | this.title = res.data.length |
| | | |
| | | this.selectedCode = res.data[0].code |
| | | |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @import url('@/style/global.css'); |
| | | |
| | | .container { |
| | | width: 100%; |
| | | height: 70vh; |
| | | /*åçä¸å®å¾æè¿ä¸ªoverflowçhiddenææ,æ¤å¤ç¨äºscroll-viewæä»¥ä¸éè¦*/ |
| | | /*overflow:auto;*/ |
| | | } |
| | | |
| | | .item { |
| | | /* æç
§å®é
éæ±åcss */ |
| | | width: 100%; |
| | | height: 200rpx; |
| | | line-height: 90rpx; |
| | | /* è¦å¯¹åºä¸itemHeight */ |
| | | border: 1px solid #c8c8c8; |
| | | } |
| | | |
| | | ::v-deep .uicon-arrow-left>span { |
| | | display: block; |
| | | } |
| | | |
| | | .u-input--square { |
| | | margin: 20rpx 10rpx; |
| | | border-radius: 40rpx; |
| | | background-color: #fff; |
| | | border: 1px solid #c8c8c8; |
| | | } |
| | | |
| | | ::v-deep .u-alert__text--primary--light { |
| | | margin-bottom: 0; |
| | | font-size: 32rpx !important; |
| | | } |
| | | |
| | | .radioGroupClass { |
| | | display: flex; |
| | | flex-direction: column; |
| | | background-color: #fff; |
| | | |
| | | overflow-y: auto; |
| | | max-height: 1100rpx; |
| | | margin-top: 20rpx; |
| | | } |
| | | |
| | | ::v-deep .u-radio-label--right { |
| | | height: 90rpx; |
| | | line-height: 90rpx; |
| | | width: 92%; |
| | | margin-left: 4%; |
| | | // padding: 0 50rpx; |
| | | } |
| | | </style> |
| | |
| | | mouldcode: mouldcode, |
| | | repartempcode: repartempcode |
| | | }) |
| | | |
| | | res.forEach(i => { |
| | | i.isOK = 'OK' |
| | | }) |
| | | this.resultValue = 'OK' |
| | | this.centerContent = res |
| | | }, |
| | | topScanClick() { |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <view> |
| | | <page-nav title="模å
·ä¿å
»"></page-nav> |
| | | |
| | | |
| | | <!-- <view v-if="purchorderArrAll.length>0"> --> |
| | | |
| | | |
| | | <u-input prefixIcon="search" prefixIconStyle="font-size: 22px;color: #909399" placeholder="æ«ææ¨¡å
·ç¼ç /è¾å
¥æ¨¡å
·ä¿¡æ¯" |
| | | clearable border="surround" @clear='inputBoxValueClear' v-model="inputBoxValue" |
| | | @change="changeInputBoxValue"> |
| | | <template slot="suffix"> |
| | | <u-icon name="scan" color="#909399" size="24" @click="topScanClick"></u-icon> |
| | | </template> |
| | | </u-input> |
| | | |
| | | |
| | | |
| | | <u-alert :title="'模å
·æ°ï¼å
±'+title+'个ï¼'" type="primary"></u-alert> |
| | | |
| | | |
| | | |
| | | <scroll-view class="container" scroll-y="true" @scroll="scroll"> |
| | | <!-- èæå表æ»é«åº¦ --> |
| | | <view :style="{'height': `${totalHeight}rpx`, 'position': 'relative'}"> |
| | | <!-- å¯è§æ¸²æåº --> |
| | | <view :style="{'top': `${top}px`}" style="width: 100%;position:absolute"> |
| | | <!--å¨è¿éèªå®ä¹ä½ æ°æ®çå±ç¤ºç»æåæ ·å¼,itemHeight为è¿éçæ»é«åº¦--> |
| | | |
| | | <view class="radioGroupClass"> |
| | | <view v-for="(item,index) in purchorderArr" :key="item.code" class="item"> |
| | | <view @click="highlightClick(item.code)" :style="{color:selectedCode===item.code?'#fff':'#000', |
| | | background:selectedCode===item.code?'#3c9cff':'#fff' |
| | | }"> |
| | | |
| | | <view style="display: flex;"> |
| | | <view style="text-align: center;margin-right: 20rpx;">{{item.code}} |
| | | </view> |
| | | <view style="">{{item.name}}</view> |
| | | <view style="margin-left: 20rpx;">{{item.spec}}</view> |
| | | |
| | | </view> |
| | | |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | |
| | | </view> |
| | | </view> |
| | | </scroll-view> |
| | | |
| | | |
| | | |
| | | <view class="footer" style="min-height:62rpx;"> |
| | | <u-button type="primary" size='large' :hairline="true" @click="navigateTo" text="ä¸ä¸æ¥"></u-button> |
| | | </view> |
| | | <!-- </view> --> |
| | | |
| | | |
| | | <!-- <view v-if="purchorderArrAll.length===0"> |
| | | <div class="sacnBody"> |
| | | <div class="boxImg"></div> |
| | | <div class="scanText">ææ æ¨¡å
·ä¿¡æ¯</div> |
| | | </div> |
| | | </view> --> |
| | | |
| | | </view> |
| | | </template> |
| | | |
| | | |
| | | <script> |
| | | import { |
| | | ScanMouldQrCodeMessageData, |
| | | ScanMouldQrCodeMessageSubData |
| | | } from '../../config/api.js'; |
| | | export default { |
| | | |
| | | onPullDownRefresh() { |
| | | setTimeout(() => { |
| | | this.init(() => { |
| | | uni.stopPullDownRefresh(); |
| | | }) |
| | | }, 1000); |
| | | }, |
| | | |
| | | data() { |
| | | return { |
| | | |
| | | inputBoxValue: '', //è¾å
¥æ¡å¼ |
| | | |
| | | title: 0, |
| | | |
| | | purchorderArr: [], |
| | | |
| | | purchorderArrAll: [], |
| | | |
| | | allList: [], //åå§æ°æ®å表 |
| | | //èæå表 |
| | | showList: [], //å¯è§åºåæ¾ç¤ºçæ°æ® |
| | | itemHeight: 100, //æ¯æ¡æ°æ®æå é«åº¦ |
| | | showNum: 0, //å¯è§åºåæ¾ç¤ºçæå¤§æ¡æ° |
| | | top: 0, //åç§»é |
| | | scrollTop: 0, //å·èµ·çé«åº¦ |
| | | startIndex: 0, //å¯è§åºåç¬¬ä¸æ¡æ°æ®çç´¢å¼ |
| | | endIndex: 0, //å¯è§åºåæå䏿¡æ°æ®çç´¢å¼+1ï¼ |
| | | |
| | | selectedCode: '' |
| | | |
| | | } |
| | | }, |
| | | |
| | | onShow() { |
| | | //ç¬¬ä¸æ¬¡æ¶è°ç¨ä¸ä¸,ä¸uni.createSelectorQuery()éè¦å¨çå½å¨æmountedä¹åä½¿ç¨ |
| | | // this.scroll() |
| | | }, |
| | | computed: { |
| | | totalHeight() { |
| | | return this.allList.length * this.itemHeight * 2 //å 为rpxåpxçå
³ç³» |
| | | } |
| | | }, |
| | | created() { |
| | | |
| | | }, |
| | | mounted() { |
| | | this.init() |
| | | |
| | | this.getScanMouldQrCodeMessageData() |
| | | }, |
| | | methods: { |
| | | |
| | | //èæå表 |
| | | getShowList() { |
| | | //å¯è§åºåè½åºç°çæ°æ®æ¡æ° |
| | | this.showNum = Math.ceil(this.contentHeight / this.itemHeight); |
| | | // console.log('å¯è§æ°é', this.showNum) |
| | | |
| | | //å¯è§åºåç¬¬ä¸æ¡æ°æ®çç´¢å¼ |
| | | this.startIndex = Math.floor(this.scrollTop / this.itemHeight); |
| | | // console.log('åå§ç´¢å¼',this.startIndex) |
| | | |
| | | //å¯è§åºåæå䏿¡æ°æ®çä¸ä¸æ¡æ°æ® |
| | | this.endIndex = this.startIndex + this.showNum; |
| | | |
| | | //å¯è§åºæ°æ®ï¼ä¼æ¯å®é
å¯è§å¤æ¸²æä¸æ¡ |
| | | this.showList = this.allList.slice(this.startIndex, this.endIndex) |
| | | // console.log(this.showList) |
| | | |
| | | //ä¿è¯æ»å¨æ¶ç¬¬ä¸æ¡æ°æ®å®æ´å±ç¤º |
| | | let offsetY = this.scrollTop - (this.scrollTop % this.itemHeight); |
| | | |
| | | this.top = offsetY; |
| | | }, |
| | | scroll() { |
| | | // å©ç¨uniappæä¾çæ¥å£è·åå¯è§åºåçé«åº¦åæ»å¨é«åº¦ |
| | | let query = uni.createSelectorQuery() |
| | | let container = query.select('.container'); |
| | | container.fields({ |
| | | // rect:true, //æ¯å¦è¿åèç¹å¸å±ä½ç½®ä¿¡æ¯{left,top,right,bottom} |
| | | size: true, //æ¯å¦è¿åèç¹å°ºå¯¸ä¿¡æ¯{widthï¼height} |
| | | scrollOffset: true //æ¯å¦è¿åèç¹æ»å¨ä¿¡æ¯{scrollLeft,scrollTop} |
| | | }, (res) => { |
| | | // console.log(res) |
| | | this.scrollTop = res.scrollTop |
| | | this.contentHeight = res.height |
| | | this.getShowList(); //å 为æå¨å½æ°æ¯å¼æ¥ |
| | | }).exec() |
| | | }, |
| | | highlightClick(code) { |
| | | this.selectedCode = code |
| | | }, |
| | | |
| | | |
| | | init() { |
| | | uni.stopPullDownRefresh(); |
| | | }, |
| | | // æ«ç å·¥ä½ çæ«ç æ¡ç¹å» |
| | | topScanClick() { |
| | | // if (this.topContent.length > 0) { |
| | | // return uni.$u.toast('请å
æäº¤æ¤ç»´ä¿®ç³è¯·ï¼') |
| | | // } |
| | | |
| | | let that = this; |
| | | uni.scanCode({ |
| | | onlyFromCamera: true, |
| | | // scanType: ['barCode', 'qrCode'], |
| | | scanType: ['qrCode'], |
| | | success: function(res) { |
| | | console.log('æ¡ç ç±»åï¼' + res.scanType); |
| | | console.log('æ¡ç å
容ï¼' + res.result); |
| | | that.scanContent = res.result; |
| | | that.inputBoxValue = res.result; |
| | | |
| | | //å¤çæ«ç äºä»¶ |
| | | that.changeInputBoxValue(that.scanContent); |
| | | |
| | | }, |
| | | complete: function(res) { |
| | | |
| | | }, |
| | | fail: function(res) { |
| | | console.log('æ¡ç ç±»åï¼' + res.scanType); |
| | | console.log('æ¡ç å
容ï¼' + res.result); |
| | | } |
| | | |
| | | }); |
| | | }, |
| | | changeInputBoxValue(val) { |
| | | this.purchorderArr = this.purchorderArrAll.filter((p) => { |
| | | return p.code.indexOf(val) !== -1 || p.name.indexOf(val) !== -1 || p.spec.indexOf(val) !== -1 |
| | | }) |
| | | this.selectedCode = this.purchorderArr[0].code |
| | | this.$forceUpdate() |
| | | }, |
| | | inputBoxValueClear() { |
| | | this.inputBoxValue = '' |
| | | }, |
| | | |
| | | navigateTo() { |
| | | uni.navigateTo({ |
| | | url: './mjby2?code=' + this.selectedCode |
| | | }); |
| | | }, |
| | | async getScanMouldQrCodeMessageData() { |
| | | const res = await ScanMouldQrCodeMessageData() |
| | | |
| | | this.purchorderArrAll = res.data |
| | | |
| | | this.purchorderArr = res.data |
| | | |
| | | this.title = res.data.length |
| | | |
| | | this.selectedCode = res.data[0].code |
| | | |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @import url('@/style/global.css'); |
| | | |
| | | .container { |
| | | width: 100%; |
| | | height: 70vh; |
| | | /*åçä¸å®å¾æè¿ä¸ªoverflowçhiddenææ,æ¤å¤ç¨äºscroll-viewæä»¥ä¸éè¦*/ |
| | | /*overflow:auto;*/ |
| | | } |
| | | |
| | | .item { |
| | | /* æç
§å®é
éæ±åcss */ |
| | | width: 100%; |
| | | height: 200rpx; |
| | | line-height: 90rpx; |
| | | /* è¦å¯¹åºä¸itemHeight */ |
| | | border: 1px solid #c8c8c8; |
| | | } |
| | | |
| | | ::v-deep .uicon-arrow-left>span { |
| | | display: block; |
| | | } |
| | | |
| | | .u-input--square { |
| | | margin: 20rpx 10rpx; |
| | | border-radius: 40rpx; |
| | | background-color: #fff; |
| | | border: 1px solid #c8c8c8; |
| | | } |
| | | |
| | | ::v-deep .u-alert__text--primary--light { |
| | | margin-bottom: 0; |
| | | font-size: 32rpx !important; |
| | | } |
| | | |
| | | .radioGroupClass { |
| | | display: flex; |
| | | flex-direction: column; |
| | | background-color: #fff; |
| | | |
| | | overflow-y: auto; |
| | | max-height: 1100rpx; |
| | | margin-top: 20rpx; |
| | | } |
| | | |
| | | ::v-deep .u-radio-label--right { |
| | | height: 90rpx; |
| | | line-height: 90rpx; |
| | | width: 92%; |
| | | margin-left: 4%; |
| | | // padding: 0 50rpx; |
| | | } |
| | | </style> |
| | |
| | | }) |
| | | }, 1000); |
| | | }, |
| | | |
| | | // çå¬ä¸æå·æ°å¨ä½ï¼UniApp åççå½å¨æï¼ |
| | | onPullDownRefresh() { |
| | | let that = this |
| | | uni.startPullDownRefresh({ |
| | | success() { |
| | | that.getScanMouldQrCodeMessageData() |
| | | uni.showToast({ |
| | | title: "䏿巿°", |
| | | icon: 'none' |
| | | }) |
| | | }, |
| | | complete() { |
| | | uni.stopPullDownRefresh() |
| | | } |
| | | }) |
| | | }, |
| | | data() { |
| | | return { |
| | | |
| | |
| | | } |
| | | |
| | | .item { |
| | | /* æç
§å®é
éæ±åcss */ |
| | | width: 100%; |
| | | height: 200rpx; |
| | | line-height: 90rpx; |
| | | /* è¦å¯¹åºä¸itemHeight */ |
| | | border: 1px solid #c8c8c8; |
| | | } |
| | | |