|
@@ -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;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
-
|
|
|
- }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
|
|
|
|