Quellcode durchsuchen

feat:充值页面新增自定义充值

xyh8905170 vor 2 Jahren
Ursprung
Commit
86b3aa45d3
4 geänderte Dateien mit 42 neuen und 19 gelöschten Zeilen
  1. 4 0
      .hbuilderx/launch.json
  2. 0 1
      common/js/api.js
  3. 38 16
      myPages/recharge/index.vue
  4. 0 2
      myPages/serviceObjectFaceAuth/index.vue

+ 4 - 0
.hbuilderx/launch.json

@@ -2,6 +2,10 @@
   // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
     "version": "0.0",
     "configurations": [{
+     	"app-plus" : 
+     	{
+     		"launchtype" : "local"
+     	},
      	"default" : 
      	{
      		"launchtype" : "local"

+ 0 - 1
common/js/api.js

@@ -592,7 +592,6 @@ export default {
     },
 
     // get请求 获取公告详情
-
     getNoticeDetail(data) {
         return request({
             url: '/system/openapi/notice/' + data.noticeId,

+ 38 - 16
myPages/recharge/index.vue

@@ -94,14 +94,14 @@
 
 
 				<!-- 自定义充值金额 -->
-				<!-- <view class="h-custom">
+				<view class="h-custom">
 					<view class="h-icon">
 						<u-icon name="rmb" color="#333" size="22"></u-icon>
 					</view>
 					<view class="h-money">
 						<input v-model="reqOrderParm.rechargeAmount" @click="cancelChooseMoney" placeholder="请输入金额" type="number">
 					</view>
-				</view> -->
+				</view>
 
 				<!-- 充值按钮 -->
 				<view v-if="rechargeList.length > 0" @click="submitOrder()" class="h-submit-btn">
@@ -203,8 +203,7 @@
 			},
 			// 提交订单
 			submitOrder(){
-				const that = this;
-
+        const that = this;
 				if(!this.isSelected){ // 是否确定协议
 					uni.showToast({
             			icon: 'none',
@@ -213,23 +212,46 @@
 					return;
 				}
 
-				if(this.reqOrderParm.strategyId == null){
+				if(!this.reqOrderParm.rechargeAmount){
 					uni.showToast({
-            		icon: 'none',
-						title: '请选择充值项目!'
+            icon: 'none',
+						title: '请输入或选择充值金额!'
 					});
 					return;
 				}
-				let promotionParam = uni.getStorageSync('promotionParam')
-				Object.assign(this.reqOrderParm,promotionParam)
-				// 提交订单
-				this.$api.commonGeneralOrder(this.reqOrderParm).then((res)=>{
-					console.log('+++++++++++commonGeneralOrder++++++++++',res)
-					that.reqPayParm.orderNo = res.data.data.orderNo;
-					// 调用微信支付
-					that.wechatPay();
-				})
+
+        if(!this.reqOrderParm.strategyId){
+          uni.showModal({
+            title: '警告!',
+            content: '您确定选择自定义充值金额 而自动放弃充值优惠策略',
+            success: function (res) {
+              if (res.confirm) {
+                console.log('用户点击确定');
+               that.handleCommon()
+              } else if (res.cancel) {
+                console.log('用户点击取消');
+                return;
+              }
+            }
+          });
+        }else {
+          this.handleCommon()
+        }
 			},
+//提交充值订单
+      handleCommon(){
+        const that = this;
+        let promotionParam = uni.getStorageSync('promotionParam')
+        Object.assign(this.reqOrderParm,promotionParam)
+        // 提交订单
+        this.$api.commonGeneralOrder(this.reqOrderParm).then((res)=>{
+          console.log('+++++++++++commonGeneralOrder++++++++++',res)
+          that.reqPayParm.orderNo = res.data.data.orderNo;
+          // 调用微信支付
+          that.wechatPay();
+        })
+      },
+
 			// 微信支付
 			wechatPay(){
 				const that = this;

+ 0 - 2
myPages/serviceObjectFaceAuth/index.vue

@@ -90,7 +90,6 @@
       verifyFace(){
         let that  = this;
 
-
         if(!this.selectIcon){
           uni.$u.toast('请阅读并同意《服务对象协议》')
          return;
@@ -124,7 +123,6 @@
             })
           } else { // 人脸存在
             let serviceObject =  res.data.data
-
             serviceObject.opType = "1";
             serviceObject.facePhotoUrl =  that.facePhotoUrl;
             serviceObject.facePhoto = that.reqParm.facePath;