Jelajahi Sumber

Merge branch 'master' of http://git.ds-bay.com/project/kmall-pt

csk 5 tahun lalu
induk
melakukan
7a03c9120f
35 mengubah file dengan 2701 tambahan dan 91 penghapusan
  1. 6 0
      kmall-admin/src/main/java/com/kmall/admin/controller/OrderController.java
  2. 10 0
      kmall-admin/src/main/java/com/kmall/admin/entity/WxOrderEntity.java
  3. 7 2
      kmall-admin/src/main/java/com/kmall/admin/service/impl/OrderRefundServiceImpl.java
  4. 41 41
      kmall-admin/src/main/resources/conf/fastdfs.properties
  5. 1 1
      kmall-admin/src/main/webapp/WEB-INF/page/shop/orderresend.html
  6. 3 2
      kmall-admin/src/main/webapp/js/shop/orderrefund.js
  7. 28 27
      kmall-admin/src/main/webapp/js/shop/orderresend.js
  8. 2 2
      kmall-api/src/main/java/com/kmall/api/service/ApiOrderService.java
  9. 4 4
      kmall-api/src/main/java/com/kmall/api/service/ApiPayService.java
  10. 2 2
      kmall-api/src/main/java/com/kmall/api/service/wxGlobal/ApiWxGlobalPayService.java
  11. 2 2
      kmall-schedule/src/main/resources/logback.xml
  12. 211 0
      wx-mall/pages/checkVideo/checkVideo.js
  13. 4 0
      wx-mall/pages/checkVideo/checkVideo.json
  14. 7 0
      wx-mall/pages/checkVideo/checkVideo.wxml
  15. 19 0
      wx-mall/pages/checkVideo/checkVideo.wxss
  16. 241 0
      wx-mall/pages/checkoutIdCard/checkoutIdCard.js
  17. 4 0
      wx-mall/pages/checkoutIdCard/checkoutIdCard.json
  18. 55 0
      wx-mall/pages/checkoutIdCard/checkoutIdCard.wxml
  19. 248 0
      wx-mall/pages/checkoutIdCard/checkoutIdCard.wxss
  20. 2 2
      wx-mall/pages/index/index.js
  21. 31 0
      wx-mall/pages/prompt/prompt.js
  22. 4 0
      wx-mall/pages/prompt/prompt.json
  23. 8 0
      wx-mall/pages/prompt/prompt.wxml
  24. 508 0
      wx-mall/pages/prompt/prompt.wxss
  25. 244 0
      wx-mall/pages/ucenter/crossBoundaryQuotaQuery/crossBoundaryQuotaQuery.js
  26. 3 0
      wx-mall/pages/ucenter/crossBoundaryQuotaQuery/crossBoundaryQuotaQuery.json
  27. 41 0
      wx-mall/pages/ucenter/crossBoundaryQuotaQuery/crossBoundaryQuotaQuery.wxml
  28. 252 0
      wx-mall/pages/ucenter/crossBoundaryQuotaQuery/crossBoundaryQuotaQuery.wxss
  29. 12 4
      wx-mall/pages/ucenter/index/index.js
  30. 1 1
      wx-mall/pages/ucenter/index/index.wxml
  31. 452 0
      wx-mall/pages/ucenter/userLogin/userLogin.js
  32. 4 0
      wx-mall/pages/ucenter/userLogin/userLogin.json
  33. 59 0
      wx-mall/pages/ucenter/userLogin/userLogin.wxml
  34. 184 0
      wx-mall/pages/ucenter/userLogin/userLogin.wxss
  35. 1 1
      wx-mall/project.config.json

+ 6 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/OrderController.java

