Przeglądaj źródła

帮机构下单

zhengjinyi 1 rok temu
rodzic
commit
5cd40f1333

+ 23 - 20
components/cm-module/headerNavbar/header-back.vue

@@ -18,8 +18,8 @@
 				lineHeight: navbarBtn.height + 'px;'
 				lineHeight: navbarBtn.height + 'px;'
 			}"
 			}"
 		>
 		>
-			<text v-if="isShare" @click="_goBack" class="iconfont icon-shouye"></text>
-			<text v-else @click="_goBack" class="iconfont icon-fanhui"></text>
+			<text v-if="isShare" @click="handleNavigateBack" class="iconfont icon-shouye"></text>
+			<text v-else @click="handleNavigateBack" class="iconfont icon-fanhui"></text>
 		</view>
 		</view>
 		<view
 		<view
 			class="navbar-icon"
 			class="navbar-icon"
@@ -32,7 +32,7 @@
 			}"
 			}"
 		>
 		>
 			<text @click.stop="_goSearchPath" class="iconfont icon-iconfonticonfontsousuo1"></text>
 			<text @click.stop="_goSearchPath" class="iconfont icon-iconfonticonfontsousuo1"></text>
-			<text v-if="screenTab === 3" @click.stop="_showRightDrawer" class="iconfont icon-shaixuan"></text>
+			<text v-if="screenTab === 3" @click.stop="handleShowRightDrawer" class="iconfont icon-shaixuan"></text>
 		</view>
 		</view>
 	</view>
 	</view>
 </template>
 </template>
@@ -73,7 +73,7 @@ export default {
 			navbarBtn: {
 			navbarBtn: {
 				// 胶囊位置信息
 				// 胶囊位置信息
 				height: 0,
 				height: 0,
-			 width: 0,
+				width: 0,
 				top: 0,
 				top: 0,
 				bottom: 0,
 				bottom: 0,
 				right: 0
 				right: 0
@@ -83,6 +83,7 @@ export default {
 		}
 		}
 	},
 	},
 	created() {
 	created() {
+		console.log('isShare', this.isShare)
 		let statusBarHeight = this.systeminfo.statusBarHeight // 状态栏高度
 		let statusBarHeight = this.systeminfo.statusBarHeight // 状态栏高度
 		let headerPosi = this.headerBtnPosi // 胶囊位置信息
 		let headerPosi = this.headerBtnPosi // 胶囊位置信息
 		this.fontSizeSetting = this.systeminfo.fontSizeSetting
 		this.fontSizeSetting = this.systeminfo.fontSizeSetting
@@ -127,31 +128,33 @@ export default {
 		}
 		}
 	},
 	},
 	methods: {
 	methods: {
-		_goBack() {
+		handleNavigateBack() {
 			if (this.isShare) {
 			if (this.isShare) {
-				this._goHome()
+				let data = {
+					type: 'switchTab',
+					url: '/pages/tabBar/home/index'
+				}
+				this.$emit('navigatePath', data)
 			} else if (this.isDelete) {
 			} else if (this.isDelete) {
-				this._goUser()
+				let data = {
+					type: 'switchTab',
+					url: '/pages/tabBar/user/user'
+				}
+				this.$emit('navigatePath', data)
 			} else {
 			} else {
 				uni.navigateBack({
 				uni.navigateBack({
 					delta: 1
 					delta: 1
 				})
 				})
 			}
 			}
 		},
 		},
-		_goHome() {
-			uni.switchTab({
-				url: '/pages/tabBar/home/index'
-			})
-		},
-		_goUser() {
-			uni.switchTab({
-				url: '/pages/tabBar/user/user'
-			})
-		},
-		_goSearchPath() {
-			this.$emit('goSearchPath')
+		handleSearchPath() {
+			let data = {
+				type: 'navigateTo',
+				url: '/pages/user/order/order-search'
+			}
+			this.$emit('navigatePath', data)
 		},
 		},
-		_showRightDrawer() {
+		handleShowRightDrawer() {
 			//显示筛选抽屉
 			//显示筛选抽屉
 			this.$parent.rightDrawer = true
 			this.$parent.rightDrawer = true
 		}
 		}

+ 6 - 0
pages.json

@@ -227,6 +227,12 @@
 						"navigationBarTitleText": "查看订单"
 						"navigationBarTitleText": "查看订单"
 					}
 					}
 				},
 				},
