Jelajahi Sumber

refactor:订单列表一键支付

zhanghui 2 tahun lalu
induk
melakukan
5a93287321

+ 3 - 3
common/js/api.js

@@ -5,10 +5,10 @@ export default {
 
 
 
-	//post请求  申诉
-	appeal(data){
+	//post请求  一键付款
+	oneClickPay(data){
 		return request({
-			url: '/business/wechat/order/appeal',
+			url: '/business/wechat/order/oneClickPay?orderId='+data.orderId,
 			method: 'POST',
 			data:data
 		})

+ 0 - 1
orderPages/bookService/index.vue

@@ -112,7 +112,6 @@
                         <text>确定</text>
                     </view>
                 </view>
-
             </view>
         </uni-popup>
 

+ 80 - 0
pages/order/index.rpx.scss

@@ -392,3 +392,83 @@
 .tabs{
   background: #FFFFFF;
 }
+
+
+.payView{
+  height: 638rpx;
+  background: #FFFFFF;
+  box-shadow: 0rpx -4rpx 8rpx 0rpx rgba(0,0,0,0.03);
+  border-radius: 24rpx 24rpx 0rpx 0rpx;
+  padding: 24rpx 32rpx;
+  z-index: 100;
+}
+.payType{
+  font-size: 32rpx;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: bord;
+  color: #111111;
+  line-height: 48rpx;
+}
+.x{
+  width: 35rpx;
+  height: 35rpx;
+  border-radius: 18rpx;
+}
+.payTitle{
+  font-size: 24rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #666666;
+  line-height: 40rpx;
+  margin-top: 8rpx;
+}
+.payItem{
+  background: #FAFAFA;
+  border-radius: 20rpx;
+  padding: 34rpx 32rpx;
+  margin-top: 32rpx;
+}
+.payName{
+  margin-left: 24rpx;
+}
+.balance{
+  font-size: 24rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #999999;
+  line-height: 40rpx;
+}
+.commitBtn{
+  width: 686rpx;
+  height: 108rpx;
+  background: #FFE05C;
+  border-radius: 60rpx;
+  margin-top: 32rpx;
+
+  font-size: 32rpx;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: bold;
+  color: #111111;
+  line-height: 108rpx;
+  text-align: center;
+}
+.passwordView{
+  background: #FFFFFF;
+  width: 686rpx;
+  height: 400rpx;
+  border-radius: 20rpx;
+  padding: 34rpx 0;
+}
+
+.h-tab-bar{
+  margin-top: 80rpx;
+}
+.h-operate-btn{
+  width: 550rpx;
+  height: 80rpx;
+  border-radius: 40rpx;
+  background: #FFE05C;
+  line-height: 80rpx;
+  text-align: center;
+  margin-top: 80rpx;
+}

+ 99 - 4
pages/order/index.vue

@@ -26,8 +26,7 @@
 			<swiper :style="{'height':windowHeight}" :current="tabIndex" @change="swiperChange">
 				<swiper-item class="swiperItem" v-for="(item,index) in tabList" :key="index">
 					<view>
-						<mescroll-item ref="MescrollItem" :i="index" :index="tabIndex" :tabs="tabList"
-							:height="windowHeight">
+						<mescroll-item ref="MescrollItem" :i="index" :index="tabIndex" :tabs="tabList" :height="windowHeight" @openPay="openPay">
 						</mescroll-item>
 					</view>
 				</swiper-item>
@@ -70,6 +69,79 @@
 			</view>
 		</uni-popup>
 
+		<uni-popup ref="popup" :catchtouchmove="true" :animation="false" type="bottom">
+
+			<view class=" payView">
+				<view class="flex-row justify-between">
+					<text class="payType">请选择支付方式</text>
+					<image class="x" src="/static/common/ox.png" @click="closePayPopup"></image>
+				</view>
+				<view class="payTitle">
+					<text>选择微信支付或余额支付</text>
+				</view>
+
+
+				<view class="payItem flex-row justify-between" @click="payItem(1)">
+					<view class="flex-row">
+						<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>
+						</view>
+					</view>
+
+					<view class="flex-col justify-center">
+						<view v-if="curServiceTab === 1" >
+							<u-icon name="checkmark-circle-fill" color="#38db38" size="25"></u-icon>
+						</view>
+						<view v-else>
+							<u-icon name="/static/order/ud9.png" color="green" size="25"></u-icon>
+						</view>
+					</view>
+
+				</view>
+
+				<view class="payItem flex-row justify-between" @click="payItem(2)">
+					<view class="flex-row">
+						<u-icon name="weixin-circle-fill" color="#38db38" size="36"></u-icon>
+						<view class="payName flex-col justify-center">
+							<text>微信支付</text>
+						</view>
+					</view>
+					<view class="flex-col justify-center">
+						<view v-if="curServiceTab === 2" >
+							<u-icon name="checkmark-circle-fill" color="#38db38" size="25"></u-icon>
+						</view>
+						<view v-else>
+							<u-icon name="/static/order/ud9.png" color="green" size="25"></u-icon>
+						</view>
+					</view>
+				</view>
+
+				<view class="commitBtn" @click="commonGeneralOrder">
+					<text>确定</text>
+				</view>
+			</view>
+
+		</uni-popup>
+
+
+		<uni-popup ref="passwordPopup">
+			<view class="passwordView flex-col">
+				<view class="flex-row justify-center">
+					<text>请输入交易密码</text>
+				</view>
+				<view class="h-tab-bar flex-row justify-center">
+					<u-code-input  v-model="password" mode="box" dot></u-code-input>
+				</view>
+				<view class="flex-row justify-center">
+					<view class="h-operate-btn flex-row justify-center" @click="balancePay">
+						<text>确定</text>
+					</view>
+				</view>
+			</view>
+		</uni-popup>
+
 
 		<view class="tabBarLineHeight"></view>
 		<view class="tabBarView">
@@ -104,7 +176,10 @@
 				}, {
 					name: '已完成'
 				}],
-				windowHeight: ''
+				windowHeight: '',
+
+				userInfo:{},
+				curServiceTab:1,
 
 			}
 		},
