zhengjinyi 5 年之前
父节点
当前提交
7d39a77b85

+ 3 - 0
common/config/caimeiApi.js

@@ -108,6 +108,9 @@ const caimeiApi = {
 				key: key,
 				success: function (res){
 					resolve(res.data);
+				},
+				fail: function(res){
+					reject(false)
 				}
 			})
 		});

+ 2 - 2
common/config/config.js

@@ -4,8 +4,8 @@ if(process.env.NODE_ENV === 'development'){
 	// URL_CONFIG = 'http://192.168.1.24:8008'	 //俊俊联调地址
 	// URL_CONFIG = 'http://192.168.1.22:8008'	 //裴裴联调地址
 	// URL_CONFIG = 'http://192.168.1.26:8008'	 //超超联调地址
-    // URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
-	URL_CONFIG = 'https://spi.caimei365.com'
+    URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
+	// URL_CONFIG = 'https://spi.caimei365.com'
 }else{
     // 生产环境
     URL_CONFIG = 'https://spi.caimei365.com'

+ 10 - 8
components/cm-module/listTemplate/commodityList.vue

@@ -9,7 +9,7 @@
 					<text class="list-details-specs">规格:{{item.unit}}</text>
 					<view class="list-details-specs" v-if="item.productCode!=''&&item.productCode!=null">商品编码:{{item.productCode}}</view>
 					<view class="list-details-price">
-						<view v-if="hasLogin"class="list-price">
+						<view v-if="hasLogin" class="list-price">
 							<view v-if="userIdentity == 1">
 								<text v-if="priceLoading" class="price-larger small">正在获取价格...</text>
 								<text v-else>¥<text class="price-larger">{{item.price?item.price :'0.00'}}</text></text>
@@ -95,7 +95,7 @@
 				showLoading: false,
 				loadingNow: true,
 				loadingText: '上拉加载更多',
-				pageSize: 10,
+				pageSize: 20,
 				pageNum: 1,
 				totalPage: 1,
 				pullFlag: true,
@@ -110,14 +110,14 @@
 				this.clubStatus = resolve.clubStatus
 				this.userID = resolve.userID ? resolve.userID : '';
 				this.userIdentity = resolve.userIdentity
-				if(this.userIdentity = 1){
+				if(this.userIdentity == 1){
 					this.identity = 1
 				}else{
 					this.identity = 2
 				}
 				this.getListFromServer();
 			}).catch(error =>{
-				console.log(error)
+				this.getListFromServer();
 			})
 		},
 		computed: {
@@ -125,7 +125,7 @@
 		},
 		methods:{
 			toLower() {
-				if(this.totalPage>this.pageNum && this.pullFlag) {
+				if(this.totalPage>this.listData.length && this.pullFlag) {
 					this.getListFromServer(true);
 				}
 			},
@@ -165,11 +165,12 @@
 							this.setProductPrice()
 							this.showSkeleton = false
 						}
+						console.log(this.listData)
 						// 防上拉暴滑
 						this.pullFlag = false;
 						setTimeout(()=>{ this.pullFlag = true; },500)
 						// 底部提示文案
-						if(this.totalPage>this.pageNum) {
+						if(this.totalPage>this.listData.length) {
 							this.loadingText = '上拉加载更多';
 						} else {
 							this.showLoading = true;
@@ -178,6 +179,7 @@
 					} else {
 						if(!loadMore) { this.showEmpty = true; }
 					}
+					
 				}).catch(error =>{
 					this.$util.msg(error.msg,2000);
 				})
@@ -186,7 +188,7 @@
 				if (!this.userID) {return false;}
 				let productIdArr = [];
 				this.listData.map(item=>{// 0公开价格 1不公开价格 2仅对会员机构公开
-					if (item.priceflag != 1){ productIdArr.push(item.pid) }
+					productIdArr.push(item.pid)
 				})
 				this.productIds = productIdArr.join(",");
 				querySearchProductPrice({userId: this.userID,productIds:this.productIds}).then(response =>{
@@ -208,9 +210,9 @@
 								}
 							}
 						});
+						console.log(this.listData)
 					}
 					this.priceLoading = false;
-					this.showSkeleton = false;
 				}).catch(error =>{
 					this.$util.msg(error.msg,2000)
 				})

文件差异内容过多而无法显示
+ 509 - 502
components/cm-module/listTemplate/immediatelyList.vue


+ 30 - 13
pages/search/search.vue

@@ -3,8 +3,8 @@
 		<view class="search-main">
 			<view class="search-input">
 				<text class="iconfont icon-iconfonticonfontsousuo1"></text>