+				{
+					"path": "order/order-confirmed",
+					"style": {
+						"navigationBarTitleText": "确认订单"
+					}
+				},
 				{
 				{
 					"path": "order/order-list",
 					"path": "order/order-list",
 					"style": {
 					"style": {

+ 3 - 4
pages/login/login.vue

@@ -76,10 +76,10 @@
 				>忘记密码?</view
 				>忘记密码?</view
 			>
 			>
 			<view class="login-other">
 			<view class="login-other">
-				<view class="login-other-item" @click="navigatorRegirst('/pages/seller/login/login')">
+				<!-- <view class="login-other-item" @click="navigatorRegirst('/pages/seller/login/login')">
 					<view class="item-icon"><text class="iconfont icon-jituancaigouyuandenglu"></text></view>
 					<view class="item-icon"><text class="iconfont icon-jituancaigouyuandenglu"></text></view>
 					<view class="item-text">集团采购员登录</view>
 					<view class="item-text">集团采购员登录</view>
-				</view>
+				</view> -->
 				<view class="login-other-item" @click="navigatorRegirst('/pages/login/login-code')">
 				<view class="login-other-item" @click="navigatorRegirst('/pages/login/login-code')">
 					<view class="item-icon"><text class="iconfont icon-yaoqingmakuaijiedenglu"></text></view>
 					<view class="item-icon"><text class="iconfont icon-yaoqingmakuaijiedenglu"></text></view>
 					<view class="item-text">邀请码快捷登录</view>
 					<view class="item-text">邀请码快捷登录</view>
@@ -485,8 +485,7 @@ export default {
 		.login-other-item{
 		.login-other-item{
 			width: 170rpx;
 			width: 170rpx;
 			height: auto;
 			height: auto;
-			float: left;
-			margin: 0 62rpx;
+			margin: 0 auto;
 			.item-icon{
 			.item-icon{
 				width: 80rpx;
 				width: 80rpx;
 				height: 80rpx;
 				height: 80rpx;

+ 1 - 1
pages/user/order/components/details/cm-goods-temp.vue

@@ -62,7 +62,7 @@ export default {
 	name: 'goods',
 	name: 'goods',
 	props: {
 	props: {
 		list: {
 		list: {
-			type: Object
+			type: Array
 		},
 		},
 		orderInfo: {
 		orderInfo: {
 			type: Object
 			type: Object

+ 287 - 0
pages/user/order/order-confirmed.vue

@@ -0,0 +1,287 @@
+<template>
+	<view class="container details clearfix" :class="orderInfo.status !== 0 ? 'none' : ''">
+		<tui-skeleton
+			v-if="!skeletonShow"
+			backgroundColor="#fafafa"
+			borderRadius="10rpx"
+			:isLoading="true"
+			:loadingType="5"
+		/>
+		<template v-else>
+			<!-- 地址信息 -->
+			<cm-address-temp ref="orderAddress" v-if="skeletonShow" :addressData="addressData" />
+			<!-- 商品信息 -->
+			<cm-goods-temp ref="goods" v-if="skeletonShow" :list="orderInfo.orderProductList" :orderInfo="orderInfo" />
+			<!-- 订单信息 -->
+			<cm-order-temp ref="information" v-if="skeletonShow" :information="orderInfo" />
+			<!-- 发票信息 -->
+			<cm-invice-temp ref="invoice" v-if="skeletonShow" :orderInvoice="orderInvoice" />
+			<template v-if="orderInfo.status === 0">
+				<view class="tips-text" >
+					<text class="iconfont icon-tishi"></text>
+					点击下方按钮对订单进行确认。若未登录账号,将跳转到登录
+					页面进行机构账号登录/注册,登录/注册成功后再操作确认订
+					单。
+				</view>
+				<!-- 底部按钮 -->
+				<view class="button-content" :style="{ paddingBottom: isIphoneX ? '68rpx' : '34rpx' }">
+					<view class="btn btn-query"  @click.stop="handleConfirmOrder">确认订单</view>
+				</view>
+			</template>
+		</template>
+		<!-- 提示弹窗 -->
+		<tui-modal
+			:show="modal"
+			@click="handleClick"
+			:content="contentModalText"
+			:button="modalButton"
+			color="#333"
+			:size="32"
+			shape="circle"
+			:maskClosable="false"
+		/>
+	</view>
+</template>
+
+<script>
+import { mapState, mapMutations } from 'vuex'	
+import authorize from '@/common/config/authorize.js'
+import wxLogin from '@/common/config/wxLogin.js'
+import cmAddressTemp from './components/details/cm-address-temp' //地址信息
+import cmGoodsTemp from './components/details/cm-goods-temp' //商品列表
+import cmInviceTemp from './components/details/cm-invice-temp' //发票信息
+import cmOrderTemp from './components/details/cm-order-temp' //订单信息
+
+export default {
+	components: {
+		cmAddressTemp,
+		cmGoodsTemp,
+		cmOrderTemp,
+		cmInviceTemp
+	},
+	data() {
+		return {
+			status: '',
+			userId: '',
+			orderId: '',
+			shopOrderId: '',
+			skeletonShow: false,
+			cellPhone: '', //客服电话
+			btnStatus: 0, //按钮组件状态
+			addressData: {}, //地址信息初始化
+			orderInfo: {}, //订单信息初始化
+			orderInvoice: {}, //发票信息初始化
+			returnedPurchaseList: {}, //退款信息初始化
+			discernReceiptList: {}, //支付信息初始化
+			voucherList: [], //支付凭证
+			receiptAmount: 0, //支付金额
+			returnedPurchaseFee: 0, //退款金额
+			isIphoneX: this.$store.state.isIphoneX,
+			popupShow: false,
+			handlerPros: {},
+			modal: false,
+			contentModalText: '确定订单无误,要确认订单吗?', //操作文字提示语句
+			modalButton: [
+				{
+					text: '取消',
+					type: 'gray',
+					plain: true //是否空心
+				},
+				{
+					text: '确定',
+					customStyle: {
+						color: '#fff',
+						bgColor: '#F3B574'
+					},
+					plain: false
+				}
+			]
+		}
+	},
+	computed: {
+		...mapState(['hasLogin'])
+	},
+	onLoad(option) {
+		this.shopOrderId = option.shopOrderId
+		wxLogin.wxLoginAuthorize()
+		this.getShopOrderById(option.shopOrderId)
+	},
+	methods: {
+		async getShopOrderById(shopOrderId) {
+			try {
+				const res = await this.OrderService.getShopOrderById({ shopOrderId: shopOrderId })
+				const data = res.data
+				this.skeletonShow = true
+				this.status = data.shopOrder.status
+				this.addressData = data.userInfo
+				this.orderInfo = data.shopOrder
+				this.orderInvoice = data.orderInvoice
+				this.returnedPurchaseList = data.returnedPurchaseList
+				this.discernReceiptList = data.discernReceiptList
+				this.receiptAmount = data.shopOrder.receiptAmount
+				this.returnedPurchaseFee = data.shopOrder.returnedPurchaseFee
+				this.voucherList = data.voucher
+				this.mapStateArr.forEach(el => {
+					el.val.forEach(value => {
+						if (this.status === value) {
+							this.btnState[el.label] = el.status
+						}
+					})
+				})
+			} catch (error) {
+				this.$util.msg(error.msg, 2000)
+			}
+		},
+		//按钮点击事件
+		handleConfirmOrder() {
+			if(!this.hasLogin){
+				const pages = getCurrentPages()
+				const page = pages[pages.length - 1]
+				console.log('fullPath',page.$page.fullPath)
+				uni.setStorageSync('LOGIN_REDIRECT_URL', page.$page.fullPath)
+				this.$api.redirectTo('/pages/login/login')
+			}else{
+				this.modal = true
+			}
+		},
+		// 确认操作
+		handleClick(e) {
+			if (e.index == 1) {
+				this.confirmShopOrder(this.shopOrderId)
+			}
+			this.modal = false
+		},
+		//确认订单
+		async confirmShopOrder(shopOrderId) {
+			try {
+				const usrInfo = await this.$api.getStorage()
+				const res = await this.OrderService.confirmShopOrder({ shopOrderId: shopOrderId,userId:usrInfo.userId })
+				this.$util.msg('订单确认成功~', 2000, true, 'success')
+				setTimeout(() => {
+					this.$api.redirectTo(`/pages/user/order/order-details?type=share&shopOrderId=${shopOrderId}`)
+				}, 2000)
+			} catch (error) {
+				this.$util.msg(error.msg, 2000)
+			}
+		},
+	},
+	onShow() {}
+}
+</script>
+
+<style lang="scss">
+page {
+	height: auto;
+	background: #f7f7f7;
+}
+.details {
+	padding-bottom: 180rpx;
+	&.none{
+		padding-bottom: 0;
+	}
+}
+.btn-hover {
+	background: #ffffff;
+}
+.animation {
+	/* transition: transform 0.3s ease;*/
+	transition-property: transform;
+	transition-duration: 0.3s;
+	transition-timing-function: ease;
+}
+.invoice-balance {
+	width: 702rpx;
+	height: auto;
+	padding: 0 24rpx;
+	background: #ffffff;
+	float: left;
+	margin-top: 24rpx;
+	margin-bottom: 24rpx;
+	.balabce-t {
+		width: 100%;
+		height: 86rpx;
+		line-height: 86rpx;
+		font-size: $font-size-28;
+		color: $text-color;
+		float: left;
+		.balabce-t-le {
+			float: left;
+			font-weight: bold;
+		}
+		.balabce-t-ri {
+			float: right;
+			display: flex;
+			align-items: center;
+			.money {
+				display: flex;
+				float: left;
+			}
+			.checkbox-box {
+				display: flex;
+				width: 60rpx;
+				float: left;
+				height: 100%;
+				font-size: $font-size-24;
+				.checkbox {
+					width: 40rpx;
+					text-align: right;
+					box-sizing: border-box;
+					text-align: center;
+					text-decoration: none;
+					border-radius: 0;
+					-webkit-tap-highlight-color: transparent;
+					overflow: hidden;
+				}
+			}
+		}
+	}
+	.balabce-b {
+		width: 100%;
+		float: left;
+		overflow: hidden;
+		.balabce-b-text {
+			width: 100%;
+			line-height: 58rpx;
+			font-size: $font-size-24;
+			color: #ff2a2a;
+			text-align: right;
+			float: right;
+		}
+		&.balabce-b--hide {
+			padding: 0 0;
+			height: 0px;
+			line-height: 0px;
+		}
+	}
+}
+.tips-text{
+	width: 100%;
+	height: auto;
+	box-sizing: border-box;
+	padding: 30rpx;
+	font-size: $font-size-24;
+	color: #F94B4B;
+	float: left;
+	line-height: 40rpx;
+}
+.button-content {
+	width: 702rpx;
+	padding:24rpx 24rpx 0 24rpx;
+	height: auto;
+	background: #ffffff;
+	position: fixed;
+	bottom: 0;
+	left: 0;
+	.btn {
+		width: 600rpx;
+		height: 90rpx;
+		line-height: 90rpx;
+		font-size: $font-size-32;
+		color: #ffffff;
+		text-align: center;
+		border-radius: 45rpx;
+		background: #F3B574;
+		margin: 0 auto;
+	}
+}
+</style>

+ 8 - 4
pages/user/order/order-details.vue

@@ -2,10 +2,12 @@
 	<view class="container details clearfix" :style="{ paddingBottom: isIphoneX ? 130 + 68 + 'rpx' : '130rpx' }">
 	<view class="container details clearfix" :style="{ paddingBottom: isIphoneX ? 130 + 68 + 'rpx' : '130rpx' }">
 		<!-- 自定义返回 -->
 		<!-- 自定义返回 -->
 		<header-back
 		<header-back
+			v-if="skeletonShow"
 			:systeminfo="systeminfo"
 			:systeminfo="systeminfo"
 			:navbar-data="nvabarData"
 			:navbar-data="nvabarData"
 			:headerBtnPosi="headerBtnPosi"
 			:headerBtnPosi="headerBtnPosi"
 			:isShare="isOrderShare"
 			:isShare="isOrderShare"
+			@navigatePath="handlNavigatePath"
 		/>
 		/>
 		<tui-skeleton
 		<tui-skeleton
 			v-if="!skeletonShow"
 			v-if="!skeletonShow"
@@ -192,6 +194,7 @@ export default {
 		if (this.shareType === 'share') {
 		if (this.shareType === 'share') {
 			this.state = 0
 			this.state = 0
 			this.isOrderShare = true
 			this.isOrderShare = true
+			console.log('isOrderShare', this.isOrderShare)
 		} else if (option.type === 'confim' || option.type === 'search') {
 		} else if (option.type === 'confim' || option.type === 'search') {
 			this.state = 0
 			this.state = 0
 		} else {
 		} else {
@@ -223,10 +226,6 @@ export default {
 		}
 		}
 	},
 	},
 	methods: {
 	methods: {
-		// showFreight 运费底部上拉框
-		showFreight($event) {
-			this.popupShow = $event
-		},
 		// 获取订单详情
 		// 获取订单详情
 		async initOrderDetaileData() {
 		async initOrderDetaileData() {
 			try {
 			try {
@@ -256,6 +255,11 @@ export default {
 				this.$util.msg(error.msg, 2000)
 				this.$util.msg(error.msg, 2000)
 			}
 			}
 		},
 		},
+		handlNavigatePath(data) {
+			if(data.type === 'switchTab'){
+				this.$api.switchTabTo(data.url)
+			}
+		},
 		handButtonConfirm(data) {
 		handButtonConfirm(data) {
 			//监听点击时间的按钮类型并执行...
 			//监听点击时间的按钮类型并执行...
 			this.handShowAlert(data)
 			this.handShowAlert(data)

+ 5 - 3
pages/user/order/order-list.vue

@@ -6,7 +6,7 @@
 			:navbar-data="nvabarData"
 			:navbar-data="nvabarData"
 			:headerBtnPosi="headerBtnPosi"
 			:headerBtnPosi="headerBtnPosi"
 			:isDelete="isDelete"
 			:isDelete="isDelete"
-			@goSearchPath="handlSearchPath"
+			@navigatePath="handlNavigatePath"
 		/>
 		/>
 		<tui-skeleton
 		<tui-skeleton
 			v-if="skeletonShow"
 			v-if="skeletonShow"
@@ -525,8 +525,10 @@ export default {
 				this.$util.msg(error.msg, 2000)
 				this.$util.msg(error.msg, 2000)
 			}
 			}
 		},
 		},
-		handlSearchPath() {
-			this.$api.navigateTo('/pages/user/order/order-search')
+		handlNavigatePath(data) {
+			if(data.type === 'navigateTo'){
+				this.$api.navigateTo(data.url)
+			}
 		},
 		},
 		handButtonShareConfirm(data) {
 		handButtonShareConfirm(data) {
 			this.handleShopOrderId = data
 			this.handleShopOrderId = data

+ 17 - 0
services/order.service.js

@@ -23,6 +23,23 @@ export default class OrderService {
               
               
         })
         })
     }
     }
+    /* 查询确认订单详情 */
+    getShopOrderById (data = {}) {
+        return this.AjaxService.get({ 
+            url:'/order/club/getShopOrderById', 
+            data, 
+            isLoading: true ,
+              
+        })
+    }
+    /* 采购员下单的订单确认订单 */
+    confirmShopOrder (data = {}) {
+        return this.AjaxService.get({ 
+            url:'/order/club/confirmShopOrder', 
+            data, 
+            isLoading: true ,
+        })
+    }
     /* 操作取消订单 */
     /* 操作取消订单 */
     CancelOrder (data = {}) {
     CancelOrder (data = {}) {
         return this.AjaxService.post({ 
         return this.AjaxService.post({