|
@@ -1,7 +1,20 @@
|
|
|
<template>
|
|
|
- <view class="content">
|
|
|
-
|
|
|
- </view>
|
|
|
+ <view class="content">
|
|
|
+ <mosowe-invented-list
|
|
|
+ :list="list"
|
|
|
+ :cacheNum="30">
|
|
|
+ <template #default="{ item }">
|
|
|
+ <view class="item">
|
|
|
+ <view class="name">
|
|
|
+ {{ item.list[0].productName }}
|
|
|
+ </view>
|
|
|
+ <view class="age">
|
|
|
+ {{ item.list[0].productCode }}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
+ </mosowe-invented-list>
|
|
|
+ </view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
@@ -10,31 +23,38 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- extraData:{
|
|
|
- id: 'promoProductList',
|
|
|
- // 添加产品
|
|
|
- chooseProduct:(item)=>{
|
|
|
- this.chooseProduct(item)
|
|
|
- }
|
|
|
- },
|
|
|
promoActiveSn: null,
|
|
|
chooseList: [],
|
|
|
- screenWidth: 0,
|
|
|
+ windowWidth: 0,
|
|
|
+ windowHeight: 0,
|
|
|
showChoosePopu: false,
|
|
|
- queryWord: ''
|
|
|
+ queryWord: '',
|
|
|
+ ctxScroll: null,
|
|
|
+ trigger: false,
|
|
|
+ loading: false,
|
|
|
+ over: false,
|
|
|
+ // 列表数据
|
|
|
+ pageNo: 1,
|
|
|
+ pageSize: 200,
|
|
|
+ list: [],
|
|
|
};
|
|
|
},
|
|
|
onLoad(opts) {
|
|
|
uni.setNavigationBarTitle({
|
|
|
title: opts.title||'促销活动产品'
|
|
|
})
|
|
|
- this.screenWidth = uni.getSystemInfoSync().windowWidth
|
|
|
+ this.windowWidth = uni.getSystemInfoSync().windowWidth
|
|
|
+ this.windowHeight = uni.getSystemInfoSync().windowHeight
|
|
|
+ // 初始化数据
|
|
|
this.$store.state.vuex_tempData = null
|
|
|
this.promoActiveSn = opts.promoActiveSn
|
|
|
// 购物车是否有缓存
|
|
|
const cacheList = this.$store.state.vuex_cartList.find(k => k.sn == this.promoActiveSn)
|
|
|
this.chooseList = cacheList ? JSON.parse(JSON.stringify(cacheList.list)) : []
|
|
|
},
|
|
|
+ onReady() {
|
|
|
+ this.loadData()
|
|
|
+ },
|
|
|
onShow() {
|
|
|
this.showChoosePopu=false
|
|
|
},
|
|
@@ -47,23 +67,17 @@
|
|
|
this.$store.state.vuex_cartList.push({sn:this.promoActiveSn,list: this.chooseList})
|
|
|
}
|
|
|
this.$u.vuex('vuex_cartList', this.$store.state.vuex_cartList)
|
|
|
-
|
|
|
// 清空数据
|
|
|
this.chooseList = null
|
|
|
},
|
|
|
methods: {
|
|
|
- // 查询列表
|
|
|
- searchList(){
|
|
|
- this.$refs.paging.reload()
|
|
|
- },
|
|
|
- // @query所绑定的方法不要自己调用!!需要刷新列表数据时,只需要调用this.$refs.paging.reload()即可
|
|
|
- getRow(pageNo, pageSize) {
|
|
|
- console.log('pageNo',pageNo)
|
|
|
- console.log('pageSize',pageSize)
|
|
|
- let _this = this
|
|
|
+ // 加载数据
|
|
|
+ loadData() {
|
|
|
+ console.log('pageNo',this.pageNo)
|
|
|
+ console.log('pageSize',this.pageSize)
|
|
|
let params = {
|
|
|
- pageNo: pageNo,
|
|
|
- pageSize: pageSize,
|
|
|
+ pageNo: this.pageNo,
|
|
|
+ pageSize: this.pageSize,
|
|
|
queryWord: this.queryWord,
|
|
|
promoActiveSn: this.promoActiveSn
|
|
|
}
|
|
@@ -86,7 +100,8 @@
|
|
|
ret.push({list:[this.formatData(a,hasAChecked)]})
|
|
|
}
|
|
|
}
|
|
|
- _this.$refs.paging.complete(ret);
|
|
|
+ this.total = (res.data.count || 0) + 1
|
|
|
+ this.list = this.list.concat(ret)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -118,12 +133,30 @@
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
-.content{
|
|
|
- width: 100%;
|
|
|
- height: 100vh;
|
|
|
-}
|
|
|
.tab-search{
|
|
|
padding: 15rpx 20rpx;
|
|
|
background: #fff;
|
|
|
}
|
|
|
+.content {
|
|
|
+ width: 100vw;
|
|
|
+ height: 100vh;
|
|
|
+ .name {
|
|
|
+ font-size: 32rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ line-height: 40rpx;
|
|
|
+ margin-bottom: 20rpx;
|
|
|
+ color: #333;
|
|
|
+ }
|
|
|
+ .age {
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #999;
|
|
|
+ }
|
|
|
+ .item {
|
|
|
+ margin: 30rpx;
|
|
|
+ padding: 30rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
+ background-color: #eee;
|
|
|
+ border-radius: 12rpx;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|