parent
106179eb6c
commit
14abcdac7a
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,16 @@ |
||||
<!DOCTYPE html> |
||||
<html lang="en"> |
||||
<head> |
||||
<meta charset="UTF-8" /> |
||||
<meta name="viewport" |
||||
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" /> |
||||
<title></title> |
||||
<!--preload-links--> |
||||
<!--app-context--> |
||||
<script src="https://3gimg.qq.com/lightmap/components/geolocation/geolocation.min.js"></script> |
||||
</head> |
||||
<body> |
||||
<div id="app"><!--app-html--></div> |
||||
<script type="module" src="/main.js"></script> |
||||
</body> |
||||
</html> |
@ -0,0 +1,21 @@ |
||||
MIT License |
||||
|
||||
Copyright (c) 2020 LancerComet |
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy |
||||
of this software and associated documentation files (the "Software"), to deal |
||||
in the Software without restriction, including without limitation the rights |
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
||||
copies of the Software, and to permit persons to whom the Software is |
||||
furnished to do so, subject to the following conditions: |
||||
|
||||
The above copyright notice and this permission notice shall be included in all |
||||
copies or substantial portions of the Software. |
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
||||
SOFTWARE. |
@ -0,0 +1,153 @@ |
||||
# Vue-jsonp |
||||
|
||||
[![VueJsonp](https://github.com/LancerComet/vue-jsonp/workflows/Test/badge.svg)](https://github.com/LancerComet/vue-jsonp/actions) |
||||
|
||||
A tiny library for handling JSONP request. |
||||
|
||||
## Quick Start |
||||
|
||||
As Vue plugin: |
||||
|
||||
```ts |
||||
import { VueJsonp } from 'vue-jsonp' |
||||
|
||||
// Vue Plugin. |
||||
Vue.use(VueJsonp) |
||||
|
||||
// Now you can use this.$jsonp in Vue components. |
||||
const vm = new Vue() |
||||
vm.$jsonp('/some-jsonp-url', { |
||||
myCustomUrlParam: 'veryNice' |
||||
}) |
||||
``` |
||||
|
||||
Use function directly: |
||||
|
||||
```ts |
||||
import { jsonp } from 'vue-jsonp' |
||||
|
||||
jsonp('/some-jsonp-url', { |
||||
myCustomUrlParam: 'veryNice' |
||||
}) |
||||
``` |
||||
|
||||
## Send data and set query & function name |
||||
|
||||
### Send data |
||||
|
||||
```ts |
||||
// The request url will be "/some-jsonp-url?name=LancerComet&age=100&callback=jsonp_{RANDOM_STR}". |
||||
jsonp('/some-jsonp-url', { |
||||
name: 'LancerComet', |
||||
age: 100 |
||||
}) |
||||
``` |
||||
|
||||
### Custom query & function name |
||||
|
||||
The url uniform is `/url?{callbackQuery}={callbackName}&...`, the default is `/url?callback=jsonp_{RANDOM_STRING}&...`. |
||||
|
||||
And you can change it like this: |
||||
|
||||
```ts |
||||
// The request url will be "/some-jsonp-url?name=LancerComet&age=100&cb=jsonp_func". |
||||
jsonp('/some-jsonp-url', { |
||||
callbackQuery: 'cb', |
||||
callbackName: 'jsonp_func', |
||||
name: 'LancerComet', |
||||
age: 100 |
||||
}) |
||||
``` |
||||
|
||||
## Module exports |
||||
|
||||
- `VueJsonp: PluginObject<never>` |
||||
|
||||
- `jsonp<T>: (url: string, param?: IJsonpParam, timeout?: number) => Promise<T>` |
||||
|
||||
## API |
||||
|
||||
### IJsonpParam |
||||
|
||||
IJsonpParam is the type of param for jsonp function. |
||||
|
||||
```ts |
||||
/** |
||||
* JSONP parameter declaration. |
||||
*/ |
||||
interface IJsonpParam { |
||||
/** |
||||
* Callback query name. |
||||
* This param is used to define the query name of the callback function. |
||||
* |
||||
* @example |
||||
* // The request url will be "/some-url?myCallback=jsonp_func&myCustomUrlParam=veryNice" |
||||
* jsonp('/some-url', { |
||||
* callbackQuery: 'myCallback', |
||||
* callbackName: 'jsonp_func', |
||||
* myCustomUrlParam: 'veryNice' |
||||
* }) |
||||
* |
||||
* @default callback |
||||
*/ |
||||
callbackQuery?: string |
||||
|
||||
/** |
||||
* Callback function name. |
||||
* This param is used to define the jsonp function name. |
||||
* |
||||
* @example |
||||
* // The request url will be "/some-url?myCallback=jsonp_func&myCustomUrlParam=veryNice" |
||||
* jsonp('/some-url', { |
||||
* callbackQuery: 'myCallback', |
||||
* callbackName: 'jsonp_func', |
||||
* myCustomUrlParam: 'veryNice' |
||||
* }) |
||||
* |
||||
* @default jsonp_ + randomStr() |
||||
*/ |
||||
callbackName?: string |
||||
|
||||
/** |
||||
* Custom data. |
||||
*/ |
||||
[key: string]: any |
||||
} |
||||
``` |
||||
|
||||
## Example |
||||
|
||||
```ts |
||||
import Vue from 'vue' |
||||
import { VueJsonp } from 'vue-jsonp' |
||||
|
||||
Vue.use(VueJsonp) |
||||
|
||||
const vm = new Vue() |
||||
const { code, data, message } = await vm.$jsonp<{ |
||||
code: number, |
||||
message: string, |
||||
data: { |
||||
id: number, |
||||
nickname: string |
||||
} |
||||
}>('/my-awesome-url', { |
||||
name: 'MyName', age: 20 |
||||
}) |
||||
|
||||
assert(code === 0) |
||||
assert(message === 'ok') |
||||
assert(data.id === 1) |
||||
assert(data.nickname === 'John Smith') |
||||
``` |
||||
|
||||
```ts |
||||
import { jsonp } from 'vue-jsonp' |
||||
|
||||
const result = await jsonp<string>('/my-awesome-url') |
||||
assert(result === 'such a jsonp') |
||||
``` |
||||
|
||||
## License |
||||
|
||||
MIT |
@ -0,0 +1,73 @@ |
||||
/** |
||||
* Vue Jsonp. |
||||
* # Carry Your World # |
||||
* |
||||
* @author: LancerComet |
||||
* @license: MIT |
||||
*/ |
||||
import { PluginObject } from 'vue/types/plugin'; |
||||
declare module 'vue/types/vue' { |
||||
interface Vue { |
||||
$jsonp: typeof jsonp; |
||||
} |
||||
} |
||||
/** |
||||
* Vue JSONP. |
||||
*/ |
||||
declare const VueJsonp: PluginObject<never>; |
||||
/** |
||||
* JSONP function. |
||||
* |
||||
* @param { string } url Target URL address. |
||||
* @param { IJsonpParam } param Querying params object. |
||||
* @param { number } timeout Timeout setting (ms). |
||||
* |
||||
* @example |
||||
* jsonp('/url', { |
||||
* callbackQuery: '' |
||||
* callbackName: '', |
||||
* name: 'LancerComet', |
||||
* age: 26 |
||||
* }, 1000) |
||||
*/ |
||||
declare function jsonp<T = any>(url: string, param?: IJsonpParam, timeout?: number): Promise<T>; |
||||
export { VueJsonp, jsonp }; |
||||
/** |
||||
* JSONP parameter declaration. |
||||
*/ |
||||
interface IJsonpParam { |
||||
/** |
||||
* Callback query name. |
||||
* This param is used to define the query name of the callback function. |
||||
* |
||||
* @example |
||||
* // The request url will be "/some-url?myCallback=jsonp_func&myCustomUrlParam=veryNice"
|
||||
* jsonp('/some-url', { |
||||
* callbackQuery: 'myCallback', |
||||
* callbackName: 'jsonp_func', |
||||
* myCustomUrlParam: 'veryNice' |
||||
* }) |
||||
* |
||||
* @default callback |
||||
*/ |
||||
callbackQuery?: string; |
||||
/** |
||||
* Callback function name. |
||||
* This param is used to define the jsonp function name. |
||||
* |
||||
* @example |
||||
* // The request url will be "/some-url?myCallback=jsonp_func&myCustomUrlParam=veryNice"
|
||||
* jsonp('/some-url', { |
||||
* callbackQuery: 'myCallback', |
||||
* callbackName: 'jsonp_func', |
||||
* myCustomUrlParam: 'veryNice' |
||||
* }) |
||||
* |
||||
* @default jsonp_ + randomStr() |
||||
*/ |
||||
callbackName?: string; |
||||
/** |
||||
* Custom data. |
||||
*/ |
||||
[key: string]: any; |
||||
} |
@ -0,0 +1,8 @@ |
||||
function e(t,n){t=t.replace(/=/g,"");var o=[];switch(n.constructor){case String:case Number:case Boolean:o.push(encodeURIComponent(t)+"="+encodeURIComponent(n));break;case Array:n.forEach((function(n){o=o.concat(e(t+"[]=",n))}));break;case Object:Object.keys(n).forEach((function(r){var a=n[r];o=o.concat(e(t+"["+r+"]",a))}))}return o}function t(e){var n=[];return e.forEach((function(e){"string"==typeof e?n.push(e):n=n.concat(t(e))})),n} |
||||
/** |
||||
* Vue Jsonp. |
||||
* # Carry Your World # |
||||
* |
||||
* @author: LancerComet |
||||
* @license: MIT |
||||
*/var n={install:function(e){e.prototype.$jsonp=o}};function o(n,o,r){if(void 0===o&&(o={}),"string"!=typeof n)throw new Error('[Vue-jsonp] Type of param "url" is not string.');if("object"!=typeof o||!o)throw new Error("[Vue-jsonp] Invalid params, should be an object.");return r="number"==typeof r?r:5e3,new Promise((function(a,c){var u="string"==typeof o.callbackQuery?o.callbackQuery:"callback",i="string"==typeof o.callbackName?o.callbackName:"jsonp_"+(Math.floor(1e5*Math.random())*Date.now()).toString(16);o[u]=i,delete o.callbackQuery,delete o.callbackName;var s=[];Object.keys(o).forEach((function(t){s=s.concat(e(t,o[t]))}));var l=t(s).join("&"),f=function(){p(),clearTimeout(m),c({status:400,statusText:"Bad Request"})},p=function(){b.removeEventListener("error",f)},d=function(){document.body.removeChild(b),delete window[i]},m=null;r>-1&&(m=setTimeout((function(){p(),d(),c({statusText:"Request Timeout",status:408})}),r)),window[i]=function(e){clearTimeout(m),p(),d(),a(e)};var b=document.createElement("script");b.addEventListener("error",f),b.src=n+(/\?/.test(n)?"&":"?")+l,document.body.appendChild(b)}))}export{n as VueJsonp,o as jsonp}; |
@ -0,0 +1,8 @@ |
||||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).VueJsonp={})}(this,(function(e){"use strict";function t(e,o){e=e.replace(/=/g,"");var n=[];switch(o.constructor){case String:case Number:case Boolean:n.push(encodeURIComponent(e)+"="+encodeURIComponent(o));break;case Array:o.forEach((function(o){n=n.concat(t(e+"[]=",o))}));break;case Object:Object.keys(o).forEach((function(r){var c=o[r];n=n.concat(t(e+"["+r+"]",c))}))}return n}function o(e){var t=[];return e.forEach((function(e){"string"==typeof e?t.push(e):t=t.concat(o(e))})),t} |
||||
/** |
||||
* Vue Jsonp. |
||||
* # Carry Your World # |
||||
* |
||||
* @author: LancerComet |
||||
* @license: MIT |
||||
*/var n={install:function(e){e.prototype.$jsonp=r}};function r(e,n,r){if(void 0===n&&(n={}),"string"!=typeof e)throw new Error('[Vue-jsonp] Type of param "url" is not string.');if("object"!=typeof n||!n)throw new Error("[Vue-jsonp] Invalid params, should be an object.");return r="number"==typeof r?r:5e3,new Promise((function(c,a){var i="string"==typeof n.callbackQuery?n.callbackQuery:"callback",s="string"==typeof n.callbackName?n.callbackName:"jsonp_"+(Math.floor(1e5*Math.random())*Date.now()).toString(16);n[i]=s,delete n.callbackQuery,delete n.callbackName;var u=[];Object.keys(n).forEach((function(e){u=u.concat(t(e,n[e]))}));var f=o(u).join("&"),l=function(){p(),clearTimeout(b),a({status:400,statusText:"Bad Request"})},p=function(){m.removeEventListener("error",l)},d=function(){document.body.removeChild(m),delete window[s]},b=null;r>-1&&(b=setTimeout((function(){p(),d(),a({statusText:"Request Timeout",status:408})}),r)),window[s]=function(e){clearTimeout(b),p(),d(),c(e)};var m=document.createElement("script");m.addEventListener("error",l),m.src=e+(/\?/.test(e)?"&":"?")+f,document.body.appendChild(m)}))}e.VueJsonp=n,e.jsonp=r,Object.defineProperty(e,"__esModule",{value:!0})})); |
@ -0,0 +1,20 @@ |
||||
/** |
||||
* Generate random string. |
||||
* |
||||
* @return { string } |
||||
*/ |
||||
declare function randomStr(): string; |
||||
/** |
||||
* Format params into querying string. |
||||
* |
||||
* @return {string[]} |
||||
*/ |
||||
declare function formatParams(queryKey: string, value: any): string[]; |
||||
/** |
||||
* Flat querys. |
||||
* |
||||
* @param {string[] | (string[])[]} array |
||||
* @returns |
||||
*/ |
||||
declare function flatten(array: string[] | (string[])[]): string[]; |
||||
export { formatParams, flatten, randomStr }; |
@ -0,0 +1,50 @@ |
||||
{ |
||||
"name": "vue-jsonp", |
||||
"version": "2.0.0", |
||||
"description": "A tiny library for handling JSONP request.", |
||||
"main": "./dist/index.js", |
||||
"module": "./dist/index.esm.js", |
||||
"keywords": [ |
||||
"Vue", |
||||
"JSONP" |
||||
], |
||||
"files": [ |
||||
"dist/", |
||||
"index.d.ts", |
||||
"README.md" |
||||
], |
||||
"scripts": { |
||||
"build": "rollup -c", |
||||
"test": "jest", |
||||
"pretest": "npm run build", |
||||
"preversion": "npm run test", |
||||
"prepublish": "npm run test" |
||||
}, |
||||
"author": { |
||||
"name": "LancerComet", |
||||
"email": "chw644@hotmail.com" |
||||
}, |
||||
"repository": { |
||||
"type": "git", |
||||
"url": "https://github.com/LancerComet/vue-jsonp.git" |
||||
}, |
||||
"license": "MIT", |
||||
"devDependencies": { |
||||
"@types/expect-puppeteer": "^4.4.3", |
||||
"@types/jest": "^26.0.14", |
||||
"@types/jest-environment-puppeteer": "^4.4.0", |
||||
"@types/puppeteer": "^3.0.2", |
||||
"jest": "^26.4.2", |
||||
"jest-puppeteer": "^4.4.0", |
||||
"puppeteer": "^5.3.1", |
||||
"rollup": "^2.28.2", |
||||
"rollup-plugin-cleanup": "^3.2.1", |
||||
"rollup-plugin-delete": "^2.0.0", |
||||
"rollup-plugin-terser": "^7.0.2", |
||||
"rollup-plugin-typescript2": "^0.27.3", |
||||
"ts-jest": "^26.4.1", |
||||
"tslint": "^6.1.3", |
||||
"typescript": "^4.0.3", |
||||
"vue": "^2.6.12" |
||||
} |
||||
} |
@ -0,0 +1,389 @@ |
||||
<template> |
||||
<view> |
||||
<!-- <view class="width100 line10 "></view> --> |
||||
<view class="width100 height100p" style="background-color: #eb6a53;" |
||||
v-if="ledgerReceiverApply != null && ledgerReceiverApply != '' && ledgerReceiverApply.auditStatus != 2"> |
||||
|
||||
<view class="font18 fcorfff paddtop35 fotct" v-if="ledgerReceiverApply.auditStatus == 1"> |
||||
绑定分账审核中 |
||||
</view> |
||||
<view class="font18 fcorfff paddtop35 fotct" v-if="ledgerReceiverApply.auditStatus == 4"> |
||||
解除分账审核中 |
||||
</view> |
||||
<view class="font18 fcorfff paading10 aliitem" |
||||
v-if="ledgerReceiverApply.auditStatus == 3 || ledgerReceiverApply.auditStatus == 5"> |
||||
<image src="../../../static/img/error.png" mode="widthFix" class="iconw25 marglerig"></image>审核失败 |
||||
</view> |
||||
<view class="font14 fcorfff paading10" |
||||
v-if="ledgerReceiverApply.auditStatus == 3 || ledgerReceiverApply.auditStatus == 5"> |
||||
{{ledgerReceiverApply.rejectReason}}</view> |
||||
</view> |
||||
|
||||
<view class="username"> |
||||
<view class="namecont">接收方名称</view> |
||||
<input placeholder="请选择接收方名称" v-model="receiverName" style="width: 70%;" |
||||
placeholder-style="color: #bfbfbf;font-size:14px;padding-top:2px;" /> |
||||
<image src="../../../static/img/jtg.png" mode="widthFix" class="iconw" @click="jumpMerchantlist()"></image> |
||||
</view> |
||||
|
||||
<view class="username"> |
||||
<view class="namecont">接收方编号</view> |
||||
<input placeholder="请输入接收方编号" v-model="receiverNo" style="width: 70%;" |
||||
placeholder-style="color: #bfbfbf;font-size:14px;padding-top:2px;" /> |
||||
</view> |
||||
|
||||
<view class="notes font16" style="border-bottom: 0px;"> |
||||
<view class="width70 aliitem fcor666" |
||||
v-if="typeId == 1 || (typeId == 2 && (ledgerReceiverApply.auditStatus == 1 || ledgerReceiverApply.auditStatus == 2|| ledgerReceiverApply.auditStatus == 3))"> |
||||
合作协议 |
||||
</view> |
||||
<view class="width70 aliitem fcor666" |
||||
v-if="typeId == 3 || (typeId == 2 && (ledgerReceiverApply.auditStatus == 4 || ledgerReceiverApply.auditStatus == 5))"> |
||||
解除分账说明 |
||||
</view> |
||||
<!-- <view class="fcor666 alijusend width30 font14" @click="perImage('../../../static/img/businesslic13.png')"> |
||||
查看示例 |
||||
<image mode="widthFix" style="width: 12px;" src="../../../static/img/jtg.png"></image> |
||||
</view> --> |
||||
</view> |
||||
<view class="width94 displ mart5"> |
||||
<image mode="widthFix" class="width100" :src="imgUrls+entrustFilePath" v-if="entrustFilePath" |
||||
@click="upload()"> |
||||
</image> |
||||
<image src="../../../static/img/businesslic15.png" mode="widthFix" class="width100" |
||||
v-if="!entrustFilePath && typeId == 1" @click="upload()"></image> |
||||
<image src="../../../static/img/businesslic16.png" mode="widthFix" class="width100" |
||||
v-if="!entrustFilePath && typeId == 3" @click="upload()"></image> |
||||
</view> |
||||
|
||||
<view class="btn" @click="submitbtn()" |
||||
v-if="typeId == 1 && ledgerReceiverApply.auditStatus !=1 && ledgerReceiverApply.auditStatus != 4">提交审核 |
||||
</view> |
||||
<view class="btn" @click="submitbtn()" |
||||
v-if="typeId == 3 && ledgerReceiverApply.auditStatus !=1 && ledgerReceiverApply.auditStatus != 4">解除合作 |
||||
</view> |
||||
<view class="height60"></view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import { |
||||
merLedgerReceiverApply, |
||||
getLedgerReceiverById, |
||||
merLedgerReceiverDelApply |
||||
} from '../../../Utils/Api.js' |
||||
let app = getApp(); |
||||
export default { |
||||
data() { |
||||
return { |
||||
receiverName: '', //接收方名称 |
||||
reqUrl: app.globalData.url, //请求地址 |
||||
imgUrls: app.globalData.imgUrl, //图片查看 |
||||
receiverNo: '', //接收方编号 |
||||
entrustFilePath: '', //接收方合作协议 |
||||
merLedgerId: '', //商户id |
||||
typeId: '', //进入id 1 新建 2 查看 |
||||
ledgerReceiverId: '', //接收方id |
||||
ledgerReceiverApply: '', //详情数据 |
||||
} |
||||
}, |
||||
onLoad(options) { |
||||
this.merLedgerId = options.id; |
||||
this.typeId = options.typeid; |
||||
|
||||
if (this.typeId == 2 || this.typeId == 3) { |
||||
this.ledgerReceiverId = options.ledgerReceiverId; |
||||
this.getLedgerReceiverById(); |
||||
} |
||||
|
||||
}, |
||||
onShow() { |
||||
if (app.globalData.receiverNo) { |
||||
this.receiverNo = app.globalData.receiverNo; |
||||
} |
||||
if (app.globalData.receiverName) { |
||||
this.receiverName = app.globalData.receiverName; |
||||
} |
||||
|
||||
}, |
||||
onUnload() { |
||||
app.globalData.receiverNo = ''; |
||||
app.globalData.receiverName = ''; |
||||
}, |
||||
methods: { |
||||
//查看所以商户 |
||||
jumpMerchantlist() { |
||||
if (this.typeId == 1) { |
||||
uni.navigateTo({ |
||||
url: '/pages/index/ledgerReceiverList/ledgerReceiverList' |
||||
}) |
||||
} |
||||
}, |
||||
// 放大图片 |
||||
perImage(item) { |
||||
uni.previewImage({ |
||||
current: 0, //预览图片的下标 |
||||
urls: [item] //预览图片的地址,必须要数组形式,如果不是数组形式就转换成数组形式就可以 |
||||
}) |
||||
}, |
||||
//上传图片 |
||||
upload() { |
||||
if (this.ledgerReceiverApply.auditStatus == 1 || this.ledgerReceiverApply.auditStatus == 4 || this |
||||
.typeId == 2) { |
||||
return; |
||||
} |
||||
let that = this; |
||||
uni.chooseImage({ |
||||
count: 1, |
||||
sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有 |
||||
sourceType: ['camera', 'album'], |
||||
success: function(res) { |
||||
const tempFilePaths = res.tempFilePaths; |
||||
that.uploadFile(tempFilePaths[0]); |
||||
}, |
||||
error: function(e) { |
||||
console.log(e); |
||||
} |
||||
}); |
||||
}, |
||||
//上传 |
||||
uploadFile(item) { |
||||
let that = this |
||||
that.translate(item, 0.2, imgURL => { |
||||
const uploadTask = uni.uploadFile({ |
||||
url: that.reqUrl + '/fileUpload/uploadBase64File', |
||||
filePath: imgURL, |
||||
header: { |
||||
"Authorization": app.globalData.token |
||||
}, |
||||
name: 'file', |
||||
formData: { |
||||
'merId': that.merId, |
||||
'base64File': imgURL |
||||
}, |
||||
success: function(uploadFileRes) { |
||||
that.entrustFilePath = JSON.parse(uploadFileRes.data).return_data[0]; |
||||
} |
||||
}); |
||||
}) |
||||
}, |
||||
/** |
||||
* H5端图片压缩 |
||||
* 参数说明: |
||||
* imgSrc 图片url |
||||
* scale缩放比例 0-1 |
||||
* 返回base64 |
||||
* callback 回调设置返回值 |
||||
*/ |
||||
translate(imgSrc, scale, callback) { |
||||
var img = new Image(); |
||||
img.src = imgSrc; |
||||
img.onload = function() { |
||||
var that = this; |
||||
var h = that.height; // 默认按比例压缩 |
||||
var w = that.width; |
||||
var canvas = document.createElement('canvas'); |
||||
var ctx = canvas.getContext('2d'); |
||||
var width = document.createAttribute("width"); |
||||
width.nodeValue = w; |
||||
var height = document.createAttribute("height"); |
||||
height.nodeValue = h; |
||||
canvas.setAttributeNode(width); |
||||
canvas.setAttributeNode(height); |
||||
ctx.drawImage(that, 0, 0, w, h); |
||||
var base64 = canvas.toDataURL('image/jpeg', scale); //压缩比例 |
||||
canvas = null; |
||||
callback(base64); |
||||
} |
||||
}, |
||||
//查询详情 |
||||
getLedgerReceiverById() { |
||||
uni.showLoading({ |
||||
title: '加载中' |
||||
}) |
||||
let datas = { |
||||
"ledgerReceiverId": this.ledgerReceiverId |
||||
} |
||||
getLedgerReceiverById(datas).then(res => { |
||||
uni.hideLoading(); |
||||
if (res.return_code == '000000') { |
||||
this.ledgerReceiverApply = res.return_data; |
||||
this.receiverNo = res.return_data.receiverNo; |
||||
this.receiverName = res.return_data.receiverName; |
||||
if (this.typeId == 2 && (res.return_data.auditStatus == 3 || res.return_data.auditStatus == |
||||
2 || res.return_data.auditStatus == 1)) { |
||||
this.entrustFilePath = res.return_data.entrustFilePath; |
||||
} |
||||
|
||||
if (this.typeId == 2 && res.return_data.auditStatus == 4) { |
||||
this.entrustFilePath = res.return_data.relieveEntrustFilePath; |
||||
} |
||||
|
||||
if (this.typeId == 2 && res.return_data.auditStatus == 5) { |
||||
this.entrustFilePath = res.return_data.relieveEntrustFilePath; |
||||
} |
||||
if (this.typeId == 3 && res.return_data.status == 2 && res.return_data.auditStatus == 3) { |
||||
this.entrustFilePath = res.return_data.relieveEntrustFilePath; |
||||
} |
||||
} else { |
||||
uni.showToast({ |
||||
title: res.return_msg, |
||||
icon: 'none', |
||||
duration: 2000 |
||||
}) |
||||
} |
||||
}) |
||||
}, |
||||
//提交审核 |
||||
submitbtn() { |
||||
if (!this.receiverNo) { |
||||
uni.showToast({ |
||||
title: '请输入或选择接收方名称', |
||||
icon: "none", |
||||
duration: 2000 |
||||
}); |
||||
return; |
||||
} |
||||
if (!this.receiverName) { |
||||
uni.showToast({ |
||||
title: '请输入接收方编号', |
||||
icon: "none", |
||||
duration: 2000 |
||||
}); |
||||
return; |
||||
} |
||||
if (!this.entrustFilePath) { |
||||
uni.showToast({ |
||||
title: '请上传合作协议', |
||||
icon: "none", |
||||
duration: 2000 |
||||
}); |
||||
return; |
||||
} |
||||
uni.showModal({ |
||||
title: '提交审核', |
||||
content: '确认信息是否正确。', |
||||
success: (res) => { |
||||
if (res.confirm) { |
||||
uni.showLoading({ |
||||
title: '提交审核中...' |
||||
}) |
||||
|
||||
if (this.typeId == 1) { |
||||
let datas = { |
||||
"merLedgerId": this.merLedgerId, |
||||
"receiverNo": this.receiverNo, |
||||
"receiverName": this.receiverName, |
||||
"entrustFilePath": this.entrustFilePath |
||||
} |
||||
merLedgerReceiverApply(datas).then(res => { |
||||
uni.hideLoading(); |
||||
if (res.return_code == '000000') { |
||||
uni.showToast({ |
||||
title: '提交成功', |
||||
icon: 'none', |
||||
duration: 2000, |
||||
success() { |
||||
setTimeout(() => { |
||||
uni.navigateBack({}) |
||||
}, 2000); |
||||
} |
||||
}) |
||||
} else { |
||||
uni.showToast({ |
||||
title: res.return_msg, |
||||
icon: 'none', |
||||
duration: 2000 |
||||
}) |
||||
} |
||||
}) |
||||
} |
||||
|
||||
if (this.typeId == 3) { |
||||
let datas = { |
||||
"merLedgerId": this.merLedgerId, |
||||
"receiverNo": this.receiverNo, |
||||
"receiverName": this.receiverName, |
||||
"relieveEntrustFilePath": this.entrustFilePath |
||||
} |
||||
merLedgerReceiverDelApply(datas).then(res => { |
||||
uni.hideLoading(); |
||||
if (res.return_code == '000000') { |
||||
uni.showToast({ |
||||
title: '提交成功', |
||||
icon: 'none', |
||||
duration: 2000, |
||||
success() { |
||||
setTimeout(() => { |
||||
uni.navigateBack({}) |
||||
}, 2000); |
||||
} |
||||
}) |
||||
} else { |
||||
uni.showToast({ |
||||
title: res.return_msg, |
||||
icon: 'none', |
||||
duration: 2000 |
||||
}) |
||||
} |
||||
}) |
||||
} |
||||
} else if (res.cancel) { |
||||
console.log('用户点击取消'); |
||||
} |
||||
} |
||||
}); |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss"> |
||||
.username { |
||||
width: calc(100% - 90upx); |
||||
height: 100upx; |
||||
display: flex; |
||||
align-items: center; |
||||
background-color: rgba($color: #ffffff, $alpha: 0.1); |
||||
border-bottom: 1px solid #f6f6f6; |
||||
padding: 8upx 45upx; |
||||
|
||||
input { |
||||
width: 50%; |
||||
height: 50upx; |
||||
font-size: 16px; |
||||
color: #333333; |
||||
font-weight: blod; |
||||
} |
||||
|
||||
.namecont { |
||||
color: #666666; |
||||
width: 28%; |
||||
} |
||||
} |
||||
|
||||
.btn { |
||||
color: #FFFFFF; |
||||
background-color: #0083f5; |
||||
width: 90%; |
||||
margin-left: 5%; |
||||
margin-top: 80rpx; |
||||
height: 90rpx; |
||||
display: flex; |
||||
justify-content: center; |
||||
align-items: center; |
||||
border-radius: 10rpx; |
||||
font-size: 40rpx; |
||||
} |
||||
|
||||
.notes { |
||||
width: calc(100% - 90upx); |
||||
display: flex; |
||||
align-items: center; |
||||
background-color: rgba($color: #ffffff, $alpha: 0.1); |
||||
border-bottom: 1px solid #f6f6f6; |
||||
padding: 20rpx 45rpx; |
||||
color: #bfbfbf; |
||||
|
||||
} |
||||
</style> |
@ -0,0 +1,118 @@ |
||||
<template> |
||||
<view> |
||||
<view v-if="merchantList == ''" class="mart60 fotct font14 fcor666"> |
||||
<image mode="widthFix" style="width: 70vw;" src="../../../static/img/noorder.png"></image> |
||||
</view> |
||||
<view class="width94 paddbotm10 backcorfff mart20" v-for="(item,indexs) in merchantList" :key="indexs" |
||||
@click="jumpBindMerchants(2,item.id)"> |
||||
<view class="font18 font306adb paddtop10 fontwig6 padleft15 alijusstart"> |
||||
<view class="width80p">{{item.receiverName}}</view> |
||||
<view class="statucs font14" v-if="item.status == 1 && item.auditStatus == 2">正常</view> |
||||
<view class="otstatucs font14" v-if="item.status == 1 && item.auditStatus == 4">审核中</view> |
||||
<view class="otstatucs font14" v-if="item.status == 2 && item.auditStatus == 1">审核中</view> |
||||
<view class="otstatucs font14" v-if="item.status == 2 && item.auditStatus == 3">审核驳回</view> |
||||
<view class="otstatucs font14" v-if="item.status == 1 && item.auditStatus == 5">审核驳回</view> |
||||
</view> |
||||
<view class="mart10 fcor666 padleft15 font14">绑定时间: |
||||
{{item.createTime | timeFormat('yyyy-mm-dd')}} |
||||
{{item.createTime | timeFormat('hh:mm')}} |
||||
</view> |
||||
<view class="height45 width100 paddbotm10" v-if="item.status == 1 && item.auditStatus == 2"> |
||||
<button class="btns mart10 margle10" @click.stop="jumpBindMerchants(3,item.id)">解除绑定</button> |
||||
</view> |
||||
</view> |
||||
<image src="../../../static/img/addser.png" mode="widthFix" class="xfimg" @click="jumpBindMerchants(1,'')"> |
||||
</image> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import { |
||||
getLedgerReceiverListByMer |
||||
} from '../../../Utils/Api.js'; |
||||
export default { |
||||
data() { |
||||
return { |
||||
merchantList: [], //商户列表 |
||||
merLedgerId: '', //开通分账ID |
||||
merId: '' //商户id |
||||
} |
||||
}, |
||||
onLoad(options) { |
||||
this.merId = options.merId; |
||||
this.merLedgerId = options.id; |
||||
}, |
||||
onShow() { |
||||
this.getLedgerReceiverListByMer(); |
||||
}, |
||||
methods: { |
||||
//查询开通分账商量列表 |
||||
getLedgerReceiverListByMer() { |
||||
let datas = { |
||||
merId: this.merId, |
||||
platformType: 1 |
||||
} |
||||
getLedgerReceiverListByMer(datas).then(res => { |
||||
if (res.return_code == '000000' && res.return_data != null) { |
||||
this.merchantList = res.return_data; |
||||
} |
||||
}) |
||||
}, |
||||
//跳转绑定商户 |
||||
jumpBindMerchants(item, item1) { |
||||
uni.navigateTo({ |
||||
url: '/pages/index/bindDividedMerchant/bindDividedMerchant?id=' + this.merLedgerId + |
||||
'&typeid=' + item + '&ledgerReceiverId=' + item1 |
||||
}) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss"> |
||||
page { |
||||
background-color: #f8f9f9; |
||||
} |
||||
|
||||
.borbtom { |
||||
border-bottom: 3px solid #089bf5; |
||||
} |
||||
|
||||
.font306adb { |
||||
color: #306adb; |
||||
} |
||||
|
||||
.xfimg { |
||||
width: 100rpx; |
||||
bottom: 60rpx; |
||||
position: fixed; |
||||
right: 40rpx; |
||||
} |
||||
|
||||
//正常状态 |
||||
.statucs { |
||||
background-color: #e9f9e5; |
||||
color: #84b878; |
||||
text-align: center; |
||||
padding: 2px 5px; |
||||
} |
||||
|
||||
//其他状态 |
||||
.otstatucs { |
||||
background-color: #fbeee4; |
||||
color: #db8c73; |
||||
text-align: center; |
||||
padding: 2px 5px; |
||||
} |
||||
.btns { |
||||
width: 21%; |
||||
float: left; |
||||
height: 35px; |
||||
line-height: 35px; |
||||
background-color: #0083f5; |
||||
color: #FFFFFF; |
||||
font-weight: bold; |
||||
font-size: 12px; |
||||
padding: 0px; |
||||
} |
||||
</style> |
@ -0,0 +1,62 @@ |
||||
<template> |
||||
<view> |
||||
<view v-if="receiverList == ''" class="mart60 fotct font14 fcor666"> |
||||
<image mode="widthFix" style="width: 70vw;" src="../../../static/img/noorder.png"></image> |
||||
</view> |
||||
<view class="width100"> |
||||
<view class=" mcclist font15 fcor666" v-for="(item,index) in receiverList" :key="index" |
||||
@click="changebank(item)"> |
||||
{{item.receiverName}} |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import { |
||||
getLedgerReceiverList |
||||
} from '../../../Utils/Api.js'; |
||||
let app = getApp(); |
||||
export default { |
||||
data() { |
||||
return { |
||||
receiverList: '' //商户列表 |
||||
} |
||||
}, |
||||
onLoad(options) { |
||||
this.getLedgerReceiverList(); |
||||
}, |
||||
methods: { |
||||
//查询所有商户列表 |
||||
getLedgerReceiverList() { |
||||
let datas = { |
||||
platformType: 1, |
||||
pageNum: 1, |
||||
pageSize: 10 |
||||
} |
||||
getLedgerReceiverList(datas).then(res => { |
||||
if (res.return_code == '000000' && res.return_data.list != null) { |
||||
this.receiverList = res.return_data.list; |
||||
} |
||||
}) |
||||
}, |
||||
// 选择商户 |
||||
changebank(item) { |
||||
app.globalData.receiverNo = item.receiverNo; |
||||
app.globalData.receiverName = item.receiverName; |
||||
uni.navigateBack(); |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
<style lang="scss"> |
||||
.mcclist { |
||||
width: calc(100% - 50upx); |
||||
height: 100upx; |
||||
display: flex; |
||||
align-items: center; |
||||
background-color: rgba($color: #ffffff, $alpha: 0.1); |
||||
border-bottom: 1px solid #f6f6f6; |
||||
padding: 12upx 25upx; |
||||
} |
||||
</style> |
@ -0,0 +1,220 @@ |
||||
<template> |
||||
<view class="map-box"> |
||||
<map id="maps" class="tui-maps" :longitude="longitude" :latitude="latitude" :scale="16" |
||||
@regionchange="regionchange" :style="{'width':windowWidth+'px','height':'300px'}"> |
||||
<cover-image class="cover-image" src="../../../static/img/location.png" /> |
||||
<cover-view class="tip">您可以拖动地图,标记当前精准位置</cover-view> |
||||
</map> |
||||
<view class="gps-body" v-if="poiss.length > 0"> |
||||
<scroll-view scroll-y="true" :scroll-top="scrollTop" scroll-with-animation="true" style="height:720rpx;"> |
||||
<block v-for="(item,index) in poiss" :key="item.id"> |
||||
<view class="gps-lists"> |
||||
<text class="gps-title">{{item.title}}</text> |
||||
<view class="gps-flex"> |
||||
<view class="gps-view">{{item.address}}</view> |
||||
<view style="margin-top:-18rpx;"> |
||||
<radio-group @change="radioChange(item,index)"> |
||||
<radio :checked="index === current" /> |
||||
</radio-group> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</block> |
||||
</scroll-view> |
||||
</view> |
||||
<view class="but"> |
||||
<button type="primary" @click="handleConfirm"> |
||||
确认位置 |
||||
</button> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
const QQMapWX = require('../../../Utils/js/qqmap-wx-jssdk') |
||||
const qqmapsdk = new QQMapWX({ |
||||
key: '7UMBZ-HFEHX-HSD4Q-Z3QY6-OQKN7-2QBDB' |
||||
}) |
||||
let app = getApp(); |
||||
export default { |
||||
data() { |
||||
return { |
||||
longitude: null, |
||||
latitude: null, |
||||
windowWidth: 0, |
||||
poiss: [], |
||||
scrollTop: 0, |
||||
current: 0, |
||||
address: {}, |
||||
mapContext: null |
||||
} |
||||
}, |
||||
//第一次初始化用户位置信息 |
||||
onLoad() { |
||||
try { |
||||
var th_is = this; |
||||
th_is.mapContext = uni.createMapContext('maps') |
||||
const res = uni.getSystemInfoSync(); |
||||
th_is.windowWidth = res.windowWidth; |
||||
uni.showLoading({ |
||||
title: '正在获取定位中', |
||||
}); |
||||
uni.getLocation({ |
||||
type: 'gcj02', |
||||
isHighAccuracy: 'true', |
||||
geocode: 'true', |
||||
success: (res) => { |
||||
th_is.longitude = res.longitude; |
||||
th_is.latitude = res.latitude; |
||||
uni.hideLoading(); |
||||
th_is.getAddress(th_is.latitude, th_is.longitude); |
||||
} |
||||
}) |
||||
} catch (e) { |
||||
// error |
||||
} |
||||
}, |
||||
methods: { |
||||
//每移动一次获取周围地址 |
||||
regionchange(e) { |
||||
var th_is = this; |
||||
if (e.type == "end") { |
||||
th_is.longitude = e.detail.centerLocation.longitude; |
||||
th_is.latitude = e.detail.centerLocation.latitude; |
||||
th_is.getAddress(th_is.latitude, th_is.longitude); |
||||
} |
||||
}, |
||||
//获取附近位置信息 |
||||
getAddress(longitude, latitude) { |
||||
let location = [longitude, latitude] |
||||
let StringLocation = location.toString(); |
||||
var th_is = this; |
||||
qqmapsdk.reverseGeocoder({ |
||||
location: StringLocation, |
||||
get_poi: 1, |
||||
poi_options: 'policy=1;page_size=20;page_index=1', |
||||
success: res => { |
||||
th_is.poiss = res.result.pois; |
||||
th_is.address = res.result.pois.length > 0 ? res.result.pois[0] : {} |
||||
}, |
||||
fail: err => { |
||||
uni.showToast({ |
||||
title: err.message, |
||||
icon: 'none', |
||||
duration: 3000 |
||||
}) |
||||
} |
||||
}) |
||||
}, |
||||
radioChange(item, evt) { |
||||
this.current = evt; |
||||
this.mapContext.moveToLocation({ |
||||
latitude: item.location.lat, |
||||
longitude: item.location.lng |
||||
}) |
||||
this.address = Object.assign(item); |
||||
// console.log(item); |
||||
}, |
||||
//确认位置 |
||||
handleConfirm() { |
||||
console.log('======-----------' + JSON.stringify(this.address)); |
||||
uni.$emit('onAddressChange', this.address); |
||||
app.globalData.storeMessage = this.address; |
||||
setTimeout(function() { |
||||
uni.navigateBack({ |
||||
delta: 1 |
||||
}); |
||||
}, 500) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
.map-box { |
||||
padding-bottom: constant(safe-area-inset-bottom); // 底部安全区 |
||||
padding-bottom: env(safe-area-inset-bottom); // 底部安全区 |
||||
box-sizing: content-box; |
||||
} |
||||
|
||||
.tui-maps { |
||||
width: 100%; |
||||
height: 600rpx; |
||||
// position: relative; |
||||
} |
||||
|
||||
.cover-image { |
||||
width: 62rpx; |
||||
height: 62rpx; |
||||
position: absolute; |
||||
top: 50%; |
||||
left: 50%; |
||||
transform: translate(-50%, -50%); |
||||
} |
||||
|
||||
.tip { |
||||
font-size: 20rpx; |
||||
color: #b6b6b6; |
||||
line-height: 42rpx; |
||||
padding: 0 20rpx; |
||||
position: absolute; |
||||
left: 50%; |
||||
bottom: 30rpx; |
||||
box-shadow: 0px 1px 10px 1px rgba(153, 153, 153, 0.34); |
||||
background-color: #fff; |
||||
border-radius: 4px; |
||||
transform: translateX(-50%); |
||||
} |
||||
|
||||
.gps-body { |
||||
width: 100%; |
||||
padding-top: 20rpx; |
||||
// padding-bottom: 32rpx; |
||||
// box-sizing: border-box; |
||||
background-color: #FFFFFF; |
||||
// position: absolute; |
||||
// top: 600rpx; |
||||
// bottom: 0; |
||||
font-size: 26rpx; |
||||
|
||||
|
||||
.gps-lists { |
||||
width: 98%; |
||||
height: 100rpx; |
||||
margin: 0px auto; |
||||
border: 1px solid #f9f9f9; |
||||
|
||||
.gps-flex { |
||||
display: flex; |
||||
justify-content: space-between; |
||||
} |
||||
|
||||
.gps-flex /deep/ .uni-radio-input { |
||||
width: 40rpx; |
||||
height: 40rpx; |
||||
} |
||||
|
||||
.gps-title { |
||||
padding-left: 10rpx; |
||||
display: block; |
||||
padding-top: 15rpx; |
||||
} |
||||
|
||||
.gps-view { |
||||
width: 70%; |
||||
overflow: hidden; |
||||
text-overflow: ellipsis; |
||||
white-space: nowrap; |
||||
padding-left: 10rpx; |
||||
color: #b6b6b6; |
||||
font-size: 25rpx; |
||||
margin-top: 15rpx; |
||||
} |
||||
} |
||||
} |
||||
|
||||
.but { |
||||
margin-top: 32rpx; |
||||
padding: 0 32rpx; |
||||
} |
||||
</style> |
@ -0,0 +1,272 @@ |
||||
<template> |
||||
<view> |
||||
<!-- <view class="width100 line10" v-if="merLedgerApply !=null && merLedgerApply !=''"></view> --> |
||||
<view class="width100 height100p" style="background-color: #eb6a53;" |
||||
v-if="merLedgerApply !=null && merLedgerApply !='' && merLedgerApply.status != 1"> |
||||
|
||||
<view class="font18 fcorfff paddtop35 fotct" v-if="merLedgerApply !=null && merLedgerApply.status == 2"> |
||||
审核中 |
||||
</view> |
||||
<view class="font18 fcorfff paading10 aliitem" v-if="merLedgerApply !=null && merLedgerApply.status == 3"> |
||||
<image src="../../../static/img/error.png" mode="widthFix" class="iconw25 marglerig"></image>审核驳回 |
||||
</view> |
||||
<view class="font14 fcorfff paading10" v-if="merLedgerApply !=null && merLedgerApply.status == 3"> |
||||
{{merLedgerApply.rejectReason}} |
||||
</view> |
||||
</view> |
||||
|
||||
<view class="username"> |
||||
<view class="namecont">最低分账比例</view> |
||||
<input placeholder="请输入最低分账比例" v-model="splitLowestRatio" type="digit" |
||||
style="width: 70%;padding-right:10px;text-align: right;" |
||||
placeholder-style="color: #bfbfbf;font-size:14px;padding-top:2px;padding-right:10px;text-align: right;" /> |
||||
% |
||||
</view> |
||||
|
||||
<view class="notes font16" style="border-bottom: 0px;"> |
||||
<view class="width70 aliitem fcor666"> |
||||
分账结算委托书 |
||||
</view> |
||||
<view class="fcor666 alijusend width30 font14" @click="perImage('../../../static/img/businesslic13.png')"> |
||||
查看示例 |
||||
<image mode="widthFix" style="width: 12px;" src="../../../static/img/jtg.png"></image> |
||||
</view> |
||||
</view> |
||||
<view class="width94 displ mart5"> |
||||
<image mode="widthFix" class="width100" :src="imgUrls+powerofattorney" v-if="powerofattorney" |
||||
@click="upload()"> |
||||
</image> |
||||
<image src="../../../static/img/businesslic14.png" mode="widthFix" class="width100" v-else |
||||
@click="upload()"></image> |
||||
</view> |
||||
|
||||
<view class="btn" @click="submitbtn()" v-if="merLedgerApply == null || merLedgerApply.status == 3">提交审核</view> |
||||
<view class="height60"></view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import { |
||||
getMerLedgerApply, |
||||
merLedgerApply |
||||
} from '../../../Utils/Api.js' |
||||
let app = getApp(); |
||||
export default { |
||||
data() { |
||||
return { |
||||
splitLowestRatio: '', //最低费率 |
||||
powerofattorney: '', //协议委托书 |
||||
imgUrls: app.globalData.imgUrl, //图片查看 |
||||
reqUrl: app.globalData.url, //请求地址 |
||||
merId: '', //商户id |
||||
merLedgerApply: '' //是否开通分账数据 |
||||
} |
||||
}, |
||||
onLoad(options) { |
||||
this.merId = options.id; |
||||
this.getMerLedgerApply(); |
||||
}, |
||||
methods: { |
||||
//查询商户分账详情 |
||||
getMerLedgerApply() { |
||||
let datas = { |
||||
merId: this.merId, |
||||
platformType: 1 |
||||
} |
||||
getMerLedgerApply(datas).then(res => { |
||||
if (res.return_code == '000000' && res.return_data != null) { |
||||
this.merLedgerApply = res.return_data; |
||||
this.splitLowestRatio = res.return_data.splitLowestRatio; |
||||
this.powerofattorney = res.return_data.splitEntrustFilePath; |
||||
}else{ |
||||
this.merLedgerApply = null; |
||||
} |
||||
}) |
||||
}, |
||||
//item 放大图片 |
||||
perImage(item) { |
||||
uni.previewImage({ |
||||
current: 0, //预览图片的下标 |
||||
urls: [item] //预览图片的地址,必须要数组形式,如果不是数组形式就转换成数组形式就可以 |
||||
}) |
||||
}, |
||||
//上传图片 |
||||
upload() { |
||||
|
||||
let that = this; |
||||
uni.chooseImage({ |
||||
count: 1, |
||||
sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有 |
||||
sourceType: ['camera', 'album'], |
||||
success: function(res) { |
||||
const tempFilePaths = res.tempFilePaths; |
||||
that.uploadFile(tempFilePaths[0]); |
||||
}, |
||||
error: function(e) { |
||||
console.log(e); |
||||
} |
||||
}); |
||||
}, |
||||
|
||||
//上传 |
||||
uploadFile(item) { |
||||
let that = this |
||||
that.translate(item, 0.2, imgURL => { |
||||
const uploadTask = uni.uploadFile({ |
||||
url: that.reqUrl + '/fileUpload/uploadBase64File', |
||||
filePath: imgURL, |
||||
header: { |
||||
"Authorization": app.globalData.token |
||||
}, |
||||
name: 'file', |
||||
formData: { |
||||
'merId': that.merId, |
||||
'base64File': imgURL |
||||
}, |
||||
success: function(uploadFileRes) { |
||||
that.powerofattorney = JSON.parse(uploadFileRes.data).return_data; |
||||
} |
||||
}); |
||||
}) |
||||
}, |
||||
/** |
||||
* H5端图片压缩 |
||||
* 参数说明: |
||||
* imgSrc 图片url |
||||
* scale缩放比例 0-1 |
||||
* 返回base64 |
||||
* callback 回调设置返回值 |
||||
*/ |
||||
translate(imgSrc, scale, callback) { |
||||
var img = new Image(); |
||||
img.src = imgSrc; |
||||
img.onload = function() { |
||||
var that = this; |
||||
var h = that.height; // 默认按比例压缩 |
||||
var w = that.width; |
||||
var canvas = document.createElement('canvas'); |
||||
var ctx = canvas.getContext('2d'); |
||||
var width = document.createAttribute("width"); |
||||
width.nodeValue = w; |
||||
var height = document.createAttribute("height"); |
||||
height.nodeValue = h; |
||||
canvas.setAttributeNode(width); |
||||
canvas.setAttributeNode(height); |
||||
ctx.drawImage(that, 0, 0, w, h); |
||||
var base64 = canvas.toDataURL('image/jpeg', scale); //压缩比例 |
||||
canvas = null; |
||||
callback(base64); |
||||
} |
||||
}, |
||||
//提交审核 |
||||
submitbtn() { |
||||
if (!this.splitLowestRatio) { |
||||
uni.showToast({ |
||||
title: '请输入最低分账比例', |
||||
icon: "none", |
||||
duration: 2000 |
||||
}); |
||||
return; |
||||
} |
||||
if (!this.powerofattorney) { |
||||
uni.showToast({ |
||||
title: '请上传分账结算委托书', |
||||
icon: "none", |
||||
duration: 2000 |
||||
}); |
||||
return; |
||||
} |
||||
uni.showModal({ |
||||
title: '提交审核', |
||||
content: '确认信息是否正确。', |
||||
success: (res) => { |
||||
if (res.confirm) { |
||||
uni.showLoading({ |
||||
title: '提交审核中...' |
||||
}) |
||||
let datas = { |
||||
"merId": this.merId, |
||||
"platformType": 1, |
||||
"splitLowestRatio": this.splitLowestRatio, |
||||
"splitEntrustFilePath": this.powerofattorney[0] |
||||
} |
||||
merLedgerApply(datas).then(res => { |
||||
uni.hideLoading(); |
||||
if (res.return_code == '000000') { |
||||
uni.showToast({ |
||||
title: '提交成功', |
||||
icon: 'none', |
||||
duration: 2000, |
||||
success() { |
||||
setTimeout(() => { |
||||
uni.navigateBack({}) |
||||
}, 2000); |
||||
} |
||||
}) |
||||
} else { |
||||
uni.showToast({ |
||||
title: res.return_msg, |
||||
icon: 'none', |
||||
duration: 2000 |
||||
}) |
||||
} |
||||
}) |
||||
} else if (res.cancel) { |
||||
console.log('用户点击取消'); |
||||
} |
||||
} |
||||
}); |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss"> |
||||
.username { |
||||
width: calc(100% - 90upx); |
||||
height: 100upx; |
||||
display: flex; |
||||
align-items: center; |
||||
background-color: rgba($color: #ffffff, $alpha: 0.1); |
||||
border-bottom: 1px solid #f6f6f6; |
||||
padding: 8upx 45upx; |
||||
|
||||
input { |
||||
width: 50%; |
||||
height: 50upx; |
||||
font-size: 16px; |
||||
color: #333333; |
||||
font-weight: blod; |
||||
} |
||||
|
||||
.namecont { |
||||
color: #666666; |
||||
width: 28%; |
||||
} |
||||
} |
||||
|
||||
.btn { |
||||
color: #FFFFFF; |
||||
background-color: #0083f5; |
||||
width: 90%; |
||||
margin-left: 5%; |
||||
margin-top: 150rpx; |
||||
height: 90rpx; |
||||
display: flex; |
||||
justify-content: center; |
||||
align-items: center; |
||||
border-radius: 10rpx; |
||||
font-size: 40rpx; |
||||
} |
||||
|
||||
.notes { |
||||
width: calc(100% - 90upx); |
||||
display: flex; |
||||
align-items: center; |
||||
background-color: rgba($color: #ffffff, $alpha: 0.1); |
||||
border-bottom: 1px solid #f6f6f6; |
||||
padding: 20rpx 45rpx; |
||||
color: #bfbfbf; |
||||
|
||||
} |
||||
</style> |
After Width: | Height: | Size: 786 KiB |
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 740 B |
@ -1,2 +1,2 @@ |
||||
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>惠支付</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)')) |
||||
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/cweb/static/index.63b34199.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/cweb/static/js/chunk-vendors.65d11cca.js></script><script src=/cweb/static/js/index.a731bc12.js></script></body></html> |
||||
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/cweb/static/index.63b34199.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/cweb/static/js/chunk-vendors.65d11cca.js></script><script src=/cweb/static/js/index.95963628.js></script></body></html> |
Loading…
Reference in new issue