Explorar o código

协销组员订单权限

zhengjinyi %!s(int64=2) %!d(string=hai) anos
pai
achega
f0be665ca4
Modificáronse 3 ficheiros con 58 adicións e 74 borrados
  1. 41 62
      pages/seller/club/club-list.vue
  2. 2 4
      pages/seller/club/list.vue
  3. 15 8
      pages/seller/order/order-list.vue

+ 41 - 62
pages/seller/club/club-list.vue

@@ -7,9 +7,9 @@
 					class="input"
 					type="text"
 					confirm-type="search"
-					v-model="searchInputVal"
+					v-model="listQuery.name"
 					@input="onShowClose"
-					@confirm="initclubList()"
+					@confirm="GetSellerClubList()"
 					placeholder="机构名称/联系人"
 					maxlength="12"
 				/>
@@ -47,25 +47,27 @@
 							<view class="list-item">
 								<view class="list-title">
 									<text class="list-name">{{ club.name }}</text>
-									<text class="list-hist" @click.stop="_goOperation(5,club)"
+									<text class="list-hist" @click.stop="_goOperation(5, club)"
 										><text class="iconfont icon-dingdanxuanzhong"></text>订单列表</text
 									>
 								</view>
 								<view class="list-opea">
-									<text class="tags" v-if="club.vipFlag == 0 && club.userIdentity === 2 ">VIP</text>
+									<text class="tags" v-if="club.vipFlag == 0 && club.userIdentity === 2">VIP</text>
 									<text class="tags sv" v-if="club.vipFlag == 1">SVIP</text>
 								</view>
 							</view>
 						</view>
 						<view class="club-list-bot">
 							<view class="list-opea">
-								<view class="btn org" @click.stop="_goOperation(1,club)"> <text>立即下单</text> </view>
-								<view class="btn gre" @click.stop="_goOperation(2,club)"> <text>二手下单</text> </view>
-								<view class="btn yel" @click.stop="_goOperation(3,club)"> <text>再次购买</text> </view>
-								<view class="btn yeo" @click.stop="_goOperation(4,club)">
+								<view class="btn org" @click.stop="_goOperation(1, club)"> <text>立即下单</text> </view>
+								<view class="btn gre" @click.stop="_goOperation(2, club)"> <text>二手下单</text> </view>
+								<view class="btn yel" @click.stop="_goOperation(3, club)"> <text>再次购买</text> </view>
+								<view class="btn yeo" @click.stop="_goOperation(4, club)">
 									<text>充值/下订金</text>
 								</view>
-								<view class="btn yel" @click.stop="_goOperation(6,club)"> <text>购买优惠券</text> </view>
+								<view class="btn yel" @click.stop="_goOperation(6, club)">
+									<text>购买优惠券</text>
+								</view>
 							</view>
 						</view>
 					</view>
@@ -83,6 +85,16 @@
 import authorize from '@/common/config/authorize.js'
 import tuiLoadmore from '@/components/tui-components/loadmore/loadmore'
 import tuiNomore from '@/components/tui-components/nomore/nomore'