-				<input maxlength="20" focus type="text" value="" confirm-type="search" @focus="onFocus" @input="onShowClose" @confirm="subMitSearch()" placeholder="请输入商品关键词" v-model.trim="searchInputVal"/>
-				<text class="iconfont icon-shanchu1" v-if="isShowClose" @click="delInputText()"></text>
+				<input maxlength="20" :focus="isFocus" type="text" value="" confirm-type="search" @focus="onFocus" @input="onShowClose" @confirm="subMitSearch()" placeholder="请输入商品关键词" v-model.trim="searchInputVal"/>
+				<text class="iconfont icon-shanchu1" v-if="isShowClose" @click.stop="delInputText()"></text>
 			</view>
 			<view class="search-btn" @click="subMitSearch()">搜索</view>
 		</view>
@@ -110,6 +110,7 @@
 				serachRecordList:[],//历史搜索记录
 				isShowWrapper:false,
 				isModallayer:false,
+				isFocus:false,
 				priceLoading:true,
 				windowHeight: '',
 				showEmpty: false,
@@ -119,7 +120,7 @@
 				showLoading: false,
 				loadingNow: true,
 				loadingText: '上拉加载更多',
-				pageSize: 10,
+				pageSize: 20,
 				pageNum: 1,
 				hasNextPage: false,
 				totalPage: 1,
@@ -127,6 +128,7 @@
 			}
 		},
 		onLoad() {
+			this.isFocus = true
 			this.initGetSerachRecord()			
 		},
 		computed: {
@@ -155,11 +157,12 @@
 				}else{
 					this.listData =[]
 					this.setSearchHistoryAdd()
-					this.getListFromServer(false)
+					this.getListFromServer()
+					this.isFocus = false
 				}
 			},
 			scrolltolower() {
-				if(this.totalPage>this.pageNum && this.pullFlag) {
+				if(this.totalPage>this.listData.length && this.pullFlag) {
 					this.getListFromServer(true);
 				}
 			},
@@ -171,12 +174,19 @@
 				if(loadMore) {
 					this.pageNum += 1;
 				}
-				let params = {identity:this.identity,keyword:this.searchInputVal,pageNum:this.pageNum,pageSize:this.pageSize,sortField:'',sortType:''}
+				let params = {
+						identity:this.identity,
+						keyword:this.searchInputVal,
+						pageNum:this.pageNum,
+						pageSize:this.pageSize,
+						sortField:'',
+						sortType:'',
+					}
 				queryNewSearchProduct(params).then(response =>{
 					this.isShowWrapper = true
 					const resData = JSON.parse(response.data);
 					const resList = resData.items;
-					console.log(resData)
+					// console.log(resData)
 					if(resList && resList.length > 0){
 						this.totalPage = resData.total;
 						this.showEmpty = false;
@@ -191,7 +201,8 @@
 						this.pullFlag = false;
 						setTimeout(()=>{ this.pullFlag = true; },500)
 						// 底部提示文案
-						if(this.totalPage>this.pageNum) {
+						if(this.totalPage>this.listData.length) {
+							console.log('1111111111')
 							this.loadingText = '上拉加载更多';
 						} else {
 							this.showLoading = true;
@@ -246,7 +257,7 @@
 					this.$util.msg(error.msg,2000)
 				})
 			},
-			onShowClose () {//输入框失去焦点时触发
+			onShowClose () {//输入框输入时触发
 				this.inputEmpty(this.searchInputVal)
 			},
 			onFocus () { //输入框获取焦点时触发
@@ -279,8 +290,10 @@
 				this.isShowWrapper = false
 				if(val != ''){
 					this.isShowClose = true
+					this.isFocus = true
 				}else{					
 					this.isShowClose = false
+					this.isFocus = true
 				}
 			},
 			isInterceptHtmlFn(text){
@@ -335,6 +348,8 @@
 			background: #F0F0F0;
 			float: left;
 			.icon-iconfonticonfontsousuo1{
+				display: block;
+				width: 68rpx;
 				font-size: 36rpx;
 				color: #8A8A8A;
 				position: absolute;
@@ -342,13 +357,15 @@
 				z-index: 10;
 			}
 			.icon-shanchu1{
+				display: block;
+				width: 68rpx;
 				font-size: 36rpx;
-				color: #8A8A8A;
+				text-align: center;
+				color: #999;
 				position: absolute;
-				right: 24rpx;
+				right: 0;
 				top: 0;
-				padding: 0 10rpx;
-				z-index: 10;
+				z-index: 60;
 			}
 			input{
 				width: 448rpx;

部分文件因为文件数量过多而无法显示