| | |
| | | <view class="tag-item">{{item.name}}</view> |
| | | </view> |
| | | </scroll-view> |
| | | <scroll-view> |
| | | <view> |
| | | <view class="tag-list" v-for="(item,i) in matList" :key="i" @click="findBySelect(item.matnr)"> |
| | | <view class="tag"> |
| | | <view style="display: flex;"> |
| | |
| | | <view class="tag-item">商品名称: {{item.maktx}}</view> |
| | | <view class="tag-item">商品规格: {{item.specs}}</view> |
| | | </view> |
| | | </scroll-view> |
| | | </view> |
| | | <uni-load-more v-show="matList.length != 0" :status="status" :icon-size="16" :content-text="contentText" /> |
| | | </view> |
| | | </template> |
| | | |
| | |
| | | data() { |
| | | return { |
| | | tagList: [], |
| | | matList: '', |
| | | matList: [], |
| | | reload: false, |
| | | curr:1, |
| | | tag: '分类', |
| | | baColor: "background-color: #0081ff;", |
| | | desc: '商品编号:', |
| | | baseUrl: '', |
| | | token: '' |
| | | token: '', |
| | | status: 'more', |
| | | contentText: { |
| | | contentdown: '上拉加载更多', |
| | | contentrefresh: '加载中', |
| | | contentnomore: '没有更多' |
| | | }, |
| | | // 当前tagId |
| | | tagIdNow: 1 |
| | | } |
| | | }, |
| | | onReachBottom() { |
| | | this.status = 'more'; |
| | | this.showMat(this.tagIdNow); |
| | | }, |
| | | onLoad() { |
| | | // 没啥用了 |
| | | let that = this |
| | | // const eventChannel = this.$scope.eventChannel; // 兼容APP-NVUE |
| | | const eventChannel = this.getOpenerEventChannel(); |
| | |
| | | // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据 |
| | | eventChannel.on('commonUrl', function(data) { |
| | | that.commonUrl = data.commonUrl |
| | | that.showTag(1) |
| | | }) |
| | | }, |
| | | onShow() { |
| | |
| | | }, |
| | | success(result) { |
| | | that.tagList = null |
| | | that.matList = null |
| | | that.matList = [] |
| | | var res = result.data |
| | | if (res.code === 200) { |
| | | if (res.data != null && res.data.length > 0) { |
| | |
| | | }, |
| | | showMat(tagId) { |
| | | let that = this |
| | | that.tagIdNow = tagId |
| | | if (tagId == null || tagId == '' || tagId == undefined) { |
| | | return; |
| | | } |
| | | console.log(tagId); |
| | | uni.request({ |
| | | url: that.baseUrl + '/mat/list/pda/auth', |
| | | url: that.baseUrl + '/mat/list/pda/page/auth', |
| | | data: { |
| | | curr:that.curr, |
| | | limit: 100, |
| | | tagId: tagId |
| | | }, |
| | | method:"GET", |
| | |
| | | that.tagList = null |
| | | var res = result.data |
| | | if (res.code === 200) { |
| | | if (res.data != null && res.data.length > 0) { |
| | | that.matList = res.data |
| | | if (res.data.records != null && res.data.records.length > 0) { |
| | | let list = res.data.records |
| | | that.matList = that.reload ? list : that.matList.concat(list); |
| | | that.curr = that.curr + 1 |
| | | if (res.data.records.length == 0) { |
| | | that.status = 'noMore' |
| | | } |
| | | that.baColor = "background-color: #1cbbb4;" |
| | | } |
| | | } else if (res.code === 403 ) { |
| | |
| | | }, |
| | | selectMat() { |
| | | let that = this |
| | | uni.vibrateShort(); |
| | | uni.navigateTo({ |
| | | url: "../mat/matQuery", |
| | | success: function(res) { |
| | | // 通过eventChannel向被打开页面传送数据 向另外一个页面传递值的 |
| | | res.eventChannel.emit('commonUrl', {commonUrl:that.commonUrl }) |
| | | res.eventChannel.emit('commonUrl', {commonUrl: '' }) |
| | | }, |
| | | events: { |
| | | // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据 另外一个页面传过来的 |
| | |
| | | var add = true |
| | | for (var i = 0; i < len; i++) { |
| | | if (mat.matnr == this.dataList[i].matnr) { |
| | | console.log(typeof mat.anfme); |
| | | this.dataList[i].anfme += mat.anfme |
| | | this.$forceUpdate() // 强制刷新 |
| | | add = false |