hmp hace 4 años
padre
commit
4f3d226e82

+ 26 - 0
assets/colorui/app.scss

@@ -316,4 +316,30 @@ button {
 		align-items: center;
 		background: #ffffff;
 		box-shadow: -4upx -4upx 30upx #888888;
+	}
+	
+	
+	
+	@mixin arch {
+		content: "";
+		position: absolute;
+		background-color: #F1F1F1;
+		width: 30rpx;
+		height: 30rpx;
+		bottom: -15rpx;
+		z-index: 10;
+		border-radius: 100%;
+	}
+	.section {
+		position: relative;
+		
+		&::before {
+			@include arch;
+			left: -15rpx;
+		}
+		
+		&::after {
+			@include arch;
+			right: -15rpx;
+		}
 	}

+ 2 - 2
assets/http/global.js

@@ -4,8 +4,8 @@ let global = {}
 // global.baseUrl = 'https://ldt.guosen-fumao.cn/api/'
 // global.WebSocketUrl='wss://ldt.guosen-fumao.cn/websocket/'
 
-global.baseUrl = 'http://192.168.1.48:2366/'
-global.WebSocketUrl = 'ws://192.168.1.48:2366/websocket/'
+global.baseUrl = 'http://192.168.1.168:2366/'
+global.WebSocketUrl = 'ws://192.168.1.168:2366/websocket/'
 
 global.tokenUrl = global.baseUrl +
 	'blade-auth/oauth/token?tenantId=000000&password=21232f297a57a5a743894a0e4a801fc3&username=admin'

+ 160 - 0
components/channel-list.vue

