dujingxian 4 år sedan
förälder
incheckning
6fd48c99b7

+ 6 - 5
src/api/index.js

@@ -191,20 +191,21 @@ export const updateKey = (secure_key) => {
 export const updateVoucher = (name) => {
     // return requestLoading(`${Prefix}act=merchant_recharge&op=voucherupload&client_type=ajax`, 'post', {voucher})
     return axios({
-        method: 'post',
+        method: "post",
         url: `http://192.168.1.195/upfile.php`,
+        // url: `https://www.xyzshops.cn/upfile.php`,
         // withCredentials: true,
         data: name,
         timeout: 120000,
     })
 }
-// export const updateVoucher = (voucher) => {
+// export const updateVoucherList = (params) => {
 //     // return requestLoading(`${Prefix}act=merchant_recharge&op=voucherupload&client_type=ajax`, 'post', {voucher})
 //     return axios({
-//         method: 'post',
-//         url: `http://192.168.1.195:8080/index.php&client_type=ajax`,
+//         method: "post",
+//         url: `${Prefix}act=refill_evidence&op=add&client_type=ajax`,
 //         withCredentials: true,
-//         data: voucher,
+//         data: params,
 //         timeout: 120000,
 //     })
 // }

+ 4 - 0
src/pages/index.vue

@@ -73,6 +73,10 @@
                     <i class="el-icon-mobile"></i>
                     <span slot="title">手机卡充值</span>
                 </el-menu-item>
+                <el-menu-item index="interfaceDoc" route="interfaceDoc">
+                    <i class="el-icon-document"></i>
+                    <span slot="title">接口文档</span>
+                </el-menu-item>
             </el-menu>
         </el-aside>
         <el-main class="el-menu">

+ 15 - 0
src/pages/subPages/balance.vue

@@ -475,3 +475,18 @@ export default {
     text-align: center;
 }
 </style>
+<style>
+.el-table td, .el-table th.is-leaf,.el-table--border, .el-table--group{
+  border-color: #ccc; 
+}
+.el-table--border::after, .el-table--group::after, .el-table::before{
+  background-color: #ccc;
+}
+.el-table td, .el-table th.is-leaf {
+  border-bottom: 1px solid #ccc;
+  border-right: 1px solid #ccc;
+}
+.el-table thead {
+  color: #606266;
+}
+</style>

+ 166 - 0
src/pages/subPages/interfaceDoc.vue

@@ -0,0 +1,166 @@
+<template>
+  <div class="interfaceDoc">
+    <el-card>
+      <h3>接 口 规 范</h3>
+      <h4>验签规则:</h4>
+      <p>
+        签名(sign字段)生成方式:将所有参数名按照ASCII自然排序,并拼接成key1=value&key2=value----,末尾加上“&key=密钥”,
+        然后进行MD5生成sign。如果字段值为空,拼接的时候需要去掉,并对各个字段的值做URL编码。
+      </p>
+      <p>验签方式同上</p>
+      <p>提交格式:使用POST提交form表单格式,提交的字段里面不要带key。</p>
+      <p>服务器返回数据:json格式</p>
+      <p>异步回调方式:POST表单请求异步地址</p>
+      <h4>网关地址:</h4>
+      <p>网关地址: https://www.xyzshops.cn/mobile/index.php</p>
+      <h4>可充值商品列表信息:</h4>
+        <pre>
+          描述:获取平台各种类型的充值卡支持的充值面额。
+          请求参数:
+              act: refill 固定填为refill
+              add  固定为goods
+          返回:
+              {
+                "code":200,
+                "message":"成功",
+                "datas":{
+                    "sinopec":[
+                      100,
+                      200,
+                      500,
+                      1000,
+                      2000
+                    ],
+                    "chinamobile":[
+                      50,
+                      100,
+                      200
+                    ],
+                    "chinaunicom":[
+                      50,
+                      100,
+                      200
+                    ],
+                    "chinatelecom":[
+                      50,
+                      100,
+                      200
+                    ]
+                }
+              }
+        </pre>
+      <h4>充值接口:</h4>
+      <pre>
+        充值油卡和话费统一接口。
+        请求参数:
+            act: refill 固定填为refill
+            op: add  固定为add
+            mchid: 组织机构号(商户号)
+            cardno: 卡号
+            amount: 充值金额(固定金额,如100,200,500,1000等,详细请查看后台)
+            order_sn: 商户自己可唯一标记订单的序列号。
+            notifyurl: 异步通知地址
+            card_name:持卡人姓名(中石油需要填写,其余的不需要)
+            idcard: 持卡人身份证(中石油需要填写,其余的不需要)
+            sign: 签名(不参与签名的字段,参考签名方法)
+        返回参数:
+            code:200代表成功,非200代表失败
+            msg:code非200时,返回出错信息.
+      </pre>
+      <h4>充值成功后异步通知:</h4>
+      <pre>
+        充值油卡和话费统一接口。
+        请求异步地址的参数:
+            mchid: 组织机构号(商户号)
+            order_sn: 商户自己可唯一标记订单的序列号。
+            amount: 充值金额(固定金额,如100,200,500,1000等,详细请查看后台)
+            cardno: 卡号
+            trade_no: 平台唯一交易号,和提交的成功时返回对应。
+            card_name:持卡人姓名(中石油需要填写,其余的不需要)
+            idcard: 持卡人身份证(中石油需要填写,其余的不需要)
+            state:SUCCESS表示充值成功,CANCEL表示充值失败订单取消.
+            sign: 签名(不参与签名的字段,参考签名方法)
+        确认接受异步通知返回:
+            直接返回大写:SUCCESS
+            如未返回SUCCESS,则2,4,5,16,32……秒间隔通知,每种时间重复5次,累积通知80次后,取消通知。
+      </pre>
+      <h4>交易查询接口:</h4>
+      <pre>
+        通过商户自己的订单号查询订单状态。
+        请求参数:
+            act: refill 固定填为refill
+            op: query
+            mchid: 组织机构号(商户号)
+            order_sn: 商户订单序列号
+
+        返回参数:
+            code:200代表成功,非200代表失败
+            msg:code非200时,返回出错信息.
+            data: 数组格式,里面包含交易信息。
+        示例:
+            {
+              "code":200,
+              "message":"成功",
+              "datas":{
+                  "mchid":"1",
+                  "trade_no":"230660948104151671",
+                  "order_sn":"13281476",
+                  "card_no":"1000111100020445281",
+                  "card_type":"2",
+                  "refill_amount":"100.00",
+                  "order_amount":"97.80",
+                  "order_time":"1607604106",
+                  "success_time":0,
+                  "order_state":"20"
+              }
+            }
+        其中:
+            card_type:
+                1, PetroChina
+                2, Sinopec
+                4, ChinaMobile
+                5, ChinaUnicom
+                6, ChinaTelecom
+            refill_amount:充值金额
+            order_amount:扣款金额
+            order_time:下单时间
+            success_time:确认是否成功时间,运营商回调时间。
+            order_state:
+                0,订单已经取消,充值失败会取消订单。
+                10,新订单
+                20,已经支付
+                30,正在处理
+                40,充值成功
+      </pre>
+    </el-card>
+
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'interfaceDoc'
+}
+</script>
+
+<style scoped>
+.el-card {
+  padding: 0 5%;
+}
+h3 {
+  text-align: center;
+}
+h4 {
+  line-height: 30px;
+}
+h6 {
+  line-height: 30px;
+}
+p {
+  text-indent: 2em;
+  line-height: 30px;
+}
+pre {
+  line-height: 30px;
+}
+</style>