@@ -117,6 +192,26 @@
 		},
 		methods: {
 
+			payItem(num){
+				if (this.userInfo.balance < this.price){
+					return
+				}
+				this.curServiceTab = num
+			},
+
+			closePayPopup(){
+				this.$refs.popup.close()
+			},
+
+			openPay(){
+				this.$refs.popup.open()
+			},
+
+			commonGeneralOrder(){
+
+				this.$refs.passwordPopup.open()
+			},
+
 			clickTab(e) {
 				this.tabIndex = e.index
 			},
@@ -133,6 +228,6 @@
 </script>
 
 <style scoped lang="scss">
-	//@import '/common/css/common.css';
+	@import '/common/css/common.css';
 	@import './index.rpx.scss';
 </style>

+ 2 - 0
pages/order/module/index.rpx.css

@@ -398,3 +398,5 @@
 .tabs{
     background: #FFFFFF;
 }
+
+

+ 35 - 22
pages/order/module/mescrollUni-item.vue

@@ -115,35 +115,38 @@
 								<u-icon name="scan" size="18" />
 								<text>扫码</text>
 							</view>
-							<view class="btn" @click="gotoPayOrder(item)" v-if="item.orderStatus == 1">
-								<text>去付款</text>
-							</view>
-							<view class="btn" v-else-if="item.orderStatus == 2">
-								<text>已取消</text>
+							<view class="btn" @click="oneClickPay(item)">
+								<text>一键付款</text>
 							</view>
+<!--							<view class="btn" v-else-if="item.orderStatus == 2">-->
+<!--								<text>已取消</text>-->
+<!--							</view>-->
 <!--							<view @click="orderSign(item)" v-else-if="item.orderStatus == 4" class="btn">-->
 <!--								立即排队-->
 <!--								&lt;!&ndash; <text class="text1">点击开始排号</text> &ndash;&gt;-->
 <!--							</view>-->
-							<view @click="getOrderSign(item)" class="btn" v-else-if="item.orderStatus == 5">
-								<text>点击查看排号</text>
-							</view>
-							<view class="btn" v-else-if="item.orderStatus == 6">
-								<text>服务中</text>
-							</view>
-							<view class="btn" v-else-if="item.orderStatus == 7">
-								<text>排号过期</text>
-							</view>
-							<view @click="gotoEvaluate(item)" class="btn" v-else-if="item.orderStatus == 8">
-								<text>待评价</text>
-							</view>
-							<view @click="gotoPayOrder(item)" class="btn" v-else-if="item.orderStatus == 9">
-								<text>去支付预约费用</text>
-							</view>
+<!--							<view @click="getOrderSign(item)" class="btn" v-else-if="item.orderStatus == 5">-->
+<!--								<text>点击查看排号</text>-->
+<!--							</view>-->
+<!--							<view class="btn" v-else-if="item.orderStatus == 6">-->
+<!--								<text>服务中</text>-->
+<!--							</view>-->
+<!--							<view class="btn" v-else-if="item.orderStatus == 7">-->
+<!--								<text>排号过期</text>-->
+<!--							</view>-->
+<!--							<view @click="gotoEvaluate(item)" class="btn" v-else-if="item.orderStatus == 8">-->
+<!--								<text>待评价</text>-->
+<!--							</view>-->
+<!--							<view @click="gotoPayOrder(item)" class="btn" v-else-if="item.orderStatus == 9">-->
+<!--								<text>去支付预约费用</text>-->
+<!--							</view>-->
 						</view>
 					</view>
 				</view>
 			</view>
+
+
+
 		</view>
 
 	</mescroll-uni>
@@ -176,6 +179,7 @@
 					textNoMore: '没有更多了'
 				},
 				list: [],
+
 			}
 		},
 		props: {
@@ -206,10 +210,20 @@
 
 		},
 
-		created() {},
+		created() {
+			this.userInfo = uni.getStorageSync('userInfo')
+		},
 
 
 		methods: {
+
+
+
+			oneClickPay(order){
+				this.$emit('openPay',order)
+			},
+
+
       scanCodeOrder(item){
       	let that = this
         uni.scanCode({
@@ -218,7 +232,6 @@
 			uni.navigateTo({
 				 url:'/orderPages/serviceItems/index?serviceStationId='+ res.result + '&orderId='+item.orderId
 			})
-
           }
         })
       },