Pārlūkot izejas kodu

维沙门店,余额抵扣版本

yuwenjun 3 gadi atpakaļ
vecāks
revīzija
6c7aa14a1b

+ 1 - 1
components/cm-module/creatOrder/sellerFreight.vue

@@ -188,7 +188,7 @@
 		height: auto;
 		background: #FFFFFF;
 		float: left;
-		margin: 24rpx 0 34rpx 0;
+		margin: 24rpx 0;
 		.invoice-freight{
 			width: 702rpx;
 			padding: 0 24rpx;

+ 27 - 15
components/cm-module/creatOrder/sellerInvoice.vue

@@ -99,6 +99,7 @@
 </template>
 
 <script>
+	import { mapState } from 'vuex'
 	export default{
 		name:"invoice",
 		data() {
@@ -137,25 +138,36 @@
 			// this.initData(this.invoiceDatas)
 		},
 		computed: {
-
+			...mapState(['userInfo'])
 		},
 		methods:{
-			getUseFindInvoice(){//获取发票信息
-				this.$api.getComStorage('clubInfo').then((resolve) =>{
-					this.OrderService.GetFindInvoice({userId:resolve.userId}).then(response =>{
-						if(response.data == null){
-							this.invoiceData = Object.assign(this.invoiceData,'',{type:0})
-						}else{
-							this.invoiceData = response.data
-						} 
-					})
+			//获取发票信息
+			getUseFindInvoice(){
+				this.OrderService.GetFindInvoice({ organizeId:this.userInfo.organizeId }).then(response =>{
+					if(response.data == null){
+						this.invoiceData = Object.assign(this.invoiceData, '', {type:0})
+					}else{
+						this.invoiceData = response.data
+					} 
 				})
+				// this.$api.getComStorage('clubInfo').then((resolve) =>{
+				// 	this.OrderService.GetFindInvoice({userId:resolve.userId}).then(response =>{
+				// 		if(response.data == null){
+				// 			this.invoiceData = Object.assign(this.invoiceData,'',{type:0})
+				// 		}else{
+				// 			this.invoiceData = response.data
+				// 		} 
+				// 	})
+				// })
 			},
-			updateInvoiceFn(){//保存发票信息
-				this.$api.getComStorage('clubInfo').then((resolve) =>{
-					let params =Object.assign(this.invoiceData,'',{userId:resolve.userId})
-					this.OrderService.UpdateInvoice(params).then(response =>{})
-				})
+			//保存发票信息
+			updateInvoiceFn(){
+				let params =Object.assign(this.invoiceData,'', { organizeId:this.userInfo.organizeId })
+				this.OrderService.UpdateInvoice(params).then(response =>{})
+				// this.$api.getComStorage('clubInfo').then((resolve) =>{
+				// 	let params =Object.assign(this.invoiceData,'',{userId:resolve.userId})
+				// 	this.OrderService.UpdateInvoice(params).then(response =>{})
+				// })
 			},
 			choiceaInvoiceConfim(){
 				switch(this.invoiceType){

+ 120 - 110
components/cm-module/modelAlert/order-alert.vue

@@ -1,148 +1,158 @@
 <template name="sharealert">
-	<view class="alert spec" >
+	<view class="alert spec">
 		<view class="model-warp" @click.stop="hideConfirm">
 			<view class="content" v-if="modelType == 1">
 				<view class="content-title"></view>
 				<view class="text-content clearfix">
 					<view class="text">
-						<text>您有采美余额¥{{payModelData.ableUserMoney}}暂未使用,是否需要抵扣订单?</text>
-						<text>抵扣后您只需再支付¥{{payModelData.pendingPayments}}</text></view>
+						<text>您有余额<text class="price_number">¥{{ payModelData.ableUserMoney }}</text>暂未使用,是否需要抵扣订单?</text>
+						<text>抵扣后您只需再支付<text class="price_number">¥{{ payModelData.pendingPayments }}</text></text></view>
 					<view class="alert-btn" @click="cancelConfirm(dataInfo)">不抵扣,继续付款</view>
-					<view class="alert-btn" @click="paymentConfirm(1,dataInfo)">抵扣,继续付款</view>
-				</view>				
+					<view class="alert-btn border" @click="paymentConfirm(1, dataInfo)">抵扣,继续付款</view>
+				</view>
 			</view>
 			<view class="content" v-if="modelType == 2">
 				<view class="content-title"></view>
 				<view class="text-content clearfix">
-					<view class="text">您有采美余额¥{{payModelData.ableUserMoney}}暂未使用,是否需要抵扣订单?抵扣后订单支付完成</view>
+					<view class="text">您有余额<text class="price_number">¥{{ payModelData.ableUserMoney }}</text>暂未使用,是否需要抵扣订单?抵扣后订单支付完成</view>
 					<view class="alert-btn" @click="cancelConfirm(dataInfo)">不抵扣,继续付款</view>
-					<view class="alert-btn" @click="paymentConfirm(2,dataInfo)">抵扣</view>
-				</view>				
+					<view class="alert-btn border" @click="paymentConfirm(2, dataInfo)">抵扣</view>
+				</view>
 			</view>
 			<view class="content" v-if="modelType == 3">
 				<view class="content-title"></view>
 				<view class="text-content clearfix">
-					<view class="text">目前机构余额剩余¥{{payModelData.ableUserMoney.toFixed(2)}}是否抵扣订单?</view>
+					<view class="text">目前账户余额剩余<text class="price_number">¥{{ payModelData.ableUserMoney.toFixed(2) }}</text>是否抵扣订单?</view>
 					<view class="alert-btn" @click="hideConfirm">取消,不抵扣</view>
-					<view class="alert-btn" @click="paymentConfirm(3,dataInfo)">抵扣</view>
-				</view>				
+					<view class="alert-btn border" @click="paymentConfirm(3, dataInfo)">抵扣</view>
+				</view>
 			</view>
 		</view>
 	</view>
 </template>
 
 <script>
-	export default{
-		name:'sharealert',
-		props:{
-			modelType:{
-				type:Number,
-				default:3
-			},
-			payModelData:{
-				type:Object
-			}
+export default {
+	name: 'sharealert',
+	props: {
+		modelType: {
+			type: Number,
+			default: 3
 		},
-		data() {
-			return{
-				dataInfo:{}
-			}
+		payModelData: {
+			type: Object
+		}
+	},
+	data() {
+		return {
+			dataInfo: {}
+		}
+	},
+	created() {
+		this.infoData(this.payModelData)
+	},
+	methods: {
+		infoData(el) {
+			this.dataInfo = el
 		},
-		created() {
-			this.infoData(this.payModelData)
+		hideConfirm() {
+			this.$parent.isPayModel = false
 		},
-		methods:{
-			infoData(el){
-				this.dataInfo = el
-			},
-			hideConfirm(){
-				this.$parent.isPayModel = false
-			},
-			cancelConfirm(data){
-				this.$emit('cancelConfirm',data)
-			},
-			paymentConfirm(type,data){
-				this.$parent.isPayModel = false
-				let _data = {type:type,order:data}
-				this.$emit('paymentConfirm',_data)
-			},
-			btnConfirm(data){//点击事件
-				this.$emit('btnConfirm',data)
-			}
+		cancelConfirm(data) {
+			this.$emit('cancelConfirm', data)
+		},
+		paymentConfirm(type, data) {
+			this.$parent.isPayModel = false
+			let _data = { type: type, order: data }
+			this.$emit('paymentConfirm', _data)
+		},
+		btnConfirm(data) {
+			//点击事件
+			this.$emit('btnConfirm', data)
 		}
 	}
+}
 </script>
 
 <style lang="scss">
-	/*弹窗*/
-	 .model-warp.none{
-		 display: none;
-	 }
-	 .model-warp.show{
-		 display: block;
-	 }
-	 .model-warp{
-		width: 100%;
-		height: 100%;
-		background: rgba(0,0,0,0.3);
-		position: fixed;
-		top: 0;
-		left: 0;
-		z-index: 10000;
-		transition: all 0.4s;
-		&.none{
-			display: none;			
-		}
-		&.show{
-			display: block;
+/*弹窗*/
+.model-warp.none {
+	display: none;
+}
+.model-warp.show {
+	display: block;
+}
+.model-warp {
+	width: 100%;
+	height: 100%;
+	background: rgba(0, 0, 0, 0.3);
+	position: fixed;
+	top: 0;
+	left: 0;
+	z-index: 10000;
+	transition: all 0.4s;
+	&.none {
+		display: none;
+	}
+	&.show {
+		display: block;
+	}
+	.content {
+		width: 540rpx;
+		min-height: 310rpx;
+		box-sizing: border-box;
+		position: absolute;
+		left: 50%;
+		top: 50%;
+		transform: translate(-50%, -50%);
+		border-radius: 14rpx;
+		background-color: #ffffff;
+		padding-top: 180rpx;
+		.content-title {
+			position: absolute;
+			left: 0;
+			top: -53rpx;
+			width: 100%;
+			height: 232rpx;
+			background: url(https://static.caimei365.com/app/wisa/img/pay-alert-bg.png) no-repeat;
+			background-size: contain;
 		}
-		.content{
-			width: 540rpx;
-			min-height: 310rpx;
+		.text-content {
+			width: 100%;
+			min-height: 208rpx;
 			box-sizing: border-box;
-			position: absolute;
-			left: 50%;
-			top: 50%;
-			transform: translate(-50%,-50%);
-			border-radius: 14rpx;
-			background-color: #FFFFFF;
-			padding-top: 180rpx;
-			.content-title{
-				position: absolute;
-				left: 0;
-				top: -53rpx;
-				width: 100%;
-				height: 232rpx;
-				background: url(https://admin-b.caimei365.com/userfiles/1/images/photo/2020/08/alert%402x.png) no-repeat;
-				background-size: contain;
+			padding: 24rpx;
+			float: left;
+			background-color: #ffffff;
+			border-radius: 0 0 14rpx 14rpx;
+			.text {
+				letter-spacing: 2rpx;
+				line-height: 50rpx;
+				font-size: $font-size-26;
+				color: $text-color;
+				text-align: justify;
+				margin-bottom: 30rpx;
 			}
-			.text-content{
-				width: 100%;
-				min-height: 208rpx;
-				box-sizing: border-box;
-				padding:24rpx;
-				float: left;
-				background-color: #FFFFFF;
-				border-radius:0 0 14rpx 14rpx;
-				.text{
-					letter-spacing: 2rpx;
-					line-height: 50rpx;
-					font-size: $font-size-26;
-					color: $text-color;
-					text-align: justify;
-					margin-bottom: 30rpx;
-				}
+			.price_number {
+				color: $uni-text-color-price;
 			}
-			.alert-btn{
-				width: 492rpx;
-				height: 88rpx;
-				background: $btn-confirm;
-				line-height: 88rpx;
-				text-align: center;
-				border-radius: 44rpx;
-				color: #FFFFFF;
-				margin-top: 20rpx;
+		}
+		.alert-btn {
+			box-sizing: border-box;
+			width: 492rpx;
+			height: 86rpx;
+			background: $btn-confirm;
+			line-height: 86rpx;
+			text-align: center;
+			border-radius: 43rpx;
+			color: #ffffff;
+			margin-top: 20rpx;
+			border: 1px solid $btn-confirm;
+			&.border {
+				background: #fff;
+				color: $btn-confirm;
 			}
-		}	
+		}
 	}
+}
 </style>

+ 10 - 7
components/cm-module/orderDetails/orderInformation.vue

@@ -13,7 +13,7 @@
 			<view class="information-view title">
 				<view class="view-num time">下单时间:<label class="label">{{ orderData.orderTime =='undefined' ? '' : orderData.orderTime }}</label></view>
 			</view>
-			<view class="information-view">
+			<view class="information-view bame">
 				<view class="view-num bold">
 					订单标识:<label class="label">{{ orderData.orderMark =='undefined' ? '' : orderData.orderMark }}</label>
 				</view>
@@ -22,14 +22,14 @@
 				<view class="view-num">订单总额:<label class="label">¥{{ orderData.payTotalFee =='undefined' ? '' : orderData.payTotalFee | NumFormat }}</label></view>
 			</view>
 			<template v-if="openShowflag">
-				<view class="information-view">
+				<view class="information-view bame">
 					<view class="view-num">待付金额:<text class="red">¥{{ orderData.pendingPayments =='undefined' ? '0.00' : orderData.pendingPayments | NumFormat }}</text></view>
 					<view class="view-man"></view>
 				</view>
 				<view class="information-view bame">
 					<view class="view-man">应付总额:<label class="red">¥{{ orderData.payableAmount =='undefined' ? '0.00' : orderData.payableAmount | NumFormat }}</label></view>
 				</view>
-				<view class="information-view">
+				<view class="information-view bame">
 					<view class="view-num">余额抵扣:<label class="label">¥{{ orderData.balancePayFee =='undefined' ? '' : orderData.balancePayFee | NumFormat}}</label></view>
 				</view>
 				<view class="information-view bame">
@@ -37,13 +37,13 @@
 					<view class="view-num" v-if="orderData.freePostFlag == '-1'">运费:<label class="label">到付</label></view>
 					<view class="view-num" v-if="orderData.freePostFlag == '1'">运费:<label class="label">¥{{ orderData.freight | NumFormat}}</label></view>
 				</view>
-				<view class="information-view" v-show="orderData.promotionFullReduction>0">
+				<view class="information-view bame" v-if="orderData.promotionFullReduction">
 					<view class="view-man" >促销满减:<label class="label">¥{{ orderData.promotionFullReduction | NumFormat}}</label></view>
 				</view>
 				<view class="information-view bame">
 					<view class="view-man">赠品总数:<label class="label">{{ orderData.presentCount + orderData.promotionalGiftsCount}}</label></view>
 				</view>
-				<view class="information-view">
+				<view class="information-view bame" v-if="orderData.discountFee">
 					<view class="view-num">经理折扣:<label class="label">¥{{ orderData.discountFee =='undefined' ? '' : orderData.discountFee | NumFormat}}</label></view>
 				</view>
 				<view class="information-view bame">
@@ -129,6 +129,7 @@
 			},
 			initData(res) {
 				this.orderData = res;
+				console.log(this.orderData);
 			},
 			clipboard(data) {
 				thorui.getClipboardData(data, (res) => {
@@ -167,8 +168,10 @@
 					text-align: right;
 				}
 				&.bame{
-					width: 42%;
-					text-align: right;
+					width: 50%;
+					&:nth-child(2n){
+						text-align: right;
+					}
 				}
 				&.title{
 					width: 100%;

+ 2 - 2
pages.json

@@ -52,7 +52,7 @@
 		"pages": [{
 				"path": "club/club-list",
 				"style": {
-					"navigationBarTitleText": "机构列表"
+					"navigationBarTitleText": "门店列表"
 				}
 			}, {
 				"path": "cart/cart",
@@ -121,7 +121,7 @@
 			{
 				"path": "order/order-historylist",
 				"style": {
-					"navigationBarTitleText": "机构订单列表"
+					"navigationBarTitleText": "门店订单列表"
 				}
 			},
 			{

+ 5 - 6
pages/goods/list.vue

@@ -57,7 +57,7 @@ export default {
 	},
 	data() {
 		return {
-			userId: '',
+			storeId: '',
 			isRequest:false,
 			specClass: '', //规格弹窗css类,控制开关动画
 			handleData: {},
@@ -72,7 +72,8 @@ export default {
 	onLoad(option) {
 		// 获取机构id
 		const clubInfo = uni.getStorageSync('clubInfo')
-		this.userId = clubInfo.userId
+		console.log(clubInfo);
+		this.storeId = clubInfo.storeId
 	},
 	methods: {
 		//显示选择数量确认弹窗
@@ -147,7 +148,7 @@ export default {
 		getAddProductCart() {
 			this.ProductService.shoppingAddCart({
 				productId: this.handleData.productId,
-				userId: this.userId,
+				storeId: this.storeId,
 				productCount: this.number
 			})
 			.then(response => {
@@ -164,9 +165,7 @@ export default {
 		},
 		// 获取购物车商品数量
 		getCartQuantity() {
-			const clubInfo = uni.getStorageSync('clubInfo')
-			this.userId = clubInfo.userId
-			this.SellerService.CartQuantity({ userId: this.userId }).then(res => {
+			this.SellerService.CartQuantity({ storeId: this.storeId }).then(res => {
 				this.$refs.productList.cartQuantity = res.data
 			})
 		}

+ 1 - 1
pages/index/index.vue

@@ -88,7 +88,7 @@
 			<view class="place-order" @click="navigator(`/pages/user/club/club-list`)">
 				<view class="place-left">
 					<text class="iconfont icon-bangjigouxiadan"></text>
-					<text class="title">帮机构下单</text>
+					<text class="title">帮门店下单</text>
 				</view>
 				<text class="iconfont icon-chakangengduo"></text>
 			</view>

+ 6 - 5
pages/user/address/address.vue

@@ -86,7 +86,8 @@ export default {
 			isSelect: false,
 			isEmpty: false,
 			isLoadMore: false,
-			userId: '',
+			// userId: '',
+			storeId:'',
 			pageNum: 1,
 			pageSize: 10,
 			addressList: [],
@@ -142,10 +143,10 @@ export default {
 				// this.userId = resolve.userId
 				// 设置默认地址 测试使用
 				// const clubInfo = uni.getStorageSync('clubInfo')
-				this.userId = resolve.userId
+				this.storeId = resolve.storeId
 				// this.userId = '13914'
 				// console.log(this.userId)
-				let params = { pageNum: this.pageNum, pageSize: this.pageSize, userId: this.userId }
+				let params = { pageNum: this.pageNum, pageSize: this.pageSize, storeId: this.storeId }
 				this.UserService.QueryAddressList(params)
 					.then(response => {
 						if (response.data.list == '') {
@@ -192,7 +193,7 @@ export default {
 			if (index == 1) {
 				this.UserService.DeleteNewAddress({
 					addressId: this.deleteaddressId,
-					userId: this.userId
+					storeId: this.storeId
 				})
 					.then(response => {
 						this.$util.msg('删除成功', 2000, true, 'success')
@@ -226,7 +227,7 @@ export default {
 		setDefaultAddress(id) {
 			this.UserService.DefaultAddress({
 				addressId: id,
-				userId: this.userId
+				storeId: this.storeId
 			})
 				.then(res => {
 					if (res.code === 0) {

+ 4 - 3
pages/user/address/addressManage.vue

@@ -93,7 +93,7 @@ export default {
 			addressData: {
 				addressId: '',
 				allAddress: '请选择所在地区',
-				userId: '', //用户id ,只在新增收货地址时传
+				storeId: '', //用户id ,只在新增收货地址时传
 				shouHuoRen: '', //收货人
 				mobile: '', //收货人手机
 				townId: '', //区ID
@@ -104,6 +104,7 @@ export default {
 		}
 	},
 	onLoad(option) {
+		this.addressData.storeId = uni.getStorageSync('clubInfo').storeId
 		let title = '添加新地址'
 		if (option.type === 'edit') {
 			title = '编辑收货地址'
@@ -117,7 +118,7 @@ export default {
 			}`
 			this.addressData.address = optionData.address
 			this.addressData.defaultFlag = optionData.defaultFlag
-			this.addressData.userId = optionData.userId
+			this.addressData.storeId = optionData.storeId
 			this.addressData.mobile = optionData.mobile
 			this.addressData.townId = optionData.townId
 			this.addressData.addressId = optionData.addressId
@@ -168,7 +169,7 @@ export default {
 				this.params = {
 					// 测试id
 					// userId:'13914',
-					userId: this.addressData.userId, //用户id ,只在新增收货地址时传
+					storeId: this.addressData.storeId, //用户id ,只在新增收货地址时传
 					shouHuoRen: this.addressData.shouHuoRen, //收货人
 					townId: this.addressData.townId, //区ID
 					address: this.addressData.address, //地址

+ 4 - 4
pages/user/cart/cart.vue

@@ -160,7 +160,7 @@
 			return{
 				CustomBar:this.CustomBar,// 顶部导航栏高度
 				isIphoneX:this.$store.state.isIphoneX,
-				userId:'',
+				storeId:'',
 				alertType:'',
 				isStock:'',
 				popupShow:false,
@@ -209,7 +209,7 @@
 				this.isCheckAll=false//是否全选
 				this.submitIds = []
 				this.$api.getComStorage('clubInfo').then((resolve) =>{
-					this.userId = resolve.userId
+					this.storeId = resolve.storeId
 					this.initGetCartGoodsList();
 				})
 			},
@@ -232,7 +232,7 @@
 				}, 500)
 			},
 			initGetCartGoodsList(){//初始化购物车 index:1
-				this.ProductService.QueryShoppingCartList({userId:this.userId}).then(response =>{
+				this.ProductService.QueryShoppingCartList({storeId:this.storeId}).then(response =>{
 					this.skeletonShow = false
 					let data = response.data
 					this.kindCount = data.cartQuantity
@@ -559,7 +559,7 @@
 						})
 					})
 					let cartPramsData={
-							userId:this.userId,
+							storeId:this.storeId,
 							allPrice:this.allPrice,
 							allCount:this.allCount,
 							productID:productID.substring(0,productID.lastIndexOf(',')),

+ 14 - 22
pages/user/club/club-list.vue

@@ -10,7 +10,7 @@
 					v-model="searchInputVal"
 					@input="onShowClose"
 					@confirm="getClubList()"
-					placeholder="请输入机构名称/机构联系人"
+					placeholder="请输入门店名称/门店联系人"
 					maxlength="12"
 					@focus="searchInputFoucs"
 					@blur="hideSearchModalHandle"
@@ -33,7 +33,7 @@
 					mode="widthFix"
 					lazy-load
 				></image>
-				<view class="txt">机构列表空空如也~</view>
+				<view class="txt">门店列表空空如也~</view>
 			</view>
 			<!-- :style="{ height: scrollHeight }" -->
 			<view v-else class="club-list">
@@ -41,34 +41,27 @@
 					class="club-scroll"
 					scroll-y="true"
 					@scrolltolower="getOnReachBottomData"
-					:style="{ height: scrollHeight ,'padding-bottom':isIphoneX ? '44px' :''}"
+					:style="{ height: scrollHeight, 'padding-bottom': isIphoneX ? '44px' : '' }"
 				>
 					<!-- 机构数据 -->
-					<view
-						class="list"
-						v-for="item in clubList"
-						:key="item.userId"
-					>
+					<view class="list" v-for="item in clubList" :key="item.storeId">
 						<view class="list-left">
-							<view class="list-head"
-								><image
-									src="https://static.caimei365.com/app/img/icon/icon-club@3x.png"
-									mode=""
-								></image
-							></view>
+							<view class="list-head">
+								<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">{{ item.clubName }}</text>
+								<text class="list-name">{{ item.name }}</text>
 							</view>
 							<view class="list-contact">
 								<view class="list-row">
 									<text class="iconfont icon-lianxiren"></text>
-									<text>{{ item.userName }}</text>
+									<text>{{ item.linkMan }}</text>
 								</view>
 								<view class="list-row">
 									<text class="iconfont icon-dianhua"></text>
-									<text>{{ item.bindMobile }}</text>
+									<text>{{ item.mobile }}</text>
 								</view>
 							</view>
 							<view class="list-opea">
@@ -149,7 +142,7 @@ export default {
 			uni.getSystemInfo({
 				success(res) {
 					if (_that.isIphoneX) {
-						_that.scrollHeight = res.windowHeight - 60  + 'px'
+						_that.scrollHeight = res.windowHeight - 60 + 'px'
 					} else {
 						_that.scrollHeight = res.windowHeight - 60 + 'px'
 					}
@@ -236,10 +229,9 @@ export default {
 		},
 		// 跳转订单列表
 		goOrderList(item) {
-			console.log(item)
-			this.$api.setStorage('clubInfo', item)
-			this.$api.navigateTo('pages/user/order/order-list')
-			this.$api.navigateTo(`/pages/user/order/order-historylist`)
+			uni.setStorageSync('clubInfo', item)
+			this.$api.navigateTo(`/pages/user/order/order-list?listType=store&state=0`)
+			// this.$api.navigateTo(`/pages/user/order/order-historylist`)
 		},
 		async hideSearchModalHandle() {
 			this.showSearchModal = false

+ 114 - 25
pages/user/order/create-order.vue

@@ -18,6 +18,31 @@
 						@showFreightAlert="handFreightAlertShow">
 		</seller-freight>
 		<freight-alert v-if="isfreightTip" ref="csPhone"></freight-alert>
+		<!-- 余额抵扣 -->
+		<view class="invoice-balance" v-show="!rechargeGoods">
+			<view class="balabce-t">
+				<view class="balabce-t-le">余额抵扣</view>
+				<view class="balabce-t-ri">
+					<view class="money"> 
+						<text>可用余额:</text>
+						<text>¥{{userMoney | NumFormat}}</text>
+					</view>
+					<view class="checkbox-box" v-if="userMoney!==0">
+						<button class="checkbox iconfont"
+								hover-class="btn-hover"
+								@click.stop="checkedBalabce"
+								:class="[ischecked ?'icon-xuanze':'icon-weixuanze']"
+						>
+						</button>
+					</view>
+				</view>
+			</view>
+			<view class="balabce-b" :class="{'balabce-b--hide':!ischecked}">
+				<view class="balabce-b-text animation" :style="{'transform':ischecked?'translateY(0)':'translateY(-50%)','-webkit-transform':ischecked?'translateY(0)':'translateY(-50%)'}">
+					<text>当前使用:¥{{deductMoney | NumFormat}},剩余:¥{{surplusMoney | NumFormat}}</text>
+				</view>
+			</view>
+		</view>
 		<!-- 底部 -->
 		<view class="footer" :style="{paddingBottom :isIphoneX ? '68rpx' : '0rpx'}">
 			<view class="footer-le">
@@ -46,6 +71,7 @@
 	import sellerInvoice from '@/components/cm-module/creatOrder/sellerInvoice'
 	import sellerFreight from '@/components/cm-module/creatOrder/sellerFreight'
 	import freightAlert from '@/components/cm-module/modelAlert/freightAlert.vue'
+	import { mapState } from 'vuex'
 	export default {
 		components:{
 			choiceAddress,
@@ -59,6 +85,7 @@
 				isSubLoading:false,
 				orderID:0,
 				userId:'',
+				storeId:'',
 				productIds:'',			  //获取上一级页面商品信息
 				productCount:'',		  //获取上一级页面商品数量
 				classifyIDS:'',			  //获取上一级页面商品分类
@@ -66,7 +93,7 @@
 				submitState:'',  		  //提交状态
 				allCount:1,				  //订单提交总数量
 				totalOriginalPrice:0,	  //订单总原价(划线部分)
-				totalFullReduction:0,			  //满减金额
+				totalFullReduction:0,	  //满减金额
 				payAllPrice:0.00,		  //订单提交总金额
 				allPrice:0.00,			  //订单总金额
 				addressId:'',			  //地址ID
@@ -85,6 +112,11 @@
 				isIphoneX:this.$store.state.isIphoneX,
 				clauseId:0,
 				productsList:[],
+				// 余额抵扣
+				userMoney:0,			  //可用余额
+				deductMoney:0, 			  //当前使用金额
+				surplusMoney:0,			  //剩余金额
+				balanceDeductionFlag:0
 			}
 		},
 		onLoad(option){//商品数据
@@ -92,7 +124,7 @@
 			this.allPrice = data.data.allPrice;
 			this.allCount = data.data.allCount;
 			this.payAllPrice = this.totalPrice;
-			this.userId = data.data.userId
+			this.storeId = data.data.storeId
 			this.productIds = data.data.productID
 			console.log(this.allCount)
 			this.getInitCrearOrder();
@@ -102,9 +134,13 @@
 				return Number(value).toFixed(2);
 			},
 		},
+		computed:{
+			...mapState(['userInfo'])
+		},
 		methods: {
 			getInitCrearOrder(option){//确认订单初始化信息 
-				let params ={userId:this.userId,productIds:this.productIds}
+				// let params ={userId:this.userId,productIds:this.productIds}
+				let params ={organizeId:this.userInfo.organizeId, storeId:this.storeId ,productIds:this.productIds}
 				this.OrderService.QueryOrderConfirm(params)
 					.then(response =>{
 						let data = response.data
@@ -114,14 +150,16 @@
 						this.totalFullReduction = data.totalFullReduction
 						this.totalOriginalPrice = data.totalFullReduction + data.totalPrice
 						this.allPrice = this.payAllPrice = data.totalPrice
+						this.userMoney = data.userMoney
 					})
 					.catch(error =>{
 						this.$util.msg(error.msg,2000)
 					})
 			},
-			getFreightData(){//获取邮费信息
+			//获取邮费信息
+			getFreightData(){
 				let params ={
-						userId:this.userId,
+						storeId:this.storeId,
 						productIds:this.productIds,
 						totalPrice:this.allPrice,
 						townId:this.addressData.townId
@@ -136,8 +174,9 @@
 					}
 				})
 			},
-			getAddressData(){//获取地址信息
-				this.UserService.QueryAddressList({pageNum:1,pageSize:1,userId:this.userId})
+			//获取地址信息
+			getAddressData(){
+				this.UserService.QueryAddressList({pageNum:1,pageSize:1,storeId:this.storeId})
 				.then(response =>{
 					this.isAddress = true
 					this.addressData = {}
@@ -176,11 +215,39 @@
 				}
 			},
 			attributeNofreight(){//计算没有邮费的支付价格
-				this.payAllPrice = this.allPrice;
+				if(this.ischecked){
+					if(this.userMoney>this.payAllPrice){
+						this.payAllPrice = 0.00
+						this.deductMoney = this.allPrice							//勾选后使用抵余额
+						this.surplusMoney = this.userMoney - this.deductMoney	    //勾选后的剩余抵扣
+					}else{
+						this.payAllPrice = this.allPrice - this.userMoney       	//勾选后的总价
+						this.deductMoney = this.userMoney				            //勾选后使用抵余额
+						this.surplusMoney = this.userMoney - this.deductMoney	    //勾选后的剩余抵扣
+					}
+				}else{
+					this.payAllPrice = this.allPrice;
+					this.deductMoney = 0.00;
+					this.surplusMoney = this.userMoney;
+				}
 			},
 			attributeHashfreight(freight){//计算需要邮费的支付价格
 				this.payAllPrice = this.allPrice+parseInt(freight)//计算不包邮的价格 总价等于商品价格+邮费
 			},
+			checkedBalabce(){//勾选使用余额
+				if(this.userMoney > 0){
+					this.ischecked = !this.ischecked
+					if(this.ischecked){
+						this.balanceDeductionFlag =1
+						this.attributePallPrice()
+					}else{
+						this.payAllPrice = this.allPrice
+						this.balanceDeductionFlag = 2
+					}
+				}else{
+					return
+				}
+			},
 			orderSubmitMit(){//提交订单
 				if(this.isSubLoading){ return; }
 				if(this.addressId == ''){
@@ -192,13 +259,13 @@
 					let productInfo = [];
 					el.productList.forEach(item => {
 						productInfo.push({
-							productId:item.productId,
-							productNum:item.productCount,
-							productType:item.productType ? Number(item.productType) : 0,
-							presentNum:0,
+							productId: item.productId,
+							productNum: item.productCount,
+							productType: item.productType ? Number(item.productType) : 0,
+							presentNum: 0,
 						})
 					})				
-					return {shopId:el.shopId,note:el.note?el.note:'',productInfo:productInfo}
+					return { shopId: el.shopId, note: el.note?el.note:'', productInfo: productInfo }
 				})
 				//订单信息
 				this.payInfo = {
@@ -209,7 +276,9 @@
 					}
 					console.log(this.payInfo)
 				let params = {
-						clubUserId:this.userId,
+						// clubUserId:this.userId,
+						storeId:this.storeId,
+						organizeId:this.userInfo.organizeId,
 						addressId:this.addressId,	  //地址ID
 						orderInfo:this.orderInfo,	  //商品信息
 						payInfo:this.payInfo,		  //订单信息
@@ -217,16 +286,34 @@
 					}
 				this.isSubLoading = true;	
 				this.OrderService.CreatedOrderSubmit(params).then(response =>{
-					const data = response.data;
-					this.$util.msg('订单提交成功',2000,true,'success')
-					setTimeout(()=>{
-						this.isSubLoading = false;
-					},2000)
-					setTimeout(()=>{
-						this.$api.redirectTo(`/pages/user/order/success?orderId=${data.orderId}`)
-					},2000)
+					const payResult = response.data
+					// 提交订单并支付成功(余额抵扣)
+					if(payResult.code === '1'){
+						this.$util.msg('订单提交成功',2000,true,'success')
+						this.submitState = 'success'
+						setTimeout(()=>{
+							this.isSubLoading = false;
+							this.$api.redirectTo(`/pages/user/order/success?orderId=${payResult.orderId}&type=${this.submitState}`)
+						},2000)
+					}else if(payResult.code === '2'){
+						this.$util.msg('订单提交成功',2000,true,'success')
+						this.submitState ='confirm'
+						setTimeout(()=>{
+							this.isSubLoading = false;
+							// this.$api.redirectTo(`/pages/user/order/success?orderId=${payResult.orderId}&type=${this.submitState}`)
+							this.$api.redirectTo(`/pages/user/order/order-payment?orderId=${payResult.orderId}&type=payfirm`)
+						},2000)
+					}else{
+						this.$util.msg('订单提交失败,请新提交',2000);
+						setTimeout(()=>{
+							this.isSubLoading = false;
+						}, 2000)
+					}
 				}).catch(error =>{
 					this.$util.msg(error.msg,2000);
+					setTimeout(()=>{
+						this.isSubLoading = false;
+					}, 2000)
 				})
 			},
 			handFreightAlertShow(){//显示邮费弹窗
@@ -245,7 +332,7 @@
 				let SelectData = uni.getStorageSync('selectAddress');
 				this.addressId = SelectData.addressId;
 				this.addressData = SelectData
-				this.getFreightData()
+				// this.getFreightData()
 			}else{
 				this.getAddressData()
 			}
@@ -297,7 +384,6 @@
 		padding:0 24rpx;
 		background: #FFFFFF;
 		float: left;
-		margin-top: 24rpx;
 		margin-bottom: 24rpx;
 		.balabce-t{
 			width: 100%;
@@ -333,9 +419,12 @@
 						border-radius: 0;
 						-webkit-tap-highlight-color: transparent;
 						overflow: hidden;
-						color: $color-system;
+						color: #ff2a2a;
 						padding: 5rpx;
 					}
+					.icon-weixuanze{
+						color: $color-system;
+					}
 				}	
 			}
 		}

+ 88 - 15
pages/user/order/order-details.vue

@@ -40,6 +40,12 @@
 		<tui-modal :show="modal" @click="handleClick" @cancel="hideMobel" :content="contentModalText" color="#333" :size="32" shape="circle" :maskClosable="false"></tui-modal>
 		<!-- 促销活动弹窗 -->
 		<activi-popup :Promotion="handlerPros" :popupShow="popupShow"></activi-popup>
+		<!-- 付款弹窗 -->
+		<order-model v-if="isPayModel" 
+					:payModelData="payModelData" 
+					:modelType='modelType' 
+					@cancelConfirm = "hanldCancelConfirm"
+					@paymentConfirm ='hanldPaymentConfirm'/>
 	</view>
 </template>
 
@@ -54,8 +60,8 @@
 	import refundRecord from '@/components/cm-module/orderDetails/refundRecord'		 //退款记录
 	import orderButton from '@/components/cm-module/orderDetails/orderButton'			 //底部按钮
 	import shareAlert from '@/components/cm-module/modelAlert/shareAlert.vue'			 //分享弹窗
-	import orderModel from '@/components/cm-module/modelAlert/order-alert'			 //付款弹窗
 	import activiPopup from "@/components/cm-module/orderDetails/activipopu"		//促销活动弹窗
+	import orderModel from '@/components/cm-module/modelAlert/order-alert'			 //付款弹窗
 	
 	export default {
 		components:{
@@ -114,7 +120,10 @@
 				organizeId:0,
 				modal:false,
 				OperationType:'',
-				contentModalText:''
+				contentModalText:'',
+				hanldOrderData:'',
+				isPayModel:false, //余额抵扣弹窗
+				payModelData:{} //余额抵扣弹窗内容
 			}
 		},
 		onLoad(option){
@@ -199,14 +208,16 @@
 					})
 				})
 			},
-			handButtonConfirm(data) {//获取点击
+			//获取点击
+			handButtonConfirm(data) {
 				console.log(data)
 				this.hanldOrder = data
 				this.btnoRderID = data.orderId
 				this.OperationType = data.type
 				this.handShowAlert(data)
 			},
-			handShowAlert(data) {//执行
+			//执行
+			handShowAlert(data) {
 				switch(data.type){
 					case 'cancel':
 						this.modal = true;
@@ -225,15 +236,18 @@
 						this.$api.navigateTo('/pages/user/order/order-logistics?orderId='+data.orderId)
 						break;
 					case 'pay':
-						if(data.order.onlinePayFlag == '0'){
-						this.$api.navigateTo(`/pages/user/order/order-payment?type=payfirm&orderId=${data.orderId}`)
-						}else{
-							this.$api.navigateTo(`/pages/user/order/order-payment?type=onlinePay&Amount=${data.order.pendingPayments}&orderId=${data.orderId}`)
-						}
+						// if(data.order.onlinePayFlag == '0'){
+						// this.$api.navigateTo(`/pages/user/order/order-payment?type=payfirm&orderId=${data.orderId}`)
+						// }else{
+						// 	this.$api.navigateTo(`/pages/user/order/order-payment?type=onlinePay&Amount=${data.order.pendingPayments}&orderId=${data.orderId}`)
+						// }
+						this.hanldOrderData = data.order;
+						this.getOrderPaymentValidation(data)
 						break;
 				}
 			},
-			handleClick(e) {//用户操作订单
+			//用户操作订单
+			handleClick(e) {
 				let index = e.index;
 				if(index == 1){
 					switch(this.OperationType){
@@ -250,7 +264,62 @@
 				}
 				this.modal = false;
 			},
-			handOrderConfirm (id){//确认收货
+			//监听根据付款状态做操作
+			getOrderPaymentValidation(data){
+				this.OrderService.OrderPaymentValidation({orderId:data.orderId}).then(response =>{
+					let dataCode = response.data.code
+					this.payModelData = response.data
+					console.log(response);
+					switch(dataCode){
+						case 1:
+							this.isPayModel = true;
+							this.modelType = 1
+							break;
+						case 2:
+							this.isPayModel = true;
+							this.modelType = 2
+							break;
+						case -1:
+							this.$util.modal('','订单已申请全部退款,无需再付款!','确定','',false,() =>{})
+							break;
+						default:
+							if(response.data.onlinePayFlag == '1'){
+								this.$api.navigateTo(`/pages/user/order/order-payment?type=onlinePay&Amount=${response.data.pendingPayments}&orderId=${data.orderId}`)
+							}else{
+								this.$api.navigateTo(`/pages/user/order/order-payment?type=payfirm&orderId=${data.orderId}`)
+							}
+					}
+					
+				}).catch(error =>{
+					this.$util.msg(error.msg,2000)
+				})	
+			},
+			//余额抵扣跳转
+			hanldPaymentConfirm(data){
+				this.OrderService.OrderBalanceDeduction({orderId:data.order.orderId}).then(response =>{
+					if(data.type === 2){
+						this.$api.navigateTo(`/pages/user/order/success?type=success&orderId=${data.order.orderId}`)
+					}else{
+						if(data.order.onlinePayFlag === '1'){
+							this.$api.navigateTo(`/pages/user/order/order-payment?type=onlinePay&Amount=${data.order.pendingPayments}&orderId=${data.order.orderId}`)
+						}else{
+							this.$api.navigateTo(`/pages/user/order/order-payment?type=payfirm&orderId=${data.order.orderId}`)
+						}
+					}
+				}).catch(error =>{
+					this.$util.msg(error.msg,2000)
+				})	
+			},
+			//不使用余额抵扣直接跳转收银台
+			hanldCancelConfirm(data){
+				if(data.onlinePayFlag == '1'){
+					this.$api.navigateTo(`/pages/user/order/order-payment?type=onlinePay&Amount=${this.hanldOrderData.pendingPayments}&orderId=${data.orderId}`)
+				}else{
+					this.$api.navigateTo(`/pages/user/order/order-payment?type=payfirm&orderId=${data.orderId}`)
+				}
+			},
+			//确认收货
+			handOrderConfirm (id){
 				this.OrderService.ConfirmReceipt({orderId:id}).then(response =>{
 					this.$util.msg(response.msg,2000,true,'success');
 					setTimeout(() => {
@@ -260,7 +329,8 @@
 					this.$util.msg(error.msg,2000)
 				})
 			},
-			handOrderDetele(id){//删除订单
+			//删除订单
+			handOrderDetele(id){
 				this.OrderService.DeleteOrder({orderId:id}).then(response =>{
 					this.$util.msg(response.msg,2000,true,'success');
 					setTimeout(() => {
@@ -274,7 +344,8 @@
 					this.$util.msg(error.msg,2000)
 				})
 			},
-			handCenceConfirm(id){//取消订单
+			//取消订单
+			handCenceConfirm(id){
 				this.OrderService.CancelOrder({orderId:id}).then(response =>{
 					this.$util.msg(response.msg,2000,true,'success');
 					setTimeout(() => {
@@ -287,7 +358,8 @@
 			handlSearchPath(){
 				this.$api.navigateTo('/pages/user/order/search-order')
 			},
-			onShareAppMessage (res){//分享转发
+			//分享转发
+			onShareAppMessage (res){
 				this.isShareModal = false
 				if (res.from === 'button') {// 来自页面内转发按钮
 			    }
@@ -297,7 +369,8 @@
 					imageUrl:'https://static.caimei365.com/app/wisa/img/icon/icon-share.png'
 				}
 			},
-			hanldePopupFn(data){//监听活动内容
+			//监听活动内容
+			hanldePopupFn(data){
 				this.popupShow = true
 				this.handlerPros = data
 			},

+ 1 - 1
pages/user/order/order-historylist.vue

@@ -240,7 +240,7 @@
 				}
 				setTimeout(()=>{
 					this.$api.getComStorage('clubInfo').then((resolve) =>{
-						let params = {orderState:index,userId:resolve.userId,organizeId:this.organizeId,pageNum:1,pageSize:this.pageSize};
+						let params = {orderState:index,storeId:resolve.storeId,organizeId:this.organizeId,pageNum:1,pageSize:this.pageSize};
 						this.OrderService.QueryOrderList(params).then(response =>{
 							let orderList = response.data.list.filter(item=>{
 								//添加不同状态下订单的表现形式

+ 196 - 123
pages/user/order/order-list.vue

@@ -13,85 +13,93 @@
 		<swiper class="tab-content" :current="currentTab" duration="80" @animationfinish="onChange" :style="{height:winHeight+'px'}" >
 			<swiper-item v-for="(tabItem,index) in orderTabBar" :key="index">
 				<tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading	="false" :loadingType="5"></tui-skeleton>
-				<scroll-view scroll-y class="scoll-y tui-skeleton" @scrolltolower="scrolltolower">
+				<scroll-view scroll-y class="scoll-y tui-skeleton" @scrolltolower="scrolltolower" >
 					<view  :class="{'tui-order-list':scrollTop >= 0}" class="tui-skeleton clearfix">
 						<!-- 空白页 -->
 						<empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0" :typeIndex="currentTab" :navbarHeight="navbarHeight"></empty>
 						<!-- 列表 -->
-						<view v-else class="tui-order-content">
-							<view  class="tui-order-item" v-for="(order,orderIndex) in tabItem.orderList" :key="orderIndex" >
-								<view class="order-title">
-									<view class="order-title-name">{{order.clubName}}</view>
-									<view class="order-title-t">
-										<text class="bage-text tui-skeleton-fillet"><text class="text">订单编号:</text>{{order.orderNo}}</text>
-									</view>
-									<view class="order-title-b">
-										<view class="order-title-btxt tui-skeleton-fillet"><text class="text">下单时间:</text>{{order.orderTime}}</view>
-										<view class="order-title-tip tui-skeleton-fillet">{{ StateExpFormat(order.status) }}</view>
-									</view>
-								</view>
-								<block v-for="(shop,sindex) in order.shopOrderList" :key="sindex">
-									<view class="goods-title">
-										<view class="title-logo"><image :src="shop.shopLogo" mode=""></image></view>
-										<view class="title-text tui-skeleton-fillet">{{shop.shopName}}</view>
+						<template v-else >
+							<view class="tui-order-content" v-if="isRequest && isEmpty">
+								<view  class="tui-order-item" v-for="(order,orderIndex) in tabItem.orderList" :key="orderIndex" >
+									<view class="order-title">
+										<view class="order-title-name">{{order.clubName}}</view>
+										<view class="order-title-t">
+											<text class="bage-text tui-skeleton-fillet"><text class="text">订单编号:</text>{{order.orderNo}}</text>
+										</view>
+										<view class="order-title-b">
+											<view class="order-title-btxt tui-skeleton-fillet"><text class="text">下单时间:</text>{{order.orderTime}}</view>
+											<view class="order-title-tip tui-skeleton-fillet">{{ StateExpFormat(order.status) }}</view>
+										</view>
 									</view>
-									<view class="goods-item" v-for="(pros,prosIndex) in shop.orderProductList" :key="prosIndex" @click.stop="detail(order.orderId)">
-										<view class="goods-pros-t">
-											<view class="pros-img tui-skeleton-fillet">
-												<image :src="pros.productImage" alt="" />
-												<text class="tips" v-if="pros.productType ==2 || pros.productType ==1">赠品</text>
-											</view>
-											<view class="pros-product clearfix">
-												<view class="producttitle tui-skeleton-fillet">{{pros.name}}</view>
-												<view class="productspec tui-skeleton-fillet" v-if="pros.productCategory!=2">规格:{{pros.productUnit}}</view>
-												<view class="productprice">
-													<view class="price " v-if="pros.productType ==2 || pros.productType ==1">
-														<text>¥0.00</text>
-													</view>
-													<view class="price tui-skeleton-fillet" v-else :class="PromotionsFormat(pros.productPromotion) ? 'disabled' : ''">
-														<text>¥{{pros.price | NumFormat}}</text>
-													</view>
-													<view class="count tui-skeleton-fillet">
-														<text class="small">x</text>{{pros.num}}
-													</view>
+									<block v-for="(shop,sindex) in order.shopOrderList" :key="sindex">
+										<view class="goods-title">
+											<view class="title-logo"><image :src="shop.shopLogo" mode=""></image></view>
+											<view class="title-text tui-skeleton-fillet">{{shop.shopName}}</view>
+										</view>
+										<view class="goods-item" v-for="(pros,prosIndex) in shop.orderProductList" :key="prosIndex" @click.stop="detail(order.orderId)">
+											<view class="goods-pros-t">
+												<view class="pros-img tui-skeleton-fillet">
+													<image :src="pros.productImage" alt="" />
+													<text class="tips" v-if="pros.productType ==2 || pros.productType ==1">赠品</text>
 												</view>
-												<view class="floor-item-act" v-if=" pros.productPromotion!=null ">
-													<view v-if="PromotionsFormat(pros.productPromotion)"  class="floor-tags">
-														{{pros.productPromotion.name}}
-														<text v-if ="pros.productPromotion!=null && pros.productPromotion.type !=3">
-															:¥{{ pros.productPromotion == null ? '0.00' : pros.productPromotion.touchPrice | NumFormat}}
-														</text>
+												<view class="pros-product clearfix">
+													<view class="producttitle tui-skeleton-fillet">{{pros.name}}</view>
+													<view class="productspec tui-skeleton-fillet" v-if="pros.productCategory!=2">规格:{{pros.productUnit}}</view>
+													<view class="productprice">
+														<view class="price " v-if="pros.productType ==2 || pros.productType ==1">
+															<text>¥0.00</text>
+														</view>
+														<view class="price tui-skeleton-fillet" v-else :class="PromotionsFormat(pros.productPromotion) ? 'disabled' : ''">
+															<text>¥{{pros.price | NumFormat}}</text>
+														</view>
+														<view class="count tui-skeleton-fillet">
+															<text class="small">x</text>{{pros.num}}
+														</view>
 													</view>
-													<view v-else-if="pros.productPromotion.type !=3" class="floor-tags">{{pros.productPromotion.name}}</view>	
-												</view>
-											</view>	
+													<view class="floor-item-act" v-if=" pros.productPromotion!=null ">
+														<view v-if="PromotionsFormat(pros.productPromotion)"  class="floor-tags">
+															{{pros.productPromotion.name}}
+															<text v-if ="pros.productPromotion!=null && pros.productPromotion.type !=3">
+																:¥{{ pros.productPromotion == null ? '0.00' : pros.productPromotion.touchPrice | NumFormat}}
+															</text>
+														</view>
+														<view v-else-if="pros.productPromotion.type !=3" class="floor-tags">{{pros.productPromotion.name}}</view>	
+													</view>
+												</view>	
+											</view>
+										</view>	
+									</block>
+									<view class="order-footer">
+										<view class="order-footer-top" v-if="order.discountFee!=0">经理折扣:¥{{order.discountFee | NumFormat}}</view>
+										<view class="order-footer-bot">
+											<view class="count tui-skeleton-fillet">共{{order.productCount}}件商品</view>
+											<view class="money tui-skeleton-fillet" v-if="order.status==31||order.status==32||order.status==33">已支付:<label style="color:#f94b4b ;">¥{{ order.receiptAmount | NumFormat }}</label></view>
+											<view class="money tui-skeleton-fillet" v-else>待付总额:<label style="color:#f94b4b ;">¥{{ order.pendingPayments | NumFormat }}</label></view>
 										</view>
-									</view>	
-								</block>
-								<view class="order-footer">
-									<view class="order-footer-top" v-if="order.discountFee!=0">经理折扣:¥{{order.discountFee | NumFormat}}</view>
-									<view class="order-footer-bot">
-										<view class="count tui-skeleton-fillet">共{{order.productCount}}件商品</view>
-										<view class="money tui-skeleton-fillet" v-if="order.status==31||order.status==32||order.status==33">已支付:<label style="color:#f94b4b ;">¥{{ order.receiptAmount | NumFormat }}</label></view>
-										<view class="money tui-skeleton-fillet" v-else>待付总额:<label style="color:#f94b4b ;">¥{{ order.pendingPayments | NumFormat }}</label></view>
 									</view>
+									<!-- 底部button -->
+									<order-button ref="orderButton" 
+												  :status="order.status" 
+												  :order="order" 
+												  @buttonConfirm="handButtonConfirm">
+									</order-button>
 								</view>
-								<!-- 底部button -->
-								<order-button ref="orderButton" 
-											  :status="order.status" 
-											  :order="order" 
-											  @buttonConfirm="handButtonConfirm">
-								</order-button>
+								<tui-loadmore :visible="true" text="加载更多..." v-if="loadding"></tui-loadmore>
+								<tui-nomore :visible="true" :text="nomoreText" v-else></tui-nomore>
 							</view>
-							<!--加载loadding-->
-							<tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
-							<tui-nomore :visible="!pullUpOn" :backgroundColor="'#ffffff'" :text='nomoreText'></tui-nomore>
-							<!--加载loadding-->
-						</view>
+						</template>
 					</view>
 				</scroll-view>
 			</swiper-item>
 		</swiper>
+		<!-- 付款弹窗 -->
+		<order-model v-if="isPayModel" 
+					:payModelData="payModelData" 
+					:modelType='modelType' 
+					@cancelConfirm = "hanldCancelConfirm"
+					@paymentConfirm ='hanldPaymentConfirm'/>
+					
+		<!-- 分享弹窗 -->
 		<!-- 操作弹窗 -->
 		<tui-modal :show="modal" @click="handleClick" @cancel="hideMobel" :content="contentModalText" color="#333" :size="32" shape="circle" :maskClosable="false"></tui-modal>
 		<!-- 分享弹窗 -->
@@ -105,22 +113,16 @@
 	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"
-	import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
-	import tuiNomore from "@/components/tui-components/nomore/nomore"
 	import orderButton from '@/components/cm-module/orderDetails/orderListButton'		 //按钮
 	import modalLayer from "@/components/modal-layer"
 	import empty from "@/components/empty";
 	import shareAlert from '@/components/cm-module/modelAlert/shareAlert'			 //分享弹窗
 	import orderModel from '@/components/cm-module/modelAlert/order-alert'			 //付款弹窗
-	
-	
 	export default {
 		components: {
 			headerBack,
 			empty,
 			btSearch,
-			tuiLoadmore,
-			tuiNomore,
 			orderButton,
 			tuiSkeleton,
 			modalLayer,
@@ -130,11 +132,11 @@
 		data() {
 			return {
 				CustomBar:this.CustomBar,// 顶部导航栏高度
-				orderTabBar: [{state: 0,text: '全部',orderList: []},
-							  {state: 1,text: '待付款',orderList: []},
-							  {state: 2,text: '待发货',orderList: []},
-							  {state: 3,text: '已发货',orderList: []},
-							  {state: 4,text: '退货/款',orderList: []}
+				orderTabBar: [{state: 0, text: '全部', orderList: []},
+							  {state: 1, text: '待付款', orderList: []},
+							  {state: 2, text: '待发货', orderList: []},
+							  {state: 3, text: '已发货', orderList: []},
+							  {state: 4, text: '退货/款', orderList: []}
 							 ],
 				headerBtnPosi:	this.setHeaderBtnPosi(), //获取设备顶部胶囊高度
 				systeminfo:  this.setSysteminfo(),		 //获取设备信息
@@ -153,13 +155,14 @@
 				pageSize: 10,  //条数
 				scrollTop: 0,
 				skeletonShow: true,
+				isRequest:false,
 				isDelete:false,
 				isClickChange: false,
 				isShareModal: false,//控制分享弹窗
 				isModalLayer: false,
 				isPayModel:false,
 				loadding: false,
-				pullUpOn: true,
+				pullDownOn: true,
 				hasNextPage: false,
 				pullFlag: true,
 				navbarHeight:'',
@@ -170,12 +173,20 @@
 				isOnloadFlag:false,
 				modal:false,
 				OperationType:'',
-				contentModalText:''
+				contentModalText:'',
+				listType:''
+			}
+		},
+		computed:{
+			isEmpty(){
+				return this.orderTabBar[this.currentTab].orderList.length > 0
 			}
 		},
 		onLoad(e) {
 			let self = this;
+			this.listType = e.listType || ''
 			if(e.type ==='detele'){self.isDelete = true}
+			this.storeId = uni.getStorageSync('clubInfo').storeId
 			self.currentTab = e.state
 			self.isOnloadFlag = true
 			self.getHeaderTopHeight()//设置自定义导航高度
@@ -186,6 +197,9 @@
 					self.winHeight = calc - self.CustomBar;
 				}
 			});
+			if(this.listType === 'store'){
+				this.nvabarData.title = '门店订单列表'
+			}
 		},
 		filters:{
 			NumFormat(value) {//处理金额
@@ -208,7 +222,6 @@
 				this.currentTab = index; 
 				this.checkCor();
 				this.pageNum = 1
-				this.pullUpOn = true //切换时隐藏
 				this.loadding =  false //切换时隐藏
 				this.nomoreText = ''
 				if(!this.isOnloadFlag){
@@ -224,7 +237,6 @@
 					this.isClickChange = true;
 					this.currentTab = tabIndex
 					this.pageNum = 1
-					this.pullUpOn = true //切换时隐藏
 					this.loadding =  false //切换时隐藏
 					this.GetOrderDatainit(this.currentTab)
 				}
@@ -258,17 +270,18 @@
 					return;
 				}
 				setTimeout(()=>{
-					this.$api.getStorage().then((resolve) =>{
-						this.userId = resolve.userId
-						this.organizeId = resolve.organizeId
-						this.OrderService.QueryOrderList(
-							{
-								orderState:index,
-								organizeId:resolve.organizeId,
-								pageNum:1,
-								pageSize:this.pageSize,
-								}
-						)
+					this.$api.getStorage().then((result) =>{
+						this.organizeId = result.organizeId
+						const params = {
+							orderState:index,
+							organizeId:this.organizeId,
+							pageNum:1,
+							pageSize:this.pageSize,
+						}
+						if(this.listType === 'store'){
+							params.storeId = this.storeId
+						}
+						this.OrderService.QueryOrderList(params)
 						.then(response =>{
 							//loaded新字段用于表示数据加载完毕,如果为空可以显示空白页
 							let orderList = response.data.list.filter(item=>{
@@ -283,45 +296,44 @@
 							this.$set(orderItem, 'loaded', true);
 							this.hasNextPage = response.data.hasNextPage;
 							if(this.hasNextPage){
-								this.pullUpOn = false
-								this.nomoreText = '上拉显示更多'
+								this.loaddingText = '上拉加载更多'
 							}else{
-								if(orderItem.orderList.length < 2){
-									this.pullUpOn = true
-								}else{
-									this.pullUpOn = false
-									this.nomoreText = '已至底部'
-								}
+								this.loaddingText = '已至底部'
 							}
+							this.isRequest = true
 						}).catch(error =>{
 							this.$util.msg(error.msg,2000);
 						})
 					})
 				}, 600);	
 			}, 
-			getOnReachBottomData(index){//上拉加载
-				this.pageNum+=1
-				this.OrderService.QueryOrderList(
-					{
+			//上拉加载
+			getOnReachBottomData(index){
+				this.loadding = true
+				this.pageNum += 1
+				this.OrderService.QueryOrderList({
 						orderState:index,
 						organizeId:this.organizeId,
 						pageNum:this.pageNum,
 						pageSize:this.pageSize
-					}
-				)
+					})
 				.then(response =>{
+					//loaded新字段用于表示数据加载完毕,如果为空可以显示空白页
+					// let orderList = response.data.list.filter(item=>{
+					// 		//添加不同状态下订单的表现形式
+					// 		item = Object.assign(item, this.StateExpFormat(item.state));
+					// 		return item;
+					// });
 					let orderItem = this.orderTabBar[index];
-					let resData = response.data.results
+					let resData = response.data.list
 					this.hasNextPage = response.data.hasNextPage;
 					orderItem.orderList = orderItem.orderList.concat(resData)
 					this.pullFlag = false;// 防上拉暴滑
-					setTimeout(()=>{this.pullFlag = true;},500)
+					setTimeout(()=>{this.pullFlag = true},500)
+					this.loadding = false
 					if(this.hasNextPage){
-						this.pullUpOn = false
 						this.nomoreText = '上拉显示更多'
 					}else{
-						this.loadding = false
-						this.pullUpOn = false
 						this.nomoreText = '已至底部'
 					}
 				}).catch(error =>{
@@ -329,9 +341,7 @@
 				})
 			},
 			scrolltolower() {
-				if(this.hasNextPage){
-					this.loadding = true
-					this.pullUpOn = true
+				if(this.hasNextPage && this.pullFlag){
 					this.getOnReachBottomData(this.currentTab);
 				}	
 			},
@@ -365,15 +375,72 @@
 						this.$api.navigateTo('/pages/user/order/order-logistics?orderId='+data.orderId)
 						break;
 					case 'pay':
-						if(data.order.onlinePayFlag == '0'){
-							this.$api.navigateTo(`/pages/user/order/order-payment?type=payfirm&orderId=${data.orderId}`)
+						this.hanldOrderData = data.order;
+						this.getOrderPaymentValidation(data)
+						// if(data.order.onlinePayFlag == '0'){
+						// 	this.$api.navigateTo(`/pages/user/order/order-payment?type=payfirm&orderId=${data.orderId}`)
+						// }else{
+						// 	this.$api.navigateTo(`/pages/user/order/order-payment?type=onlinePay&Amount=${data.order.pendingPayments}&orderId=${data.orderId}`)
+						// }
+						break;
+				}
+			},
+			//监听根据付款状态做操作
+			getOrderPaymentValidation(data){
+				this.OrderService.OrderPaymentValidation({orderId:data.orderId}).then(response =>{
+					let dataCode = response.data.code
+					this.payModelData = response.data
+					console.log(response);
+					switch(dataCode){
+						case 1:
+							this.isPayModel = true;
+							this.modelType = 1
+							break;
+						case 2:
+							this.isPayModel = true;
+							this.modelType = 2
+							break;
+						case -1:
+							this.$util.modal('','订单已申请全部退款,无需再付款!','确定','',false,() =>{})
+							break;
+						default:
+							if(response.data.onlinePayFlag == '1'){
+								this.$api.navigateTo(`/pages/user/order/order-payment?type=onlinePay&Amount=${response.data.pendingPayments}&orderId=${data.orderId}`)
+							}else{
+								this.$api.navigateTo(`/pages/user/order/order-payment?type=payfirm&orderId=${data.orderId}`)
+							}
+					}
+					
+				}).catch(error =>{
+					this.$util.msg(error.msg,2000)
+				})	
+			},
+			//余额抵扣跳转
+			hanldPaymentConfirm(data){
+				this.OrderService.OrderBalanceDeduction({orderId:data.order.orderId}).then(response =>{
+					if(data.type === 2){
+						this.$api.navigateTo(`/pages/user/order/success?type=success&orderId=${data.order.orderId}`)
+					}else{
+						if(data.order.onlinePayFlag === '1'){
+							this.$api.navigateTo(`/pages/user/order/order-payment?type=onlinePay&Amount=${data.order.pendingPayments}&orderId=${data.order.orderId}`)
 						}else{
-							this.$api.navigateTo(`/pages/user/order/order-payment?type=onlinePay&Amount=${data.order.pendingPayments}&orderId=${data.orderId}`)
+							this.$api.navigateTo(`/pages/user/order/order-payment?type=payfirm&orderId=${data.order.orderId}`)
 						}
-						break;
+					}
+				}).catch(error =>{
+					this.$util.msg(error.msg,2000)
+				})	
+			},
+			//不使用余额抵扣直接跳转收银台
+			hanldCancelConfirm(data){
+				if(data.onlinePayFlag == '1'){
+					this.$api.navigateTo(`/pages/user/order/order-payment?type=onlinePay&Amount=${this.hanldOrderData.pendingPayments}&orderId=${data.orderId}`)
+				}else{
+					this.$api.navigateTo(`/pages/user/order/order-payment?type=payfirm&orderId=${data.orderId}`)
 				}
 			},
-			handleClick(e) {//用户操作订单
+			//用户操作订单
+			handleClick(e) {
 				let index = e.index;
 				if(index == 1){
 					switch(this.OperationType){
@@ -390,7 +457,8 @@
 				}
 				this.modal = false;
 			},
-			handOrderConfirm (id){//确认收货
+			//确认收货
+			handOrderConfirm (id){
 				this.OrderService.ConfirmReceipt({orderId:id}).then(response =>{
 					this.$util.msg(response.msg,2000,true,'success');
 					setTimeout(() => {
@@ -400,7 +468,8 @@
 					this.$util.msg(error.msg,2000)
 				})
 			},
-			handOrderDetele(id){//删除订单
+			//删除订单
+			handOrderDetele(id){
 				this.OrderService.DeleteOrder({orderId:id}).then(response =>{
 					this.$util.msg(response.msg,2000,true,'success');
 					setTimeout(() => {
@@ -410,7 +479,8 @@
 					this.$util.msg(error.msg,2000)
 				})
 			},
-			handCenceConfirm(id){//取消订单
+			//取消订单
+			handCenceConfirm(id){
 				this.OrderService.CancelOrder({orderId:id}).then(response =>{
 					this.$util.msg(response.msg,2000,true,'success');
 					setTimeout(() => {
@@ -423,7 +493,8 @@
 			handlSearchPath(){
 				this.$api.navigateTo('/pages/user/order/search-order')
 			},
-			onShareAppMessage (res){//分享转发
+			//分享转发
+			onShareAppMessage (res){
 				this.isShareModal = false
 				if (res.from === 'button') {// 来自页面内转发按钮
 			    }
@@ -580,8 +651,10 @@
 		background: #F7F7F7;
 	}
 	.container {
-		padding-bottom: env(safe-area-inset-bottom);
-		height: auto;
+		height: 100vh;
+		box-sizing: border-box;
+		// padding-bottom: env(safe-area-inset-bottom);
+		// height: auto;
 		position: relative;
 	}
 	.tui-order-content{

+ 69 - 57
pages/user/order/order-pay.vue

@@ -96,25 +96,25 @@
 		},
 		data(){
 			return{
-				orderID:'',
-				payType:'',
-				payWay:'',
+				orderId:'',			//支付订单id
+				payType:'',			//支付类型 0:微信支付 1:企业网银支付 2:个人网银支付
+				payWay:'',			//支付通道标识
 				isRepuest:false,
-				payableAmount:0,
-				receiptAmount:0,
-				balanceAmount:0,
-				payTotalFee:0,
-				payAmount:0,
+				payableAmount:0,	//待付金额 && 应付金额
+				receiptAmount:0,	//已付金额
+				balanceAmount:0,	//剩余支付金额
+				payTotalFee:0,		//订单总额
+				payAmount:0,		//自定义金额
 				nvabarData: {		//顶部自定义导航
-					showCapsule:1, // 是否显示左上角图标  1表示显示  0表示不显示,
+					showCapsule:1, 	// 是否显示左上角图标  1表示显示  0表示不显示,
 					showSearch: 0,
-					title: '收银台',  // 导航栏 中间的标题
+					title: '收银台',	// 导航栏 中间的标题
 					haveBack:true,
 					textLeft:this.$store.state.isIphone
 				},
 				idCardList:[],
 				isIphoneX:this.$store.state.isIphoneX,
-				CustomBar:this.CustomBar,// 顶部导航栏高度
+				CustomBar:this.CustomBar,	// 顶部导航栏高度
 				tabCurrentIndex:0,
 				isShowTip:false,
 				buttonText:'去支付',
@@ -151,9 +151,9 @@
 		},
 		methods:{
 			initData(e){
-				this.payType = e.type
+				this.payType = e.payType
 				console.log(this.payType)
-				this.orderID = e.orderID
+				this.orderId = e.orderId
 				switch(this.payType){
 					case '0':
 						this.payWay = 'WEIXIN'
@@ -174,14 +174,14 @@
 				this.GetPayOrderInfo()
 			},
 			GetPayOrderInfo(){
-				this.PayService.PayOrderCheckoutCounter({orderId:this.orderID}).then(response =>{
+				this.PayService.PayOrderCheckoutCounter({orderId:this.orderId}).then(response =>{
 					this.isRepuest = true
 					this.discernReceipt = response.data.discernReceipt 		//支付记录
-					this.payTotalFee = response.data.order.payTotalFee  //订单总额
+					this.payTotalFee = response.data.order.payTotalFee  	//订单总额
 					this.receiptAmount = response.data.order.receiptAmount  //已付金额
-					this.payableAmount = response.data.order.payableAmount - this.receiptAmount//已付金额
-					this.payAmount = this.toFixedFn(this.payableAmount)	//自定义金额
-					this.balanceAmount = this.payableAmount - this.payAmount// 计算剩余支付金额
+					this.payableAmount = response.data.order.payableAmount - this.receiptAmount		//已付金额
+					this.payAmount = this.toFixedFn(this.payableAmount)		//自定义金额
+					this.balanceAmount = this.payableAmount - this.payAmount	// 计算剩余支付金额
 				}).catch(error =>{
 					this.$util.msg(error.msg,2000)
 				})
@@ -199,6 +199,7 @@
 						break;
 				}
 			},
+			// 创建网银支付链接
 			BuildCatenate(){
 				if(this.payAmount == 0){
 					this.$util.msg("请输入本次支付的金额",2000)
@@ -208,39 +209,46 @@
 					this.$util.msg("企业网银支付的金额必须大于¥10.00",2000)
 					return
 				}
-				this.PayService.PayOrderPayLink({unpaidAmount:this.payAmount,orderId:this.orderID,payType:this.payType}).then(response =>{
+				this.PayService.PayOrderPayLink({unpaidAmount:this.payAmount,orderId:this.orderId,payType:this.payType}).then(response =>{
 					this.payHttpUrl = response.data
 					this.isShowTip = true
 				})
 			},
-			MiniWxPayFor(){
-				authorize.getCode('weixin').then(wechatcode =>{
-					if(this.payAmount > 5000){
-						this.$util.modal('','本次支付金额已超出微信支付限额,请输入小于5千的金额进行支付','知道了','',false,() =>{})
-						return
-					}
-					if(this.payAmount == 0){
-						this.$util.msg("请输入本次支付的金额",2000)
-						return
-					}
-					if(this.payAmount*100 < 2){
-						this.$util.msg("本次支付的金额必须大于¥0.02",2000)
-						return
+			// 微信支付
+			async MiniWxPayFor(){
+				const wechatCode = await authorize.getCode('weixin')
+				if(this.payAmount > 5000){
+					this.$util.modal('','本次支付金额已超出微信支付限额,请输入小于5千的金额进行支付','知道了','',false,() =>{})
+					return
+				}
+				let params ={
+						payAmount:this.accMul(this.payAmount, 100),
+						payWay:"WEIXIN",
+						code:wechatCode,
+						orderId:this.orderId
 					}
-					let params ={
-							payAmount:this.payAmount*100,
-							payWay:"WEIXIN",
-							code:wechatcode,
-							orderId:this.orderID
-						}
-					this.PayService.WeChatMiniWxPay(params).then(response =>{
-						let PayInfo = JSON.parse(response.data.data.payInfo);
-						this.WxRequestPayment(PayInfo)
-					}).catch(error =>{
-						this.$util.msg(error.msg,2000)
-					})
+				this.PayService.WeChatMiniWxPay(params).then(response =>{
+					let PayInfo = JSON.parse(response.data.data.payInfo);
+					this.WxRequestPayment(PayInfo)
+				}).catch(error =>{
+					this.$util.msg(error.msg,2000)
 				})
 			},
+			// 处理金额
+		    accMul(value1, value2) {
+			    if (value1 == 0 || value2 == 0) {
+				  return 0;
+			    }
+			    let m = 0;
+			    let v1 = value1.toString();
+			    let v2 = value2.toString();
+			    m += v1.split(".")[1] ? v1.split(".")[1].length : 0;
+			    m += v2.split(".")[1] ? v2.split(".")[1].length : 0;
+			    let _v1 = Number(v1.replace(".", ""));
+			    let _v2 = Number(v2.replace(".", ""));
+			    return (_v1 * _v2) / Math.pow(10, m);
+		    },
+			// 调用微信支付接口
 			WxRequestPayment(data){
 				let self = this
 				wx.requestPayment({
@@ -250,17 +258,19 @@
 					'signType': data.signType,
 					'paySign': data.paySign,
 					'success':function(res){
-						wx.reLaunch({url: '/pages/tabBar/user/user'});
+						wx.reLaunch({url: '/pages/index/index'});
 					},
 					'fail':function(res){
-						self.$util.msg('用户取消支付~')
+						console.log(res)
+						self.$util.msg('支付失败~')
 					},
 					'complete':function(res){
-
+			
 					}
 				})
 			},
-			confirmEvent(value){//点击自定义键盘完成的回调函数
+			//点击自定义键盘完成的回调函数
+			confirmEvent(value){
 				this.chechValue(value)
 				this.showDigitKeyboard = false
 			},
@@ -289,12 +299,14 @@
 					this.balanceAmount = this.toFixedFn(this.payableAmount - this.payAmount)
 				}
 			},
-			hanldNavigateBack(){//页面返回
+			//页面返回
+			hanldNavigateBack(){
 				uni.navigateBack({
 					delta: 1
 				});
 			},
-			payTypeText (state){//处理支付记录文字
+			//处理支付记录文字
+			payTypeText (state){
 				let stateText = '',
 					stateTextObject={
 						12:'企业网银',
@@ -310,19 +322,22 @@
 				})
 				return stateText;
 			},
-			hideTips(){//隐藏弹窗
+			//隐藏弹窗
+			hideTips(){
 				this.isShowTip = false
 			},
-			toFixedFn(text){//处理小数点后两位数
+			//处理小数点后两位数
+			toFixedFn(text){
 				return Number(text).toFixed(2);
 			},
-			clipboard(data) {//复制链接
+			//复制链接
+			clipboard(data) {
 				thorui.getClipboardData(data, (res) => {
 					if (res) {
 						this.isShowTip = false;
 						this.$util.msg("复制成功",2000,true,'success');
 						setTimeout(()=>{
-							this.$api.navigateTo(`/pages/user/order/order-details?state=0&orderID=${this.orderID}`)
+							this.$api.navigateTo(`/pages/user/order/order-details?state=0&orderId=${this.orderId}`)
 						},2000)
 					} else {
 						this.$util.msg("复制失败",2000,true,'none');
@@ -332,9 +347,6 @@
 			discard(){
 				//丢弃
 			}
-		},
-		onShow() {
-
 		}
 	}
 </script>

+ 41 - 114
pages/user/order/order-payment.vue

@@ -1,6 +1,7 @@
 <template>
 	<view class="container cashier" :style="{paddingTop:CustomBar+'px'}">
 		<ws-custom :systeminfo='systeminfo' :navbar-data='nvabarData' :headerBtnPosi ="headerBtnPosi" :isBackType="true" :path="'/pages/user/cart/cart'"></ws-custom>
+		<!-- 线上支付维护提示 -->
 		<template v-if="isPaySwitch">
 			<view class="container-cash clearfix">
 				<view class="pay-bring-title">线上支付功能正在维护中,请使用线下转账方式支付订单</view>
@@ -25,6 +26,7 @@
 			</view>		
 		</template>
 		<template v-else>
+			<!-- 有发票 -->
 			<view class="container-cash clearfix" v-if="invoiceStatus">
 				<view class="pay-bring-title">
 					<text class="iconfont icon-tongzhi"></text>
@@ -46,12 +48,13 @@
 						<view class="text-v">开户行:<text class="span">中信银行(深圳泰然支行)</text></view>
 						<view class="text-v">银行卡号:<text class="span">{{ bankNumber }}</text> </view>
 						<view class="text-v">户名: <text class="span">周仁声</text></view>
-<!-- 					<view class="text-v">订单标识:{{ payOrderId }} <text class="clipboard" @click.stop="clipboard(payOrderId)">复制</text></view>
+<!-- 					<view class="text-v">订单标识:{{ payorderId }} <text class="clipboard" @click.stop="clipboard(payorderId)">复制</text></view>
 						<view class="text-v title">特别注意</view>
 						<view class="text-v bg-color">请在转账备注中填写上述订单标识,方便财务快速审核,提高发货速度</view> -->
 				</view>
 				</view>
-			</view>		
+			</view>	
+			<!-- 不用发票 -->
 			<view class="container-cash clearfix" v-else>
 				<view class="container-wrapper">
 					<view class="pay-content">
@@ -64,13 +67,13 @@
 					</view>
 					<view class="pay-check">
 						<view class="pay-checked">
-							<view  class="pay-item" :class="{ 'current' : tabCurrentIndex === 0 }"   @click="tabClick(0)" v-if="isUnbindWxPay">
+							<view  class="pay-item" :class="{ current : tabCurrentIndex === 0 }"   @click="tabClick(0)">
 								<view class="item-l">
 									<view class="item-icon"><text class="iconfont icon-weixinzhifu"></text></view>
 									<view class="item-texts"><text>微信支付</text></view>
 								</view>
 							</view>
-							<view  class="pay-item" :class="{ 'current' : tabCurrentIndex === 1}"   @click="tabClick(1)" >
+							<view  class="pay-item" :class="{ current : tabCurrentIndex === 1}"   @click="tabClick(1)" >
 								<view class="item-l">
 									<view class="item-icon"><text class="iconfont icon-qiyewangyinzhifu"></text></view>
 									<view class="item-text">
@@ -79,7 +82,7 @@
 									</view>
 								</view>
 							</view>
-							<view  class="pay-item" :class="{ 'current' : tabCurrentIndex === 2}"   @click="tabClick(2)" >
+							<view  class="pay-item" :class="{ current : tabCurrentIndex === 2}"   @click="tabClick(2)" >
 								<view class="item-l">
 									<view class="item-icon"><text class="iconfont icon-gerenwangyinzhifu"></text></view>
 									<view class="item-text">
@@ -116,14 +119,14 @@
 						<view class="text-v">开户行:中信银行(深圳泰然支行)</view>
 						<view class="text-v">银行卡号:{{bankNumber}}</view>
 						<view class="text-v">户名:周仁声</view>
-						<view class="text-v">订单标识:{{payOrderId}} <text class="clipboard" @click.stop="clipboard(payOrderId)">复制</text></view>
+						<view class="text-v">订单标识:{{payorderId}} <text class="clipboard" @click.stop="clipboard(payorderId)">复制</text></view>
 						<view class="text-v title">特别注意</view>
 						<view class="text-v bg-color">请在转账备注中填写上述订单标识,方便财务快速审核,提高发货速度</view>
 					</view>
 				</view>
 			</view>
-			<view class="alert spec" :class="specClass" v-if="isHttpUrlShowTip">
-				<!-- 选择支付弹窗说明 -->
+			<!-- 选择支付弹窗说明 -->
+			<!-- <view class="alert spec" :class="specClass" v-if="isHttpUrlShowTip">
 				<view class="freight-alert"  @tap="hideTips">
 					<view class="content">
 						<view class="title">
@@ -138,7 +141,7 @@
 						<view class="text-button" @click.stop="clipboard(payHttpUrl)">复制链接</view>
 					</view>
 				</view>
-			</view>
+			</view> -->
 		</template>
 	</view>
 </template>
@@ -149,24 +152,24 @@
 	export default{
 		data(){
 			return{
-				orderID:'',
-				payableAmount:0,
-				ableUserMoney:'',
+				orderId:'',			//订单id
+				payableAmount:0,	//待付款金额
+				ableUserMoney:'',	
 				showIndexOfMoney:'0',
 				smallMoney:'.00',
 				emptyWrapperH: '',
 				bankNumber:'6217 6803 0362 0897',
-				payOrderId:'',
-				nvabarData: {		//顶部自定义导航
+				payorderId:'',
+				nvabarData: {				//顶部自定义导航
 					haveBack:true,
-					showCapsule:1, // 是否显示左上角图标  1表示显示  0表示不显示,
-					title: '选择支付方式',  // 导航栏 中间的标题
+					showCapsule:1, 			// 是否显示左上角图标  1表示显示  0表示不显示,
+					title: '选择支付方式',  	// 导航栏 中间的标题
 					textLeft:this.$store.state.isIphone
 				},
-				headerBtnPosi:this.setHeaderBtnPosi(),//获取设备顶部胶囊高度
-				systeminfo:this.setSysteminfo(),		 //获取设备信息
+				headerBtnPosi:this.setHeaderBtnPosi(),	//获取设备顶部胶囊高度
+				systeminfo:this.setSysteminfo(),		//获取设备信息
 				isIphoneX:this.$store.state.isIphoneX,
-				CustomBar:this.CustomBar,// 顶部导航栏高度
+				CustomBar:this.CustomBar,				// 顶部导航栏高度
 				tabCurrentIndex:0,
 				isShowTip:false,
 				isReceiptStatus:false,
@@ -181,7 +184,7 @@
 				payStatusText:'使用微信和网银支付全部金额后,供应商会在24小时后发货(周末、节假日顺延)。若着急发货,可以选择使用线下转账进行付款。',
 				pageType:'',
 				payType:'',
-				isHttpUrlShowTip:false,
+				// isHttpUrlShowTip:false,
 				isUnbindWxPay:true
 			}
 		},
@@ -214,17 +217,11 @@
 		methods:{
 			initData(e){
 				this.orderId = e.orderId;
-				this.payOrderId ='#'+e.orderId+'#';
+				console.log(e);
+				this.payorderId ='#'+e.orderId+'#';
 				this.optionType = e.type;
-				console.log(this.optionType)
 				switch(e.type){
-					case 'confirm':
-						this.nvabarData.haveBack = false
-						this.nvabarData.haveHome = true
-						this.nvabarData.title = '支付'
-						this.PayOrderOnLineSwitch()
-						this.PayOrderCheckoutCounter(this.orderId)
-						break;
+					// 选择支付方式
 					case 'payfirm':
 						this.nvabarData.haveBack = true
 						this.nvabarData.haveHome = false
@@ -232,6 +229,7 @@
 						this.PayOrderOnLineSwitch()
 						this.PayOrderCheckoutCounter(this.orderId)
 						break;
+					// 如果当前订单已经通过线下付款支付了部分款项,剩下的款项就只能通过线下支付
 					case 'onlinePay':
 						this.invoiceStatus = true
 						this.isPaySwitch = false
@@ -244,7 +242,8 @@
 						break;
 				}
 			},
-			PayOrderOnLineSwitch(){//线上支付开关
+			//线上支付开关
+			PayOrderOnLineSwitch(){
 				this.PayService.PayOrderOnLineSwitch().then(response=>{
 					if(response.data === 0 ){
 						this.isPaySwitch = true
@@ -258,16 +257,11 @@
 			PayOrderCheckoutCounter(orderId){
 				this.PayService.PayOrderCheckoutCounter({orderId:orderId}).then(response =>{
 					let data = response.data.order
+					// 待支付金额 = 总支付金额 - 已支付金额
 					this.payableAmount = this.ableUserMoney = data.payableAmount - data.receiptAmount  //待付金额
 					this.receiptStatus =  data.receiptStatus
 					this.onlinePayFlag = data.onlinePayFlag		
 					this.initAbleUserMoney(this.payableAmount)
-					if(this.payableAmount > 5000){
-						this.tabCurrentIndex = 1
-						this.isUnbindWxPay = false
-						this.btnColor="#034582"
-						this.buttonText='使用企业网银支付';
-					}
 					//判断线上线下显示
 					if(this.optionType == 'onlinePay'){
 						this.invoiceStatus = true
@@ -291,67 +285,12 @@
 					this.payStatusText = '使用微信和网银支付全部金额后,供应商会在24小时后发货(周末、节假日顺延)。若着急发货,可以选择使用线下转账进行付款。'
 					this.isReceiptStatus = true
 				}else{
-					switch(this.tabCurrentIndex){
-						case 0:
-							this.MiniWxPayFor()
-							break;
-						case 1:
-							this.payType = '1'
-							this.BuildCatenate()
-							break;
-						case 2:
-							this.payType = '2'
-							this.BuildCatenate()
-							break;
-					}
-				}
-			},
-			async MiniWxPayFor(){
-				const wechatCode = await authorize.getCode('weixin')
-				if(this.payableAmount > 5000){
-					this.$util.modal('','本次支付金额已超出微信支付限额,请输入小于5千的金额进行支付','知道了','',false,() =>{})
-					return
+					const pagePath = `/pages/user/order/order-pay?orderId=${this.orderId}&payType=${this.tabCurrentIndex}`
+					this.$api.navigateTo(pagePath)
 				}
-				let params ={
-						payAmount:this.payableAmount*100,
-						payWay:"WEIXIN",
-						code:wechatCode,
-						orderId:this.orderId
-					}
-				this.PayService.WeChatMiniWxPay(params).then(response =>{
-					let PayInfo = JSON.parse(response.data.data.payInfo);
-					this.WxRequestPayment(PayInfo)
-				}).catch(error =>{
-					this.$util.msg(error.msg,2000)
-				})
-			},
-			WxRequestPayment(data){
-				let self = this
-				wx.requestPayment({
-					'timeStamp': data.timeStamp,
-					'nonceStr': data.nonceStr,
-					'package': data.package,
-					'signType': data.signType,
-					'paySign': data.paySign,
-					'success':function(res){
-						wx.reLaunch({url: '/pages/index/index'});
-					},
-					'fail':function(res){
-						console.log(res)
-						self.$util.msg('支付失败~')
-					},
-					'complete':function(res){
-			
-					}
-				})
-			},
-			BuildCatenate(){
-				this.PayService.PayOrderPayLink({unpaidAmount:this.payableAmount,orderId:this.orderId,payType:this.payType}).then(response =>{
-					this.payHttpUrl = response.data
-					this.isHttpUrlShowTip = true
-				})
 			},
-			initAbleUserMoney(money){//拆分金额并转千分位格式显示
+			//拆分金额并转千分位格式显示
+			initAbleUserMoney(money){
 				if(money == 0){
 					this.showIndexOfMoney ='0';
 					this.smallMoney=".00"
@@ -388,46 +327,34 @@
 						break;
 				}
 			},
-			hanldNavigateBack(){//页面返回
+			//页面返回
+			hanldNavigateBack(){
 				uni.navigateBack({
 					delta: 1
 				});
 			},
-			hideTips(){//隐藏弹窗
+			//隐藏弹窗
+			hideTips(){
 				this.isHttpUrlShowTip = false
 			},
 			showTips(){
 				this.isShowTip=!this.isShowTip
 			},
-			clipboard(data) {
-				thorui.getClipboardData(data, (res) => {
-					if (res) {
-						this.$util.msg("复制成功",2000,true,'success');
-						setTimeout(()=>{
-							this.$api.navigateTo(`/pages/user/order/order-details?state=0&orderId=${this.orderId}`)
-						},2000)
-					} else {
-						this.$util.msg("复制失败",2000,true,'none');
-					}
-				})
-			},
+			// 获得胶囊按钮位置信息
 			setHeaderBtnPosi(){
-				// 获得胶囊按钮位置信息
 				let headerBtnPosi = uni.getMenuButtonBoundingClientRect();
 				return headerBtnPosi
 			},
 			setSysteminfo(){
 				let systeminfo;
-				uni.getSystemInfo({ // 获取设备信息
+				// 获取设备信息
+				uni.getSystemInfo({ 
 					success: (res) => {
 						systeminfo = res
 					},
 				})
 				return systeminfo
 			},
-		},
-		onShow() {
-
 		}
 	}
 </script>

+ 9 - 3
pages/user/order/success.vue

@@ -10,8 +10,9 @@
 					<text>{{ successText }}</text>
 				</view>
 				<view class="cash-btn">
-					<view class="btn btn-pay" @click="this.$api.redirectTo(`/pages/user/order/order-payment?type=payfirm&orderId=${orderId}`)">支付订单</view>
+					<view class="btn btn-pay" v-if="payType === 'confirm'" @click="this.$api.redirectTo(`/pages/user/order/order-payment?type=payfirm&orderId=${orderId}`)">支付订单</view>
 					<view class="btn btn-open" @click="this.$api.redirectTo('/pages/user/order/order-details?type=confim&orderId='+orderId)">查看订单</view>
+					<view class="btn btn-pay" v-if="payType === 'success'" @click="this.$api.redirectTo('/pages/goods/list')">继续采购</view>
 				</view>
 			</view>
 		</view>
@@ -35,7 +36,7 @@
 				isIphoneX:this.$store.state.isIphoneX,
 				CustomBar:this.CustomBar,// 顶部导航栏高度
 				successText:'订单提交成功~',
-				
+				payType:''
 			}
 		},
 		onLoad(option) {
@@ -57,8 +58,13 @@
 				return systeminfo
 			},
 			initData(option){
-				console.log(option)
 				this.orderId = option.orderId
+				this.payType = option.type
+				if(this.payType === 'success'){
+					this.successText = '订单提交并支付成功'
+				}else{
+					this.successText = '订单提交成功'
+				}
 			}
 		},
 		onShow() {

+ 1 - 1
services/config.env.js

@@ -4,7 +4,7 @@ if(process.env.NODE_ENV === 'development'){
 	// URL_CONFIG = 'http://192.168.2.68:8010'	 //涛涛联调地址
 	// URL_CONFIG = 'http://192.168.2.67:8010'	 //裴裴联调地址
 	// URL_CONFIG = 'http://192.168.2.75:8008'	 //超超联调地址
-    URL_CONFIG = 'https://mall2b-b.caimei365.com'//采美测试地址
+    URL_CONFIG = 'https://mall2b-b.caimei365.com'//维沙测试地址
 	// URL_CONFIG = 'https://mall2b.caimei365.com'
 }else{
     // 生产环境

+ 1 - 1
services/order.service.js

@@ -187,7 +187,7 @@ export default class OrderService {
 	}
 	/* 余额抵扣 orderId 订单ID */
 	OrderBalanceDeduction (data = {}) {
-		return this.AjaxService.post({ url:'/order/balanceDeduction', data, isLoading: false })
+		return this.AjaxService.get({ url:'/order/balanceDeduction', data, isLoading: false })
 	}
 	/* 分享订单初始化查询 orderId 订单ID */
 	OrderCommodityData (data = {}) {

+ 2 - 1
services/sellse.service.js

@@ -92,7 +92,8 @@ export default class SellerService {
 	 */
 	GetSellerClubList(data = {}) {
 		return this.AjaxService.get({
-			url: '/product/clubList',
+			// url: '/product/clubList',
+			url: '/product/storeList',
 			data,
 			isLoading: true
 		})

+ 11 - 0
services/user.service.js

@@ -82,4 +82,15 @@ export default class UserService {
 			isLoading: false
 		})
 	}
+	/**
+	 * @机构-获取账户余额明细
+	 * @param:userId 用户ID(必传),
+	 */
+	GetAccountInfo (data = {}) {
+		return this.AjaxService.get({ 
+			url:'/personalCenter/touchBalance', 
+			data, 
+			isLoading: true ,
+		})
+	}
 }