@@ -0,0 +1,160 @@
+<template>
+	<view >
+		<view v-if="$isNotEmpty(channel)" @click="channelShow=true" class="channel " style="width: 100%;">
+			<view class="left">
+				<view class="center">
+					<image :src="channel.channelLogo" mode=""></image>
+				</view>
+				<view class="content">
+					<text>{{channel.channelName}}</text>
+					<text>优先使用该渠道积分支付</text>
+				</view>
+			</view>
+			<view class="right">
+				<text class="cuIcon-right"></text>
+			</view>
+		</view>
+		
+		<u-popup :closeable="true" v-model="channelShow" mode="bottom" height="65%">
+			<view class="popup-content">
+				<view class="">
+					<view style="border-bottom: 1rpx solid #eee;" class="fixed center text-bold text-lg padding-bottom-40">
+						请选择优先使用的渠道积分
+					</view>
+					<view @click="check(item)" v-for="(item,index) in channelList" :key="index" class="channel-item">
+						<image :src="item.channelLogo" mode=""></image>
+						<text class="margin-left-10">{{item.channelName}}(剩余 ¥ {{item.available}})</text>
+						<text v-if="channel.channelId==item.channelId" class="cuIcon-check checked"></text>
+					</view>
+				</view>
+				<view class="center">
+					<view @click="confirm" class="cu-btn radius channelbtn">
+						确认
+					</view>
+				</view>
+			</view>
+		</u-popup>
+	</view>
+</template>
+
+<script>
+	export default {
+		name:"channel-list",
+		data() {
+			return {
+				//渠道积分
+				channel:{},
+				channelList:[],
+				channelShow:false,
+			};
+		},
+		created() {
+			this.getUserPonint()
+		},
+		methods:{
+			//获取用户渠道积分
+			getUserPonint(){
+				let params={
+					userId:this.vuex_userId
+				}
+				this.$api.userChannelPoint.list(params).then(res=>{
+					if (this.$isNotEmpty(res.data.records)) {
+						this.channelList=res.data.records
+						this.channel=this.channelList[0]
+						this.$u.vuex('vuex_channel',this.channel)
+					}
+				})
+			},
+			confirm(){
+				this.channelShow=false
+				this.$u.vuex('vuex_channel',this.channel)
+				this.$emit('click',this.channel)
+			},
+			check(item){
+				this.channel=item
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.channel{
+		display: flex;
+		justify-content: space-between;
+		margin-top: 10rpx;
+		padding:20rpx 30rpx;
+		background-color: #FFFFFF;
+		
+		.left{
+			display: flex;
+			image{
+				width: 60rpx;
+				height: 60rpx;
+				display: flex;
+				justify-content: center;
+				align-items: center;
+			}
+			view{
+				display: flex;
+				flex-direction: column;
+			}
+			
+			.content{
+				margin-left: 16rpx;
+				
+				text:first-child{
+					font-size: 34rpx;
+					margin-bottom: 10rpx;
+				}
+				
+				text:last-child{
+					font-size: 28rpx;
+					color: #989898;
+				}
+			}
+		}
+		
+		.right{
+			display: flex;
+			justify-content: center;
+			align-items: center;
+		}
+		
+	}
+	
+	.popup-content{
+		display: flex;
+		flex-direction: column;
+		justify-content: space-between;
+		padding: 40rpx 0;
+		height: 100%;
+		
+		.channelbtn{
+			background-color: #18b566;
+			color: #FFFFFF;
+			padding: 36rpx 150rpx;
+		}
+		
+		.channel-item{
+			position: relative;
+			display: flex;
+			padding: 30rpx;
+			border-bottom: 1rpx solid #eee;
+			image{
+				width: 40rpx;
+				height: 40rpx;
+				margin-right: 10rpx;
+			}
+			
+			.checked{
+				color: #18b566;
+				font-size: 34rpx;
+				position: absolute;
+				font-weight: 800;
+				right: 40rpx;
+				bottom: 30rpx;
+			}
+			
+		}
+	}
+</style>

+ 10 - 0
pagesD/pages/pay/pay.vue

@@ -140,6 +140,10 @@
 					<text class="cuIcon-right margin-left-10 center"></text>
 				</view>
 			</view>
+			
+			<view class="margin-top-20">
+				<channel-list ></channel-list>
+			</view>
 		</view>
 
 		<!-- 付款栏 begin -->
@@ -167,10 +171,12 @@
 </template>
 
 <script>
+	import channelList from '@/components/channel-list.vue'
 	import global from "@/assets/http/global.js"
 	import hTimeAlert from "../../comps/h-time-alert.vue"
 	export default {
 		components: {
+			channelList,
 			hTimeAlert
 		},
 		data() {
@@ -285,6 +291,10 @@
 					userPhone: this.vuex_phone,
 					appId: this.$global.wxParams.APPID,
 				}
+				if (this.$isNotEmpty(this.vuex_channel)) {
+					params.channelId=this.vuex_channel.channelId
+				}
+				
 				if (this.takeType == this.$global.takeType.dine_in) {
 					//店内堂食
 					params.seatNum = this.seatNum

+ 72 - 27
pagesD/pages/take-order/take-order.vue

@@ -1,9 +1,9 @@
 <template>
 	<view class="page">
-		<view class="card u-border-bottom">
-			<text>{{vuex_orderInfo.store.shopName}}</text>
+		<view class="card u-border-bottom ">
+			<text >{{shop.name}}</text>
 			<view class="">
-				<view class="cuIcon cu-btn sm btn-icon">
+				<view @click="$util.callPhone(shop.personTel)" class="cuIcon cu-btn sm btn-icon">
 					<u-icon name="phone-fill" color="#FF9447"></u-icon>
 				</view>
 				<view class="cuIcon cu-btn sm btn-icon margin-left-30">
@@ -11,24 +11,24 @@
 				</view>
 			</view>
 		</view>
-		<view class="card" style="flex-direction: column;">
+		<view class="section">
+			
+		</view>
+		<view class="card section" style="flex-direction: column;">
 			<view class="center text-bold margin-50" style="font-size: 66rpx;">
-				<text>2874</text>
+				<text>{{order.verifyNum}}</text>
 			</view>
-			<view class="cu-steps steps-arrow ">
-				<view class="cu-item" :class="index>0?'text-default':'text-base'" v-for="(item,index) in stepList" :key="index">
+			<view class="cu-steps steps-arrow margin-bottom-50">
+				<view class="cu-item" :class="index>stepIndex?'text-default':'text-base'" v-for="(item,index) in stepList" :key="index">
 					<text style="font-size: 80rpx;margin-bottom: 20rpx;margin-right: 10rpx;" :class="'cuIcon-' + item.icon"></text>
 					<text >{{item.name}}</text>
 				</view>
 			</view>
-			<view class="center text-gray margin-50">
-				<text>您前面还有4单待制作</text>
-			</view>
-			<u-read-more ref="uReadMore" close-text="展开更多" show-height="500" color="#999">
-				<view v-for="(item,index) in vuex_orderInfo.cart" :key="index" class="cart">
+			<u-read-more ref="uReadMore" close-text="展开更多" show-height="300" color="#999">
+				<view v-for="(item,index) in cart" :key="index" class="cart">
 					<view class="flex" style="width: 70%;">
 						<image :src="item.image" mode=""></image>
-						<view class="item-content " style="justify-content: flex-start;text-align: left;">
+						<view class="item-content " >
 							<text class="text-cut-1">{{item.name}}</text>
 							<text class="text-cut-1">{{item.propertyStr ? item.propertyStr : item.name}}</text>
 						</view>
@@ -44,6 +44,21 @@
 			</u-read-more>
 		</view>
 		
+		<view class="card text-df ">
+			<text class="text-gray">金额总计</text>
+			<view class="">
+				<text class="text-price">{{order.totalPrice / 100}}</text>
+			</view>
+		</view>
+		<view class="card text-df" v-if="$isNotEmpty(order.packingPrice)&&order.packingPrice != -1">
+			<text class="text-gray">包装费</text>
+			<text class="text-price">{{order.packingPrice / 100}}</text>
+		</view>
+		<view class="card text-df" v-if="$isNotEmpty(order.sendingPrice)&&order.sendingPrice != -1">
+			<text class="text-gray">配送费</text>
+			<text class="text-price">{{order.sendingPrice / 100}}</text>
+		</view>
+		
 		
 		
 	</view>
@@ -54,19 +69,51 @@ export default {
 	name: '',
 	data() {
 		return {
+			id:'',
+			order:{},
+			shop:{},
+			cart:[],
+			//订单流程
 			stepList:[{
 				name:'待付款',
-				icon:'recharge'
+				icon:'rechargefill'
 			},
 			{
 				name:'制作中',
-				icon:'time'
+				icon:'timefill'
 			},
 			{
 				name:'已完成',
-				icon:'roundcheck'
-			}]
+				icon:'roundcheckfill'
+			}],
 		};
+	},
+	onLoad(options) {
+		this.id=options.id || '1442319466162036738'
+		this.fetchDetail()
+	},
+	computed:{
+		stepIndex:{
+			get(){
+				if (this.order.orderStatus == '待付款') {
+					return 0
+				}else{
+					return 2
+				}
+			}
+		}
+	},
+	methods:{
+		fetchDetail(){
+			let params={
+				id:this.id
+			}
+			this.$api.order.detail(params).then(res=>{
+				this.order=res.data || {}
+				this.shop=this.order.shop || {}
+				this.cart=JSON.parse(this.order.goodsPreview)
+			})
+		}
 	}
 };
 </script>
@@ -98,31 +145,29 @@ export default {
 		border-bottom: 1rpx solid #f1f1f1;
 		display: flex;
 		background-color: #FFFFFF;
+		padding: 15rpx 0;
 	
 		image {
-			width: 120rpx;
-			height: 120rpx;
+			width: 100rpx;
+			height: 100rpx;
+			border-radius: 8rpx;
 		}
 	
 		.item-content {
-			background-color: #007AFF;
-			width: calc(100% - 120rpx);
+			width: calc(100% - 100rpx);
+			margin-left: -40rpx;
 			display: flex;
 			flex-direction: column;
 			justify-content: space-between;
-			justify-content: flex-start;
-			align-items: flex-start;
 	
 			text:first-child {
-				font-size: 32rpx;
-				padding-top: 10rpx;
+				font-size: 30rpx;
 			}
 	
 			text:last-child {
-				font-size: 26rpx;
+				font-size: 24rpx;
 				color: #999;
 				font-weight: 400;
-				padding-bottom: 10rpx;
 			}
 		}
 	

+ 2 - 0
store/index.js

@@ -44,6 +44,8 @@ const store = new Vuex.Store({
 		vuex_location: lifeData.vuex_location ? lifeData.vuex_location : null,
 		//订单信息
 		vuex_orderInfo: lifeData.vuex_orderInfo ? lifeData.vuex_orderInfo : null,
+		//默认渠道
+		vuex_channel: lifeData.vuex_channel ? lifeData.vuex_channel : null,
 	},
 	mutations: {
 		$uStore(state, payload) {