sharp-agezi 6 rokov pred
rodič
commit
8cdb21c63e

+ 136 - 126
pages/confirmOrder/confirmOrder.js

@@ -318,145 +318,155 @@ Page({
     var user_phone = that.data.user_phone;
 
     var formId = e.detail.formId;
-    
-    console.log("mineGiftList - formId1:" + formId);
-
-    if (user_phone == '' || user_phone == null || user_phone == undefined){
-      wx.navigateTo({
-        url: '/pages/bindingPhone/bindingPhone',
-      })
-      return false;
-    }
-    wx.showLoading({
-      title: '订单合成中',
-    })
+    wx.showModal({
+      title: '提示',
+      content: '下单生成订单后不可更改',
+      success(res) {
+        if (res.confirm) {
+          console.log("mineGiftList - formId1:" + formId);
+
+          if (user_phone == '' || user_phone == null || user_phone == undefined) {
+            wx.navigateTo({
+              url: '/pages/bindingPhone/bindingPhone',
+            })
+            return false;
+          }
+          wx.showLoading({
+            title: '订单合成中',
+          })
 
-    var pages = getCurrentPages();
-    var currPage = pages[pages.length - 1];  //当前页面
-    var prevPage = pages[pages.length - 2]; //上一个页面
-    var prevPageUrl = prevPage.route;
+          var pages = getCurrentPages();
+          var currPage = pages[pages.length - 1];  //当前页面
+          var prevPage = pages[pages.length - 2]; //上一个页面
+          var prevPageUrl = prevPage.route;
 
-    var len = that.data.carts.length;
+          var len = that.data.carts.length;
 
-    // wx.showLoading({//支付提示
-    //   title: '生成订单', //微信支付
-    //   icon: 'loading',
-    //   mask: true,
-    //   success: function () {
+          // wx.showLoading({//支付提示
+          //   title: '生成订单', //微信支付
+          //   icon: 'loading',
+          //   mask: true,
+          //   success: function () {
           // that.setData({
           //   maskBg: true,
           //   allowPay: 1
           // })
-    //   }
-    // })
-    that.setData({
-      maskBg: true,
-      allowPay: 1
-    })
-
-    if (that.data.value == 0) {
-      that.setData({
-        invoice_flag: 3,
-        invoice_send_flag: 3,
-        invoice_type_name: '',//发票类型名称
-        invoice_name: '',//个人名字
-        invoice_content: '',//纸质发票内容
-        invoice_company_name: '',//发票公司名字(纸质单位和增值单位的公司名称相同)
-        invoice_number: '', //纳税人识别号
-        invoice_address: '',//注册地址
-        invoice_telphone: '',//注册电话
-        invoice_brandName: '',//开户银行
-        invoice_brandNum: '',//银行账户
-        invoice_company_content: '',//增值发票内容
-        invoice_price: '',//发票金额
-        invoice_title: '',//纸质个人发票抬头
-        invoice_company_title: '',//纸质单位和增值发票抬头
-        invoice_takeName: '',//收货姓名
-        invoice_takeTelphone: '',//收货人联系方式
-        invoice_takeAddress: ''//收货人地址
-      })
-    }
-    var timestamp = Date.parse(new Date());
-    timestamp = timestamp / 1000;
-    var timestamp1 = timestamp;
-    wx.setStorageSync('orderId', timestamp1)
-    var host = getApp().globalData.servsers;
-    var un_id = getApp().globalData.un_id;
-
-    if (un_id != undefined && un_id != '' && un_id != null){
+          //   }
+          // })
+          that.setData({
+            maskBg: true,
+            allowPay: 1
+          })
 
-      wx.request({
-        url: host + "orderapi/insertorder",
-        data: {
-          order_userid: un_id,
-          order_sta: '1',
-          order_number: timestamp,
-          order_type: '0',
-          order_Consignee: that.data.consignee,
-          order_phone: that.data.phone,
-          order_address: '',
-          order_commodityid: that.data.carts[0].id,
-          order_num: that.data.carts[0].num,
-          order_Price: that.data.total2,//////
-          orderr_Coupon: that.data.minNum,
-          coupon_id: that.data.coupon_id,
-          order_Specifications: '',
-          order_gixbox: '',
-          invoice_send_flag: that.data.invoice_send_flag,
-          invoice_flag: that.data.invoice_flag, //发票标志位
-          invoice_type_name: that.data.invoice_type_name,//发票类型名称
-          invoice_name: that.data.invoice_name,//个人名字
-          invoice_content: that.data.invoice_content,//纸质发票内容
-          invoice_company_name: that.data.invoice_company_name,//发票公司名字(纸质单位和增值单位的公司名称相同)
-          invoice_number: that.data.invoice_number, //纳税人识别号
-          invoice_address: that.data.invoice_address,//注册地址
-          invoice_telphone: that.data.invoice_telphone,//注册电话
-          invoice_brandName: that.data.invoice_brandName,//开户银行
-          invoice_brandNum: that.data.invoice_brandNum,//银行账户
-          invoice_company_content: that.data.invoice_company_content,//增值发票内容
-          invoice_price: that.data.invoice_price,//发票金额
-          invoice_title: that.data.invoice_title,//纸质个人发票抬头
-          invoice_company_title: that.data.invoice_company_title,//纸质单位和增值发票抬头
-          invoice_takeName: that.data.invoice_takeName,//收货姓名
-          invoice_takeTelphone: that.data.invoice_takeTelphone,//收货人联系方式
-          invoice_takeAddress: that.data.invoice_takeAddress,//收货人地址
-          channel_account_id: wx.getStorageSync('channelIdObj').channelAccountId ? wx.getStorageSync('channelIdObj').channelAccountId : ""
-        },
-        method: 'GET', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
-        header: {
-          'Accept': 'application/json'
-        },
-        success: function (res) {
-          if (res.data.result == 1){
-            //插入订单
-            that.insertOrder(len, timestamp, timestamp1, that.data.coupon_id, un_id, formId); 
-          }else{
-            //删除当前订单
-            that.deleteOrder(un_id, timestamp, that.data.coupon_id);
-            wx.hideLoading();
+          if (that.data.value == 0) {
             that.setData({
-              maskBg: false,
-              allowPay: 0,
-              firstClick: 0
+              invoice_flag: 3,
+              invoice_send_flag: 3,
+              invoice_type_name: '',//发票类型名称
+              invoice_name: '',//个人名字
+              invoice_content: '',//纸质发票内容
+              invoice_company_name: '',//发票公司名字(纸质单位和增值单位的公司名称相同)
+              invoice_number: '', //纳税人识别号
+              invoice_address: '',//注册地址
+              invoice_telphone: '',//注册电话
+              invoice_brandName: '',//开户银行
+              invoice_brandNum: '',//银行账户
+              invoice_company_content: '',//增值发票内容
+              invoice_price: '',//发票金额
+              invoice_title: '',//纸质个人发票抬头
+              invoice_company_title: '',//纸质单位和增值发票抬头
+              invoice_takeName: '',//收货姓名
+              invoice_takeTelphone: '',//收货人联系方式
+              invoice_takeAddress: ''//收货人地址
             })
           }
+          var timestamp = Date.parse(new Date());
+          timestamp = timestamp / 1000;
+          var timestamp1 = timestamp;
+          wx.setStorageSync('orderId', timestamp1)
+          var host = getApp().globalData.servsers;
+          var un_id = getApp().globalData.un_id;
+
+          if (un_id != undefined && un_id != '' && un_id != null) {
+
+            wx.request({
+              url: host + "orderapi/insertorder",
+              data: {
+                order_userid: un_id,
+                order_sta: '1',
+                order_number: timestamp,
+                order_type: '0',
+                order_Consignee: that.data.consignee,
+                order_phone: that.data.phone,
+                order_address: '',
+                order_commodityid: that.data.carts[0].id,
+                order_num: that.data.carts[0].num,
+                order_Price: that.data.total2,//////
+                orderr_Coupon: that.data.minNum,
+                coupon_id: that.data.coupon_id,
+                order_Specifications: '',
+                order_gixbox: '',
+                invoice_send_flag: that.data.invoice_send_flag,
+                invoice_flag: that.data.invoice_flag, //发票标志位
+                invoice_type_name: that.data.invoice_type_name,//发票类型名称
+                invoice_name: that.data.invoice_name,//个人名字
+                invoice_content: that.data.invoice_content,//纸质发票内容
+                invoice_company_name: that.data.invoice_company_name,//发票公司名字(纸质单位和增值单位的公司名称相同)
+                invoice_number: that.data.invoice_number, //纳税人识别号
+                invoice_address: that.data.invoice_address,//注册地址
+                invoice_telphone: that.data.invoice_telphone,//注册电话
+                invoice_brandName: that.data.invoice_brandName,//开户银行
+                invoice_brandNum: that.data.invoice_brandNum,//银行账户
+                invoice_company_content: that.data.invoice_company_content,//增值发票内容
+                invoice_price: that.data.invoice_price,//发票金额
+                invoice_title: that.data.invoice_title,//纸质个人发票抬头
+                invoice_company_title: that.data.invoice_company_title,//纸质单位和增值发票抬头
+                invoice_takeName: that.data.invoice_takeName,//收货姓名
+                invoice_takeTelphone: that.data.invoice_takeTelphone,//收货人联系方式
+                invoice_takeAddress: that.data.invoice_takeAddress,//收货人地址
+                channel_account_id: wx.getStorageSync('channelIdObj').channelAccountId ? wx.getStorageSync('channelIdObj').channelAccountId : ""
+              },
+              method: 'GET', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
+              header: {
+                'Accept': 'application/json'
+              },
+              success: function (res) {
+                if (res.data.result == 1) {
+                  //插入订单
+                  that.insertOrder(len, timestamp, timestamp1, that.data.coupon_id, un_id, formId);
+                } else {
+                  //删除当前订单
+                  that.deleteOrder(un_id, timestamp, that.data.coupon_id);
+                  wx.hideLoading();
+                  that.setData({
+                    maskBg: false,
+                    allowPay: 0,
+                    firstClick: 0
+                  })
+                }
 
-          if (res == null || res.data == null || res.data == '') {
-            console.error('插入订单失败');
-            //删除当前订单
-            that.deleteOrder(un_id, timestamp, that.data.coupon_id);
-            that.setData({
-              maskBg: false,
-              allowPay: 0,
-              firstClick: 0
-            })
-            return;
-          }
-        }
-      });
+                if (res == null || res.data == null || res.data == '') {
+                  console.error('插入订单失败');
+                  //删除当前订单
+                  that.deleteOrder(un_id, timestamp, that.data.coupon_id);
+                  that.setData({
+                    maskBg: false,
+                    allowPay: 0,
+                    firstClick: 0
+                  })
+                  return;
+                }
+              }
+            });
 
-      
-    }
+
+          }
+        } 
+      }
+    })
+    
+    
+    
   },
 
 

+ 2 - 2
pages/confirmOrder/confirmOrder.wxml

@@ -85,12 +85,12 @@
     <block wx:if="{{allowPay == 0}}">
       <form bindsubmit="{{serchecked ? 'save' : ''}}"   data-id="{{i}}"  report-submit  >
         <button formType="submit"  class='form_button'>
-            <view class="footer_right  {{serchecked ? '' : 'footer_right_gray'}}">立即采购</view>
+            <view class="footer_right  {{serchecked ? '' : 'footer_right_gray'}}">生成订单</view>
         </button>
       </form>
     </block>
     <block wx:else>
-      <view class="footer_right  {{footer_right_gray}}" >立即采购</view>
+      <view class="footer_right  {{footer_right_gray}}" >生成订单</view>
     </block>
 
     <view class="footer_left">

+ 1 - 1
pages/orderCanvas/orderCanavs.js

@@ -79,7 +79,7 @@ Page({
   },
   returnHome(){
     wx.switchTab({
-      url: '/pages/index/index',
+      url: '/pages/mine/mine',
     })
   },
   uploadImg() {

+ 1 - 1
pages/orderCanvas/orderCanavs.wxml

@@ -32,7 +32,7 @@
         <button class='share-box f-item f-s32' open-type="share">分享</button>
       </view>
       <view wx:if="{{!params.static}}" class='f-item f-box f-justify-content-center c-white f-s32' style='width:100%;background:#eea957' bindtap='uploadImg'>{{uploadText}}</view>
-      <view class='f-item f-box f-justify-content-center c-white bg-theme f-s32' style='width:100%' bindtap='returnHome'>首页</view>
+      <view class='f-item f-box f-justify-content-center c-white bg-theme f-s32' style='width:100%' bindtap='returnHome'>我的中心</view>
     </view>
   </view>
 </view>