+const defaultListQuery = {
+	userIdentity: '',
+	name: '',
+	pageNum: 1,
+	pageSize: 10,
+	spId: 0,
+	status: 66,
+	type: 1,
+	groupServiceId: 0
+}
 export default {
 	components: {
 		tuiLoadmore,
@@ -90,14 +102,9 @@ export default {
 	},
 	data() {
 		return {
-			serviceProviderId: '',
 			isShowClose: false,
-			searchInputVal: '',
 			isEmpty: false,
 			nomoreText: '上拉显示更多',
-			status: 66,
-			pageNum: 1,
-			pageSize: 10,
 			hasNextPage: false,
 			loadding: false,
 			pullUpOn: true,
@@ -105,41 +112,25 @@ export default {
 			scrollHeight: '',
 			currPage: '', //当前页面
 			prevPage: '', //上一个页面
-			clubList: []
+			clubList: [],
+			listQuery: Object.assign({}, defaultListQuery)
 		}
 	},
-	onLoad() {
-		this.setScrollHeight()
-	},
+	onLoad() {},
 	methods: {
-		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)
+		async initGetStotage() {
+			// 初始化
+			const userInfo = await this.$api.getStorage()
+			this.listQuery.spId = userInfo.serviceProviderId ? userInfo.serviceProviderId : 0
+			this.GetSellerClubList()
 		},
 		searchClubList() {
-			this.pageNum = 1
-			this.initclubList()
+			// 搜索
+			this.GetSellerClubList()
 		},
-		initclubList() {
-			let params = {
-					userIdentity: '',
-					name: this.searchInputVal,
-					pageNum: 1,
-					pageSize: this.pageSize,
-					spId: this.serviceProviderId,
-					status: this.status
-			}
-			this.SellerService.GetSellerClubList(params)
+		GetSellerClubList() {
+			this.listQuery.pageNum = 1
+			this.SellerService.GetSellerClubList(this.listQuery)
 				.then(response => {
 					let data = response.data
 					if (data.list && data.list.length > 0) {
@@ -167,16 +158,8 @@ export default {
 				})
 		},
 		getOnReachBottomData() {
-			this.pageNum += 1
-			let params = {
-				userIdentity: '',
-				name: this.searchInputVal,
-				pageNum: this.pageNum,
-				pageSize: this.pageSize,
-				spId: this.serviceProviderId,
-				status: this.status
-			}
-			this.SellerService.GetSellerClubList(params)
+			this.listQuery.pageNum += 1
+			this.SellerService.GetSellerClubList(this.listQuery)
 				.then(response => {
 					let data = response.data
 					if (data.list && data.list.length > 0) {
@@ -202,7 +185,7 @@ export default {
 		},
 		onShowClose() {
 			//输入框失去焦点时触发
-			if (this.searchInputVal != '') {
+			if (this.listQuery.name != '') {
 				this.isShowClose = true
 			} else {
 				this.isShowClose = false
@@ -210,12 +193,12 @@ export default {
 		},
 		delInputText() {
 			//清除输入框内容
-			this.searchInputVal = ''
+			this.listQuery.name = ''
 			this.isShowClose = false
 		},
-		_goOperation(type,club){
+		_goOperation(type, club) {
 			this.$api.setStorage('orderUserInfo', club)
-			switch(type){
+			switch (type) {
 				case 1:
 					this.$api.navigateTo('/pages/seller/cart/immediately')
 					break
@@ -245,11 +228,7 @@ export default {
 		}
 	},
 	onShow() {
-		this.$api.getStorage().then(response => {
-			this.serviceProviderId = response.serviceProviderId
-			this.pageNum = 1
-			this.initclubList()
-		})
+		this.initGetStotage()
 	}
 }
 </script>

+ 2 - 4
pages/seller/club/list.vue

@@ -224,14 +224,12 @@ export default {
 			},
 		}
 	},
-	onLoad() {
-		console.log('isManage',this.isManage)
-	},
+	onLoad() {},
 	computed: {
 		...mapState(['isManage'])
 	},
 	methods: {
-		async initGetStotage() {
+		async initGetStotage() {// 初始化
 			const userInfo = await this.$api.getStorage()
 			this.listQuery.spId = userInfo.serviceProviderId ? userInfo.serviceProviderId : 0
 			this.GetSellerClubList()

+ 15 - 8
pages/seller/order/order-list.vue

@@ -233,7 +233,7 @@
 								<!-- 底部button -->
 								<order-button
 									ref="orderButton"
-									v-if="screenTab!=3"
+									v-if="screenTab != 3"
 									:status="order.status"
 									:order="order"
 									:orderId="order.orderId"
@@ -283,13 +283,18 @@
 			</view>
 		</view>
 		<!-- 筛选抽屉 -->
-		<cm-orderDrawer ref="screendrawer" :rightDrawer="rightDrawer" @handSearchConfirm="handSearchConfirmData">
+		<cm-orderDrawer
+			ref="screendrawer"
+			v-if="rightDrawer"
+			:rightDrawer="rightDrawer"
+			@handSearchConfirm="handSearchConfirmData"
+		>
 		</cm-orderDrawer>
 	</view>
 </template>
 
 <script>
-import { mapState, mapMutations } from 'vuex'		
+import { mapState, mapMutations } from 'vuex'
 import headerBack from '@/components/cm-module/headerNavbar/header-back' //自定义顶部导航
 import btSearch from '@/components/uni-search/bt-search.vue' //搜索
 import tuiSkeleton from '@/components/tui-skeleton/tui-skeleton'
@@ -348,6 +353,7 @@ export default {
 			btnoRderID: 0, //点击按钮传入的的订单ID
 			pageNum: 1, //页数
 			pageSize: 10, //条数
+			groupServiceId: 0,
 			scrollTop: 0,
 			deteleType: '',
 			skeletonShow: true,
@@ -385,7 +391,7 @@ export default {
 				self.winHeight = calc - self.CustomBar - 82
 			}
 		})
-		console.log('isManage',this.isManage)
+		console.log('isManage', this.isManage)
 	},
 	filters: {
 		NumFormat(value) {
@@ -468,7 +474,8 @@ export default {
 						orderSubmitType: this.screenTab,
 						serviceProviderId: this.serviceProviderId,
 						pageNum: 1,
-						pageSize: this.pageSize
+						pageSize: this.pageSize,
+						groupServiceId: this.groupServiceId
 					})
 						.then(response => {
 							let data = response.data
@@ -511,7 +518,8 @@ export default {
 				orderSubmitType: this.screenTab,
 				serviceProviderId: this.serviceProviderId,
 				pageNum: (this.pageNum += 1),
-				pageSize: this.pageSize
+				pageSize: this.pageSize,
+				groupServiceId: this.groupServiceId
 			})
 				.then(response => {
 					let orderItem = this.orderTabBar[index]
@@ -670,9 +678,8 @@ export default {
 			})
 		},
 		handSearchConfirmData(data) {
-			console.log('确定筛选', data)
 			//确定筛选
-			this.listQuery.startAddTime = data.startAddTime
+			this.groupServiceId = data.serviceProviderId
 			this.getOrderDatainit(this.currentTab)
 		},
 		handlSearchPath() {