lilei vor 9 Monaten
Ursprung
Commit
16966a6c18
4 geänderte Dateien mit 21 neuen und 53 gelöschten Zeilen
  1. 1 1
      App.vue
  2. 3 3
      pages/index/index.vue
  3. 1 1
      pagesB/cart/productitem.vue
  4. 16 48
      pagesB/shopiing/shopProduct.vue

+ 1 - 1
App.vue

@@ -1,7 +1,7 @@
 <script>
 	export default {
 		globalData: {
-			baseUrl: 'http://192.168.2.100:9110/saas/clz/', // 本地
+			baseUrl: 'http://192.168.2.10:7002/saas/clz/', // 本地
 			// baseUrl: 'https://md.test.zyucgj.com/saas/clz/', // 预发布
 			// baseUrl: 'https://car.zyucgj.com/saas/clz/' // 生产
 		},

+ 3 - 3
pages/index/index.vue

@@ -489,7 +489,7 @@
 			// 商品一级分类
 			getGoodType(){
 				this.productTypeList = []
-				getShopCategory({categoryLevel: 1, status: 1}).then(res => {
+				getShopCategory({categoryLevel: 1}).then(res => {
 					const list = res.data || []
 					const ret = []
 					list.forEach(item => {
@@ -499,7 +499,7 @@
 							auth: true,
 							name: item.categoryName,
 							icon: item.iconUrl,
-							url: '/pagesB/shopiing/shopProduct?clzId='+item.categorySn+'&clzName='+item.categoryName,
+							url: '/pagesB/shopiing/shopProduct?clzId='+item.categorySn+'&clzName='+item.categoryName+"&shopCategoryCount="+item.shopCategoryCount+'&shopProductCount='+item.shopProductCount,
 							target: 'page'
 						})
 					})
@@ -522,7 +522,7 @@
 				this.status = "loading"
 				const dealerSn = this.hasLogin && this.userInfo && this.userInfo.sysUserFlag == '1' ? this.$store.state.vuex_storeShelf.dealerSn : ''
 				// 获取推荐产品	
-				 getShopProductList({pageNo:this.hotProductPageNo,pageSize:10,hotFlag:1, status: 1,categoryStatus : 1, dealerSn: dealerSn}).then(res => {
+				 getShopProductList({pageNo:this.hotProductPageNo,pageSize:10,hotFlag:1, status: 1, dealerSn: dealerSn}).then(res => {
 					 if(res.status == 200){
 						 const list = res.data ? res.data.list : []
 						 this.productList.push(list)

+ 1 - 1
pagesB/cart/productitem.vue

@@ -23,7 +23,7 @@
 						<text max-lines="2" overflow="ellipsis">{{item.productOrigCode}}</text>
 					</view>
 					<view class="choose-product-item-left-info-price">
-						<view class="price-txt">¥<text>{{item.price}}</text></view>
+						<view class="price-txt" v-if="item.status==1">¥<text>{{item.price}}</text></view>
 						<view>
 							<view v-if="item.status==1&&item.dealerScopeFlag==1" :style="{opacity:!item.edit?1:0,width:!item.edit?'auto':0}">
 								<view class="flex align_center qty-box">

+ 16 - 48
pagesB/shopiing/shopProduct.vue

@@ -77,7 +77,7 @@
 	    mapMutations,
 	} from 'vuex'
 	import chooseProductItem from '@/pagesB/components/chooseProductItemSkline.vue'
-	import { getShopCategoryExt, getShopProductList } from '@/api/shop.js'
+	import { getShopCategory, getShopProductList } from '@/api/shop.js'
 	export default {
 		components:{
 			chooseProductItem
@@ -127,17 +127,20 @@
 			
 			// 一级分类id
 			this.clzId = opts.clzId
+			// 一级分类名称
+			this.title = opts.clzName
 			
-			// 搜索商品
-			if(opts.clzId==''){
-				this.title = '商城商品搜索'
-				this.focus = true
-			}else{
-				// 分类下产品
-				this.title = opts.clzName
+			// 一级分类下是二级目录
+			if(opts.shopCategoryCount>0){
 				// 查二级目录
 				this.getCategory()
 			}
+			// 一级分类下是产品
+			if(opts.shopProductCount>0){
+				this.categorySn = opts.clzId
+				// 目录下商品
+				this.searchList()
+			}
 		},
 		methods: {
 			// 返回
@@ -152,55 +155,20 @@
 			},
 			// 获取二级目录
 			getCategory(){
-				getShopCategoryExt({
-					categorySn: this.clzId,
-					status: 1
+				getShopCategory({
+					parentSn: this.clzId,
+					categoryLevel: 2
 				}).then(res => {
 					if(res.status == 200){
 						// 二级目录
-						this.categoryList = res.data && res.data.shopCategoryList ? res.data.shopCategoryList : []
+						this.categoryList = res.data || []
 						// 如果有二级目录
 						if(this.categoryList.length > 0){
-							// this.categoryList.unshift({
-							// 	categorySn: this.clzId,
-							// 	categoryName: '全部'
-							// })
 							// 默认显示第一个
 							this.categorySn = this.categoryList[0].categorySn
 							// 目录下商品
 							this.searchList()
-						}else{
-							// 禁用下拉刷新
-							this.enableRefresh = false
-							// 只有产品
-							const list = res.data && res.data.shopProductList ? res.data.shopProductList : []
-							this.total = list.length
-							// 更新已选状态
-							for(let i=0;i<list.length;i=i+this.pageSize){
-							  // 追加数据
-							  this.list.push(list.slice(i,(i+this.pageSize)>list.length?list.length:(i+this.pageSize)).map(k=>{
-								  return  {
-									  id: k.id,
-									  price: k.price,
-									  productCode: k.productCode,
-									  productSn: k.productSn,
-									  productImage: k.productMsg,
-									  productName: k.productName,
-									  productOrigCode: k.productOrigCode,
-									  categorySn: k.categorySn,
-									  hotFlag: k.hotFlag,
-									  productSn: k.productSn,
-									  priceType: k.priceType,
-									  shopProductSn: k.shopProductSn,
-									  status: k.status,
-									  statusDictValue: k.statusDictValue,
-									  dealerScopeFlag: k.dealerScopeFlag
-								  }
-							  }))
-							}
-							this.loadEnd = true
-							this.loadText = '没有更多了'
-						}
+						} 
 					}else{
 						uni.showToast({
 							title: res.message,