zhanghui před 2 roky
rodič
revize
2fcd911611

+ 8 - 1
components/pay/pay.vue

@@ -17,7 +17,7 @@
 							<u-icon name="/static/me/u701.png" color="#38db38" size="36"></u-icon>
 							<view class="payName flex-col justify-center">
 								<text>余额支付</text>
-								<text class="balance">可以余额¥{{ userInfo.balance || 0 }}</text>
+								<text class="balance">可以余额¥{{balance}}</text>
 							</view>
 						</view>
 						<view class="flex-col justify-center">
@@ -75,6 +75,7 @@
 	 *4,selectBlPay:Boolean类型,余额支付选项是否能够选中。使用时请根据用户的余额进行判断。true--能,false--不能。默认true。
 	 *5,orderNo:String类型,支付的订单号。
 	 *6,openType:Number类型,1--支付预约费用,2---支付子订单费用。
+	 *7,balance:用户余额
 	 *
 	 *   function 回调函数
 	 * 1,payResult(e),支付结果回调。
@@ -117,6 +118,12 @@
 				default () {
 					return 1
 				}
+			},
+			balance: {
+				type: Number,
+				default () {
+					return 0
+				}
 			}
 		},
 		data() {

+ 3 - 0
orderPages/bookService/index.rpx.scss

@@ -38,6 +38,8 @@
   width: 146rpx;
   height: 146rpx;
   overflow: hidden;
+  background: #FFE05C;
+  border-radius: 75rpx;
  }
 .serobImg{
   width: 146rpx;
@@ -101,6 +103,7 @@
   height: 80rpx;
   border-radius: 40rpx;
   margin-bottom: 32rpx;
+  background: #FFE05C;
 }
 .selectSerobName{
   font-size: 24rpx;

+ 5 - 6
orderPages/bookService/index.vue

@@ -10,7 +10,7 @@
 				<u-grid-item v-for="(item,index) in serviceObjectList" :key="index">
 					<view class="serobItem flex-col" >
 						<view class="serobImgView" @click="selectServiceObject(item)">
-							<image class="serobImg" mode="aspectFill" :src="item.facePhotoUrl || '/static/logo.png'"></image>
+							<image class="serobImg" mode="aspectFill" :src="item.facePhotoUrl || '/static/me/u4.png'"></image>
 						</view>
 						<text class="serobName">{{item.nickName || '未填写'}}</text>
 						<view class="serobV" v-if="item.select === true">
@@ -23,7 +23,7 @@
 
 		<view class="flex-col group " v-for="(item, index) in orderParam.childService">
 			<view class="flex-row " >
-				<image class="selectSerobImg" mode="aspectFill" :src="item.facePhotoUrl || '/static/logo.png'"></image>
+				<image class="selectSerobImg" mode="aspectFill" :src="item.facePhotoUrl || '/static/me/u4.png'"></image>
 				<text class="selectSerobName">{{item.nickName || '未填写'}}</text>
 			</view>
 			<view class="serob">
@@ -33,8 +33,8 @@
 				<u-grid col="4">
 					<u-grid-item  v-for="(item1,index1) in item.serviceTeacherList" :key="index1">
 						<view class="serobItem flex-col"  @click="selectServiceTeach(item.serviceTeacherList,index,index1)">
-							<view class="serobImgView ">
-								<image class="serobImg" mode="aspectFill" :src="item1.facePhotoUrl || '/static/logo.png'"></image>
+							<view class="serobImgView">
+								<image class="serobImg" mode="aspectFill" :src="item1.facePhotoUrl || '/static/me/u4.png'"></image>
 							</view>
 							<text class="serobName ">{{item1.personName || '未填写'}}</text>
 							<view class="flex-row justify-center ">
@@ -123,7 +123,7 @@
 				//预约费用
 				price: '0',
 				//订单编号
-				orderNo: '',
+				subOrderNo:'',
 				selectIcon: true,
 				orderParam:{
 					orderType: 1,
@@ -458,7 +458,6 @@
 					this.$api.commonGeneralOrder(this.orderParam).then(res => {
 						console.log('++++++++++++++++++订单提交+++++++++++', res)
 						if (res.data.data.subOrderNo) {
-							this.orderNo = res.data.data.orderNo
 							this.subOrderNo = res.data.data.subOrderNo
 							this.$refs.myPay.openPopup()
 						} else {

+ 7 - 7
orderPages/orderDetail/index.vue

@@ -41,7 +41,7 @@
 
 			<view class="flex-col borderBottom " v-for="(item,index) in order.child" :key="index">
 				<view class="flex-row justify-between ">
-					<text class="serviceType">排号:{{item.planNumber}}</text>
+					<text class="serviceType">排号:{{item.planNumber || ''}}</text>
 					<text class="projectState">{{item.statusDesc}}</text>
 				</view>
 
@@ -61,7 +61,7 @@
 						<view class="flex-row">
 							<u-icon name="/static/order/ud14.png" size="16"></u-icon>
 							<text class="key">服务时段:</text>
-							<text class="value">{{item.servicePerson || ''}}</text>
+							<text class="value">{{item.serviceRangeTime || ''}}</text>
 						</view>
 						<view class="flex-row">
 							<u-icon name="/static/order/ud3.png" size="16"></u-icon>
@@ -99,12 +99,12 @@
 					<!--                        <text  class="priceDetail">价格明细</text>-->
 				</view>
 
-				<view v-if="order.canPay" class="btn" @click="qenPayInfo">
+				<view  class="btn" @click="qenPayInfo">
 					<text class="text_33">结 算</text>
 				</view>
-				<view v-else class="btn" @click="orderFinish">
-					<text class="text_33">结束订单</text>
-				</view>
+<!--				<view v-else class="btn" @click="orderFinish">-->
+<!--					<text class="text_33">结束订单</text>-->
+<!--				</view>-->
 			</view>
 		</view>
 
@@ -467,4 +467,4 @@
 <style>
 	@import '/common/css/common.css';
 	@import './index.rpx.scss';
-</style>
+</style>

+ 1 - 1
orderPages/storeService/index.vue

@@ -10,7 +10,7 @@
 				<u-grid-item v-for="(item,index) in serviceObjectList" :key="index">
 					<view class="serobItem flex-col">
 						<view class="serobImgView" @click="selectServiceObject(item)">
-							<image class="serobImg" mode="aspectFill" :src="item.facePhotoUrl || '/static/logo.png'">
+							<image class="serobImg" mode="aspectFill" :src="item.facePhotoUrl || '/static/nullAva.png'">
 							</image>
 						</view>
 						<text class="serobName">{{item.nickName || '未填写'}}</text>

+ 1 - 1
pages/order/module/index.rpx.css

@@ -203,7 +203,7 @@
 .content {
     width: 100%;
     padding-left: 16rpx;
-    padding-top: 4rpx;
+    /*padding-top: 4rpx;*/
     padding-right: 24rpx;
 }
 .title {

+ 87 - 55
pages/order/module/mescrollUni-item.vue

@@ -13,9 +13,9 @@
 				<view class="store-wrap" >
 					<view :class="{ 'grayscale': item.forstStatus === '1' }">
 						<view @click="orderDetail(item)" class="">
-							<view class="store-list">
-								<view class="store-content">
-									<view class="content">
+							<view class="store-list ">
+								<view class="store-content ">
+									<view class="content ">
 										<view class="desc flex-row justify-start ">
 											<view  :class="item.serviceAttribute == 1? 'service-type':'service-mode'">
 												{{item.serviceAttrDesc}}
@@ -24,7 +24,7 @@
 									</view>
 								</view>
 							</view>
-							<view class="order-state">
+							<view class="order-state ">
 								<view class="order-num">
 									<view class="h-order-num">
 										<image src="/static/index/u217.png" mode=""></image>订单编号:{{ item.orderNo }}
@@ -65,7 +65,7 @@
 <!--							<view class="btn" v-if="!item.canPay && item.orderStatus == 6"  @click="orderFinish(item)">-->
 <!--								<text>结束订单</text>-->
 <!--							</view>-->
-							<view class="btn" v-if="item.canPay"  @click="oneClickPay(item)">
+							<view class="btn"  @click="oneClickPay(item)">
 								<text>一键付款</text>
 							</view>
 							<view class="btn" v-if="item.orderStatus == 5 || item.orderStatus == 11" @click="cancelOrder(item)">
@@ -80,7 +80,8 @@
 <!--							</view>-->
 
 							<view @click="orderSign(item)" class="btn">
-								<text>签到</text>
+								<u-icon name="/static/order/saoma.png" color="#2979ff" size="20"></u-icon>
+								<text>扫码签到</text>
 							</view>
 
 						</view>
@@ -91,19 +92,27 @@
 
 
 		</view>
-
+		<myPay ref="myPay" :blPay="blPay" :orderNo="orderNo" :openType="openType" :selectBlPay="selectBlPay" :balance="userInfo.balance" @payResult="payResult"></myPay>
 	</mescroll-uni>
 </template>
 
 <script>
+	import myPay from '../../../components/pay/pay';
 	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
 	import MescrollMoreItemMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mixins/mescroll-more-item.js"
 	export default {
 		mixins: [MescrollMixin, MescrollMoreItemMixin], // 注意此处还需使用MescrollMoreItemMixin (必须写在MescrollMixin后面)
-		components: {},
+		components: {
+			myPay
+		},
 
 		data() {
 			return {
+				openType:1,
+				selectBlPay:true,
+				blPay:true,
+				orderNo:'',
+				userInfo:{},
 				downOption: {
 					auto: false // 不自动加载 (mixin已处理第一个tab触发downCallback)
 				},
@@ -159,32 +168,39 @@
 
 
 		methods: {
+			payResult(e){
+				if (e.payResult){
+					uni.showToast({
+						icon: 'success',
+						duration: 2000,
+						title: '付款成功'
+					});
+				}
+				this.downCallback()
+				this.getUserInfo()
+			},
 
 			orderSign(e){
-					let  that = this
-
-				  uni.getLocation({
-				    type: 'gcj02',
-				    success: function (res) {
-				      var latitude = res.latitude;
-				      var longitude = res.longitude;
-
-						console.log(res)
-						console.log(e)
-						that.$api.orderSign({
-							orderId:e.orderId,
-							latitude:latitude,
-							longitude:longitude
-						}).then(res=>{
-
-						})
-				    },
-					  fail:function (err) {
-
-						  console.log(err)
-					  }
-				  });
-				},
+				let  that = this
+				uni.scanCode({
+					onlyFromCamera: true,
+					hideAlbum: true,
+					success: function (res) {
+						let result = JSON.parse(res.result)
+							that.$api.orderSign({
+								orderId:e.orderId,
+								storeId:result.storeId,
+								timestamp:result.timestamp
+							}).then(res1=>{
+								uni.showToast({
+									icon: 'success',
+									duration: 2000,
+									title: '签到成功'
+								});
+							})
+					}
+				});
+			},
 
 
 
@@ -201,11 +217,24 @@
 			},
 
 			appointment(order){
-				this.$emit('openPayAppointment',order,2)
+				//支付预约费用
+				this.blPay = false
+				this.orderNo = order.subOrderNo
+				this.openType = 1
+				this.$refs.myPay.openPopup()
 			},
 
 			oneClickPay(order){
-				this.$emit('openPay',order,1)
+				//支付订单费用
+				this.blPay = true
+				this.orderNo = order.orderNo
+				this.openType = 2
+				if (this.userInfo.balance *1 > order.payAmount *1){
+					this.selectBlPay = true
+				}else {
+					this.selectBlPay = false
+				}
+				this.$refs.myPay.openPopup()
 			},
 
 
@@ -267,7 +296,12 @@
 
 			},
 
-
+			getUserInfo() {
+				this.$api.getUserInfo().then(res => {
+					this.userInfo = res.data.data
+					uni.setStorageSync('userInfo', res.data.data)
+				})
+			},
 
 			//点击空布局按钮的回调
 			emptyClick() {
@@ -282,26 +316,24 @@
 			},
 
 			cancelOrder(item){
-				console.log('++++++++++++++++++++',item)
-        uni.showModal({
-          content: '请确认是否取消订单!',
-          success: function (res) {
-            if (res.confirm) {
-              let that = this
-              this.$api.cancelOrder({
-                orderId:item.orderId
-              }).then(res=>{
-                that.downCallback()
-                that.$api.getUserInfo().then( res=> {
-                  uni.setStorageSync('userInfo', res.data.data);
-                });
-              })
-            } else if (res.cancel) {
-              console.log('用户点击取消');
-            }
-          }.bind(this)
-        })
-
+				uni.showModal({
+				  content: '请确认是否取消订单!',
+				  success: function (res) {
+					if (res.confirm) {
+					  let that = this
+					  this.$api.cancelOrder({
+						orderId:item.orderId
+					  }).then(res=>{
+						that.downCallback()
+						that.$api.getUserInfo().then( res=> {
+						  uni.setStorageSync('userInfo', res.data.data);
+						});
+					  })
+					} else if (res.cancel) {
+					  console.log('用户点击取消');
+					}
+				  }.bind(this)
+				})
 			},
 
 			orderDetail(item) {

binární
static/me/u4c.png


binární
static/order/saoma.png