浏览代码

云仓库存显示

liyuan 1 周之前
父节点
当前提交
4333183c44
共有 3 个文件被更改,包括 78 次插入38 次删除
  1. 10 1
      api/tabBar/classification.js
  2. 1 1
      manifest.json
  3. 67 36
      pages/tabBar/classification.vue

+ 10 - 1
api/tabBar/classification.js

@@ -31,4 +31,13 @@ export function goodsListNew(params) {
 		method: 'GET',
 		params
 	})
-}
+}
+
+// 云仓模式
+export function cloudWarehouseList(params) {
+	return http.request({
+		url: '/blade-sales-part/productLaunch/cloudWarehouseList',
+		method: 'POST',
+		params
+	})
+}

+ 1 - 1
manifest.json

@@ -125,7 +125,7 @@
     "quickapp" : {},
     /* 小程序特有相关 */
     "mp-weixin" : {
-        "appid" : "wx18d75b948eaae4b1",
+        "appid" : "wx7a875fc287f41c3a",
         "setting" : {
             "urlCheck" : false,
             "postcss" : true,

+ 67 - 36
pages/tabBar/classification.vue

@@ -56,7 +56,7 @@
 									<view v-if="item.suggestedRetailPrice">
 										建议零售价:¥{{item.suggestedRetailPrice}}
 									</view>
-									
+
 								</view>
 							</view>
 							<image src="/static/images/tabBar/carIcon@2x.png" @click.stop="shoppingCartfun(item)"
@@ -134,7 +134,8 @@
 	import {
 		listAll2,
 		goodsList,
-		goodsListNew
+		goodsListNew,
+    cloudWarehouseList
 	} from '@/api/tabBar/classification.js'
 	import {
 		details,
@@ -145,6 +146,7 @@
 		addToCart,
 		appDetailNew,
 	} from '@/api/tabBar/homeNew.js'
+  import {isProcurement} from '@/api/tabBar/shoppingCart.js'
 	export default {
 		data() {
 			return {
@@ -190,6 +192,7 @@
 				phoneNumber: '', // 业务员联系电话
 				salesmanShow: false, // 联系业务员弹窗
 				userInfo: {}, // 当前用户数据
+        cloudWarehouse: 0
 			}
 		},
 		mounted() {},
@@ -233,6 +236,7 @@
 		},
 		onShow() {
 			this.getUpdate()
+      this.getIsCloud()
 			// 获取审核状态
 			details().then(res => {
 				this.checkStatus = res.data.checkStatus
@@ -265,6 +269,15 @@
 			}
 		},
 		methods: {
+      getIsCloud(){
+        isProcurement({
+          "param": "cloud_warehouse"
+        }).then(res => {
+          console.info('res-----', res)
+          this.cloudWarehouse = res.data
+        })
+      },
+
 			getUpdate() {
 				const updateManager = uni.getUpdateManager();
 				updateManager.onCheckForUpdate(function(res) {
@@ -582,39 +595,57 @@
 					title: '加载中',
 					mask: true
 				});
-				if (uni.getStorageSync('whether_openShare') == 1) {
-					goodsListNew({
-						size: this.page.size,
-						current: this.page.current,
-						...this.search,
-						whetherIntegral: '0'
-					}).then(res => {
-						this.dataList = this.dataList.concat(res.data.records)
-						this.page.total = res.data.total
-						if (this.dataList.length == res.data.total) {
-							this.status = 'nomore'
-						}
-						uni.hideLoading();
-					}).catch(err => {
-						uni.hideLoading();
-					})
-				} else {
-					goodsList({
-						size: this.page.size,
-						current: this.page.current,
-						...this.search,
-						whetherIntegral: '0'
-					}).then(res => {
-						this.dataList = this.dataList.concat(res.data.records)
-						this.page.total = res.data.total
-						if (this.dataList.length == res.data.total) {
-							this.status = 'nomore'
-						}
-						uni.hideLoading();
-					}).catch(err => {
-						uni.hideLoading();
-					})
-				}
+        if (this.cloudWarehouse == 1) {
+          cloudWarehouseList({
+            size: this.page.size,
+            current: this.page.current,
+            ...this.search,
+            whetherIntegral: '0'
+          }).then(res => {
+            this.dataList = this.dataList.concat(res.data.records)
+            this.page.total = res.data.total
+            if (this.dataList.length == res.data.total) {
+              this.status = 'nomore'
+            }
+            uni.hideLoading();
+          }).catch(err => {
+            uni.hideLoading();
+          })
+        } else {
+          if (uni.getStorageSync('whether_openShare') == 1) {
+            goodsListNew({
+              size: this.page.size,
+              current: this.page.current,
+              ...this.search,
+              whetherIntegral: '0'
+            }).then(res => {
+              this.dataList = this.dataList.concat(res.data.records)
+              this.page.total = res.data.total
+              if (this.dataList.length == res.data.total) {
+                this.status = 'nomore'
+              }
+              uni.hideLoading();
+            }).catch(err => {
+              uni.hideLoading();
+            })
+          } else {
+            goodsList({
+              size: this.page.size,
+              current: this.page.current,
+              ...this.search,
+              whetherIntegral: '0'
+            }).then(res => {
+              this.dataList = this.dataList.concat(res.data.records)
+              this.page.total = res.data.total
+              if (this.dataList.length == res.data.total) {
+                this.status = 'nomore'
+              }
+              uni.hideLoading();
+            }).catch(err => {
+              uni.hideLoading();
+            })
+          }
+        }
 
 			},
 		}
@@ -760,4 +791,4 @@
 			}
 		}
 	}
-</style>
+</style>