+ 0 - 15
src/pages/subPages/mobileCard.vue

@@ -281,19 +281,4 @@ export default {
 .cardType  span {
   vertical-align: middle;
 }
-</style>
-<style>
-.el-table td, .el-table th.is-leaf,.el-table--border, .el-table--group{
-  border-color: #ccc; 
-}
-.el-table--border::after, .el-table--group::after, .el-table::before{
-  background-color: #ccc;
-}
-.el-table td, .el-table th.is-leaf {
-  border-bottom: 1px solid #ccc;
-  border-right: 1px solid #ccc;
-}
-.el-table thead {
-  color: #606266;
-}
 </style>

+ 8 - 0
src/router/index.js

@@ -17,6 +17,8 @@ const View = () => import('@/pages/subPages/view');
 const OilCard = () => import('@/pages/subPages/oilCard');
 // 手机卡充值
 const MobileCard = () => import('@/pages/subPages/mobileCard');
+// 接口文档
+const InterfaceDoc = () => import('@/pages/subPages/interfaceDoc');
 
 Vue.use(VueRouter)
 
@@ -74,6 +76,12 @@ Vue.use(VueRouter)
         path:'/mobileCard',
         name:'mobileCard',
         component:MobileCard
+      },
+      // 接口文档
+      {
+        path:'/interfaceDoc',
+        name:'interfaceDoc',
+        component:InterfaceDoc
       }
     ]
   },

+ 5 - 1
src/utils/constants.js

@@ -2,7 +2,11 @@
 export const changeType = [
   {value: 'order_pay', label: '下单减款'},
   {value: 'order_cancel', label: '下单失败返回余款'},
-  {value: 'recharge', label: '余款充值'}
+  {value: 'recharge', label: '余款充值'},
+  {value: 'sys_add_money', label: '管理员调节预存款【增加】'},
+  {value: 'sys_del_money', label: '管理员调节预存款【减少】'},
+  {value: 'sys_freeze_money', label: '管理员调节预存款【冻结】'},
+  {value: 'sys_unfreeze_money', label: '管理员调节预存款【解冻】'},
 ]
 
 // 余额状态