dujingxian il y a 4 ans
Parent
commit
9575a9789e
4 fichiers modifiés avec 51 ajouts et 32 suppressions
  1. 5 5
      src/api/index.js
  2. 17 14
      src/pages/subPages/balance.vue
  3. 3 3
      src/pages/subPages/order.vue
  4. 26 10
      src/pages/subPages/view.vue

+ 5 - 5
src/api/index.js

@@ -28,7 +28,7 @@ axios.interceptors.request.use(
 
 axios.interceptors.response.use(
     res => {
-        // console.log('响应res', res);
+        console.log('响应res', res);
         // loading.close();
         if (res.data.code == 200) {
             return res.data;
@@ -46,7 +46,7 @@ axios.interceptors.response.use(
         }
     },
     err => {
-        console.dir('err', err);
+        console.log('err', err);
         // loading.close();
         // if (err.message.includes('timeout')) {
         //     err.message = '请求超时';
@@ -211,16 +211,16 @@ export const updateVoucher = (name) => {
 
 // 上传凭证
 export const updateVoucherList = (params) => {
-    return requestLoading(`${Prefix}act=merchant_recharge&op=add&client_type=ajax`, 'post', params)
+    return requestLoading(`${Prefix}act=refill_evidence&op=add&client_type=ajax`, 'post', params)
 }
 
 // 获取充值列表
 export const getVoucherList = () => {
-    return requestLoading(`${Prefix}act=merchant_recharge&op=index&client_type=ajax`, 'post')
+    return requestLoading(`${Prefix}act=refill_evidence&op=index&client_type=ajax`, 'post')
 }
 // 查询充值列表
 export const queryVoucherList = (page, start_time, end_time) => {
-    return requestLoading(`${Prefix}act=merchant_recharge&op=index&client_type=ajax&curpage=${page}&start_time=${start_time}&end_time=${end_time}`, 'get')
+    return requestLoading(`${Prefix}act=refill_evidence&op=index&client_type=ajax&curpage=${page}&start_time=${start_time}&end_time=${end_time}`, 'get')
 }
 // 余额列表
 // export const balanceList = (params) => {

+ 17 - 14
src/pages/subPages/balance.vue

@@ -155,8 +155,8 @@ export default {
     data() {
         return {
             tableData: [
-                {id: 1, money: '100', recharge_code: ''},
-                {id: 2, money: '100', recharge_code: ''},
+                // {id: 1, money: '100', recharge_code: ''},
+                // {id: 2, money: '100', recharge_code: ''},
             ],
             pageSize: 10,
             pageNumber: 1,
@@ -173,11 +173,11 @@ export default {
             fileList: [],
             // 查看弹层
             seeDialogVisible: false,
-            // 查看图片
-            url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
+            // 查看图片 https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg
+            url: '',
             srcList: [
-            'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg',
-            'https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg'
+            // 'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg',
+            // 'https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg'
             ],
             // 上传弹层
             uploadDialogVisible: false,
@@ -231,6 +231,7 @@ export default {
             console.log('充值', res);
             if (res && res.code == 200) {
                 this.tableData = res.datas.data
+                this.total = res.datas.total * this.pageSize
             }
         },
         // 分页
@@ -266,15 +267,15 @@ export default {
             this.getVoucherList();
         },
         // 	文件上传成功时的钩子
-        handleAvatarSuccess(res, file) {
-            console.log('res', res);
-            console.log('file', file);
-            this.imageUrl = URL.createObjectURL(file.raw);
-        },
+        // handleAvatarSuccess(res, file) {
+        //     console.log('res', res);
+        //     console.log('file', file);
+        //     this.imageUrl = URL.createObjectURL(file.raw);
+        // },
         // 上传文件之前的钩子
-        beforeAvatarUpload(file) {
-            console.log('file', file);
-        },
+        // beforeAvatarUpload(file) {
+        //     console.log('file', file);
+        // },
         // 确定文件上传
         // onSubmit() {
             // var xhr = new XMLHttpRequest();
@@ -427,6 +428,8 @@ export default {
                 if (result && result.code == 200) {
                     this.$message.success('上传成功')
                     this.uploadDialogVisible = false
+                    this.getVoucherList()
+
                 }
             })
         }

+ 3 - 3
src/pages/subPages/order.vue

@@ -21,7 +21,7 @@
    
     <el-table :data="tableData" border style="width: 100%; margin-top:20px">
         <el-table-column align="center" type="index" width="50" label="序号" />
-        <el-table-column align="center" prop="card_no" width="160" label="卡号"></el-table-column>
+        <el-table-column align="center" prop="card_no" width="200" label="卡号"></el-table-column>
         <el-table-column align="center" prop="mch_amount" label="充值金额"></el-table-column>
         <el-table-column align="center" prop="card_type_name" label="充值卡类型"></el-table-column>
         <el-table-column align="center" prop="order_time" width="200" label="充值时间"></el-table-column>
@@ -128,8 +128,8 @@ export default {
         // },
         // 查询
         async queryList() {
-            const startTime = this.dataRange[0]
-            const endTime = this.dataRange[1]
+            const startTime = this.dataRange[0] || ''
+            const endTime = this.dataRange[1] || ''
             const res = await queryList(this.pageNumber, startTime, endTime, this.RechargeType)
             console.log('查询订单', res);
             if (res && res.code == 200) {

+ 26 - 10
src/pages/subPages/view.vue

@@ -23,26 +23,31 @@
         <el-form-item label="余额预警:">
             {{alarm_amount}}
         </el-form-item>
-        <el-form-item label="密钥设置:" prop="securityKey">
-            <el-input v-model="formKey.securityKey" autocomplete="off" style="width: 300px;margin-right:10px"></el-input>
-            <el-button type="primary" size="small" @click="updateKey">设置</el-button>
+        <el-form-item label="密钥设置:" :prop="isKey == '1' ? 'ReSecurityKey' : 'securityKey'">
+            <el-input v-if="isKey == '1'" v-model="formKey.ReSecurityKey" autocomplete="off" style="width: 300px;margin-right:10px"></el-input>
+            <el-input v-else v-model="formKey.securityKey" autocomplete="off" style="width: 300px;margin-right:10px"></el-input>
+            <el-button type="primary" size="small" @click="updateKey">{{isKey == '1' ? '重设' : '设置'}}</el-button>
             <el-alert
-                title="请输入15位以内的数字,字母或者两者结合的字符作为传递信息时的密钥"
+                title="请输入数字,字母或者两者结合的字符作为密钥。用于接口对接时生成签名"
                 type="info"
                 show-icon
-                style="width:500px;height:25px;margin-top:5px"
+                style="width:880px;margin-top:5px"
                 :closable="false">
             </el-alert>
         </el-form-item>
         <el-form-item label="ip白名单:" >
             <div v-if="cIpList">
-                <el-input style="width: 300px;margin-bottom: 10px;margin-right: 10px;" v-model="ipFormData.name"></el-input>
+                <el-input style="width: 300px;margin-bottom: 10px;margin-right: 10px;" :value="ipFormData.name"></el-input>
                 <i class="el-icon-circle-plus-outline" style="color:#409EFF;" @click="add"></i>
             </div>
             <template v-else>
                 <div v-for="(item, idx) in ipList" :key="item">
                     <el-input style="width: 300px;margin-bottom: 10px;margin-right: 10px;" :value="item"></el-input>
-                    <i v-if="idx == 0" class="el-icon-circle-plus-outline" style="color:#409EFF;" @click="add"></i>
+                    <template v-if="idx == 0">
+                        <i class="el-icon-circle-plus-outline" style="color:#409EFF;" @click="add"></i>
+                        <i class="el-icon-remove-outline" style="color:#F56C6C;margin-left:10px" @click="del(item)"></i>
+                    </template>
+                    <!-- <i v-if="idx == 0" class="el-icon-circle-plus-outline" style="color:#409EFF;" @click="add"></i> -->
                     <i v-else class="el-icon-remove-outline" style="color:#F56C6C;" @click="del(item)"></i>
                 </div>
             </template>
@@ -106,14 +111,21 @@ export default {
             // securityKey: '',
             // 密钥校验,只能是数字和字母
             formKey: {
-                securityKey: ''
+                securityKey: '',
+                ReSecurityKey: ''
             },
             ruleKey: {
                 securityKey: [
                     { required: true, message: '请输入密钥', trigger: 'blur' },
-                    { pattern: /^[A-Za-z0-9]{1,15}$/, message:'请输入合法密钥', trigger: 'blur' }
+                    { pattern: /^[A-Za-z0-9]{1,30}$/, message:'请输入合法密钥,字母或者数字或者两者结合,字数在30个以内', trigger: 'blur' }
+                ],
+                // 之前设置过密钥
+                ReSecurityKey: [
+                    { pattern: /^[A-Za-z0-9]{1,30}$/, message:'请输入合法密钥,字母或者数字或者两个结合,字数在30个以内', trigger: 'blur' }
                 ]
-            }
+            },
+            // 是否设置过密钥 1-设置过
+            isKey: ''
         };
     },
     created() {
@@ -209,6 +221,7 @@ export default {
                 this.merchantsName = res.datas.name
                 this.ipList = res.datas.ips
                 this.alarm_amount = res.datas.alarm_amount
+                this.isKey = res.datas.is_key
             }
         },
         // 设置密钥
@@ -281,4 +294,7 @@ export default {
     font-size: 25px;
     vertical-align: middle;
 }
+.el-alert {
+    padding: 0px 10px;
+}
 </style>