@@ -377,6 +377,8 @@ public class OrderController {
                     orderRefund.setRefundType(Integer.parseInt(Dict.RefundType.item_1.getItem()));
                     orderRefund.setRefundMoney(BigDecimal.valueOf(orderInfo.getActualPrice().doubleValue()));
                     orderRefund.setRefundStatus(Integer.parseInt(Dict.RefundStatus.item_4.getItem()));
+                    SysUserEntity user = ShiroUtils.getUserEntity();
+                    orderRefund.setModerSn(user.getUsername());
                     orderRefund.setModTime(new Date());
                     orderRefund.setOutRefundNo(tradeResult.getString("ord_no"));
                     if (mallOrderRefund != null) {
@@ -416,6 +418,8 @@ public class OrderController {
             orderRefund.setRefundType(Integer.parseInt(Dict.RefundType.item_1.getItem()));
             orderRefund.setRefundMoney(BigDecimal.valueOf(orderInfo.getActualPrice().doubleValue()));
             orderRefund.setRefundStatus(Integer.parseInt(Dict.RefundStatus.item_4.getItem()));
+            SysUserEntity user = ShiroUtils.getUserEntity();
+            orderRefund.setModerSn(user.getUsername());
             orderRefund.setModTime(new Date());
 //            orderRefund.setOutRefundNo(result.getOut_refund_no());
             if (mallOrderRefund != null) {
@@ -501,6 +505,8 @@ public class OrderController {
                     orderRefund.setRefundMoney(BigDecimal.valueOf(orderInfo.getActualPrice().doubleValue()));
                     orderRefund.setRefundStatus(Integer.parseInt(Dict.RefundStatus.item_4.getItem()));
 //                    orderRefund.setOutRefundNo(result.getOut_refund_no());
+                    SysUserEntity user = ShiroUtils.getUserEntity();
+                    orderRefund.setModerSn(user.getUsername());
                     orderRefund.setModTime(new Date());
                     if (mallOrderRefund != null) {
                         orderRefund.setId(mallOrderRefund.getId());

+ 10 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/WxOrderEntity.java

@@ -157,6 +157,8 @@ public class WxOrderEntity implements Serializable {
 
     private String placeOrderlTimeStr;
 
+    private String failMsg;
+
     public String getPlaceOrderlTimeStr() {
         return placeOrderlTimeStr;
     }
@@ -732,4 +734,12 @@ public class WxOrderEntity implements Serializable {
     public void setExField5(String exField5) {
         this.exField5 = exField5 == null ? null : exField5.trim();
     }
+
+    public String getFailMsg() {
+        return failMsg;
+    }
+
+    public void setFailMsg(String failMsg) {
+        this.failMsg = failMsg;
+    }
 }

+ 7 - 2
kmall-admin/src/main/java/com/kmall/admin/service/impl/OrderRefundServiceImpl.java

@@ -43,17 +43,22 @@ public class OrderRefundServiceImpl implements OrderRefundService {
 
     @Override
     public int save(OrderRefundEntity orderRefund) {
+        SysUserEntity user = ShiroUtils.getUserEntity();
+        orderRefund.setCreateSn(user.getUsername());
+        orderRefund.setCreateTime(new Date());
         return orderRefundDao.save(orderRefund);
     }
 
     @Override
     public int update(OrderRefundEntity orderRefund) {
+        SysUserEntity user = ShiroUtils.getUserEntity();
         if (StringUtils.isNotEmpty(orderRefund.getApprovalRemark())) {
             orderRefund.setApprovalTime(new Date());
-            SysUserEntity user = ShiroUtils.getUserEntity();
-            orderRefund.setApprover(user.getUserId().toString());
+            orderRefund.setApprover(user.getUsername());
             orderRefund.setRefundStatus(3);
         }
+        orderRefund.setModerSn(user.getUsername());
+        orderRefund.setModTime(new Date());
         return orderRefundDao.update(orderRefund);
     }
 

+ 41 - 41
kmall-admin/src/main/resources/conf/fastdfs.properties

@@ -1,43 +1,7 @@
-###\u8FDE\u63A5\u8D85\u65F6\u65F6\u95F4
-#connect_timeout=30
-#
-##\u7F51\u7EDC\u8D85\u65F6\u65F6\u95F4
-#network_timeout=60
-#
-##\u6587\u4EF6\u8DEF\u5F84
-#base_path=/data/files/
-#
-##tracker server\u662FFastDFS\u6587\u4EF6\u7CFB\u7EDF\u7684\u534F\u8C03\u8005,\u5176\u4E3B\u8981\u4F5C\u7528\u662F\u8D1F\u8F7D\u5747\u8861\u548C\u8C03\u5EA6\u3002
-##Tracker server\u5728\u5185\u5B58\u4E2D\u8BB0\u5F55\u5206\u7EC4\u548CStorage server\u7684\u72B6\u6001\u7B49\u4FE1\u606F\uFF0C\u4E0D\u8BB0\u5F55\u6587\u4EF6\u7D22\u5F15\u4FE1\u606F
-#tracker_server=192.168.1.251:22122
-#
-#log_level=info
-#
-#use_connection_pool = false
-#
-#connection_pool_max_idle_time = 3600
-#
-#load_fdfs_parameters_from_tracker=false
-#
-#use_storage_id = false
-#
-#storage_ids_filename = storage_ids.conf
-#
-##HTTP \u670D\u52A1\u5668\u5730\u5740
-#http.tracket_nginx_addr=192.168.1.251
-#
-##HTTP \u670D\u52A1\u5668\u7AEF\u53E3\u53F7
-#http.tracker_server_port=80
-#
-##\u6587\u4EF6\u4F5C\u8005
-#file.author=kmall-pt
-
-
-#############\u751F\u4EA7\u73AF\u5883################
 ##\u8FDE\u63A5\u8D85\u65F6\u65F6\u95F4
-#connect_timeout=30
-#
-##\u7F51\u7EDC\u8D85\u65F6\u65F6\u95F4
+connect_timeout=30
+
+#\u7F51\u7EDC\u8D85\u65F6\u65F6\u95F4
 network_timeout=60
 
 #\u6587\u4EF6\u8DEF\u5F84
@@ -45,7 +9,7 @@ base_path=/data/files/
 
 #tracker server\u662FFastDFS\u6587\u4EF6\u7CFB\u7EDF\u7684\u534F\u8C03\u8005,\u5176\u4E3B\u8981\u4F5C\u7528\u662F\u8D1F\u8F7D\u5747\u8861\u548C\u8C03\u5EA6\u3002
 #Tracker server\u5728\u5185\u5B58\u4E2D\u8BB0\u5F55\u5206\u7EC4\u548CStorage server\u7684\u72B6\u6001\u7B49\u4FE1\u606F\uFF0C\u4E0D\u8BB0\u5F55\u6587\u4EF6\u7D22\u5F15\u4FE1\u606F
-tracker_server=120.76.26.84:22122
+tracker_server=192.168.1.251:22122
 
 log_level=info
 
@@ -60,10 +24,46 @@ use_storage_id = false
 storage_ids_filename = storage_ids.conf
 
 #HTTP \u670D\u52A1\u5668\u5730\u5740
-http.tracket_nginx_addr=120.76.26.84
+http.tracket_nginx_addr=192.168.1.251
 
 #HTTP \u670D\u52A1\u5668\u7AEF\u53E3\u53F7
 http.tracker_server_port=80
 
 #\u6587\u4EF6\u4F5C\u8005
 file.author=kmall-pt
+
+
+#############\u751F\u4EA7\u73AF\u5883################
+###\u8FDE\u63A5\u8D85\u65F6\u65F6\u95F4
+##connect_timeout=30
+##
+###\u7F51\u7EDC\u8D85\u65F6\u65F6\u95F4
+#network_timeout=60
+#
+##\u6587\u4EF6\u8DEF\u5F84
+#base_path=/data/files/
+#
+##tracker server\u662FFastDFS\u6587\u4EF6\u7CFB\u7EDF\u7684\u534F\u8C03\u8005,\u5176\u4E3B\u8981\u4F5C\u7528\u662F\u8D1F\u8F7D\u5747\u8861\u548C\u8C03\u5EA6\u3002
+##Tracker server\u5728\u5185\u5B58\u4E2D\u8BB0\u5F55\u5206\u7EC4\u548CStorage server\u7684\u72B6\u6001\u7B49\u4FE1\u606F\uFF0C\u4E0D\u8BB0\u5F55\u6587\u4EF6\u7D22\u5F15\u4FE1\u606F
+#tracker_server=120.76.26.84:22122
+#
+#log_level=info
+#
+#use_connection_pool = false
+#
+#connection_pool_max_idle_time = 3600
+#
+#load_fdfs_parameters_from_tracker=false
+#
+#use_storage_id = false
+#
+#storage_ids_filename = storage_ids.conf
+#
+##HTTP \u670D\u52A1\u5668\u5730\u5740
+#http.tracket_nginx_addr=120.76.26.84
+#
+##HTTP \u670D\u52A1\u5668\u7AEF\u53E3\u53F7
+#http.tracker_server_port=80
+#
+##\u6587\u4EF6\u4F5C\u8005
+#file.author=kmall-pt

+ 1 - 1
kmall-admin/src/main/webapp/WEB-INF/page/shop/orderresend.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
 <head>
-    <title>订单退款记录表</title>
+    <title>订单ccnet重发记录表</title>
     #parse("sys/header.html")
 </head>
 <body>

+ 3 - 2
kmall-admin/src/main/webapp/js/shop/orderrefund.js

@@ -59,8 +59,9 @@ $(function () {
                 }
             },
 			{label: '退款原因', name: 'refundReason', index: 'refund_reason', width: 140},
+            {label: '退款操作人', name: 'moderSn', index: 'moderSn', width: 80},
 			{label: '退款入账账户', name: 'refundRecvAccout', index: 'refund_recv_accout', width: 80, hidden: true},
-			{label: '审核人', name: 'approver', index: 'approver', width: 80, hidden: true},
+			{label: '审核人', name: 'approver', index: 'approver', width: 80},
 			{
 			    label: '审核时间', name: 'approvalTime', index: 'approval_time', width: 100,
                 formatter: function (value) {
@@ -251,4 +252,4 @@ var vm = new Vue({
             });
         }
 	}
-});
+});

+ 28 - 27
kmall-admin/src/main/webapp/js/shop/orderresend.js

@@ -4,8 +4,8 @@ $(function () {
         url: url,
         datatype: "json",
         colModel: [
-			{label: 'wxOrderSn', name: 'wxOrderSn', index: 'wxOrderSn', key: true, hidden: true},
-			{label: '订单编号', name: 'wxOrderId', index: 'wxOrderId', width: 40},
+			{label: 'wxOrderId', name: 'wxOrderId', index: 'id', key: true, hidden: true},
+			// {label: '订单编号', name: 'wxOrderId', index: 'wxOrderId', width: 40},
 			{label: '商户订单编号', name: 'merchOrderId', index: 'merchOrderId', width: 90},
 			{label: '商户子订单编号', name: 'orderSn', index: 'orderSn', width: 100},
             {label: '商户编号', name: 'merchSn', index: 'merchSn', width: 100},
@@ -81,29 +81,32 @@ $(function () {
                     return '-';
                 }
             },
-            {
-                label: '操作', width: 180, sortable: false,
+            {label: '失败原因', name: 'failMsg', index: 'failMsg', width: 100},
+            {label: '操作', width: 180, sortable: false,align: 'center',
                 formatter: function (value, col, row) {
-                    let htmlStr = '<button class="btn btn-outline btn-info" onclick="vm.lookDetail(' + row.wxOrderSn + ')"><i class="fa fa-info-circle"></i>详情</button>&nbsp;';
-                    if(row.clecOrderStatus==3){
-                        htmlStr += '<button class="btn btn-outline btn-primary" ' +
-                            'onclick="vm.resendOrder(' + row.wxOrderSn + ')"><i class="fa fa-check-circle"></i>&nbsp;重发电子订单</button>&nbsp;';
-                    }
-                    if(row.wayOrderStatus==3){
-                        htmlStr += '<button class="btn btn-outline btn-primary" ' +
-                            'onclick="vm.resendOrder(' + row.wxOrderSn + ')"><i class="fa fa-check-circle"></i>&nbsp;重发运单</button>&nbsp;';
-                    }
-                    if(row.playOrderStatus==3){
-                        htmlStr += '<button class="btn btn-outline btn-primary" ' +
-                            'onclick="vm.resendOrder(' + row.wxOrderSn + ')"><i class="fa fa-check-circle"></i>&nbsp;重发支付单</button>&nbsp;';
+                    let htmlStr = '<button class="btn btn-outline btn-info" onclick="vm.lookDetail('+row.wxOrderId+')"><i class="fa fa-info-circle"></i>失败原因</button>&nbsp;';
+
+                    if (hasPermission('order:resendWxOrder')) {
+                        if (row.clecOrderStatus == 3) {
+                            htmlStr += '<button class="btn btn-outline btn-primary" ' +
+                                'onclick="vm.resendWxOrder(' + row.wxOrderId + ')"><i class="fa fa-check-circle"></i>&nbsp;重发电子订单</button>&nbsp;';
+                        }
+                        if (row.wayOrderStatus == 3) {
+                            htmlStr += '<button class="btn btn-outline btn-primary" ' +
+                                'onclick="vm.resendWxOrder(' + row.wxOrderId + ')"><i class="fa fa-check-circle"></i>&nbsp;重发运单</button>&nbsp;';
+                        }
+                        if (row.playOrderStatus == 3) {
+                            htmlStr += '<button class="btn btn-outline btn-primary" ' +
+                                'onclick="vm.resendWxOrder(' + row.wxOrderId + ')"><i class="fa fa-check-circle"></i>&nbsp;重发支付单</button>&nbsp;';
+                        }
                     }
                     return htmlStr;
                 }
             }],
 		viewrecords: true,
         height: 645,
-        rowNum: 10,
-        rowList: [200, 300, 500],
+        rowNum: 999,
+        // rowList: [200, 300, 500],
         rownumbers: true,
         rownumWidth: 25,
         autowidth: true,
@@ -163,10 +166,9 @@ var vm = new Vue({
         handleReset: function (name) {
             handleResetForm(this, name);
         },
-        resendOrder: function (orderId, rowId) {
+        resendWxOrder: function (rowId) {
             let params = {};
-            params.orderId = orderId;
-            params.refundId = rowId;
+            params.wxOrderId = rowId;
             confirm('是否确认重发?', function () {
                 $.ajax({
                     type: "POST",
@@ -184,12 +186,11 @@ var vm = new Vue({
                 });
             })
         },
-        lookDetail: function (rowId) {
-            vm.showList = 1;
-            vm.title = "维权订单详情";
-            // $.get("../orderrefund/info/" + rowId, function (r) {
-            //     vm.orderResend = r.orderRefund;
-            // });
+        lookDetail: function (sn) {
+            // vm.showList = 1;
+            // vm.title = "维权订单详情";
+            let jqGrid = $("#jqGrid").jqGrid('getRowData',sn);
+            alert(jqGrid.failMsg);
         }
 	}
 });

+ 2 - 2
kmall-api/src/main/java/com/kmall/api/service/ApiOrderService.java

@@ -496,8 +496,8 @@ public class ApiOrderService {
                 orderVo.setMerchOrderSn(merchOrderSn);
                 apiOrderMapper.updateOrderByMerchOrderSn(orderVo);
             }
-            // formIds保存
-            formIdsService.save(loginUser.getId(), formId, 1, merchOrderSn);
+            // formIds保存,已废弃_2020-1-10
+            // formIdsService.save(loginUser.getId(), formId, 1, merchOrderSn);
 
             //保税展示跨境商品保存是否核验信息
             if(isOrderBizType10) {

+ 4 - 4
kmall-api/src/main/java/com/kmall/api/service/ApiPayService.java

@@ -96,8 +96,8 @@ public class ApiPayService {
             if(orderInfo.getPay_status() == Integer.parseInt(Dict.payStatus.item_2.getItem())) {
                 FormIdsEntity formIdsEntity = formIdsService.getFormIdsByMerchOrderSn(orderInfo.getMerchOrderSn());
                 if (formIdsEntity == null) {
-                    // 保存form_id
-                    formIdsService.save(orderInfo.getUser_id(), prepay_id, 1, orderInfo.getMerchOrderSn());
+                    // 保存form_id,已废弃_2020-1-10
+                    // formIdsService.save(orderInfo.getUser_id(), prepay_id, 1, orderInfo.getMerchOrderSn());
                 } else {
                     FormIdsEntity formIds = new FormIdsEntity();
                     formIds.setMerchOrderSn(orderInfo.getMerchOrderSn());
@@ -190,8 +190,8 @@ public class ApiPayService {
                 if(orderInfo.getPay_status() == Integer.parseInt(Dict.payStatus.item_2.getItem())) {
                     FormIdsEntity formIdsEntity = formIdsService.getFormIdsByMerchOrderSn(orderInfo.getMerchOrderSn());
                     if (formIdsEntity == null) {
-                        // 保存form_id
-                        formIdsService.save(orderInfo.getUser_id(), orderInfo.getPay_id(), 1, orderInfo.getMerchOrderSn());
+                        // 保存form_id,已废弃_2020-1-10
+                        // formIdsService.save(orderInfo.getUser_id(), orderInfo.getPay_id(), 1, orderInfo.getMerchOrderSn());
                     } else {
                         FormIdsEntity formIds = new FormIdsEntity();
                         formIds.setMerchOrderSn(orderInfo.getMerchOrderSn());

+ 2 - 2
kmall-api/src/main/java/com/kmall/api/service/wxGlobal/ApiWxGlobalPayService.java

@@ -151,8 +151,8 @@ public class ApiWxGlobalPayService {
                             formIds.setId(formIdsEntity.getId());
                             formIdsService.releaseFormIds(formIds);
                         }else{
-                            // 保存form_id
-                            formIdsService.save(orderInfo.getUser_id(), orderInfo.getPay_id(), 1, orderInfo.getMerchOrderSn());
+                            // 保存form_id,已废弃_2020-1-10
+                            // formIdsService.save(orderInfo.getUser_id(), orderInfo.getPay_id(), 1, orderInfo.getMerchOrderSn());
                         }
                     }
                     // 微信支付成功通知

+ 2 - 2
kmall-schedule/src/main/resources/logback.xml

@@ -6,7 +6,7 @@ debug:当此属性设置为true时,将打印出logback内部日志信息,
 -->
 <configuration scan="false" scanPeriod="60 seconds" debug="false">
 
-    <property name="LOG_HOME" value="/data/project/logs/kmall-pt/kmall-schedule/"/>
+    <property name="LOG_HOME" value="/app/project/logs/kmall-pt/kmall-schedule/"/>
     <!-- 定义日志的根目录 -->
     <property name="TRACE_DIR" value="trace" />
     <property name="DEBUG_DIR" value="debug" />
@@ -225,4 +225,4 @@ debug:当此属性设置为true时,将打印出logback内部日志信息,
         <appender-ref ref="warnAppender" />
         <appender-ref ref="errorAppender" />-->
     </root>
-</configuration>
+</configuration>

+ 211 - 0
wx-mall/pages/checkVideo/checkVideo.js

@@ -0,0 +1,211 @@
+const util = require('../../utils/util.js');
+const api = require('../../config/api.js');
+const user = require('../../services/user.js');
+
+//获取应用实例
+const app = getApp();
+Page({
+  data: {
+    // text:"这是一个页面"
+    videoSource: '',
+    videoHidden: true,
+    cameraCtx: null,
+    src: null,
+    videoSrc: null,
+    isStartDisable: null,
+    isEndDisable: null
+  },
+
+  /**
+* 生命周期函数--监听页面初次渲染完成
+*/
+  onReady: function (res) {
+    if (wx.createCameraContext()) {
+      // this.cameraContext = wx.createCameraContext('myCamera')
+      // this.takePhoto();
+
+      this.cameraContext = wx.createCameraContext()
+    } else {
+      // 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示
+      wx.showModal({
+        title: '提示',
+        content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
+      })
+    }
+  },
+  takePhoto() {
+    var that = this;
+    const ctx = wx.createCameraContext()
+    console.log(ctx)
+    ctx.takePhoto({
+      quality: 'high',
+      success: (res) => {
+        that.setData({
+          src: res.tempImagePath
+        })
+      },
+      fail: (res) => {
+        console.log('拍摄失败')
+        console.log(res)
+      },
+      complete: (res) => {
+        console.log('接口调用结束的回调函数(调用成功、失败都会执行)')
+        console.log(res)
+      }
+    })
+  },
+  takeVideo() {
+    wx.showLoading({
+      title: '视频录制开始...',
+    });
+    var that = this;
+    // const ctx = wx.createCameraContext()
+    console.log(that.cameraContext)
+    that.cameraContext.startRecord({
+      timeoutCallback: (res) => {
+        console.log('摄影开始中1')
+        console.log(res)
+        that.setData({
+          isStartDisable: true,
+          isEndDisable: false
+        })
+      },
+      success: (res) => {
+        console.log('摄影开始成功2')
+        console.log(res)
+        that.setData({
+          isStartDisable: true,
+          isEndDisable: false
+        })
+      },
+      fail: (res) => {
+        console.log('摄影开始失败')
+        console.log(res)
+        that.setData({
+          isStartDisable: false,
+          isEndDisable: false
+        })
+      },
+      complete: (res) => {
+        console.log('摄影开始,接口调用结束的回调函数(调用成功、失败都会执行)')
+        console.log(res)
+      }
+    })
+  },
+  stopVideo: function () {
+    wx.hideLoading();
+    var that = this;
+    that.cameraContext.stopRecord({
+      success: (videoRes) => {
+        console.log('摄影成功2')
+        console.log(videoRes.tempVideoPath)
+        that.setData({
+          isStartDisable: true,
+          isEndDisable: true,
+          videoSrc: videoRes.tempVideoPath
+        })
+        that.getBase64(videoRes.tempVideoPath);
+        // util.request(api.CheckLivenessRecognition, {
+        //   storeId: wx.getStorageSync('storeId'),
+        //   merchId: wx.getStorageSync('merchSn'),
+        //   idCard: '',
+        //   name: '',
+        //   videoBase64: 'base64',
+        //   livenessType: 'SILENT'
+        // }, 'POST').then(function (urlRes) {
+        //   console.log(urlRes);
+        //   // wx.showToast({
+        //   //   title: '成功',
+        //   //   icon: 'success',
+        //   //   duration: 2000
+        //   // })
+        //   wx.showToast({
+        //     title: urlRes.msg,
+        //     icon: 'success'
+        //   })
+        // });
+      },
+      fail: (videoFailRes) => {
+        console.log('摄影失败')
+        console.log(videoFailRes)
+        that.setData({
+          isStartDisable: false,
+          isEndDisable: false
+        })
+      },
+      complete: (videoComRes) => {
+        console.log('接口调用结束的回调函数(调用成功、失败都会执行)')
+        console.log(videoComRes)
+      }
+    });
+  },
+  getBase64(path) {
+    wx.showLoading({
+      title: '人脸身份核验中...',
+    });
+    var that = this;
+    wx.getFileSystemManager().readFile({
+      filePath: path,
+      encoding: "base64",
+      complete: res => {
+        // var baseRes = wx.getFileSystemManager().readFileSync(videoRes.tempVideoPath, 'base64')
+        console.log('base64码');
+        // console.log(res);
+        var base64 = res.data;
+        util.request(api.CheckLivenessRecognition, {
+          storeId: wx.getStorageSync('storeId'),
+          merchId: wx.getStorageSync('merchSn'),
+          idCard: '',
+          name: '',
+          videoBase64: base64,
+          livenessType: 'SILENT'
+        }, 'POST').then(function (urlRes) {
+          console.log(urlRes);
+          if(urlRes.errno!=undefined){
+            if(urlRes.errno===0){
+              wx.showToast({
+                title: '人脸核验成功',
+                icon: 'success',
+                duration: 2000
+              })
+            }else{
+              wx.showToast({
+                title: urlRes.errmsg,
+                icon: 'none'
+              });
+            }
+          } else {
+            if (urlRes.code != 0) {
+              wx.showToast({
+                title: urlRes.msg,
+                icon: 'none'
+              });
+              that.setData({
+                isStartDisable: false,
+                isEndDisable: false
+              })
+            }
+          }
+        });
+      },
+      fail: function (baseFailRes) {
+        console.log(baseFailRes);
+      }
+    });
+  },
+  error(e) {
+    console.log(e.detail)
+  },
+  onLoad: function (options) {
+    // 页面初始化 options为页面跳转所带来的参数
+  },
+  onShow: function () {
+    // 页面显示
+  },
+  onHide: function () {
+    // 页面隐藏
+  },
+  onUnload: function () {
+    // 页面关闭
+  }
+})

+ 4 - 0
wx-mall/pages/checkVideo/checkVideo.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

+ 7 - 0
wx-mall/pages/checkVideo/checkVideo.wxml

@@ -0,0 +1,7 @@
+<camera device-position="front" mode='normal' flash="off" binderror="error" style="width: 80vw; height: 300px;border-radius: 1000rpx;margin: 0px auto;"></camera>
+<!-- <button type="primary" bindtap="takePhoto">拍照</button> -->
+<button type="primary" bindtap="takeVideo" disabled="{{isStartDisable}}">开始摄影</button>
+<button type="primary" bindtap="stopVideo" disabled="{{isEndDisable}}">结束摄影</button>
+<!-- <view>预览</view> -->
+<!-- <image mode="widthFix" src="{{src}}"></image> -->
+<video style="width: 80vw; height: 300px;border-radius: 1000rpx;margin: 0px auto;" src="{{videoSrc}}"></video>

+ 19 - 0
wx-mall/pages/checkVideo/checkVideo.wxss

@@ -0,0 +1,19 @@
+.camera{
+  height:1080rpx;
+  width:750rpx;
+}
+.pause .time {
+  flex: 1;
+  height:100%;
+}
+.time {
+  text-align: center;
+  background-color: rgba(0, 0, 0, .5);
+  color: white;
+  line-height:50px;
+}
+.img {
+  width: 40px;
+  height: 40px;
+  margin: 5px auto;
+}

+ 241 - 0
wx-mall/pages/checkoutIdCard/checkoutIdCard.js

@@ -0,0 +1,241 @@
+var util = require('../../utils/util.js');
+var api = require('../../config/api.js');
+var app = getApp()
+Page({
+  data: {
+    userInfo: {},
+    curUser: {},
+    idNoM: '',
+    idNo: '',
+    currentIdNo: '',
+    userName: '',
+    array: ['居民身份证'],
+    items: [
+      { name: '1', value: '反光识别', checked: 'true' },
+      { name: '2', value: '读数识别' },
+    ],
+    isAgree: false
+  },
+  radioChange: function (e) {
+    console.log('radio发生change事件,携带value值为:', e.detail.value)
+  },
+  checkBoxAgree: function(e){
+    this.setData({
+      isAgree: !this.data.isAgree
+    });
+  },
+  onLoad: function (options) {
+    // 页面初始化 options为页面跳转所带来的参数
+    let that = this;
+  },
+  onReady: function () {
+
+  },
+  onShow: function () {
+    let that = this;
+    let userInfo = wx.getStorageSync('userInfo');
+    let token = wx.getStorageSync('token');
+
+    // 页面显示
+    if (userInfo && token) {
+      app.globalData.userInfo = userInfo;
+      app.globalData.token = token;
+
+      this.setData({
+        userInfo: app.globalData.userInfo,
+      });
+      util.request(api.getCurUser, {
+        userInfo: app.globalData.userInfo
+      }, 'POST').then(function (res) {
+        if (res.errno === 0) {
+          that.setData({
+            curUser: res.data
+          });
+          if (res.data.idNo) {
+            that.setData({
+              idNoM: that.formatidcard(res.data.idNo),
+              idNo: res.data.idNo,
+              currentIdNo: res.data.idNo,
+              userName: res.data.username
+            });
+          }
+        }
+      });
+    } else {
+      wx.navigateTo({
+        url: '/pages/ucenter/userLogin/userLogin'
+      })
+    }
+
+  },
+  onHide: function () {
+    // 页面隐藏
+
+  },
+  onUnload: function () {
+    // 页面关闭
+  },
+  readUserService: function(){
+    // wx.navigateTo({
+    //   url: '../userService/userService'
+    // });
+  },
+  readUserPrivacy: function () {
+    // wx.navigateTo({
+    //   url: '../userPrivacy/userPrivacy'
+    // });
+  },
+  saveIdCard: function (e) {
+    let that = this;
+    if (that.data.isAgree == false) {
+      wx.showToast({
+        title: '请先阅读并勾选内容',
+        icon: 'none'
+      });
+      return false;
+    }
+    if (!e.detail.value.idNo) {
+      wx.showToast({
+        title: '身份证号不能为空',
+        icon: 'none'
+      });
+      return false;
+    }
+
+    if (!e.detail.value.username) {
+      wx.showToast({
+        title: '姓名不能为空',
+        icon: 'none'
+      });
+      return false;
+    }
+    if (that.data.idNoM != that.formatidcard(e.detail.value.idNo)) {
+      that.setData({
+        idNo: e.detail.value.idNo
+      });
+    } else {
+      that.setData({
+        idNo: that.data.currentIdNo
+      });
+    }
+    that.setData({
+      userName: e.detail.value.username
+    });
+    console.log(that.data.idNo);
+
+    if (!that.checkIdcard(that.data.idNo)) {
+      wx.showToast({
+        title: '请输入正确的身份证号',
+        icon: 'none'
+      });
+      return false;
+    }
+
+    wx.navigateTo({
+      url: '../checkVideo/checkVideo'
+    });
+    /**util.request(api.idCardRealName, {
+      idNo: that.data.idNo,
+      userName: that.data.userName
+    }, 'POST').then(function (res) {
+      if (res.errno === 0) {
+        //成功提示
+        // wx.showToast({
+        //   title: res.errmsg
+        // });
+        that.setData({
+          idNoM: that.formatidcard(e.detail.value.idNo)
+        });
+        wx.navigateTo({
+          url: '../checkVideo/checkVideo'
+        });
+      } else {
+        wx.showToast({
+          title: res.errmsg,
+          icon: 'none'
+        });
+      }
+    });**/
+  },
+  clearData: function () {
+    let that = this;
+    that.setData({
+      idNoM: ''
+    });
+  },
+  formatidcard(idcard) {
+    var reg = /^(.).+(.)$/g;
+    if (idcard.length == 15) {
+      // return idcard.replace(/(\d{6})\d{6}(\d{3})/, "$1******$2");
+      return idcard.replace(reg, "$1*************$2");
+    } else {
+      return idcard.replace(reg, "$1****************$2");
+    }
+  },
+  // 校验身份证号
+  //校验码校验
+  checkCode: function (val) {
+    var p = /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
+    var factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
+    var parity = [1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2];
+    var code = val.substring(17);
+    if (p.test(val)) {
+      var sum = 0;
+      for (var i = 0; i < 17; i++) {
+        sum += val[i] * factor[i];
+      }
+      if (parity[sum % 11] == code.toUpperCase()) {
+        return true;
+      }
+    }
+    return false;
+  },
+  //省份校验
+  checkProv: function (val) {
+    var pattern = /^[1-9][0-9]/;
+    var provs = { 11: "北京", 12: "天津", 13: "河北", 14: "山西", 15: "内蒙古", 21: "辽宁", 22: "吉林", 23: "黑龙江 ", 31: "上海", 32: "江苏", 33: "浙江", 34: "安徽", 35: "福建", 36: "江西", 37: "山东", 41: "河南", 42: "湖北 ", 43: "湖南", 44: "广东", 45: "广西", 46: "海南", 50: "重庆", 51: "四川", 52: "贵州", 53: "云南", 54: "西藏 ", 61: "陕西", 62: "甘肃", 63: "青海", 64: "宁夏", 65: "新疆", 71: "台湾", 81: "香港", 82: "澳门" };
+    if (pattern.test(val)) {
+      if (provs[val]) {
+        return true;
+      }
+    }
+    return false;
+  },
+  //出生日期码校验
+  checkDate: function (val) {
+    var pattern = /^(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)$/;
+    if (pattern.test(val)) {
+      var year = val.substring(0, 4);
+      var month = val.substring(4, 6);
+      var date = val.substring(6, 8);
+      var date2 = new Date(year + "-" + month + "-" + date);
+      if (date2 && date2.getMonth() == (parseInt(month) - 1)) {
+        return true;
+      }
+    }
+    return false;
+  },
+  checkIdcard: function (val) {
+    if (this.checkCode(val)) {
+      var date = val.substring(6, 14);
+      if (this.checkDate(date)) {
+        if (this.checkProv(val.substring(0, 2))) {
+          return true;
+        }
+      }
+    }
+    // this.isError("请输入正确身份证号");
+    return false;
+  },
+  // 通过身份证号获取出生日期和性别
+  getBirthAndSex: function (idCard) {
+    var that = this;
+    var info = {};
+    var birth = (idCard.length === 18) ? idCard.slice(6, 14) : idCard.slice(6, 12);
+    var order = (idCard.length === 18) ? idCard.slice(-2, -1) : idCard.slice(-1);
+    info.birthDay = (idCard.length === 18) ? ([birth.slice(0, 4), birth.slice(4, 6), birth.slice(-2)]).join('-') : (['19' + birth.slice(0, 2), birth.slice(2, 4), birth.slice(-2)]).join('-');
+    info.sex = (order % 2 === 0 ? 2 : 0);
+    return info;
+  }
+
+})

+ 4 - 0
wx-mall/pages/checkoutIdCard/checkoutIdCard.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "navigationBarTitleText": "身份校验"
+}

+ 55 - 0
wx-mall/pages/checkoutIdCard/checkoutIdCard.wxml

@@ -0,0 +1,55 @@
+<form bindsubmit="saveIdCard" report-submit='true'>
+  <view class="add-idCard">
+    <view class="add-form">
+      <image class="idcard-img" src="/static/images/face_know.png"></image>
+      <view class='id-card-title'>当前业务需要人脸识别验证</view>
+      <view class='id-card-txt'>信息将与当前微信绑定(身份证信息用于用与身份验证,以及跨境商品入境申报,请输入购买者姓名和身份证号码一致的身份证信息确保正常清关;姓名需要与身份证信息一致。)</view>
+      <view class="form-item">
+        <label>证件类型</label>
+        <!-- <input class="input" name='idNo' value="居民身份证"/> -->
+        <picker style="flex:1" bindchange="bindPickerChange" value="{{index}}" range="{{array}}">
+          <view class="picker">
+            居民身份证
+          </view>
+        </picker>
+      </view>
+      <view class="form-item">
+        <label>姓名</label>
+        <input type="text" class="input" name='username' value="{{curUser.username}}" placeholder="请输入姓名" />
+      </view>
+      <view class="form-item">
+        <label>身份证号</label>
+        <input type="idcard" class="input" name='idNo' placeholder="请输入身份证号" value="{{idNoM}}"/>
+        <view bindtap="clearData">
+          <image class="clear-icon" src="/static/images/clear-fb.png"></image>
+        </view>
+      </view>
+      <view class="form-item">
+        <radio-group class="radio-group" bindchange="radioChange">
+          <radio class="radio radio-class {{item.name==2?'radio2-class':''}}" wx:for-items="{{items}}" wx:key="name" value="{{item.name}}" checked="{{item.checked}}">
+            <text>{{item.value}}</text>
+          </radio>
+        </radio-group>
+      </view>
+    </view>
+    <view class='id-card-agree-view'>
+      <checkbox bindtap="checkBoxAgree" value="{{isAgree}}" checked="{{isAgree}}"/>
+      <view class='id-card-txt2'>
+        <text bindtap="checkBoxAgree">我同意****使用我所提交的信息用于人脸识别信息绑定。查看</text>
+        <text style="color:blue;" bindtap="readUserService">《用户服务协议》</text>
+        <text bindtap="checkBoxAgree">及</text>
+        <text style="color:blue;" bindtap="readUserPrivacy">《隐私政策》</text>
+      </view>
+    </view>
+
+    <view class="btns">
+      <button class="save" form-type="submit">开始人脸识别验证</button>
+    </view>
+    
+    <view style="padding-bottom: 100px;margin-top: 43px;">
+      <view class='info-'>本服务由**公司提供技术支持</view>
+      <view class='info-'>****保障您的个人信息安全</view>
+    </view>
+
+  </view>
+</form>

+ 248 - 0
wx-mall/pages/checkoutIdCard/checkoutIdCard.wxss

@@ -0,0 +1,248 @@
+page {
+  height: 100%;
+  background: #f4f4f4;
+}
+.add-idCard {
+  background: #fff;
+}
+
+.add-idCard .add-form {
+  background: #fff;
+  width: 100%;
+  height: auto;
+  overflow: hidden;
+}
+
+.add-idCard .form-item {
+  height: 116rpx;
+  padding-left: 31.25rpx;
+  border-bottom: 1px solid #d9d9d9;
+  display: flex;
+  align-items: center;
+  padding-right: 31.25rpx;
+}
+
+.add-idCard .form-item .location{
+ height: 60rpx;
+ width: 60rpx;
+}
+
+.add-idCard label {
+  width: 160rpx;
+  font-weight: bold;
+}
+
+.add-idCard .input {
+  flex: 1;
+  height: 44rpx;
+  line-height: 44rpx;
+  overflow: hidden;
+}
+
+.add-idCard .form-default {
+  border-bottom: 1px solid #d9d9d9;
+  height: 96rpx;
+  background: #fafafa;
+  padding-top: 28rpx;
+  font-size: 28rpx;
+}
+
+.default-input {
+  margin: 0 auto;
+  display: block;
+  width: 240rpx;
+  height: 40rpx;
+  padding-left: 50rpx;
+  line-height: 40rpx;
+  background: url(http://120.76.26.84:80/group1/M00/00/02/rBJEdVvr3NeAQgp_AAAJkFQSrpc594.png) 1rpx -448rpx no-repeat;
+  background-size: 38rpx 486rpx;
+  font-size: 28rpx;
+}
+
+.default-input.selected {
+  background: url(http://120.76.26.84:80/group1/M00/00/02/rBJEdVvr3NeAQgp_AAAJkFQSrpc594.png) 0 -192rpx no-repeat;
+  background-size: 38rpx 486rpx;
+}
+
+.add-idCard .btns {
+  /* position: fixed;
+  bottom: 0;
+  left: 0; */
+  overflow: hidden;
+  display: flex;
+  height: 100rpx;
+  width: 100%;
+  margin-top: 60rpx;
+}
+
+.add-idCard .cannel, .add-idCard .save {
+  /* flex: 1; */
+  height: 100rpx;
+  text-align: center;
+  line-height: 100rpx;
+  font-size: 28rpx;
+  color: #fff;
+  border: none;
+  border-radius: 0;
+  width: 90vw;
+}
+
+.add-idCard .cannel {
+  background: #333;
+}
+
+.add-idCard .save {
+  background: #b4282d;
+}
+
+.region-select {
+  width: 100%;
+  height: 600rpx;
+  background: #fff;
+  position: fixed;
+  z-index: 10;
+  left: 0;
+  bottom: 0;
+}
+
+.region-select .hd {
+  height: 108rpx;
+  width: 100%;
+  border-bottom: 1px solid #f4f4f4;
+  padding: 46rpx 30rpx 0 30rpx;
+}
+
+.region-select .region-selected {
+  float: left;
+  height: 60rpx;
+  display: flex;
+}
+
+.region-select .region-selected .item {
+  max-width: 140rpx;
+  margin-right: 30rpx;
+  text-align: left;
+  line-height: 60rpx;
+  height: 100%;
+  color: #333;
+  font-size: 28rpx;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+
+.region-select .region-selected .item.disabled {
+  color: #999;
+}
+
+.region-select .region-selected .item.selected {
+  color: #b4282d;
+}
+
+.region-select .done {
+  float: right;
+  height: 60rpx;
+  width: 60rpx;
+  border: none;
+  background: #fff;
+  line-height: 60rpx;
+  text-align: center;
+  color: #333;
+  font-size: 28rpx;
+}
+
+.region-select .done.disabled {
+  color: #999;
+}
+
+.region-select .bd {
+  height: 492rpx;
+  width: 100%;
+  padding: 0 30rpx;
+}
+
+.region-select .region-list {
+  height: auto;
+  overflow: scroll;
+}
+
+.region-select .region-list .item {
+  width: 100%;
+  height: 104rpx;
+  line-height: 104rpx;
+  text-align: left;
+  color: #333;
+  font-size: 28rpx;
+}
+
+.region-select .region-list .item.selected {
+  color: #b4282d;
+}
+
+.bg-mask {
+  height: 100%;
+  width: 100%;
+  background: rgba(0, 0, 0, 0.4);
+  position: fixed;
+  top: 0;
+  left: 0;
+  z-index: 8;
+}
+
+.id-card-txt{
+  font-size:22rpx;
+  margin-left: 20rpx;
+  color: #a5a3a3;
+  text-align: center;
+  margin-bottom: 30rpx;
+  width: 96vw;
+}
+
+.id-card-title{
+  font-size: 40rpx;
+  width: 100vw;
+  margin: 5rpx auto 20rpx auto;
+  color: #555454;
+  text-align: center;
+  font-weight: bold;
+}
+.clear-icon{
+  position: absolute;
+  top:709rpx;
+  right:30rpx;
+  width:32rpx;
+  height:32rpx;
+  z-index:9999;
+}
+.idcard-img{
+  width: 238rpx;
+height: 215rpx;
+margin: 10rpx auto 30rpx auto;
+display: flex;
+}
+.radio-class{
+  width: 43vw;
+  border-right: 1px solid #ccc;
+  font-weight: bold;
+}
+.radio2-class{
+  border-right: 0px solid #ccc;
+  margin-left: 40rpx;
+}
+.id-card-txt2 {
+  font-size: 26rpx;
+  color: #686666;
+  width: 86vw;
+  float: right;
+
+}
+.id-card-agree-view{
+  margin-top: 63rpx;
+  margin-left: 30rpx;
+}
+.info-{
+  margin: 0px auto;
+  text-align: center;
+  color: #ccc;
+  font-weight: bold
+}

+ 2 - 2
wx-mall/pages/index/index.js

@@ -34,7 +34,7 @@ Page({
     // options.scene = 148;
     // options.scene = 93;
     // options.scene = 38;
-    options.scene = 67;
+    // options.scene = 67;
     // options.scene = 28;
     // options.scene = 8;
     if (options.scene) {
@@ -839,4 +839,4 @@ Page({
     });
     that.getGoodsList();
   }
-})
+})

+ 31 - 0
wx-mall/pages/prompt/prompt.js

@@ -0,0 +1,31 @@
+var util = require('../../utils/util.js');
+var api = require('../../config/api.js');
+
+Page({
+  data: {
+    orderId: 0,
+    orderSn: ''
+  },
+  onLoad: function (options) {
+    // 页面初始化 options为页面跳转所带来的参数
+    let that = this;
+    that.setData({
+      orderId: options.id
+    });
+  },
+  onReady: function () {
+    // 页面渲染完成
+  },
+  onShow: function () {
+    // 页面显示
+    this.setData({
+      currentStoreId: wx.getStorageSync('storeId')
+    });
+  },
+  onHide: function () {
+    // 页面隐藏
+  },
+  onUnload: function () {
+    // 页面关闭
+  }
+})

+ 4 - 0
wx-mall/pages/prompt/prompt.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

+ 8 - 0
wx-mall/pages/prompt/prompt.wxml

@@ -0,0 +1,8 @@
+<view class="container">
+  <view class="list-group goods-info">
+  实打实的实打实的
+  </view>
+  <view class="btns" wx:if="{{tabIndex != 5}}">
+    <view class="save" wx:if="{{ handleOption.pay==true && orderInfo.dateformat}}" bindtap="payOrder">去付款 {{orderInfo.dateformat.min}}{{orderInfo.dateformat?':':''}}{{orderInfo.dateformat.sec}}</view>
+  </view>
+</view>

+ 508 - 0
wx-mall/pages/prompt/prompt.wxss

@@ -0,0 +1,508 @@
+page {
+  height: 100%;
+  width: 100%;
+  background: #f4f4f4;
+}
+
+.strong {
+  font-size: 1em !important;
+}
+
+.week {
+  font-size: 0.9em !important;
+}
+
+.orange {
+  color: #d81e06;
+}
+
+.orange2 {
+  height: 40rpx;
+  text-align: center;
+  line-height: 40rpx;
+  font-size: 28rpx;
+  color: #fff;
+  border: none;
+  border-radius: 30rpx;
+  background: #d81e06;
+}
+
+.order-info {
+  margin-top: 20rpx;
+  padding-top: 25rpx;
+  background: #fff;
+  height: auto;
+  overflow: hidden;
+}
+
+.item-a {
+  padding-left: 31.25rpx;
+  height: 42.5rpx;
+  padding-bottom: 12.5rpx;
+  line-height: 24rpx;
+  font-size: 24rpx;
+  color: #666;
+}
+
+.item-b {
+  padding-left: 31.25rpx;
+  height: 29rpx;
+  line-height: 29rpx;
+  margin-top: 12.5rpx;
+  margin-bottom: 41.5rpx;
+  font-size: 24rpx;
+  color: #666;
+}
+
+.item-c {
+  margin-left: 31.25rpx;
+  border-top: 1px solid #f4f4f4;
+  height: 103rpx;
+  line-height: 103rpx;
+}
+
+.item-c .l {
+  float: left;
+}
+
+.item-c .r {
+  height: 103rpx;
+  float: right;
+  display: flex;
+  align-items: center;
+  padding-right: 16rpx;
+}
+
+.item-c .r .btn {
+  float: right;
+}
+
+.item-c .cost {
+  color: #b4282d;
+}
+
+.item-c .btn {
+  border: 1px solid #d81e06;
+  color: #d81e06;
+  border-radius: 30rpx;
+  font-size: 0.8em;
+  display: inline-block;
+  margin-left: 20rpx;
+  line-height: 1.6;
+  padding: 5rpx 15rpx;
+  background-color: #fff;
+}
+
+.goods-info .list-cell-ft {
+  padding-right: 0;
+}
+
+.goods-list {
+  width: 100%;
+}
+
+.goods-list-cell {
+  /* padding: 20rpx 0; *//* padding: 10rpx 10rpx; */
+  padding-right: 0rpx;
+  height:120rpx;
+}
+
+.goods-list-cell text {
+  font-size: 0.9em;
+  color: #9b9b9b;
+}
+
+.goods-list-cell .name {
+  width: 470rpx;
+  font-size: 25rpx;
+  color: #333;
+  display: inline-block;
+  /* overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap; */
+}
+
+.goods-list-cell .price {
+  padding-right: 20rpx;
+  color:black;
+}
+
+.fr {
+  margin-left: auto;
+  width: 50rpx;
+  text-align: right;
+}
+
+.attr {
+  margin-bottom: 17rpx;
+  height: 24rpx;
+  line-height: 24rpx;
+  font-size: 22rpx;
+  color: #666;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+}
+
+.num {
+  padding-right: 20rpx;
+  padding-top: 57rpx;
+}
+
+.order-goods {
+  margin-top: 20rpx;
+  background: #fff;
+}
+
+.order-goods .h {
+  height: 93.75rpx;
+  line-height: 93.75rpx;
+  margin-left: 31.25rpx;
+  border-bottom: 1px solid #f4f4f4;
+  padding-right: 31.25rpx;
+}
+
+.order-goods .h .label {
+  float: left;
+  font-size: 30rpx;
+  color: #333;
+}
+
+.order-goods .h .status {
+  float: right;
+  font-size: 30rpx;
+  color: #b4282d;
+}
+
+.order-goods .item {
+  display: flex;
+  align-items: center;
+  height: 192rpx;
+  margin-left: 31.25rpx;
+  padding-right: 31.25rpx;
+  border-bottom: 1px solid #f4f4f4;
+}
+
+.order-goods .item:last-child {
+  border-bottom: none;
+}
+
+.order-goods .item .img {
+  height: 145.83rpx;
+  width: 145.83rpx;
+  background: #f4f4f4;
+}
+
+.order-goods .item .img image {
+  height: 145.83rpx;
+  width: 145.83rpx;
+}
+
+.order-goods .item .info {
+  flex: 1;
+  height: 145.83rpx;
+  margin-left: 20rpx;
+}
+
+.order-goods .item .t {
+  margin-top: 8rpx;
+  height: 33rpx;
+  line-height: 33rpx;
+  margin-bottom: 10.5rpx;
+}
+
+.order-goods .item .t .name {
+  display: block;
+  float: left;
+  height: 33rpx;
+  line-height: 33rpx;
+  color: #333;
+  font-size: 30rpx;
+}
+
+.order-goods .item .t .number {
+  display: block;
+  float: right;
+  height: 33rpx;
+  text-align: right;
+  line-height: 33rpx;
+  color: #333;
+  font-size: 30rpx;
+}
+
+.order-goods .item .attr {
+  height: 29rpx;
+  line-height: 29rpx;
+  color: #666;
+  margin-bottom: 25rpx;
+  font-size: 25rpx;
+}
+
+.order-goods .item .price {
+  height: 30rpx;
+  line-height: 30rpx;
+  color: #333;
+  font-size: 30rpx;
+}
+
+.order-bottom {
+  margin-top: 20rpx;
+  padding-left: 31.25rpx;
+  height: auto;
+  overflow: hidden;
+  background: #fff;
+}
+
+.order-bottom .address {
+  height: 128rpx;
+  padding-top: 25rpx;
+  border-bottom: 1px solid #f4f4f4;
+}
+
+.order-bottom .address .t {
+  height: 35rpx;
+  line-height: 35rpx;
+  margin-bottom: 7.5rpx;
+}
+
+.order-bottom .address .name {
+  display: inline-block;
+  height: 35rpx;
+  width: 140rpx;
+  line-height: 35rpx;
+  font-size: 25rpx;
+}
+
+.order-bottom .address .mobile {
+  display: inline-block;
+  height: 35rpx;
+  line-height: 35rpx;
+  font-size: 25rpx;
+}
+
+.order-bottom .address .b {
+  height: 35rpx;
+  line-height: 35rpx;
+  font-size: 25rpx;
+}
+
+.order-bottom .total {
+  height: 106rpx;
+  padding-top: 20rpx;
+  border-bottom: 1px solid #f4f4f4;
+}
+
+.order-bottom .total .t {
+  height: 25rpx;
+  line-height: 25rpx;
+  margin-bottom: 7.5rpx;
+  display: flex;
+}
+
+.order-bottom .total .label {
+  width: 140rpx;
+  display: inline-block;
+  height: 35rpx;
+  line-height: 35rpx;
+  font-size: 25rpx;
+}
+
+.order-bottom .total .txt {
+  flex: 1;
+  display: inline-block;
+  height: 35rpx;
+  line-height: 35rpx;
+  font-size: 25rpx;
+}
+
+.order-bottom .pay-fee {
+  height: 81rpx;
+  line-height: 81rpx;
+}
+
+.order-bottom .pay-fee .label {
+  display: inline-block;
+  width: 140rpx;
+  color: #b4282d;
+}
+
+.order-bottom .pay-fee .txt {
+  display: inline-block;
+  width: 140rpx;
+  color: #b4282d;
+}
+
+.order-shipping {
+  margin-top: 20rpx;
+  background: #fff;
+  margin-bottom: 20rpx;
+  height: 1024rpx;
+}
+
+.order-shipping .h {
+  height: 80rpx;
+  line-height: 80rpx;
+  margin-left: 31.25rpx;
+  border-bottom: 1px solid #f4f4f4;
+  padding-right: 31.25rpx;
+}
+
+.order-shipping .h .label {
+  float: left;
+  font-size: 27rpx;
+  color: #333;
+}
+
+.order-shipping .shipping {
+  background: #fff;
+}
+
+.order-shipping .shipping .item {
+  display: flex;
+  float: left;
+  margin-left: 31.25rpx;
+  padding-right: 31.25rpx;
+  height: auto;
+  border-bottom: 1px solid #f4f4f4;
+}
+
+.order-shipping .shipping .item   li {
+  display: block;
+}
+
+.icon {
+  width: 35rpx;
+  height: 35rpx;
+  /* margin-left: 15rpx;
+  margin-top: 20rpx; */
+  margin-bottom: -8rpx;
+}
+
+.item-b2 {
+  padding-left: 31.25rpx;
+  height: 29rpx;
+  line-height: 29rpx;
+  margin-top: 22.5rpx;
+  margin-bottom: 41.5rpx;
+  font-size: 24rpx;
+  color: #666;
+  margin-left: 38rpx;
+}
+
+.icon2 {
+  width: 30rpx;
+  height: 30rpx;
+  /* margin-left: 15rpx;
+  margin-top: 20rpx; */
+  margin-bottom: -5rpx;
+}
+
+.strong2 {
+  font-size: 0.95em !important;
+  color: white;
+}
+
+.list-cell-bd2 {
+  flex: 1;
+  margin-top: -15px;
+  color: white;
+}
+
+.order-info2 {
+  padding-top: 20rpx;
+  background: rgb(126, 125, 125);
+  height: auto;
+  overflow: hidden;
+  color: white;
+  font-weight: bold;
+}
+
+.week2 {
+  font-size: 0.9em !important;
+  color: white;
+}
+
+.week3 {
+  font-size: 0.9em !important;
+  color: white;
+  margin-left: 40rpx;
+}
+
+.week4 {
+  font-size: 0.8em !important;
+  color: white;
+  margin-left: 40rpx;
+}
+
+.btns {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  overflow: hidden;
+  display: flex;
+  height: 70rpx;
+  width: 100%;
+}
+
+.btns .cannel {
+  flex: 1;
+  height: 70rpx;
+  text-align: center;
+  line-height: 70rpx;
+  font-size: 28rpx;
+  color: rgb(20, 20, 20);
+  border: none;
+  border-radius: 0;
+  background: rgb(255, 253, 253);
+}
+
+.btns .save {
+  flex: 1;
+  height: 70rpx;
+  text-align: center;
+  line-height: 70rpx;
+  font-size: 28rpx;
+  color: #fff;
+  border: none;
+  border-radius: 0;
+  background: #b4282d;
+}
+
+.refund {
+  height: 40rpx;
+  text-align: center;
+  line-height: 40rpx;
+  font-size: 24rpx;
+  color: #fff;
+  border: none;
+  border-radius: 30rpx;
+  background: #d81e06;
+  display: block;
+  width: 130rpx;
+}
+
+.list-group2 {
+  margin-top: 0.6em;
+  background-color: #fff;
+  line-height: 1.41176471;
+  font-size: 28rpx;
+  overflow: hidden;
+  position: relative;
+  padding-bottom: 89rpx;
+}
+
+.order-image {
+  width: 100rpx;
+  height: 100rpx;
+}
+
+.name {
+  height: 40rpx;
+}
+.camps{
+  color:#fff;
+  background: #d81e06;
+  border-radius: 8rpx;
+  font-size: 20rpx;
+  float:left;
+}

+ 244 - 0
wx-mall/pages/ucenter/crossBoundaryQuotaQuery/crossBoundaryQuotaQuery.js

@@ -0,0 +1,244 @@
+var util = require('../../../utils/util.js');
+var api = require('../../../config/api.js');
+var app = getApp()
+Page({
+  data: {
+    userInfo: {},
+    curUser: {},
+    idNoM: '',
+    idNo: '',
+    currentIdNo: '',
+    userName: '',
+    listData: [],
+    idCardIsNull: null,
+    startTime: '',
+    endTime: '',
+    isQuery: null
+  },
+  onLoad: function (options) {
+    // 页面初始化 options为页面跳转所带来的参数
+    let that = this;
+    var timestamp = Date.parse(new Date());
+    var date = new Date(timestamp);
+    //获取年份  
+    var Y = date.getFullYear();
+    //获取月份  
+    var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1);
+    //获取当日日期 
+    var D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
+    console.log("当前时间:" + Y + '年' + M + '月' + D + '日'); 
+    that.setData({
+      startTime: Y+'年1月1日00:00',
+      endTime: Y + '年' + M + '月' + (D-1) + '日24:00'
+    });
+  },
+  onReady: function () {
+
+  },
+  onShow: function () {
+    let that = this;
+    let userInfo = wx.getStorageSync('userInfo');
+    let token = wx.getStorageSync('token');
+
+    // 页面显示
+    if (userInfo && token) {
+      app.globalData.userInfo = userInfo;
+      app.globalData.token = token;
+
+      this.setData({
+        userInfo: app.globalData.userInfo,
+      });
+      util.request(api.getCurUser, {
+        userInfo: app.globalData.userInfo
+      }, 'POST').then(function (res) {
+        if (res.errno === 0) {
+          that.setData({
+            curUser: res.data
+          });
+          if (res.data.idNo) {
+            that.setData({
+              idNoM: that.formatidcard(res.data.idNo),
+              idNo: res.data.idNo,
+              currentIdNo: res.data.idNo,
+              userName: res.data.username
+            });
+          } else {
+            that.setData({
+              idCardIsNull: 'true'
+            });
+          }
+        }
+      });
+    } else {
+      wx.navigateTo({
+        url: '/pages/ucenter/userLogin/userLogin'
+      })
+    }
+
+  },
+  onHide: function () {
+    // 页面隐藏
+
+  },
+  onUnload: function () {
+    // 页面关闭
+  },
+  saveIdCard: function (e) {
+    this.setData({
+      isQuery: true
+    });
+    wx.showLoading({
+      title: '加载中...',
+    })
+    let that = this;
+    if (!e.detail.value.idNo) {
+      wx.showToast({
+        title: '身份证号不能为空',
+        icon: 'none'
+      });
+      return false;
+    }
+
+    if (!e.detail.value.username) {
+      wx.showToast({
+        title: '姓名不能为空',
+        icon: 'none'
+      });
+      return false;
+    }
+    if (that.data.idNoM != that.formatidcard(e.detail.value.idNo)) {
+      that.setData({
+        idNo: e.detail.value.idNo
+      });
+    } else {
+      that.setData({
+        idNo: that.data.currentIdNo
+      });
+    }
+    that.setData({
+      userName: e.detail.value.username
+    });
+
+    if (!that.checkIdcard(that.data.idNo)) {
+      wx.showToast({
+        title: '请输入正确的身份证号',
+        icon: 'none'
+      });
+      return false;
+    }
+    util.request(api.GetCrossBoundaryQuotaQuery, {
+      idCard: that.data.idNo,
+      name: that.data.userName,
+      merchId: wx.getStorageSync('merchSn'),
+      storeId: wx.getStorageSync('storeId')
+    }, 'POST').then(function (res) {
+      if (res.errno != undefined) {
+        if (res.errno === 0) {
+          wx.hideLoading();
+          that.setData({
+            listData: [
+              { "totalAmount": res.data.totalAmount, "innerbalance": res.data.innerbalance }
+            ],
+            isQuery: false
+          });
+        } else {
+          wx.showToast({
+            title: res.errmsg,
+            icon: 'none'
+          });
+          that.setData({
+            isQuery: false
+          });
+        }
+      } else {
+        if (res.code != 0) {
+          wx.showToast({
+            title: res.msg,
+            icon: 'none'
+          });
+          that.setData({
+            isQuery: false
+          });
+        }
+      }
+    });
+  },
+  clearData: function () {
+    let that = this;
+    that.setData({
+      idNoM: ''
+    });
+  },
+  formatidcard(idcard) {
+    if (idcard.length == 15) {
+      return idcard.replace(/(\d{3})\d{10}(\d{1})/, "$1**********$2");
+    } else {
+      return idcard.replace(/(\d{3})\d{13}(\d{1})/, "$1*************$2");
+    }
+  },
+  // 校验身份证号
+  //校验码校验
+  checkCode: function (val) {
+    var p = /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
+    var factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
+    var parity = [1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2];
+    var code = val.substring(17);
+    if (p.test(val)) {
+      var sum = 0;
+      for (var i = 0; i < 17; i++) {
+        sum += val[i] * factor[i];
+      }
+      if (parity[sum % 11] == code.toUpperCase()) {
+        return true;
+      }
+    }
+    return false;
+  },
+  //省份校验
+  checkProv: function (val) {
+    var pattern = /^[1-9][0-9]/;
+    var provs = { 11: "北京", 12: "天津", 13: "河北", 14: "山西", 15: "内蒙古", 21: "辽宁", 22: "吉林", 23: "黑龙江 ", 31: "上海", 32: "江苏", 33: "浙江", 34: "安徽", 35: "福建", 36: "江西", 37: "山东", 41: "河南", 42: "湖北 ", 43: "湖南", 44: "广东", 45: "广西", 46: "海南", 50: "重庆", 51: "四川", 52: "贵州", 53: "云南", 54: "西藏 ", 61: "陕西", 62: "甘肃", 63: "青海", 64: "宁夏", 65: "新疆", 71: "台湾", 81: "香港", 82: "澳门" };
+    if (pattern.test(val)) {
+      if (provs[val]) {
+        return true;
+      }
+    }
+    return false;
+  },
+  //出生日期码校验
+  checkDate: function (val) {
+    var pattern = /^(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)$/;
+    if (pattern.test(val)) {
+      var year = val.substring(0, 4);
+      var month = val.substring(4, 6);
+      var date = val.substring(6, 8);
+      var date2 = new Date(year + "-" + month + "-" + date);
+      if (date2 && date2.getMonth() == (parseInt(month) - 1)) {
+        return true;
+      }
+    }
+    return false;
+  },
+  checkIdcard: function (val) {
+    if (this.checkCode(val)) {
+      var date = val.substring(6, 14);
+      if (this.checkDate(date)) {
+        if (this.checkProv(val.substring(0, 2))) {
+          return true;
+        }
+      }
+    }
+    // this.isError("请输入正确身份证号");
+    return false;
+  },
+  // 通过身份证号获取出生日期和性别
+  getBirthAndSex: function (idCard) {
+    var that = this;
+    var info = {};
+    var birth = (idCard.length === 18) ? idCard.slice(6, 14) : idCard.slice(6, 12);
+    var order = (idCard.length === 18) ? idCard.slice(-2, -1) : idCard.slice(-1);
+    info.birthDay = (idCard.length === 18) ? ([birth.slice(0, 4), birth.slice(4, 6), birth.slice(-2)]).join('-') : (['19' + birth.slice(0, 2), birth.slice(2, 4), birth.slice(-2)]).join('-');
+    info.sex = (order % 2 === 0 ? 2 : 0);
+    return info;
+  }
+})

+ 3 - 0
wx-mall/pages/ucenter/crossBoundaryQuotaQuery/crossBoundaryQuotaQuery.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "跨境额度查询"
+}

+ 41 - 0
wx-mall/pages/ucenter/crossBoundaryQuotaQuery/crossBoundaryQuotaQuery.wxml

@@ -0,0 +1,41 @@
+<form bindsubmit="saveIdCard" report-submit='true'>
+  <view class="add-idCard">
+    <view class="add-form">
+      <text class='id-card-txt'>此处身份证信息用于查询跨境额度信息;身份证号、姓名需要与身份证信息一致。</text>
+      <view class='id-card-txt' style="color:red" wx:if="{{idCardIsNull=='true'}}">用户未绑定身份证信息,请先绑定身份证信息后再进行查询</view>
+      <view class="form-item">
+        <label>身份证号:</label>
+        <input class="input" name='idNo' placeholder="身份证" value="{{idNoM}}" disabled="disabled"/>
+        <!-- <view bindtap="clearData">
+          <image class="clear-icon" src="/static/images/clear-fb.png"></image>
+        </view> -->
+      </view>
+      <view class="form-item">
+        <label>姓名:</label>
+        <input class="input" name='username' value="{{curUser.username}}" placeholder="姓名"  disabled="disabled"/>
+      </view>
+    </view>
+
+    <view class="line-query">
+      <view class="line-query-label">自{{startTime}}起,至{{endTime}},您的个人额度如下:</view>
+
+      <view class="table">
+        <view class="tr bg-w">
+          <view class="th">本年已用金额</view>
+          <view class="th" style="border-right: 0px solid">本年可用金额</view>
+        </view>
+        <block wx:for="{{listData}}" wx:key="{{code}}">
+          <view class="tr bg-g">
+            <view class="td">{{item.totalAmount}}</view>
+            <view class="td">{{item.innerbalance}}</view>
+          </view>
+        </block>
+      </view>
+    </view>
+
+    <view class="btns">
+      <button class=" {{isQuery?'save-disab':'save'}}" disabled="{{isQuery}}" form-type="submit">查询额度</button>
+    </view>
+
+  </view>
+</form>

+ 252 - 0
wx-mall/pages/ucenter/crossBoundaryQuotaQuery/crossBoundaryQuotaQuery.wxss

@@ -0,0 +1,252 @@
+page {
+  height: 100%;
+  background: #f4f4f4;
+}
+
+.add-idCard .add-form {
+  background: #fff;
+  width: 100%;
+  height: auto;
+  overflow: hidden;
+}
+
+.add-idCard .form-item {
+  height: 116rpx;
+  padding-left: 31.25rpx;
+  border-bottom: 1px solid #d9d9d9;
+  display: flex;
+  align-items: center;
+  padding-right: 31.25rpx;
+}
+
+.add-idCard .form-item .location{
+ height: 60rpx;
+ width: 60rpx;
+}
+
+.add-idCard label {
+  width: 160rpx;
+  font-weight: bold;
+}
+
+.add-idCard .input {
+  flex: 1;
+  height: 44rpx;
+  line-height: 44rpx;
+  overflow: hidden;
+}
+
+.add-idCard .form-default {
+  border-bottom: 1px solid #d9d9d9;
+  height: 96rpx;
+  background: #fafafa;
+  padding-top: 28rpx;
+  font-size: 28rpx;
+}
+
+.default-input {
+  margin: 0 auto;
+  display: block;
+  width: 240rpx;
+  height: 40rpx;
+  padding-left: 50rpx;
+  line-height: 40rpx;
+  background: url(http://120.76.26.84:80/group1/M00/00/02/rBJEdVvr3NeAQgp_AAAJkFQSrpc594.png) 1rpx -448rpx no-repeat;
+  background-size: 38rpx 486rpx;
+  font-size: 28rpx;
+}
+
+.default-input.selected {
+  background: url(http://120.76.26.84:80/group1/M00/00/02/rBJEdVvr3NeAQgp_AAAJkFQSrpc594.png) 0 -192rpx no-repeat;
+  background-size: 38rpx 486rpx;
+}
+
+.add-idCard .btns {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  overflow: hidden;
+  display: flex;
+  height: 100rpx;
+  width: 100%;
+}
+
+.add-idCard .cannel, .add-idCard .save {
+  flex: 1;
+  height: 100rpx;
+  text-align: center;
+  line-height: 100rpx;
+  font-size: 28rpx;
+  color: #fff;
+  border: none;
+  border-radius: 0;
+  background: #b4282d;
+}
+
+.add-idCard .cannel, .add-idCard .save-disab {
+  flex: 1;
+  height: 100rpx;
+  text-align: center;
+  line-height: 100rpx;
+  font-size: 28rpx;
+  color: #fff;
+  border: none;
+  border-radius: 0;
+  background: #7c7b7b;
+}
+
+.add-idCard .cannel {
+  background: #333;
+}
+
+.region-select {
+  width: 100%;
+  height: 600rpx;
+  background: #fff;
+  position: fixed;
+  z-index: 10;
+  left: 0;
+  bottom: 0;
+}
+
+.region-select .hd {
+  height: 108rpx;
+  width: 100%;
+  border-bottom: 1px solid #f4f4f4;
+  padding: 46rpx 30rpx 0 30rpx;
+}
+
+.region-select .region-selected {
+  float: left;
+  height: 60rpx;
+  display: flex;
+}
+
+.region-select .region-selected .item {
+  max-width: 140rpx;
+  margin-right: 30rpx;
+  text-align: left;
+  line-height: 60rpx;
+  height: 100%;
+  color: #333;
+  font-size: 28rpx;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+
+.region-select .region-selected .item.disabled {
+  color: #999;
+}
+
+.region-select .region-selected .item.selected {
+  color: #b4282d;
+}
+
+.region-select .done {
+  float: right;
+  height: 60rpx;
+  width: 60rpx;
+  border: none;
+  background: #fff;
+  line-height: 60rpx;
+  text-align: center;
+  color: #333;
+  font-size: 28rpx;
+}
+
+.region-select .done.disabled {
+  color: #999;
+}
+
+.region-select .bd {
+  height: 492rpx;
+  width: 100%;
+  padding: 0 30rpx;
+}
+
+.region-select .region-list {
+  height: auto;
+  overflow: scroll;
+}
+
+.region-select .region-list .item {
+  width: 100%;
+  height: 104rpx;
+  line-height: 104rpx;
+  text-align: left;
+  color: #333;
+  font-size: 28rpx;
+}
+
+.region-select .region-list .item.selected {
+  color: #b4282d;
+}
+
+.bg-mask {
+  height: 100%;
+  width: 100%;
+  background: rgba(0, 0, 0, 0.4);
+  position: fixed;
+  top: 0;
+  left: 0;
+  z-index: 8;
+}
+
+.id-card-txt{
+  font-size:22rpx;
+  margin-left: 20rpx;
+  color: #a5a3a3;
+}
+
+.clear-icon{
+  position: absolute;
+  top:110rpx;
+  right:30rpx;
+  width:32rpx;
+  height:32rpx;
+  z-index:9999;
+}
+.line-query{
+  margin-top: 70rpx;
+}
+.line-query-label{
+  margin-left: 30rpx;
+  width: 93vw;
+  margin: 0px auto;
+  font-weight: bolder;
+}
+.table {
+  border: 0px solid darkgray;
+  /* margin-top: 70rpx; */
+  width: 96vw;
+  margin: 70rpx auto 0px auto;
+}
+.tr {
+  display: flex;
+  width: 100%;
+  justify-content: center;
+  height: 3rem;
+  align-items: center;
+}
+.td {
+    width:40%;
+    justify-content: center;
+    text-align: center;
+}
+.bg-w{
+  background: #3366FF;
+}
+.bg-g{
+  background: #E6F3F9;
+}
+.th {
+  width: 40%;
+  justify-content: center;
+  /* background: #3366FF; */
+  color: #fff;
+  display: flex;
+  height: 3rem;
+  align-items: center;
+  border-right: 6px solid #f4f4f4;
+}

+ 12 - 4
wx-mall/pages/ucenter/index/index.js

@@ -67,6 +67,9 @@ Page({
       // 根据用户信息查询订单信息
       util.request(api.UcenterIndex, {}).then(function (res) {
         if (res.errno === 0) {
+          that.setData({
+            isQueryCrossQuotal: res.data.countMap.isQueryCrossQuotal
+          });
           if (res.data.countMap.orders > 0) {
             that.setData({
               unPayNum: res.data.countMap.unPayNum,
@@ -270,13 +273,18 @@ Page({
     }
   },
   crossBoundaryQuotaQuery() {
+    let that = this;
     let userInfo = wx.getStorageSync('userInfo');
     let token = wx.getStorageSync('token');
     if (userInfo && token) {
-      console.log('点击')
-      wx.navigateTo({
-        url: '/pages/ucenter/crossBoundaryQuotaQuery/crossBoundaryQuotaQuery'
-      })
+      if(that.data.curUser.idNo){
+        wx.navigateTo({
+          url: '/pages/ucenter/crossBoundaryQuotaQuery/crossBoundaryQuotaQuery'
+        })
+      }else{
+        util.showErrorToast('请先实名认证');
+        return false;
+      }
     } else {
       util.showErrorToast('请先登录');
       return false;

+ 1 - 1
wx-mall/pages/ucenter/index/index.wxml

@@ -81,7 +81,7 @@
       <!-- </navigator> -->
     </view>
     
-    <view class="item" bindtap='crossBoundaryQuotaQuery' wx:if="{{isQueryCrossQuotal==1&&curUser.idNo&&userInfo.nickName!='点击头像登录'}}">
+    <view class="item" bindtap='crossBoundaryQuotaQuery' wx:if="{{isQueryCrossQuotal==1&&userInfo.nickName!='点击头像登录'}}">
       <!-- <navigator url="/pages/ucenter/idCard/idCard" class="a"> -->
       <view class="a">
         <image src="../../../static/images/edcx.png" class="icon"></image>

+ 452 - 0
wx-mall/pages/ucenter/userLogin/userLogin.js

@@ -0,0 +1,452 @@
+var api = require('../../../config/api.js');
+var util = require('../../../utils/util.js');
+var app = getApp();
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    phone: '',
+    smscode: '',
+    second: '发送验证码',
+    disabled: false,
+    disabledUpdate: false,
+    paramView: '',
+    navUrl: '',
+    isRegist: true
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    var that = this;
+    if(options.view){
+      that.setData({
+        paramView: options.view
+      });
+    }
+    console.log(that.data.paramView)
+    if (wx.getStorageSync("navUrl")) {
+      that.setData({
+        navUrl: wx.getStorageSync("navUrl")
+      })
+    } else {
+      that.setData({
+        navUrl: '/pages/index/index'
+      })
+    }
+  },
+  /**
+   * 页面渲染完成
+   */
+  onReady: function () {
+
+  },
+  /**
+   * 页面显示
+   */
+  onShow: function () {
+
+  },
+  /**
+   * 页面隐藏
+   */
+  onHide: function () {
+  },
+  /**
+   * 页面关闭
+   */
+  onUnload: function () {
+    console.log('登陆页面返回2,进入登陆页参数:' + this.data.paramView)
+    wx.setStorageSync('isRefusedLogin', 'true');//拒绝授权
+    if (this.data.paramView == 'hotGoods' || this.data.paramView == 'indexGoods' || this.data.paramView == 'cart') {
+      wx.setStorageSync("isLocationIndex", "true");//购物车是否已跳转登录页,跳转成功设置为true已跳转
+      wx.switchTab({
+        url: '/pages/index/index'
+      });
+    }
+    if (this.data.paramView == 'cateGoods') {
+      wx.switchTab({
+        url: '/pages/catalog/catalog'
+      });
+    }
+    if (this.data.paramView == 'hotGoodsView') {
+      wx.navigateBack({
+        delta: 1
+      })
+    }
+  },
+
+  clearPhone() {
+    this.setData({
+      phone: ''
+    });
+  },
+  clearCode() {
+    this.setData({
+      smscode: ''
+    });
+  },
+  bindPhoneInput: function (e) {
+    console.log(e.detail.value)
+    this.setData({
+      phone: e.detail.value
+    });
+  },
+  bindSmscodeInput: function (e) {
+    this.setData({
+      smscode: e.detail.value
+    });
+  },
+  /**
+  * 用户登录,获取授权用户信息,查询授权用户openid是否与登录用户手机号绑定一致,
+  * 不一致的提示是否更新手机绑定信息,一致则登录成功
+  */
+  loginUser: function () {
+    let regular = /^1[3|4|5|7|8]\d{9}$/;
+    if (!regular.test(this.data.phone)) {
+      util.showErrorToast('手机格式不正确')
+      return false;
+    }
+    if (this.data.smscode.length == 0) {
+      util.showErrorToast('验证码不能为空')
+      return false;
+    }
+    var that = this;
+    wx.login({
+      success: function (res) {
+        if (res.code) {
+          wx.getUserInfo({
+            withCredentials: true,
+            success: function (succRes) {
+              util.request(api.getOpenId, {
+                code: res.code
+              }).then((openIdRes) => {
+                if (openIdRes.errno === 0){
+                  //授权成功登录用户信息
+                  util.request(api.userLogin, {
+                    smscode: that.data.smscode,
+                    phone: that.data.phone,
+                    storeId: wx.getStorageSync('storeId'),
+                    merchSn: wx.getStorageSync('merchSn'),
+                    userInfo: succRes,
+                    openId: openIdRes.data
+                  }, 'POST').then(function (userLoginRes) {
+                    if (userLoginRes.errno === 0) {
+                      //存储用户信息
+                      that.setLoginUserInfo(userLoginRes);
+                      console.log("登录成功");
+                      util.showSuccessToast('登录成功');
+                    }else if (userLoginRes.errno === 2) {//openid的绑定的手机号与当前用户登录的手机号不一致
+                      wx.showModal({
+                        title: '提示',
+                        content: userLoginRes.errmsg,
+                        success: function (conRes) {
+                          if (conRes.confirm) {
+                            util.request(api.userLoginMobileUpdate, {
+                              phone: that.data.phone,
+                              openId: openIdRes.data,
+                              storeId: wx.getStorageSync('storeId'),
+                              merchSn: wx.getStorageSync('merchSn'),
+                              userInfo: succRes,
+                            }, 'POST').then(function (loginMobUpdRes) {
+                              if (loginMobUpdRes.errno === 0) {
+                                //存储用户信息
+                                that.setLoginUserInfo(loginMobUpdRes);
+                                console.log("登录成功");
+                                util.showSuccessToast('登录成功');
+                              } else {
+                                util.showErrorToast(loginMobUpdRes.errmsg);
+                              }
+                            })
+                          } else {
+                            console.log('弹框后点取消')
+                          }
+                        }
+                      })
+                    } else {
+                      if (userLoginRes.errmsg.length>8){
+                        wx.showModal({
+                          title: '提示',
+                          content: userLoginRes.errmsg,
+                          showCancel: false
+                        })
+                      } else {
+                        util.showErrorToast(userLoginRes.errmsg);
+                      }
+                    }
+                  });
+                }
+              });
+              
+            },
+            fail: function (err) {
+              wx.setStorageSync('isRefusedLogin', 'true');//拒绝授权
+              // wx.switchTab({
+              //   url: '/pages/index/index'
+              // });
+              console.log("登录页重新认证");
+            }
+          });
+        } else {
+          console.log("failed");
+        }
+      },
+      fail: function (err) {
+        console.log("failed");
+      }
+    });
+  },
+  /**
+   * 存储用户信息
+   */
+  setLoginUserInfo: function (loginMobUpdRes){
+    var that = this;
+    wx.setStorageSync('userInfo', loginMobUpdRes.data.userInfo);
+    wx.setStorageSync('token', loginMobUpdRes.data.token);
+    wx.setStorageSync('userId', loginMobUpdRes.data.userId);
+
+    if (that.data.paramView == 'goodsView') {
+      wx.navigateBack({
+        delta: 1
+      });
+    } else {
+      if (that.data.navUrl && that.data.navUrl == '/pages/index/index') {
+        console.log(that.data.navUrl)
+        wx.switchTab({
+          url: that.data.navUrl,
+        });
+      } else if (that.data.navUrl) {
+        wx.redirectTo({
+          url: that.data.navUrl,
+        });
+      }
+    }
+
+    wx.setStorageSync('isRefusedLogin', 'false');//允许授权
+  },
+  /**
+   * 发送短信
+   */
+  smscode: function () {
+    var that = this;
+
+    let regular = /^1[3|4|5|7|8]\d{9}$/;
+    if (!regular.test(that.data.phone)) {
+      util.showErrorToast('手机格式不正确')
+      return false;
+    }
+    util.request(api.smscodeSend, {
+      phone: that.data.phone
+    }, 'POST').then(function (res) {
+      let n = 59;
+      var timer = setInterval(function () {
+        if (n == 0) {
+          clearInterval(timer);
+          that.setData({
+            second: '发送验证码',
+            disabled: false
+          });
+        } else {
+          that.setData({
+            second: n-- + 's后重新获取',
+            disabled: true
+          });
+        }
+      }, 1000);
+      if (res.errno == 0) {
+        wx.showToast({
+          title: '短信发送成功'
+        })
+      } else {
+        util.showErrorToast('发送失败');
+        clearInterval(timer);
+        that.setData({
+          second: '发送验证码',
+          disabled: false
+        });
+        return false;
+      }
+    });
+  },
+  backHome: function () {
+    wx.reLaunch({
+      url: '../index/index',
+    })
+  },
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+  // /**
+  //  * 用户点击右上角分享
+  //  */
+  // onShareAppMessage: function () {
+
+  // },
+  bindCancelLogin: function () {
+    wx.setStorageSync('isRefusedLogin', 'true');//拒绝授权
+    wx.switchTab({
+      url: '/pages/index/index'
+    });
+  },
+  /**
+   * 登录页直接触发微信授权,授权成功保存用户信息
+   */
+  bindGetUserInfo: function () {
+    let that = this;
+    
+    wx.login({
+      success: function (res) {
+        if (res.code) {
+          wx.getUserInfo({
+            withCredentials: true,
+            success: function (succRes) {
+              //保存授权用户信息
+              wx.request({
+                url: api.AuthLoginByWeixin,
+                data: {
+                  code: res.code, userInfo: succRes, storeId: wx.getStorageSync('storeId'), merchSn: wx.getStorageSync('merchSn')
+                },
+                method: 'POST',
+                header: {
+                  'Content-Type': 'application/json'
+                },
+                success: function (wxRes) {
+                  if (wxRes.data.errno === 0) {
+                    //存储用户信息到缓存
+                    wx.setStorageSync('userInfo', wxRes.data.data.userInfo);
+                    wx.setStorageSync('token', wxRes.data.data.token);
+                    wx.setStorageSync('userId', wxRes.data.data.userId);
+
+                    if (that.data.paramView == 'goodsView') {
+                      wx.navigateBack({
+                        delta: 1
+                      });
+                    } else {
+                      if (that.data.navUrl && that.data.navUrl == '/pages/index/index') {
+                        console.log(that.data.navUrl)
+                        wx.switchTab({
+                          url: that.data.navUrl,
+                        });
+                      } else if (that.data.navUrl) {
+                        wx.redirectTo({
+                          url: that.data.navUrl,
+                        });
+                      }
+                    }
+
+                    wx.setStorageSync('isRefusedLogin', 'false');//允许授权
+                    // console.log("登录成功");
+                  }
+                },
+                fail: function (err) {
+                  console.log("failed");
+                }
+              });
+            },
+            fail: function (err) {
+              wx.setStorageSync('isRefusedLogin', 'true');//拒绝授权
+              // wx.switchTab({
+              //   url: '/pages/index/index'
+              // });
+              console.log("登录页重新认证");
+            }
+          });
+        } else {
+          console.log("failed");
+        }
+      },
+      fail: function (err) {
+        console.log("failed");
+      }
+    });
+
+  },
+  /*registUser: function () {
+    var that = this;
+    let regular = /^1[3|4|5|7|8]\d{9}$/;
+    if (!regular.test(that.data.phone)) {
+      util.showErrorToast('手机格式不正确')
+      return false;
+    }
+    if (that.data.smscode.length == 0) {
+      util.showErrorToast('验证码不能为空')
+      return false;
+    }
+    wx.login({
+      success: function (res) {
+        if (res.code) {
+          wx.getUserInfo({
+            withCredentials: true,
+            success: function (succRes) {
+              util.request(api.getOpenId, {
+                code: res.code
+              }).then((openIdRes) => {
+                if (openIdRes.errno === 0) {
+                  that.registUserUtil();
+                }
+              });
+            },
+            fail: function (err) {
+              wx.setStorageSync('isRefusedLogin', 'true');//拒绝授权
+              console.log("注册前进行授权重新认证");
+            }
+          });
+        } else {
+          console.log("faild");
+        }
+      },
+      fail: function (err) {
+        console.log("failed");
+      }
+    })
+  },
+  registUserUtil: function () {
+    var that = this;
+    util.request(api.registUser, {
+      smscode: that.data.smscode,
+      phone: that.data.phone
+    }, 'POST').then(function (res) {
+      if (res.errno === 0) {
+        //存储用户信息
+        wx.setStorageSync('userInfo', res.data.data.userInfo);
+        wx.setStorageSync('token', res.data.data.token);
+        wx.setStorageSync('userId', res.data.data.userId);
+
+        if (that.data.navUrl && that.data.navUrl == '/pages/index/index') {
+          wx.switchTab({
+            url: that.data.navUrl,
+          });
+        } else if (that.data.navUrl) {
+          wx.redirectTo({
+            url: that.data.navUrl,
+          });
+        }
+
+        wx.setStorageSync('isRefusedLogin', 'false');//允许授权
+        // console.log("登录成功");
+      } else {
+        util.showErrorToast(res.errmsg);
+      }
+    });
+  },
+  showRegist: function(){
+    var that = this;
+    that.setData({
+      isRegist: false
+    });
+    wx.setNavigationBarTitle({
+      title: '注册'
+    })
+  }*/
+})

+ 4 - 0
wx-mall/pages/ucenter/userLogin/userLogin.json

@@ -0,0 +1,4 @@
+{
+  "navigationBarTitleText": "用户登录",
+  "component": true
+}

+ 59 - 0
wx-mall/pages/ucenter/userLogin/userLogin.wxml

@@ -0,0 +1,59 @@
+<view class="container">
+  <view class="form-box" wx:if="{{isRegist}}">
+    <view class="form-item">
+    <!-- 用于微信支付人手机号联系 -->
+      <input class="phone" value="{{phone}}" disabled="{{disabledUpdate}}"  type="number" maxlength="{{11}}" bindinput="bindPhoneInput" placeholder="手机号" />
+      <image wx:if="{{ phone.length > 0 }}" id="clear-phone" class="clear" src="/static/images/clear_input.png" catchtap="clearPhone"></image>
+    </view>
+    <view class="form-item-code">
+      <view class="form-item code-item">
+        <input class="smscode" disabled="{{disabledUpdate}}" value="{{smscode}}" type="number" bindinput="bindSmscodeInput" placeholder="验证码" />
+        <image class="clear" id="clear-smscode" wx:if="{{ smscode.length > 0 }}" src="/static/images/clear_input.png" catchtap="clearCode"></image>
+      </view>
+      <view class="sms-rr">
+          <button class="btn" disabled="{{disabled}}" catchtap="smscode" >{{second}}</button>
+      </view>
+
+    </view>
+    <view style='width:100%;margin: 0px auto;'>
+      <button  class="login-btn" open-type="getUserInfo" bindtap="loginUser">手机号绑定登录</button>
+      <button class="no-login-btn" bindtap="bindCancelLogin">暂不登录</button>
+    </view>
+  </view>
+
+  <!-- <view class="form-box" wx:if="{{!isRegist}}">
+    <view class="form-item">
+      <input class="phone" value="{{phone}}" disabled="{{disabledUpdate}}"  type="number" maxlength="{{11}}" bindinput="bindPhoneInput" placeholder="手机号" auto-focus/>
+      <image wx:if="{{ phone.length > 0 }}" id="clear-phone" class="clear" src="/static/images/clear_input.png" catchtap="clearPhone"></image>
+    </view>
+    <view class="form-item-code">
+      <view class="form-item code-item">
+        <input class="smscode" disabled="{{disabledUpdate}}" value="{{smscode}}" type="number" bindinput="bindSmscodeInput" placeholder="验证码" />
+        <image class="clear" id="clear-smscode" wx:if="{{ smscode.length > 0 }}" src="/static/images/clear_input.png" catchtap="clearCode"></image>
+      </view>
+      <view class="sms-rr">
+          <button class="btn" disabled="{{disabled}}" catchtap="smscode" >{{second}}</button>
+      </view>
+
+    </view>
+    <view style='width:100%;margin: 0px auto;'>
+      <button class="regist-btn" open-type="getUserInfo" bindtap="registUser">注册</button>
+    </view>
+  </view> -->
+  <!-- <view class='regist' wx:if="{{isRegist}}" bindtap='showRegist'>立即注册</view> -->
+  <view style='margin:80rpx auto 80rpx auto;width:100%;' wx:if="{{isRegist}}">
+    <view class='login-third-div'></view>
+    <view class='login-third'>
+      <view class='login-third-text'>第三方账号登录</view>
+      <view class='login-third-div2'></view>
+    </view>
+    
+    
+    <view class='sq-weixin-view'>
+      <button open-type="getUserInfo" class="sq-weixin" bindgetuserinfo="bindGetUserInfo"></button>
+      <!-- <image class="sq-weixin" src="/static/images/weixin_sq.png">
+      
+      </image> -->
+    </view>
+  </view>
+</view>

+ 184 - 0
wx-mall/pages/ucenter/userLogin/userLogin.wxss

@@ -0,0 +1,184 @@
+page ,.container{
+  width: 750rpx;
+  height: 100%;
+  overflow: hidden;
+  background: #fff;
+}
+
+.form-box{
+  width:90%;
+  height:36%;
+  overflow:hidden;
+  padding:0 80rpx;
+  margin:65px auto 20px auto;
+  box-shadow:3px 1px 10px #ccc;
+  border-radius:19rpx;
+}
+
+.form-item{
+  position: relative;
+  background: #fff;
+  display: flex;
+  flex: 1;
+  align-items: center;
+  border-bottom: 1px solid #d9d9d9;
+  border-radius: 4px;
+  margin-top:55rpx;
+}
+.form-item input{
+  flex: 1;
+}
+.form-item .username, .form-item .password, .form-item .code{
+  position: absolute;
+  top: 26rpx;
+  left: 0;
+  display: block;
+  width: 100%;
+  height: 44rpx;
+  background: #fff;
+  color: #333;
+  font-size: 30rpx;
+}
+
+.form-item-code{
+  margin-top:17rpx;
+  height: auto;
+  overflow: hidden;
+  width: 100%;
+  display: flex;
+  align-items: center;
+}
+
+.form-item-code .form-item{
+  float: left;
+  width: 350rpx;
+}
+
+.form-item-code .sms-r{
+  float: right;
+  margin-top: 4rpx;
+  height: 68rpx;
+  width: 186rpx;
+}
+
+.form-item .clear{
+  display: block;
+  background: #fff;
+  height: 44rpx;
+  width: 44rpx;
+}
+
+.login-btn{
+  margin-top:70rpx;
+  height:72rpx;
+  line-height:72rpx;
+  color:#fff;
+  font-size:28rpx;
+width:48%;
+  background:#1AAD19;
+  border-radius:50rpx;
+  float:left;
+  margin-left: 10rpx;
+}
+
+.no-login-btn{
+  margin-top:70rpx;
+  height:72rpx;
+  line-height:72rpx;
+  color:#fff;
+  font-size:28rpx;
+  width:48%;
+  background:#a09e9e;
+  border-radius:50rpx;
+  float:left;
+  margin-left: 12rpx;
+}
+
+.form-item-text{
+  height: 35rpx;
+  width: 100%;
+}
+
+.form-item-text .register{
+  display: block;
+  height: 34rpx;
+  float: left;
+  font-size: 28rpx;
+  color: #999;
+}
+
+.form-item-text .reset{
+  display: block;
+  height: 34rpx;
+  float: right;
+  font-size: 28rpx;
+  color: #999;
+}
+
+.sms-rr .btn{
+  height: 60rpx;
+  line-height: 60rpx;
+  font-size: 28rpx;
+  margin-top:30rpx;
+}
+.login-third{
+  /* margin: 117rpx auto 60rpx auto; */
+  width:65%;
+  float:left;
+}
+.login-third-text{
+  /* margin: 117rpx auto 60rpx auto; */
+  color: #999;
+  text-align: center;
+  font-size:32rpx;
+  width:50%;
+  float:left;
+}
+.login-third-div{
+  width:170rpx;
+  background:#ccc;
+  height:1px;
+  float:left;
+  margin-top:24rpx;
+  margin-left:84rpx;
+}
+.login-third-div2{
+  width:170rpx;
+  background:#ccc;
+  height:1px;
+  margin-top:24rpx;
+  margin-left:243rpx;
+}
+.sq-weixin-view{
+  width: 150rpx;
+  margin: 0px auto;
+  padding-top:100rpx;
+}
+.sq-weixin-view button{
+  width: 150rpx;
+  height: 150rpx;
+  background:url(http://120.76.26.84:80/group1/M00/00/49/rBJEdV3JDzaAI3ceAAAreqbIuTw477.png) 0 0 no-repeat;
+  background-size:156.803rpx;
+}
+
+.sq-weixin-view button:after{
+  border: none;
+}
+.regist{
+  width:17%;
+  height:60rpx;
+  margin-left:581rpx;
+  color:#b4282d;
+  /* text-align:right; */
+}
+
+.regist-btn{
+  margin-top:70rpx;
+  height:72rpx;
+  line-height:72rpx;
+  color:#fff;
+  font-size:30rpx;
+  width:100%;
+  background:#1AAD19;
+  border-radius:50rpx;
+}

+ 1 - 1
wx-mall/project.config.json

@@ -21,7 +21,7 @@
 		"bundle": true
 	},
 	"compileType": "miniprogram",
-	"libVersion": "2.9.4",
+	"libVersion": "2.10.0",
 	"appid": "wxb6b30b1b14ee502a",
 	"projectname": "wx-mall",
 	"simulatorType": "wechat",