浏览代码

接口调用

yuwenjun 4 年之前
父节点
当前提交
a60d288e54

+ 115 - 104
App.vue

@@ -1,119 +1,130 @@
 <script>
-	/**
-	 * vuex管理登陆状态,具体可以参考官方登陆模板示例
-	 */
-	import Vue from 'vue'
-	import { mapState,mapMutations} from 'vuex';
-	import authorize from '@/common/config/authorize.js'
-	import wxLogin from "@/common/config/wxLogin.js"
-	export default {
-		onLaunch: function() {
-			let self = this
-			uni.getSystemInfo({
-				success: function(e) {
-					let modelmes = e.model;
-					console.log(e);
-					if (modelmes.search('iPhone 11') || modelmes.search('iPhone 11 Pro Max') ||modelmes.search('iPhone X') != -1) { //XS,XR,XS MAX均可以适配
-						self.$store.dispatch('setVariableFun',true)
-					}else{
-						self.$store.dispatch('setVariableFun',false)
-					}
-					// #ifndef MP
-					Vue.prototype.StatusBar = e.statusBarHeight;
-					if (e.platform == 'android') {
-						Vue.prototype.CustomBar = e.statusBarHeight + 50;
-						Vue.prototype.platformClass = true
-					} else {
-						Vue.prototype.CustomBar = e.statusBarHeight + 45;
-						Vue.prototype.platformClass = false
-					};
-					// #endif
-			
-					// #ifdef MP-WEIXIN || MP-QQ
-					console.log(e.platform)
-					if (e.platform == 'android') {
-						Vue.prototype.platformClass = 'left'
-						self.$store.dispatch('setVariableFun',false)
-					} else {
-						Vue.prototype.platformClass = 'center'
-						self.$store.dispatch('setIsIphoneFun',true)
-					}
-					Vue.prototype.StatusBar = e.statusBarHeight;
-					Vue.prototype.fontSizeSetting = e.fontSizeSetting
-					Vue.prototype.screenWidth = e.screenWidth
-					let capsule = wx.getMenuButtonBoundingClientRect();
-					Vue.prototype.capsule = capsule
-					if (capsule) {
-						Vue.prototype.Custom = capsule;
-						// Vue.prototype.capsuleSafe = uni.upx2px(750) - capsule.left + uni.upx2px(750) - capsule.right;
-						Vue.prototype.CustomBar = capsule.bottom + capsule.top - e.statusBarHeight;
-					} else {
-						Vue.prototype.CustomBar = e.statusBarHeight + 50;
-					}
-					// #endif		
-					// #ifdef MP-ALIPAY
-					Vue.prototype.StatusBar = e.statusBarHeight;
-					Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
-					// #endif
+/**
+ * vuex管理登陆状态,具体可以参考官方登陆模板示例
+ */
+import Vue from 'vue'
+import { mapState, mapMutations } from 'vuex'
+import authorize from '@/common/config/authorize.js'
+import wxLogin from '@/common/config/wxLogin.js'
+export default {
+	onLaunch: function() {
+		let self = this
+		uni.getSystemInfo({
+			success: function(e) {
+				let modelmes = e.model
+				console.log(e)
+				self.$store.commit('setWindowHeight', e.windowHeight)
+				if (
+					modelmes.search('iPhone 11') ||
+					modelmes.search('iPhone 11 Pro Max') ||
+					modelmes.search('iPhone X') != -1
+				) {
+					//XS,XR,XS MAX均可以适配
+					self.$store.dispatch('setVariableFun', true)
+				} else {
+					self.$store.dispatch('setVariableFun', false)
 				}
-			})
-			this.refresh()
-			if(uni.getStorageSync('isActivityStatus')){
-				const  lockTime = uni.getStorageSync('lockTime')
-				const  eTime = this.diffTime(lockTime)
-				this.$store.dispatch('setActivityFn',eTime)
-			}else{
-				this.$store.dispatch('setActivityFn',true)
+				// #ifndef MP
+				Vue.prototype.StatusBar = e.statusBarHeight
+				if (e.platform == 'android') {
+					Vue.prototype.CustomBar = e.statusBarHeight + 50
+					Vue.prototype.platformClass = true
+				} else {
+					Vue.prototype.CustomBar = e.statusBarHeight + 45
+					Vue.prototype.platformClass = false
+				}
+				// #endif
+
+				// #ifdef MP-WEIXIN || MP-QQ
+				console.log(e.platform)
+				if (e.platform == 'android') {
+					Vue.prototype.platformClass = 'left'
+					self.$store.dispatch('setVariableFun', false)
+				} else {
+					Vue.prototype.platformClass = 'center'
+					self.$store.dispatch('setIsIphoneFun', true)
+				}
+				Vue.prototype.StatusBar = e.statusBarHeight
+				Vue.prototype.fontSizeSetting = e.fontSizeSetting
+				Vue.prototype.screenWidth = e.screenWidth
+				let capsule = wx.getMenuButtonBoundingClientRect()
+				Vue.prototype.capsule = capsule
+				if (capsule) {
+					Vue.prototype.Custom = capsule
+					// Vue.prototype.capsuleSafe = uni.upx2px(750) - capsule.left + uni.upx2px(750) - capsule.right;
+					Vue.prototype.CustomBar = capsule.bottom + capsule.top - e.statusBarHeight
+				} else {
+					Vue.prototype.CustomBar = e.statusBarHeight + 50
+				}
+				// #endif
+				// #ifdef MP-ALIPAY
+				Vue.prototype.StatusBar = e.statusBarHeight
+				Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight
+				// #endif
 			}
-		},
-		methods:{
-			async getWxAuthorize() {
-				const wechatCode = await authorize.getCode('weixin')
-				this.UserService.userInfoLogin({code:wechatCode}).then(response=>{
-					this.login(response.data);
-					this.$store.commit('updateStatus',response.data)
-				}).catch(error =>{
-					uni.setStorage({//缓存游客用户openid
-					    key: 'openid',
-					    data: error.data.openid
+		})
+		this.refresh()
+		if (uni.getStorageSync('isActivityStatus')) {
+			const lockTime = uni.getStorageSync('lockTime')
+			const eTime = this.diffTime(lockTime)
+			this.$store.dispatch('setActivityFn', eTime)
+		} else {
+			this.$store.dispatch('setActivityFn', true)
+		}
+	},
+	methods: {
+		async getWxAuthorize() {
+			const wechatCode = await authorize.getCode('weixin')
+			this.UserService.userInfoLogin({ code: wechatCode })
+				.then(response => {
+					this.login(response.data)
+					this.$store.commit('updateStatus', response.data)
+				})
+				.catch(error => {
+					uni.setStorage({
+						//缓存游客用户openid
+						key: 'openid',
+						data: error.data.openid
 					})
 					this.logout()
 				})
-			},
-			refresh(){
-				let TIME = (20*60)*1000;
-				setInterval(()=>{
-					authorize.getSetting().then(res =>{// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
-						if(res == 1){
+		},
+		refresh() {
+			let TIME = 20 * 60 * 1000
+			setInterval(() => {
+				authorize
+					.getSetting()
+					.then(res => {
+						// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
+						if (res == 1) {
 							this.getWxAuthorize()
-						}else{
-							console.log('授权失败============>:'+'用户取消授权或者未操作')
+						} else {
+							console.log('授权失败============>:' + '用户取消授权或者未操作')
 						}
-					}).catch(error=>{
-						console.log('授权失败============>:'+'用户授权失败,提醒用户重新授权')
 					})
-				},TIME)
-			},
-			diffTime(t){
-				let date = Date.now();
-				return (date -t) < 2*60*1000 ? false : true
-			}
-		},
-		onShow: function() {
-			
-		},
-		onHide: function() {
-			console.log('App Hide')
+					.catch(error => {
+						console.log('授权失败============>:' + '用户授权失败,提醒用户重新授权')
+					})
+			}, TIME)
 		},
+		diffTime(t) {
+			let date = Date.now()
+			return date - t < 2 * 60 * 1000 ? false : true
+		}
+	},
+	onShow: function() {},
+	onHide: function() {
+		console.log('App Hide')
 	}
+}
 </script>
 
 <style lang="scss">
-	/*每个页面公共css */
-	@import "@/common/css/common.scss";
-	@import "@/common/css/iconfont.scss";
-	@import "@/common/css/style/thorui.css";
-	@import "@/common/css/style/icon.css";
+/*每个页面公共css */
+@import '@/common/css/common.scss';
+@import '@/common/css/iconfont.scss';
+@import '@/common/css/style/thorui.css';
+@import '@/common/css/style/icon.css';
 
 view,
 scroll-view,
@@ -150,9 +161,9 @@ video {
 //   filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
 //   --toast-default-width: 114px;
 // }
-page{
+page {
 	height: 100%;
-	background-color: #FFFFFF;
+	background-color: #ffffff;
 }
 /* 骨架屏替代方案 */
 .Skeleton {

+ 440 - 378
components/cm-module/listTemplate/productList.vue

@@ -1,436 +1,498 @@
 <template>
-	<view class="container commodity-list-wrapper" :style="{'overflow':(showSkeleton? 'hidden' : 'auto'),'height': (showSkeleton? windowHeight + 'px' : 'auto')}">
-		<list-skeleton v-if="showSkeleton" :listType='0'></list-skeleton>
+	<view
+		class="container commodity-list-wrapper"
+		:style="{
+			overflow: showSkeleton ? 'hidden' : 'auto',
+			height: showSkeleton ? windowHeight + 'px' : 'auto'
+		}"
+	>
+		<list-skeleton v-if="showSkeleton" :listType="0"></list-skeleton>
 		<!-- 搜索框 -->
-		<fuzzy-search placeholder="搜索商品名称"  @fuzzyClick="fuzzyClickHandle" :fixed="true" @input="fuzzyInputHandle"></fuzzy-search>
+		<fuzzy-search
+			placeholder="搜索商品名称"
+			:fixed="true"
+			@search="searchValHandle"
+			@input="searchValChange"
+			@clear="searchValClear"
+		></fuzzy-search>
 		<!-- 内容区域 -->
-		<view class="product-container" v-if="!isShowEmpty">
-			<scroll-view :style="{'height':scrollHeight+'px'}" @scrolltolower="scrolltolower" scroll-y v-if="productList.length > 0">
-				<view v-for="(item,index) in productList" :key="index" :id="item.id" class="all-type-list-content commodity-list goods-item" @click.stop="navToDetailPage(item.productID)">
-					<image mode='widthFix' :src="item.mainImage"  class="list-img" alt="list-img"></image>
-					<view class="list-details-info">
-						<text class="list-details-title">{{item.name}}</text>
-						<!-- 商品标签 -->
-						<!-- <view class="list-details-tags">
+		<scroll-view
+			class="product-container"
+			@scrolltolower="scrolltolower"
+			scroll-y
+			v-if="!isShowEmpty || productList.length > 0"
+		>
+			<view
+				v-for="(item, index) in productList"
+				:key="index"
+				:id="item.id"
+				class="all-type-list-content commodity-list goods-item"
+				@click.stop="navToDetailPage(item.productID)"
+			>
+				<image
+					mode="widthFix"
+					:src="item.mainImage"
+					class="list-img"
+					alt="list-img"
+				></image>
+				<view class="list-details-info">
+					<text class="list-details-title">{{ item.name }}</text>
+					<!-- 商品标签 -->
+					<!-- <view class="list-details-tags">
 							<tui-tag type="red" class="tag" padding="6rpx" size="20rpx" plain>商品标签</tui-tag>
 							<tui-tag type="red" class="tag" padding="6rpx" size="20rpx" plain>商品标签</tui-tag>
 						</view> -->
-						<text class="list-details-specs">规格:{{item.unit !=null ? item.unit : ''}}</text>
-						<text class="list-details-specs">商品编码:{{item.productCode !=null ? item.productCode : ''}}</text>
-						<!-- <text class="list-details-miniQuantity">起订量:{{ item.ladderPriceFlag == '1' ? item.maxBuyNumber : item.minBuyNumber}}</text> -->
-						
-						<!-- 价格 -->
-						<view class="list-details-price">
-							<view class="list-shop">
-								<view class="list-price-none" v-if="item.repurchasePriceState">
-									<text class="price-none">¥{{item.discountPrice}}</text>
-									<text class="iconfont icon-wenhao" @click.stop="repurchModel"></text>
-								</view>
-								<view class="list-price" v-else>
-									<text class="price-larger" :class="PromotionsFormat(item.promotions) ? 'none' : ''">
-										¥{{ (PromotionsFormat(item.promotions) ? item.price1 : item.retailPrice) | NumFormat }}
-									</text>
-								</view>
+					<text class="list-details-specs"
+						>规格:{{ item.unit != null ? item.unit : '' }}</text
+					>
+					<text class="list-details-specs"
+						>商品编码:{{ item.productCode != null ? item.productCode : '' }}</text
+					>
+					<!-- <text class="list-details-miniQuantity">起订量:{{ item.ladderPriceFlag == '1' ? item.maxBuyNumber : item.minBuyNumber}}</text> -->
+					<!-- 价格 -->
+					<view class="list-details-price">
+						<view class="list-shop">
+							<view class="list-price-none" v-if="item.repurchasePriceState">
+								<text class="price-none">¥{{ item.discountPrice }}</text>
+								<text
+									class="iconfont icon-wenhao"
+									@click.stop="repurchModel"
+								></text>
 							</view>
-							<button class="add-cart-btn" @click.stop="operationHanld(item)">购买</button>
-						</view>
-						<!-- 活动标签 -->
-						<view class="list-details-price" v-if="item.actStatus==1">
-							<view class="floor-item-act">
-								<view class="floor-tags" v-if="PromotionsFormat(item.promotions)">
-									{{item.promotions.name}}<text v-if="item.price1TextFlag != 1">:¥{{ item.retailPrice | NumFormat }}</text>
-								</view>
-								<view class="floor-tags" v-else>{{item.promotions.name}}</view>	
+							<view class="list-price" v-else>
+								<text
+									class="price-larger"
+									:class="PromotionsFormat(item.promotions) ? 'none' : ''"
+								>
+									¥{{
+										(PromotionsFormat(item.promotions)
+											? item.price1
+											: item.retailPrice) | NumFormat
+									}}
+								</text>
 							</view>
-							<view class="floor-item-act" v-if="item.actStatus ==0  &&  item.ladderPriceFlag==1">
-								<view class="floor-tags">阶梯价格</view>	
+						</view>
+						<button class="add-cart-btn" @click.stop="operationHanld(item)">
+							购买
+						</button>
+					</view>
+					<!-- 活动标签 -->
+					<view class="list-details-price" v-if="item.actStatus == 1">
+						<view class="floor-item-act">
+							<view class="floor-tags" v-if="PromotionsFormat(item.promotions)">
+								{{ item.promotions.name
+								}}<text v-if="item.price1TextFlag != 1"
+									>:¥{{ item.retailPrice | NumFormat }}</text
+								>
 							</view>
-						</view>	
+							<view class="floor-tags" v-else>{{ item.promotions.name }}</view>
+						</view>
+						<view
+							class="floor-item-act"
+							v-if="item.actStatus == 0 && item.ladderPriceFlag == 1"
+						>
+							<view class="floor-tags">阶梯价格</view>
+						</view>
 					</view>
 				</view>
-				<button class="show-more-btn" v-if="showRegularBtn" @click="getListFromServer(true)">查看更多</button>
-				<view v-if="showLoading && productList.length > 4 && !showRegularBtn">
-					<view class="loading-wrapper loading-wrapper-now" v-if="loadingNow">{{loadingText}}<text v-if="loadingText === '已至底部'">‧ ‧ ‧</text></view>
-					<view class="loading-wrapper loading-wrapper-btm" v-else>———<text class="btm-text">已至底部</text>———</view>
-				</view>
-			</scroll-view>
-		</view>
+			</view>
+			<!--加载loadding-->
+			<tui-loadmore :visible="loadingNow" :index="3" text="加载中..."></tui-loadmore>
+			<tui-nomore :visible="!loadingNow" text="没有更多了"></tui-nomore>
+			<!--加载loadding END-->
+		</scroll-view>
 		<!-- 商品列表为空时 -->
 		<view class="empty-container" v-else>
-			<image class="empty-container-image" src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AWdWzAAGlgAP0das422.png" mode="aspectFit"></image>
+			<image
+				class="empty-container-image"
+				src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AWdWzAAGlgAP0das422.png"
+				mode="aspectFit"
+			></image>
 			<text class="error-text">暂时没有商品哦,尽请期待!~</text>
 		</view>
 		<!-- 可拖动悬浮按钮 -->
-		<cm-drag v-if="!isShowEmpty"
-				 :cartNum="cartQuantity" 
-				 :isDock="true"
-				 :existTabBar="true" 
-				 @btnClick="btnClick" 
-				 @btnTouchstart="btnTouchstart" 
-				 @btnTouchend="btnTouchend">
-		</cm-drag>		
+		<cm-drag
+			:cartNum="cartQuantity"
+			:isDock="true"
+			:existTabBar="true"
+			@btnClick="btnClick"
+			@btnTouchstart="btnTouchstart"
+			@btnTouchend="btnTouchend"
+		>
+		</cm-drag>
 		<!-- 透明模态层 -->
-		<modal-layer v-if='isModallayer'></modal-layer>
+		<modal-layer v-if="isModallayer"></modal-layer>
 	</view>
 </template>
 
 <script>
-	import listSkeleton from '@/components/cm-module/listTemplate/listSkeleton'
-	import modalLayer from "@/components/modal-layer"
-	import uniStars from '@/components/uni-stars/uni-stars.vue'
-	import cmDrag from '@/components/cm-custom/cm-drag.vue'
-	import fuzzySearch from '@/components/cm-module/search/fuzzySearch.vue'
-	// 引入测试数据
-	import {productList} from '@/common/json/data.json.js'
-	import { mapState,mapMutations } from 'vuex';
-	export default{
-		name:'productList',
-		components:{
-			listSkeleton,
-			modalLayer,
-			uniStars,
-			cmDrag,
-			fuzzySearch
+import listSkeleton from '@/components/cm-module/listTemplate/listSkeleton'
+import modalLayer from '@/components/modal-layer'
+import uniStars from '@/components/uni-stars/uni-stars.vue'
+import cmDrag from '@/components/cm-custom/cm-drag.vue'
+import fuzzySearch from '@/components/cm-module/search/fuzzySearch.vue'
+import { mapState, mapMutations } from 'vuex'
+export default {
+	name: 'productList',
+	components: {
+		listSkeleton,
+		modalLayer,
+		uniStars,
+		cmDrag,
+		fuzzySearch
+	},
+	props: {
+		emptyText: {
+			type: String
+		}
+	},
+	data() {
+		return {
+			isModallayer: false,
+			windowHeight: '',
+			// 是否显示骨架
+			showSkeleton: false,
+			isShowEmpty: false,
+			userID: '',
+			scrollHeight: '',
+			productList: [],
+			loadingNow: false,
+			pageSize: 10,
+			pageNum: 1,
+			hasNextPage: false,
+			pullFlag: true,
+			cartQuantity: 0,
+			showRegularBtn: true,
+			isPrecedence: false,
+			searchVal: '' //搜索框
+		}
+	},
+	created() {
+		// 从缓存中获取机构id
+		this.$api.getComStorage('clubInfo').then(e => {
+			this.userID = e.userId
+			this.getGoodsList()
+		})
+	},
+	filters: {
+		NumFormat: function(text) {
+			//处理金额
+			return Number(text).toFixed(2)
+		}
+	},
+	computed: {
+		...mapState(['hasLogin', 'userInfo', 'identity'])
+	},
+	methods: {
+		// 模糊框单击事件
+		fuzzyClickHandle(e) {
+			console.log(e)
 		},
-		props: {
-			emptyText: {
-				type: String
-			},
+		// 绑定数据
+		searchValChange(val){
+			this.searchVal = val
 		},
-		data(){
-			return{
-				isModallayer:false,
-				windowHeight: '',
-				// 是否显示骨架
-				showSkeleton: false,
-				isShowEmpty: false,
-				userID: '',
-				scrollHeight: '',
-				productList: [],
-				showLoading: false,
-				loadingNow: true,
-				loadingText: '上拉加载更多',
-				pageSize: 10,
-				pageNum: 1,
-				hasNextPage: false,
-				pullFlag: true,
-				fromRegularPurchasePage: false,
-				cartQuantity: 0,
-				showRegularBtn: true,
-				isPrecedence:false
+		// 搜索按钮点击事件
+		searchValHandle(val){
+			// 如果输入框内容为空
+			if(val.trim().length<=0){
+				this.searchVal = ''
+				return
 			}
+			console.log(this.searchVal)
+			this.searchVal = val
+			// 查询数据 => 刷新列表
+			this.getGoodsList(true)
 		},
-		created() {
-			// 设置测试数据
-			this.productList = productList
-			this.setScrollHeight();		
-			this.$api.getStorage().then((resolve) =>{
-				this.userID = resolve.userID
-				// 获取产品数据
-				// this.getProductAgainInfo()
-			})
+		searchValClear(){
+			this.searchVal = ''
 		},
-		filters: {
-			NumFormat:function(text) {//处理金额
-				return Number(text).toFixed(2);
-			},
-		},
-		computed: {
-			...mapState(['hasLogin','userInfo','identity'])
+		// 上拉加载更多
+		scrolltolower() {
+			if (this.hasNextPage && this.pullFlag) {
+				this.pageNum += 1
+				this.pullFlag = false
+				this.loadingNow = true
+				this.getGoodsList(true)
+				// 下拉刷新间隔为2s
+				setTimeout(() => {
+					this.pullFlag = true
+				}, 2000)
+			}
 		},
-		methods:{
-			// 模糊框单击事件
-			fuzzyClickHandle(e){
-				console.log(e);
-			},
-			// 模糊搜索框输入时
-			fuzzyInputHandle(e){
-				console.log(e);
-			},
-			scrolltolower() {
-				if(this.hasNextPage && this.pullFlag) {
-					this.getProductAgainInfo(true);
+		// 获取商品列表
+		async getGoodsList(flag = false) {
+			// 如果是刷新列表或按名称查找,页码定位到第一页
+			if (!flag) {
+				this.pageNum = 1
+			}
+			// 参数
+			const params = {
+				organizeId: this.userID,
+				pageNum: this.pageNum,
+				pageSize: this.pageSize,
+				productName: this.searchVal
+			}
+			// 获取商品数据
+			const { code, data: result } = await this.SellerService.GoodList(params).catch(
+				error => {
+					console.log(error)
 				}
-			},
-			setScrollHeight() {
-				const {windowHeight, pixelRatio} = wx.getSystemInfoSync();
-				this.windowHeight = windowHeight - 1;
-				this.scrollHeight = windowHeight - 1;
-			},
-			getProductAgainInfo(loadMore) {
-				this.showLoading = true;
-				this.loadingNow = true;
-				this.loadingText = '加载中';
-				this.isShowEmpty = false;				
-				if(loadMore) {this.pageNum += 1;}
-				let params = {userId:this.userID,identity:this.identity,pageNum:this.pageNum,pageSize:this.pageSize}
-				this.ProductService.GetRepeatBuyAgainProductList(params).then(response =>{
-					this.isShowWrapper = true
-					this.cartQuantity = response.data.cartQuantity
-					const responseData = response.data.pageDate;
-					if(responseData.results && responseData.results.length > 0){
-						this.hasNextPage = responseData.hasNextPage;
-						this.isShowEmpty = false;
-						if(loadMore) {
-							this.productList = [...this.productList,...responseData.results];
-						} else {
-							this.productList = [...responseData.results];
-							this.showSkeleton = false;
-						}
-						//价格显示处理
-						let isActFlg,newProductList=[];
-						this.productList.map((item, index)=> {
-							if(item.actStatus == 1){
-								isActFlg = true
-							}else if(item.actStatus == 1 && item.ladderPriceFlag == '1'){
-								isActFlg = true
-							}else{
-								isActFlg = false
-							}
-							newProductList.push(Object.assign({},item,{isShowActFlg:isActFlg}))
-						})
-						this.productList = newProductList
-						// 防上拉暴滑
-						this.pullFlag = false;
-						setTimeout(()=>{
-							this.pullFlag = true;
-						},500)
-						// 底部提示文案
-						if(this.hasNextPage) {
-							this.loadingText = '上拉加载更多';
-						} else {
-							this.showLoading = true;
-							this.loadingNow = false;
-						}
-					} else {
-						if(!loadMore) {
-							this.isShowEmpty = true;
-						}
-					}
-				}).catch(response =>{
-					this.$util.msg(response.msg,2000);
-				})
-			},
-			operationHanld(prop){
-				this.$emit('operationConfim',prop)
-			},
-			navToDetailPage(id) {
-				this.isModallayer = true;
-				this.$api.navigateTo(`/pages/goods/product?id=${id}`);
-				this.isModallayer = false;
-			},
-			toIndexPage() {
-				uni.switchTab({
-					url: '/pages/tabBar/home/index' 
+			)
+			// 如果获取失败 返回上一页
+			if (code !== 0) {
+				uni.navigateBack({
+					delta: 1
 				})
-			},
-			repurchModel(){
-				this.$util.modal('','此商品的价格有变化,原来的购买价已不适用','知道了','',false,() =>{})
-			},
-			PromotionsFormat(promo){//促销活动类型数据处理
-				if(promo!=null){
-					if(promo.type == 1 && promo.mode == 1){
-						return true
-					}else{
-						return false
-					}
+				return
+			}
+			// 如果商品列表为空
+			if (result.total <= 0) {
+				this.isShowEmpty = true
+			}
+			// 是否加载更多 true 加载更多 false 刷新列表
+			if (flag) {
+				this.productList = [...this.productList, ...result.list]
+			} else {
+				this.productList = result.list
+			}
+			this.pageNum = result.pageNum
+			this.pageSize = result.pageSize
+			this.hasNextPage = result.hasNextPage
+			// 改变加载状态
+			this.loadingNow = false
+		},
+		operationHanld(prop) {
+			this.$emit('operationConfim', prop)
+		},
+		navToDetailPage(id) {
+			this.isModallayer = true
+			this.$api.navigateTo(`/pages/goods/product?id=${id}`)
+			this.isModallayer = false
+		},
+		toIndexPage() {
+			uni.switchTab({
+				url: '/pages/tabBar/home/index'
+			})
+		},
+		repurchModel() {
+			this.$util.modal(
+				'',
+				'此商品的价格有变化,原来的购买价已不适用',
+				'知道了',
+				'',
+				false,
+				() => {}
+			)
+		},
+		PromotionsFormat(promo) {
+			//促销活动类型数据处理
+			if (promo != null) {
+				if (promo.type == 1 && promo.mode == 1) {
+					return true
+				} else {
+					return false
 				}
-				return false
-			},
-			btnClick() {
-				this.$api.navigateTo('/pages/goods/cart')
-			},
-			btnTouchstart() {
-				// console.log('btnTouchstart');
-			},
-			btnTouchend() {
-				// console.log('btnTouchend');
 			}
+			return false
+		},
+		btnClick() {
+			this.$api.navigateTo('/pages/goods/cart')
+		},
+		btnTouchstart() {
+			// console.log('btnTouchstart');
+		},
+		btnTouchend() {
+			// console.log('btnTouchend');
 		}
 	}
+}
 </script>
 
 <style lang="scss">
-	.commodity-list-wrapper {
-		scroll-view {
-			height: 100%;
-			border-top: 2rpx solid rgba(0,0,0,0.07);
-		}
-		.empty-container-image {
-			margin-top: -300rpx;
-		}
-		.toIndexPage {
-			bottom: 390rpx;
-		}
-		.show-more-btn {
-			width: 276rpx;
-			height: 52rpx;
-			line-height: 52rpx;
-			border: 2rpx solid #D8D8D8;
-			background: #F7F7F7;
-			font-size: 26rpx;
-			margin: 26rpx 0;
-			position: absolute;
-			left: 50%;
-			margin-left: -138rpx;
-		}
+.commodity-list-wrapper {
+	scroll-view {
+		height: 100%;
+		border-top: 2rpx solid rgba(0, 0, 0, 0.07);
 	}
-	.all-type-list-content {
-		height: auto;
-		padding: 24rpx;
-		background: #fff;
-		margin-bottom: 2rpx;
-		display: flex;
-		flex-direction: row;
-		box-sizing: content-box;
-		.list-img {
-			width: 240rpx;
-			height: 240rpx !important;
-			margin-right: 26rpx;
-			border-radius: 10rpx;
-			border: 2rpx solid #f3f3f3;
-		}
+	.empty-container-image {
+		margin-top: -300rpx;
 	}
-	.list-details-info {
-		width: 442rpx;
-		flex-direction: column;
+	.toIndexPage {
+		bottom: 390rpx;
+	}
+	.show-more-btn {
+		width: 276rpx;
+		height: 52rpx;
+		line-height: 52rpx;
+		border: 2rpx solid #d8d8d8;
+		background: #f7f7f7;
 		font-size: 26rpx;
-		position: relative;
-		.list-details-title {
-			line-height: 38rpx;
-			text-overflow: ellipsis;
-			overflow: hidden;
-			display: -webkit-box;
-			-webkit-line-clamp: 2;
-			line-clamp: 2;
-			-webkit-box-orient: vertical;
-		}
-		.list-details-specs {
-			width: 100%;
-			display: inline-block;
-			margin-top: 14rpx;
-			color: #999999;
-		}
-		.list-details-miniQuantity {
-			width: 100%;
-			display: inline-block;
-			margin-top: 7rpx;
-		}
+		margin: 26rpx 0;
+		position: absolute;
+		left: 50%;
+		margin-left: -138rpx;
+	}
+}
+.all-type-list-content {
+	height: auto;
+	padding: 24rpx;
+	background: #fff;
+	margin-bottom: 2rpx;
+	display: flex;
+	flex-direction: row;
+	box-sizing: content-box;
+	.list-img {
+		width: 240rpx;
+		height: 240rpx !important;
+		margin-right: 26rpx;
+		border-radius: 10rpx;
+		border: 2rpx solid #f3f3f3;
+	}
+}
+.list-details-info {
+	width: 442rpx;
+	flex-direction: column;
+	font-size: 26rpx;
+	position: relative;
+	.list-details-title {
+		line-height: 38rpx;
+		text-overflow: ellipsis;
+		overflow: hidden;
+		display: -webkit-box;
+		-webkit-line-clamp: 2;
+		line-clamp: 2;
+		-webkit-box-orient: vertical;
 	}
-	.list-details-price {
+	.list-details-specs {
 		width: 100%;
-		line-height: 54rpx;
+		display: inline-block;
+		margin-top: 14rpx;
+		color: #999999;
+	}
+	.list-details-miniQuantity {
+		width: 100%;
+		display: inline-block;
+		margin-top: 7rpx;
+	}
+}
+.list-details-price {
+	width: 100%;
+	line-height: 54rpx;
+	float: left;
+	.floor-item-act {
+		height: 54rpx;
+		text-align: center;
+		box-sizing: border-box;
 		float: left;
-		.floor-item-act{
-			height: 54rpx;
+		.floor-tags {
+			height: 28rpx;
+			border-radius: 6rpx;
+			background-color: #ffffff;
+			line-height: 28rpx;
+			color: $color-system;
 			text-align: center;
-			box-sizing: border-box;
-			float: left;
-			.floor-tags{
-				height: 28rpx;
-				border-radius: 6rpx;
-				background-color: #FFFFFF;
-				line-height: 28rpx;
-				color: $color-system;
-				text-align: center;
-				display: inline-block;
-				padding:0 16rpx;
-				font-size: $font-size-20;
-				margin-left: 15rpx;
-				border: 1px solid #E15616;
-			}
+			display: inline-block;
+			padding: 0 16rpx;
+			font-size: $font-size-20;
+			margin-left: 15rpx;
+			border: 1px solid #e15616;
 		}
-		.price-icon {
-			width: 22rpx;
-			height: 28rpx;
-			vertical-align: middle;
+	}
+	.price-icon {
+		width: 22rpx;
+		height: 28rpx;
+		vertical-align: middle;
+		margin-right: 10rpx;
+	}
+	.price-icon + text {
+		font-size: 25rpx;
+		vertical-align: middle;
+	}
+	.list-login-now {
+		width: 375rpx;
+		color: #f8c499;
+		position: absolute;
+		bottom: 0;
+		.p-no {
+			float: left;
+			font-size: $font-size-24;
+			color: $color-system;
 			margin-right: 10rpx;
 		}
-		.price-icon + text {
-			font-size: 25rpx;
-			vertical-align: middle;
-		}
-		.list-login-now {
-			width: 375rpx;
-			color: #F8C499;
-			position: absolute;
-			bottom: 0;
-			.p-no{
-				float: left;
-				font-size: $font-size-24;
-				color: $color-system;
-				margin-right: 10rpx;
-			}
-		}
-		.login-now {
-			padding: 10rpx 10rpx 10rpx 0;
-		}
-		.list-none{
-			margin-top: 30rpx;
-			.price-small{
-				font-size:$font-size-24;
-				line-height: 40rpx;
-				color: #FF2A2A;
-			}
+	}
+	.login-now {
+		padding: 10rpx 10rpx 10rpx 0;
+	}
+	.list-none {
+		margin-top: 30rpx;
+		.price-small {
+			font-size: $font-size-24;
+			line-height: 40rpx;
+			color: #ff2a2a;
 		}
-		.list-shop{
-			height: auto;
+	}
+	.list-shop {
+		height: auto;
+		float: left;
+		.list-price {
+			width: 100%;
+			color: #ff2a2a;
 			float: left;
-			.list-price {
-				width: 100%;
-				color: #FF2A2A;
-				float: left;
-				line-height:54rpx ;
-				align-items: center;
-				justify-content: center;
-				.price-larger {
-					font-size: $font-size-30;
-					display: inline-block;
-					font-weight: bold;
-					&.none{
-						text-decoration: line-through;
-						color: #999999;
-					}
-				}
-			}
-			.list-price-none{
-				width: 100%;
-				.price-none{
+			line-height: 54rpx;
+			align-items: center;
+			justify-content: center;
+			.price-larger {
+				font-size: $font-size-30;
+				display: inline-block;
+				font-weight: bold;
+				&.none {
 					text-decoration: line-through;
 					color: #999999;
-					display: inline-block;
-				}
-				.icon-wenhao{
-					font-size: $font-size-32;
-					color: #0091FF;
-					margin-left: 6rpx;
 				}
 			}
 		}
-		.add-cart-btn {
-			float: right;
-			width: 140rpx;
-			height: 54rpx;
-			line-height: 54rpx;
-			border-radius: 27rpx;
-			color: #fff;
-			font-size: 24rpx;
-			margin-right: 0;
-			background:#FFFFFF;
-			border: 1px solid #C9C9C9;
-			color: $text-color;
+		.list-price-none {
+			width: 100%;
+			.price-none {
+				text-decoration: line-through;
+				color: #999999;
+				display: inline-block;
+			}
+			.icon-wenhao {
+				font-size: $font-size-32;
+				color: #0091ff;
+				margin-left: 6rpx;
+			}
 		}
 	}
-	.list-details-tags {
-		display: flex;
-		justify-content: flex-start;
-		margin: 14rpx 0;
-		height: 34rpx;
-		.tag{
-			margin-right: 5rpx;
-		}
+	.add-cart-btn {
+		float: right;
+		width: 140rpx;
+		height: 54rpx;
+		line-height: 54rpx;
+		border-radius: 27rpx;
+		color: #fff;
+		font-size: 24rpx;
+		margin-right: 0;
+		background: #ffffff;
+		border: 1px solid #c9c9c9;
+		color: $text-color;
 	}
-	.product-container .goods-item:first-child{
-		margin-top: 100rpx;
+}
+.list-details-tags {
+	display: flex;
+	justify-content: flex-start;
+	margin: 14rpx 0;
+	height: 34rpx;
+	.tag {
+		margin-right: 5rpx;
 	}
+}
+.product-container {
+	width: 100%;
+	height: 100vh;
+	padding-top: 100rpx;
+	box-sizing: border-box;
+}
 </style>

+ 57 - 31
components/cm-module/search/fuzzySearch.vue

@@ -3,18 +3,17 @@
 		<view class="search" :style="{ position: fixed ? 'fixed' : 'relative' }">
 			<view class="search-box">
 				<text class="iconfont icon-sousuo"></text>
-				<input type="text" :placeholder="placeholder" v-model="text" @input="onInputHandle" @focus="inputFoucsHandle" @blur="inputBlurHandle"/>
-			</view>
-			<view class="fuzzy" v-if="showMask">
-				<view
-					class="fuzzy-item"
-					v-for="(item, index) in list"
-					:key="index"
-					@click="chickHandle(item)"
-				>
-					{{ item }}
-				</view>
+				<input
+					type="text"
+					:placeholder="placeholder"
+					v-model="text"
+					@input="onInputHandle"
+					@focus="inputFoucsHandle"
+					@blur="inputBlurHandle"
+				/>
+				<view v-show="showClosable" class="iconfont icon-guanbi" @click="clearInput"></view>
 			</view>
+			<view class="search-btn" @click="searchHandle"> 搜索 </view>
 		</view>
 		<view class="mask" v-show="showMask"></view>
 	</view>
@@ -27,9 +26,6 @@ export default {
 			type: String,
 			default: '请输入搜索内容'
 		},
-		list: {
-			type: Array
-		},
 		fixed: {
 			type: Boolean,
 			default: false
@@ -37,51 +33,67 @@ export default {
 	},
 	data() {
 		return {
-			showMask:false,
+			showMask: false,
 			text:''
 		}
 	},
+	computed:{
+		showClosable(){
+			return this.text.trim().length>0
+		}
+	},
 	methods: {
 		chickHandle(e) {
 			this.$emit('fuzzyClick', e)
 		},
 		// 文本框获取焦点
-		inputFoucsHandle(){
+		inputFoucsHandle() {
 			this.showMask = true
 		},
 		// 文本框失去焦点
-		inputBlurHandle(){
+		inputBlurHandle() {
 			this.showMask = false
 		},
 		// 文本框输入事件
-		onInputHandle(){
-			this.$emit('input',this.text)
+		onInputHandle() {
+			this.$emit('input', this.text)
+		},
+		// 搜索按钮点击事件
+		searchHandle(){
+			this.$emit('search',this.text)
+		},
+		clearInput(){
+			this.text = ''
+			this.$emit('clear')
 		}
 	}
 }
 </script>
 
 <style lang="scss">
-	// 自定义动画
-	@keyframes fadeIn {
-		from{
-			opacity: 0;
-		}
-		to{
-			opacity: 1;
-		}
+// 自定义动画
+@keyframes fadeIn {
+	from {
+		opacity: 0;
+	}
+	to {
+		opacity: 1;
 	}
-.mask{
+}
+.mask {
 	width: 100vh;
 	height: 100vh;
 	position: fixed;
-	background-color: rgba(0,0,0,.4);
+	background-color: rgba(0, 0, 0, 0.4);
 	top: 0;
 	left: 0;
 	z-index: 666;
-	animation: fadeIn ease-in .2s;
+	animation: fadeIn ease-in 0.2s;
 }
 .search {
+	display: flex;
+	justify-content: space-between;
+	align-items: center;
 	position: relative;
 	top: 0;
 	padding: 20rpx 24rpx;
@@ -89,8 +101,15 @@ export default {
 	box-sizing: border-box;
 	background-color: #fff;
 	z-index: 999;
+	.search-btn{
+		width: 80rpx;
+		font-size: 28rpx;
+		margin-left: 10rpx;
+		text-align: right;
+	}
 	.search-box {
 		display: flex;
+		flex: 1;
 		justify-content: flex-start;
 		align-items: center;
 		height: 60rpx;
@@ -107,14 +126,21 @@ export default {
 			text-align: center;
 			line-height: 60rpx;
 		}
+		.iconfont-guanbi{
+			position: absolute;
+			top: 0;
+			right: 0;
+			color: #eee;
+		}
 		input {
+			width: 90%;
 			font-size: 26rpx;
 		}
 	}
 	.fuzzy {
 		padding: 10rpx 0;
 		padding-left: 76rpx;
-		animation:  fadeIn ease-in .2s;
+		animation: fadeIn ease-in 0.2s;
 		.fuzzy-item {
 			font-size: 26rpx;
 			color: #444;

+ 28 - 20
main.js

@@ -4,25 +4,29 @@ import App from './App'
 import './services/index.js'
 import * as Api from '@/common/config/utilsTools.js'
 import * as Regs from '@/common/config/common.js'
-import { msg, modal,prePage } from'./utils/util'
+import {
+	msg,
+	modal,
+	prePage
+} from './utils/util'
 import cuCustom from './components/cm-custom/cu-custom.vue'
 import auCustom from './components/cm-custom/au-custom.vue'
 import cmCustom from './components/cm-custom/cm-custom.vue'
 import wsCustom from './components/cm-custom/ws-custom.vue'
 import scrollTop from '@/components/cm-module/scrollTop/scrollTop.vue'
-Vue.component('cu-custom',cuCustom)
-Vue.component('au-custom',auCustom)
-Vue.component('cm-custom',cmCustom)
-Vue.component('ws-custom',wsCustom)
-Vue.component('scroll-top',scrollTop)
+Vue.component('cu-custom', cuCustom)
+Vue.component('au-custom', auCustom)
+Vue.component('cm-custom', cmCustom)
+Vue.component('ws-custom', wsCustom)
+Vue.component('scroll-top', scrollTop)
 
-Vue.prototype.$getStorage = function(key){
-	var userParam = uni.getStorageSync(key);
-	if (userParam != null && userParam != "" && userParam!= undefined) {
-		return userParam;
-	}else{
-		return null;
-	} 
+Vue.prototype.$getStorage = function(key) {
+	var userParam = uni.getStorageSync(key)
+	if (userParam != null && userParam != '' && userParam != undefined) {
+		return userParam
+	} else {
+		return null
+	}
 }
 /**
  * 友盟+小程序统计
@@ -48,15 +52,19 @@ Vue.prototype.$getStorage = function(key){
 
 
 Vue.config.productionTip = false
-Vue.prototype.$fire = new Vue();
-Vue.prototype.$store = store;
-Vue.prototype.$util = {msg,prePage,modal};
-Vue.prototype.$api = Api;
-Vue.prototype.$reg = Regs;
+Vue.prototype.$fire = new Vue()
+Vue.prototype.$store = store
+Vue.prototype.$util = {
+	msg,
+	prePage,
+	modal
+}
+Vue.prototype.$api = Api
+Vue.prototype.$reg = Regs
 // Vue.use(uma);
 App.mpType = 'app'
 
 const app = new Vue({
-    ...App
+	...App
 })
-app.$mount()
+app.$mount()

+ 24 - 41
pages/authorization/authorization.vue

@@ -1,6 +1,5 @@
 <template>
 	<view class="container login" :style="{ paddingTop: CustomBar + 'px' }">
-		<!-- <cu-custom :navbar-data='nvabarData' @navigateBack="hanldNavigateBack"></cu-custom> -->
 		<view class="login-main">
 			<image class="logo" src="../../static/ws/logo.png" mode="widthFix"></image>
 		</view>
@@ -56,56 +55,40 @@ export default {
 		...mapState(['hasLogin', 'userInfo'])
 	},
 	methods: {
-		getuserinfo: function(e) {
+		getuserinfo(e) {
 			//微信授权
 			if (e.detail.userInfo) {
-				this.wxGetUserInfo()
+				this.checkedUser()
 			} else {
 				this.$util.msg('授权失败', 2000)
 			}
 		},
 		undGetuserinfo() {
-			this.hanldBackFn()
+			uni.navigateBack({ delta: 1 })
 		},
-		hanldNavigateBack() {
-			this.hanldBackFn()
-		},
-		hanldBackFn() {
-			switch (this.authorizeType) {
-				case '0':
-					this.$api.switchTabTo('/pages/tabBar/home/index')
-					break
-				default:
-					uni.navigateBack({ delta: 1 })
-			}
-		},
-		wxGetUserInfo() {
-			let self = this
-			authorize.getCode('weixin').then(wechatcode => {
-				wx.getUserInfo({
-					success: res => {
-						console.log(self.authorizeType)
-						wxLogin.wxLoginAuthorize()
-						switch (self.authorizeType) {
-							case '0':
-								self.$api.switchTabTo('/pages/tabBar/home/index')
-								break
-							case '1':
-								self.$api.navigateTo('/pages/login/login')
-								break
-							case '2':
-								self.$api.navigateTo('/pages/login/register')
-								break
-							case '3':
-								self.$api.navigateTo('/pages/login/logincode')
-								break
-							default:
-								setTimeout(() => {
-									uni.navigateBack({ delta: 1 })
-								}, 2000)
-						}
+		// 用户验证
+		async checkedUser() {
+			const wechatCode = await authorize.getCode('weixin')
+			// 用户是否填写了邀请码
+			const res = await this.UserService.userInfoLogin({ code: wechatCode }).catch((error)=>{
+				console.log('登录失败')
+				uni.reLaunch({
+					url: '/pages/index/index'
+				})
+			})
+			if (res.code !== 0) {
+				return uni.showToast({
+					title: '账号未注册',
+					success() {
+						uni.reLaunch({
+							url: '/pages/login/login'
+						})
 					}
 				})
+			}
+			console.log('授权登录成功')
+			uni.reLaunch({
+				url: '/pages/index/index'
 			})
 		}
 	}

+ 12 - 13
pages/goods/list.vue

@@ -62,10 +62,11 @@
 			}
 		},
 		onLoad() {
-
+			
 		},
 		methods:{
-			hanldOperationConfim(data){//显示选择数量确认弹窗
+			//显示选择数量确认弹窗
+			hanldOperationConfim(data){
 				this.specClass = 'show'
 				this.handleData = data
 				this.minBuyNumber = data.minBuyNumber
@@ -77,7 +78,8 @@
 					this.number = data.minBuyNumber
 				}
 			},
-			hideSpec() {//关闭选择数量确认弹窗
+			//关闭选择数量确认弹窗
+			hideSpec() {
 				this.specClass = 'hide';
 				setTimeout(() => {
 					this.specClass = 'none';
@@ -122,7 +124,8 @@
 					this.calculatPerice()
 				}
 			},
-			calculatPerice(){//判断是否为阶梯价然后做计算价格处理
+			//判断是否为阶梯价然后做计算价格处理
+			calculatPerice(){
 				if(this.handleData.ladderPriceFlag == '1'){
 					this.handleData.ladderPriceList.forEach((item,index)=>{
 						if(this.number>=item.buyNum){
@@ -131,7 +134,8 @@
 					})
 				}
 			},
-			toConfirmation(){//跳转确认订单页面
+			//跳转确认订单页面
+			toConfirmation(){
 				this.specClass = 'hide';
 				let productStp ={
 						allPrice:this.number*this.buyRetailPrice,
@@ -144,7 +148,8 @@
 					this.specClass = 'none';
 				}, 200);
 			},
-			getAddProductCart(){//增加购物车成功和toast弹窗提示成功
+			//增加购物车成功和toast弹窗提示成功
+			getAddProductCart(){
 				this.ProductService.shoppingAddCart({productID:this.handleData.productID,userID:this.userID,productCount:this.number}).then(response => {
 					this.specClass = 'hide';
 					this.$util.msg(response.msg,1500,true,'success')
@@ -157,13 +162,7 @@
 			discard(){
 				//丢弃
 			}
-		},
-		onShow() {
-			let pages = getCurrentPages(),thisPage = pages[pages.length - 1];
-			this.$api.getStorage().then((resolve) =>{
-				this.userID = resolve.userID
-			})
-		},
+		}
 	}
 </script>
 

+ 48 - 29
pages/index/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="container">
 		<!-- 机构信息区域 -->
-		<template v-if="isRequest">
+		<template>
 			<view class="ws-header">
 				<!-- 用户信息 -->
 				<view class="user-info">
@@ -9,7 +9,7 @@
 					<view
 						class="ws-login"
 						@click="navigator('/pages/login/login')"
-						v-if="!hasLogin"
+						v-if="!hasLogin && !isRequest"
 					>
 						请登录
 					</view>
@@ -63,7 +63,7 @@
 			</view>
 			<!-- 订单状态区域END -->
 			<!-- 帮机构下单 -->
-			<view class="place-order" @click="navigator('/pages/user/club/club-list')">
+			<view class="place-order" @click="navigator(`/pages/user/club/club-list?id=${organizeId}`)">
 				<view class="place-left">
 					<text class="iconfont icon-bangjigouxiadan"></text>
 					<text class="title">帮机构下单</text>
@@ -80,11 +80,15 @@
 </template>
 
 <script>
+import nutBadge from '@/components/thorui/tui-badge/tui-badge.vue'
 import { mapState, mapMutations } from 'vuex'
 import authorize from '@/common/config/authorize.js'
 import wxLogin from '@/common/config/wxLogin.js'
 
 export default {
+	components: {
+		nutBadge
+	},
 	data() {
 		return {
 			nvabarData: {
@@ -99,12 +103,13 @@ export default {
 			},
 			CustomBar: this.CustomBar, // 顶部导航栏高度
 			StatusBar: this.StatusBar,
-			organizeName:'',
-			isRequest:false,
+			organizeName: '',
+			isRequest: false,
 			paymentCount: 0, //待付款角标
 			waitShipmentsCount: 0, //待收货角标
 			shipmentsCount: 0, //已发货角标
-			salesReturnCount: '' //退货/款角标
+			salesReturnCount: '', //退货/款角标
+			organizeId:''
 		}
 	},
 	onLoad() {
@@ -125,29 +130,38 @@ export default {
 			// const wechatCode = await
 			const wechatCode = await authorize.getCode('weixin')
 			// 初始化用户状态
-			this.UserService.userInfoLogin({code:wechatCode}).then(response=>{
-				this.login(response.data);
-				this.$store.commit('updateStatus',response.data)
-				this.getUserInfoPersonal(response.data.organizeId)
-			}).catch(error =>{
-				uni.setStorage({//缓存游客用户openid
-				    key: 'openid',
-				    data: error.data.openid
+			this.UserService.userInfoLogin({ code: wechatCode })
+				.then(response => {
+					// 保存登录信息
+					this.login(response.data)
+					console.log(response)
+					this.$store.commit('updateStatus', response.data)
+					this.organizeId = response.data.organizeId
+					this.getUserInfoPersonal(response.data.organizeId)
+				})
+				.catch(error => {
+					uni.setStorage({
+						//缓存游客用户openid
+						key: 'openid',
+						data: error.data.openid
+					})
+					this.logout()
 				})
-				this.logout()
-			})
 		},
-		getUserInfoPersonal(organizeId){//初始化个人中心数据
-			this.UserService.userInfoPersonal({organizeId:organizeId}).then(response=>{
-				this.organizeName = response.data.organizeName
-				this.paymentCount = this.showBadge(response.data.paymentCount) //待付款
-				this.waitShipmentsCount = this.showBadge(response.data.waitShipmentsCount) //待收货
-				this.shipmentsCount = this.showBadge(response.data.shipmentsCount) //已发货
-				this.salesReturnCount = this.showBadge(response.data.salesReturnCount) //退货/款
-				this.isRequest = true
-			}).catch(error =>{
-				this.$util.msg(error.msg, 2000)
-			})
+		getUserInfoPersonal(organizeId) {
+			//初始化个人中心数据
+			this.UserService.userInfoPersonal({ organizeId: organizeId })
+				.then(response => {
+					this.organizeName = response.data.organizeName
+					this.paymentCount = this.showBadge(response.data.paymentCount) //待付款
+					this.waitShipmentsCount = this.showBadge(response.data.waitShipmentsCount) //待收货
+					this.shipmentsCount = this.showBadge(response.data.shipmentsCount) //已发货
+					this.salesReturnCount = this.showBadge(response.data.salesReturnCount) //退货/款
+					this.isRequest = true //个人中心初始化成功后才显示页面
+				})
+				.catch(error => {
+					this.$util.msg(error.msg, 2000)
+				})
 		},
 		// 客服
 		handleContact(e) {
@@ -159,12 +173,14 @@ export default {
 				// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
 				if (wxResponse == 1) {
 					if (this.hasLogin) {
+						// 已登录
 						this.$api.navigateTo(url)
 					} else {
-						this.$api.navigateTo('/pages/login/login')
+						// 未登录
+						this.$api.navigateTo(`/pages/login/login`)
 					}
 				} else {
-					this.$api.navigateTo('/pages/authorization/authorization?type=1')
+					this.$api.navigateTo(`/pages/authorization/authorization`)
 				}
 			})
 		},
@@ -348,4 +364,7 @@ export default {
 		margin-right: 6rpx;
 	}
 }
+.badge {
+	background-color: #ff0000;
+}
 </style>

+ 3 - 2
pages/login/login.vue

@@ -41,7 +41,8 @@ export default {
 			loginMessage: '' //登录信息反馈
 		}
 	},
-	onLoad(option) {},
+	onLoad(option) {
+	},
 	computed: {
 		...mapState(['isWxAuthorize', 'isLoginType', 'isLoginProductId', 'isLoginOrderId']),
 		// 邀请码长度是否符合要求
@@ -88,7 +89,7 @@ export default {
 		// 输入框输入事件
 		vcodeChangeHandle(val) {
 			this.invitationCode = val
-			console.log(val)
+			// console.log(val)
 		},
 		// 控制组件获取焦点
 		setFocus() {

+ 107 - 83
pages/user/club/club-list.vue

@@ -8,14 +8,18 @@
 					type="text"
 					confirm-type="search"
 					v-model="searchInputVal"
-					@input="onShowClose" 
-					@confirm="initclubList()"
+					@input="onShowClose"
+					@confirm="getClubList()"
 					placeholder="请输入机构名称/机构联系人"
 					maxlength="12"
 					@focus="searchInputFoucs"
 					@blur="hideSearchModalHandle"
 				/>
-				<text class="iconfont icon-guanbi" v-if="isShowClose" @click="delInputText()"></text>
+				<text
+					class="iconfont icon-guanbi"
+					v-if="isShowClose"
+					@click="delInputText()"
+				></text>
 			</view>
 			<view class="search-btn">
 				<button class="search-btn" type="default" @click.stop="searchClubList">搜索</button>
@@ -31,29 +35,48 @@
 				<view class="txt">暂无机构数据</view>
 			</view>
 			<view v-else class="club-list">
-				<scroll-view scroll-y="true">
+				<scroll-view scroll-y="true" :style="{ height: scrollHeight }">
 					<!-- 机构数据 -->
-					<view class="list" v-for="item in 10">
+					<view class="list" v-for="item in clubList" :key="item.userId">
 						<view class="list-left">
 							<view class="list-head"
-								><image src="https://static.caimei365.com/app/img/icon/icon-club@3x.png" mode=""></image
+								><image
+									src="https://static.caimei365.com/app/img/icon/icon-club@3x.png"
+									mode=""
+								></image
 							></view>
 						</view>
 						<view class="list-item">
-							<view class="list-title"> <text class="list-name">机构名称名称</text> </view>
+							<view class="list-title">
+								<text class="list-name">{{ item.clubName }}</text>
+							</view>
 							<view class="list-contact">
-								<view class="list-row"> <text class="iconfont icon-lianxiren"></text> <text>李艳华</text> </view>
-								<view class="list-row"> <text class="iconfont icon-dianhua"></text> <text>18888888888</text> </view>
+								<view class="list-row">
+									<text class="iconfont icon-lianxiren"></text>
+									<text>{{ item.userName }}</text>
+								</view>
+								<view class="list-row">
+									<text class="iconfont icon-dianhua"></text>
+									<text>{{ item.bindMobile }}</text>
+								</view>
 							</view>
 							<view class="list-opea">
-								<view class="btn border-btn" @click.stop="_goHistory(item)"> <text>订单列表</text> </view>
-								<view class="btn border-btn" @click.stop="_goImmediately(item)"> <text>立即下单</text> </view>
+								<view class="btn border-btn" @click.stop="_goGoodsList(item)">
+									<text>订单列表</text>
+								</view>
+								<view class="btn border-btn" @click.stop="_goGoodsList(item)">
+									<text>立即下单</text>
+								</view>
 							</view>
 						</view>
 					</view>
 					<!--加载loadding-->
 					<tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
-					<tui-nomore :visible="!pullUpOn" :backgroundColor="'#ffffff'" :text="nomoreText"></tui-nomore>
+					<tui-nomore
+						:visible="!pullUpOn"
+						:backgroundColor="'#ffffff'"
+						:text="nomoreText"
+					></tui-nomore>
 					<!--加载loadding-->
 				</scroll-view>
 			</view>
@@ -71,73 +94,74 @@ export default {
 		tuiLoadmore,
 		tuiNomore
 	},
-
 	data() {
 		return {
-			serviceProviderId: '',
 			isShowClose: false,
-			searchInputVal: '',
-			isEmpty: false,
+			searchInputVal: '', //搜索框数据
+			isEmpty: false, //机构列表是否为空
 			nomoreText: '上拉显示更多',
 			status: 66,
-			pageNum: 1,
-			pageSize: 10,
-			hasNextPage: false,
+			pageNum: 1, //当前页码
+			pageSize: 10, //每页获取条数
+			hasNextPage: false, //是否还有下一页
 			loadding: false,
 			pullUpOn: true,
 			pullFlag: true,
-			scrollHeight: '',
+			scrollHeight: '', //scoll-view高度
 			currPage: '', //当前页面
 			prevPage: '', //上一个页面
 			clubList: [],
-			showSearchModal: false //模糊搜索框是否显示
+			showSearchModal: false, //模糊搜索框是否显示
+			organizeId: ''
 		}
 	},
-	onLoad() {
+	onLoad(data) {
 		this.setScrollHeight()
+		// 获取传过来的organizeId
+		this.organizeId = data.id
+		this.init()
+		console.log(this.scrollHeight)
 	},
-
 	methods: {
-		hideSearchModalHandle(){
-			this.showSearchModal = false
-		},
-		searchInputFoucs(){
-			this.showSearchModal = true
+		// 初始胡机构列表
+		init() {
+			this.$api.getStorage().then(response => {
+				this.serviceProviderId = response.serviceProviderID
+				this.pageNum = 1
+				this.getClubList()
+			})
 		},
+		// 设置scroll高度
 		setScrollHeight() {
-			// 窗口高度 - 底部距离
-			setTimeout(() => {
-				const query = wx.createSelectorQuery().in(this)
-				query.selectAll('.add-btn').boundingClientRect()
-				query.exec(res => {
-					if (res[0][0]) {
-						let winHeight = this.$api.getWindowHeight(),
-							eleTop = res[0][0].top - 1
-						this.scrollHeight = eleTop
-					}
-				})
-			}, 500)
+			this.scrollHeight = this.$store.state.windowHeight - 61 + 'px'
 		},
 		searchClubList() {
+			// 如果搜索框为空
+			if (this.searchInputVal.trim().length <= 0) {
+				this.searchInputVal = ''
+				return
+			}
 			this.pageNum = 1
-			this.initclubList()
+			this.getClubList()
 		},
-		initclubList() {
+		// 初始化机构列表
+		getClubList() {
 			let params = {
-				userIdentity: '',
+				organizeId: this.organizeId,
 				name: this.searchInputVal,
 				pageNum: 1,
-				pageSize: this.pageSize,
-				spId: this.serviceProviderId,
-				status: this.status
+				pageSize: this.pageSize
+				// status: this.status
 			}
 			this.SellerService.GetSellerClubList(params)
 				.then(response => {
 					let responseData = response.data
-					if (responseData.results && responseData.results.length > 0) {
+					console.log(responseData)
+					// 如果返回机构条数大于0
+					if (responseData.total > 0) {
 						this.isEmpty = false
 						this.hasNextPage = response.data.hasNextPage
-						this.clubList = responseData.results
+						this.clubList = responseData.list
 						this.pullFlag = false
 						setTimeout(() => {
 							this.pullFlag = true
@@ -158,22 +182,30 @@ export default {
 					this.$util.msg(error.msg, 2000)
 				})
 		},
+		// scroll触底事件
+		onReachBottom() {
+			if (this.hasNextPage) {
+				this.loadding = true
+				this.pullUpOn = true
+				this.getOnReachBottomData()
+			}
+		},
+		// 加载下一页数据
 		getOnReachBottomData() {
 			this.pageNum += 1
 			let params = {
-				userIdentity: '',
+				organizeId: this.organizeId,
 				name: this.searchInputVal,
 				pageNum: this.pageNum,
-				pageSize: this.pageSize,
-				spId: this.serviceProviderId,
-				status: this.status
+				pageSize: this.pageSize
 			}
 			this.SellerService.GetSellerClubList(params)
 				.then(response => {
 					let responseData = response.data
-					if (responseData.results && responseData.results.length > 0) {
+					if (responseData.total > 0) {
 						this.hasNextPage = response.data.hasNextPage
-						this.clubList = this.clubList.concat(responseData.results)
+						// 将数据追加到clubList列表
+						this.clubList = this.clubList.concat(responseData.list)
 						this.pullFlag = false // 防上拉暴滑
 						setTimeout(() => {
 							this.pullFlag = true
@@ -192,8 +224,8 @@ export default {
 					this.$util.msg(error.msg, 2000)
 				})
 		},
+		//输入框失去焦点时触发
 		onShowClose() {
-			//输入框失去焦点时触发
 			if (this.searchInputVal != '') {
 				this.isShowClose = true
 			} else {
@@ -204,37 +236,25 @@ export default {
 			//清除输入框内容
 			this.searchInputVal = ''
 			this.isShowClose = false
+			this.getClubList()
 		},
-		_goImmediately(item) {
-			this.$api.setStorage('orderUserInfo', item)
-			this.$api.navigateTo('/seller/pages/cart/immediately')
+		// 跳转下单产品列表
+		_goGoodsList(item) {
+			this.$api.setStorage('clubInfo', item)
+			this.$api.navigateTo(`/pages/goods/list?userId=${item.userId}`)
 		},
-		_goBuyagain(item) {
-			this.$api.setStorage('orderUserInfo', item)
-			this.$api.navigateTo('/seller/pages/cart/buyagain')
+		// 跳转订单列表
+		_goOrderList(item) {
+			this.$api.setStorage('clubInfo', item)
+			this.$api.navigateTo(`pages/user/order/order-list`)
 		},
-		_goSecond(item) {
-			this.$api.setStorage('orderUserInfo', item)
-			this.$api.navigateTo('/seller/pages/cart/second')
+		hideSearchModalHandle() {
+			this.showSearchModal = false
+			this.searchClubList()
 		},
-		_goHistory(item) {
-			this.$api.setStorage('orderUserInfo', item)
-			this.$api.navigateTo(`/seller/pages/order/order-historylist?clubID=${item.clubID}&listType=0`)
-		}
-	},
-	onReachBottom() {
-		if (this.hasNextPage) {
-			this.loadding = true
-			this.pullUpOn = true
-			this.getOnReachBottomData()
+		searchInputFoucs() {
+			this.showSearchModal = true
 		}
-	},
-	onShow() {
-		this.$api.getStorage().then(response => {
-			this.serviceProviderId = response.serviceProviderID
-			this.pageNum = 1
-			this.initclubList()
-		})
 	}
 }
 </script>
@@ -247,17 +267,20 @@ page,
 .container {
 	/* padding-bottom: 120upx; */
 	background: #fff;
+	width: 100%;
+	height: 100vh;
+	overflow: hidden;
 }
 .container {
 	position: relative;
 }
-.over-bg{
+.over-bg {
 	top: 0;
 	position: fixed;
 	width: 100vw;
 	height: 100vh;
 	z-index: 888;
-	background: rgba(0,0,0,.4);
+	background: rgba(0, 0, 0, 0.4);
 }
 .club-search {
 	display: flex;
@@ -298,6 +321,7 @@ page,
 			line-height: 64rpx;
 			text-align: center;
 			top: 0;
+			right: 0;
 			z-index: 10;
 		}
 		.input {

+ 0 - 1
pages/user/order/order-list.vue

@@ -179,7 +179,6 @@
 		},
 		onLoad(e) {
 			let self = this;
-			
 			if(e.type ==='detele'){self.isDelete = true}
 			self.currentTab = e.state
 			self.isOnloadFlag = true

+ 161 - 49
services/sellse.service.js

@@ -5,37 +5,69 @@
  */
 export default class SellerService {
 	constructor(AjaxService) {
-		Object.assign(this, { AjaxService })
+		Object.assign(this, {
+			AjaxService
+		})
 		this.name = 'SellerService'
 	}
+	/**
+	 *@下单商品列表
+	 *@param organizeId 组织id
+	 *@param pageNum 页码
+	 *@param pageSize 每页显示多少
+	 *@param productName 商品名称
+	 */
+	GoodList(data = {}) {
+		return this.AjaxService.get({
+			url: '/product/list',
+			data,
+			isLoading: true
+		})
+	}
 	/**
 	 *@协销登录
 	 *@param mobile 手机号
 	 *@param password 密码
 	 */
-	SellerLogin (data={}){
-		return this.AjaxService.post({ url:'/seller/login', data, isLoading: true })
+	SellerLogin(data = {}) {
+		return this.AjaxService.post({
+			url: '/seller/login',
+			data,
+			isLoading: true
+		})
 	}
 	/**
 	 *@协销账户中心
 	 *@param userID 协销ID
 	 */
-	GetSellerHome (data = {}) {
-		return this.AjaxService.get({ url:'/seller/home', data, isLoading: true })
+	GetSellerHome(data = {}) {
+		return this.AjaxService.get({
+			url: '/seller/home',
+			data,
+			isLoading: true
+		})
 	}
 	/**
 	 *@协销拉机构上线
 	 *@param userID 协销ID
 	 */
-	SellerClubRegister (data={}){
-		return this.AjaxService.post({ url:'/seller/club/register', data, isLoading: true })
+	SellerClubRegister(data = {}) {
+		return this.AjaxService.post({
+			url: '/seller/club/register',
+			data,
+			isLoading: true
+		})
 	}
 	/**
 	 *@协销拉机构上线检测手机号和邮箱
 	 *@param mobileOrEmail 手机号和邮箱
 	 */
-	SellerClubCheck (data={}){
-		return this.AjaxService.post({ url:'/seller/club/check', data, isLoading: true })
+	SellerClubCheck(data = {}) {
+		return this.AjaxService.post({
+			url: '/seller/club/check',
+			data,
+			isLoading: true
+		})
 	}
 	/**
 	 *@协销机构列表
@@ -45,8 +77,12 @@ export default class SellerService {
 	 *@param spId 	  协销ID
 	 *@param status   机构状态
 	 */
-	GetSellerClubList (data = {}) {
-		return this.AjaxService.get({ url:'/seller/club/list', data, isLoading: true })
+	GetSellerClubList(data = {}) {
+		return this.AjaxService.get({
+			url: '/product/clubList',
+			data,
+			isLoading: true
+		})
 	}
 	/**
 	 *@协销机构列表
@@ -54,8 +90,12 @@ export default class SellerService {
 	 *@param pageNum  页码
 	 *@param pageSize 条数
 	 */
-	GetFindAllClubList (data = {}) {
-		return this.AjaxService.get({ url:'/seller/findAllClub', data, isLoading: true })
+	GetFindAllClubList(data = {}) {
+		return this.AjaxService.get({
+			url: '/seller/findAllClub',
+			data,
+			isLoading: true
+		})
 	}
 	/**
 	 *@协销订单列表(搜索订单)
@@ -65,8 +105,12 @@ export default class SellerService {
 	 *@param pageSize 条数
 	 *@param serviceProviderId 协销ID
 	 */
-	GetSellerOrderList (data = {}) {
-		return this.AjaxService.get({ url:'/seller/order/list', data, isLoading: true })
+	GetSellerOrderList(data = {}) {
+		return this.AjaxService.get({
+			url: '/seller/order/list',
+			data,
+			isLoading: true
+		})
 	}
 	/**
 	 *@协销下机构订单列表
@@ -74,8 +118,12 @@ export default class SellerService {
 	 *@param pageNum  页码
 	 *@param pageSize 条数
 	 */
-	GetSellerClubOrderList (data = {}) {
-		return this.AjaxService.get({ url:'/seller/clubOrder', data, isLoading: true })
+	GetSellerClubOrderList(data = {}) {
+		return this.AjaxService.get({
+			url: '/seller/clubOrder',
+			data,
+			isLoading: true
+		})
 	}
 	/**
 	 *@协销帮机构下单组合商品搜索
@@ -84,8 +132,12 @@ export default class SellerService {
 	 *@param pageSize 	条数
 	 *@param searchWord 搜索关键词
 	 */
-	GetCombinationProduct (data = {}) {
-		return this.AjaxService.get({ url:'/seller/combinationProduct/search', data, isLoading: true })
+	GetCombinationProduct(data = {}) {
+		return this.AjaxService.get({
+			url: '/seller/combinationProduct/search',
+			data,
+			isLoading: true
+		})
 	}
 	/**
 	 *@协销-二手下单商品列表
@@ -93,8 +145,12 @@ export default class SellerService {
 	 *@param 二手仪器分类的类型 instrumentType	1轻光电、2重光电、3耗材配件【不传默认全部】
 	 *@param 搜索关键词 searchKeyword	【选传】 
 	 */
-	GetOrderSecondHandProductList (data = {}) {
-		return this.AjaxService.get({ url:'/product/getOrderSecondHandProductList', data, isLoading: true })
+	GetOrderSecondHandProductList(data = {}) {
+		return this.AjaxService.get({
+			url: '/product/getOrderSecondHandProductList',
+			data,
+			isLoading: true
+		})
 	}
 	/**
 	 *@协销-二手去结算接口
@@ -103,15 +159,23 @@ export default class SellerService {
 	 *@param serviceProviderId:协销ID(同之前)
 	 *@param productCount:二手购买数量 
 	 */
-	GetSettlementBySencondProduct (data = {}) {
-		return this.AjaxService.post({ url:'/seller/settlementBySencondProduct', data, isLoading: true })
+	GetSettlementBySencondProduct(data = {}) {
+		return this.AjaxService.post({
+			url: '/seller/settlementBySencondProduct',
+			data,
+			isLoading: true
+		})
 	}
 	/**
 	 *@协销-二手商品推荐
 	 *@param productId:商品ID(数字类型,必传)
 	 */
-	ProductRecommend (data={}){//相关推荐
-		return this.AjaxService.get({ url:'/product/getSecondHandProductRecommend', data, isLoading: true })
+	ProductRecommend(data = {}) { //相关推荐
+		return this.AjaxService.get({
+			url: '/product/getSecondHandProductRecommend',
+			data,
+			isLoading: true
+		})
 	}
 	/**
 	 *@协销-关键词搜索订单
@@ -119,8 +183,12 @@ export default class SellerService {
 	 *@param pageNum:机构会所ID(同之前)
 	 *@param pageSize:协销ID(同之前)
 	 */
-	getSellerOrderList (data={}){
-		return this.AjaxService.get({ url:'/seller/searchOrder', data, isLoading: true })
+	getSellerOrderList(data = {}) {
+		return this.AjaxService.get({
+			url: '/seller/searchOrder',
+			data,
+			isLoading: true
+		})
 	}
 	/*协销下单购物车->api*/
 	/**
@@ -128,47 +196,71 @@ export default class SellerService {
 	 *@param clubId 会所的ID
 	 *@param serviceProviderId 协销ID
 	 */
-	ShoppingCartAddCart (data = {}) {
-		return this.AjaxService.post({ url:'/seller/addCart', data, isLoading: true })
+	ShoppingCartAddCart(data = {}) {
+		return this.AjaxService.post({
+			url: '/seller/addCart',
+			data,
+			isLoading: true
+		})
 	}
 	/**
 	 *@组合商品加入购物车
 	 *@param clubId 会所的ID
 	 *@param serviceProviderId 协销ID
 	 */
-	ShoppingCartBatchAddCart (data = {}) {
-		return this.AjaxService.post({ url:'/seller/batchAddCart', data, isLoading: true })
+	ShoppingCartBatchAddCart(data = {}) {
+		return this.AjaxService.post({
+			url: '/seller/batchAddCart',
+			data,
+			isLoading: true
+		})
 	}
 	/**
 	 *@协销帮机构下单获取购物车数量
 	 *@param clubId 会所的ID
 	 *@param serviceProviderId 协销ID
 	 */
-	GetSellerProductNum (data = {}) {
-		return this.AjaxService.get({ url:'/seller/productNum', data, isLoading: false })
+	GetSellerProductNum(data = {}) {
+		return this.AjaxService.get({
+			url: '/seller/productNum',
+			data,
+			isLoading: false
+		})
 	}
 	/**
 	 *@协销帮机构下单购物车商品加减数量
 	 *@param clubId 机构的clubId
 	 *@param serviceProviderId 	协销ID
 	 */
-	SellerAddProductNum (data = {}) {
-		return this.AjaxService.post({ url:'/seller/addProductNum', data, isLoading: true })
+	SellerAddProductNum(data = {}) {
+		return this.AjaxService.post({
+			url: '/seller/addProductNum',
+			data,
+			isLoading: true
+		})
 	}
 	/**
 	 *@协销帮机构下单购物车删除商品
 	 *@param sellerCartIds 购物车ID
 	 */
-	DeleteSellerCart (data = {}) {
-		return this.AjaxService.post({ url:'/seller/deleteSellerCart', data, isLoading: true })
+	DeleteSellerCart(data = {}) {
+		return this.AjaxService.post({
+			url: '/seller/deleteSellerCart',
+			data,
+			isLoading: true
+		})
 	}
 	/**
 	 *@协销帮机构下单获取购物车列表
 	 *@param clubId 会所的ID
 	 *@param serviceProviderId 协销ID
 	 */
-	GetSellerShoppingInfo (data = {}) {
-		return this.AjaxService.get({ url:'/seller/shoppingInfo', data, isLoading: false })
+	GetSellerShoppingInfo(data = {}) {
+		return this.AjaxService.get({
+			url: '/seller/shoppingInfo',
+			data,
+			isLoading: false
+		})
 	}
 	/*协销下单订单->api*/
 	/**
@@ -177,8 +269,12 @@ export default class SellerService {
 	 *@param serviceProviderId 协销ID
 	 *@param productIds 商品ID
 	 */
-	SellerSettlement (data = {}) {
-		return this.AjaxService.post({ url:'/seller/settlement', data, isLoading: true })
+	SellerSettlement(data = {}) {
+		return this.AjaxService.post({
+			url: '/seller/settlement',
+			data,
+			isLoading: true
+		})
 	}
 	/**
 	 *@协销帮机构下单提交订单
@@ -191,22 +287,38 @@ export default class SellerService {
 	 *@param payInfo//订单信息
 	 *@param orderInvoice//发票信息
 	 */
-	SellerCreateOrderSubmit (data = {}) {
-		return this.AjaxService.post({ url:'/seller/order/submit', data, isLoading: true })
+	SellerCreateOrderSubmit(data = {}) {
+		return this.AjaxService.post({
+			url: '/seller/order/submit',
+			data,
+			isLoading: true
+		})
 	}
 	// 协销订单列表/再来一单
-	SellerCreateOrderAgain (data = {}) {
-		return this.AjaxService.post({ url:'/seller/order/again', data, isLoading: true })
+	SellerCreateOrderAgain(data = {}) {
+		return this.AjaxService.post({
+			url: '/seller/order/again',
+			data,
+			isLoading: true
+		})
 	}
 	// 协销购物车清空失效列表
-	SellerCartdelete (data = {}) {
-		return this.AjaxService.post({ url:'/seller/deleteSellerCart', data, isLoading: true })
+	SellerCartdelete(data = {}) {
+		return this.AjaxService.post({
+			url: '/seller/deleteSellerCart',
+			data,
+			isLoading: true
+		})
 	}
 	/**
 	 *@协销邀请运营人员
 	 *@param userID  机构userID
 	 */
-	SellerBindingOperation (data = {}) {
-		return this.AjaxService.post({ url:'/seller/bindingOperation', data, isLoading: true })
+	SellerBindingOperation(data = {}) {
+		return this.AjaxService.post({
+			url: '/seller/bindingOperation',
+			data,
+			isLoading: true
+		})
 	}
 }

+ 1 - 1
services/user.service.js

@@ -19,7 +19,7 @@ export default class UserService {
 	}
 	/* 初始化个人中心数据 */
 	userInfoPersonal(data = {}) {
-		return this.AjaxService.post({
+		return this.AjaxService.get({
 			url: '/buyer/personal',
 			data,
 			isLoading: false,

+ 6 - 1
store/index.js

@@ -15,7 +15,8 @@ const store = new Vuex.Store({
 		isIphoneX: false,
 		isActivity: false,
 		isLoginType: 0,
-		isLoginProductId: 0
+		isLoginProductId: 0,
+		windowHeight:''
 	},
 	mutations: {
 		login(state, provider) { //用户身份 1、协销 2、会员机构 3、供应商 4.普通机构
@@ -106,6 +107,10 @@ const store = new Vuex.Store({
 			//获取设备信息是否为IphoneX
 			state.isLoginOrderId = variable
 			console.log(state.isLoginOrderId)
+		},
+		setWindowHeight(state,height){
+			state.windowHeight = height
+			console.log(state.windowHeight)
 		}
 	},
 	actions: {