Initial commit (code only without large binaries)
This commit is contained in:
@@ -0,0 +1,121 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>添加支付方式</h3>
|
||||
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<csrf-token></csrf-token>
|
||||
|
||||
<table class="ui table selectable definition">
|
||||
<tr>
|
||||
<td class="title">支付方式名称 *</td>
|
||||
<td>
|
||||
<input type="text" name="name" maxlength="30" ref="focus"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>类型</td>
|
||||
<td>
|
||||
<select name="parentCode" class="ui dropdown auto-width" v-model="parentCode">
|
||||
<option value="">[自定义支付方式]</option>
|
||||
<option v-for="presetMethod in presetMethods" :value="presetMethod.code">{{presetMethod.name}}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>支付方式代号 *</td>
|
||||
<td>
|
||||
<input type="text" name="code" maxlength="60"/>
|
||||
<p class="comment">只能包含数字、字母和下划线;自定义支付页面可以根据此代号判断订单来自哪种支付方式。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>支付方式说明 *</td>
|
||||
<td>
|
||||
<textarea rows="3" name="description" maxlength="100"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>支持终端</td>
|
||||
<td>
|
||||
<select class="ui dropdown auto-width" name="clientType" v-model="clientTypeCode">
|
||||
<option v-for="clientType in clientTypes" :value="clientType.code">{{clientType.name}}</option>
|
||||
</select>
|
||||
<p class="comment" v-for="clientType in clientTypes" v-if="clientType.code == clientTypeCode">{{clientType.description}}</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-show="clientTypeCode == 'mobile'">
|
||||
<td>二维码扫描提示</td>
|
||||
<td>
|
||||
<input type="text" name="qrcodeTitle" maxlength="100"/>
|
||||
<p class="comment">用来提示用户使用App扫描二维码,类似于"请使用支付宝APP扫描下方二维码完成支付:"。</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 自定义支付方式 -->
|
||||
<tbody v-if="parentCode == ''">
|
||||
<tr>
|
||||
<td>自定义支付URL *</td>
|
||||
<td>
|
||||
<input type="text" name="url" maxlength="200"/>
|
||||
<p class="comment">用户选择此支付方式后,系统会将订单信息放在此URL参数中。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- 支付宝 -->
|
||||
<tbody v-if="parentCode == 'alipay'">
|
||||
<tr>
|
||||
<td>APPID *</td>
|
||||
<td>
|
||||
<input type="text" name="paramsAlipayAppId" maxlength="20"/>
|
||||
<p class="comment">签约的支付宝应用ID,为一组数字。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>私钥 *</td>
|
||||
<td>
|
||||
<textarea name="paramsAlipayPrivateKey" spellcheck="false"></textarea>
|
||||
<p class="comment">如果你获得的是证书文件,你需要将文件内容拷贝到这里。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>应用公钥证书 *</td>
|
||||
<td>
|
||||
<textarea name="paramsAlipayAppPublicCert" spellcheck="false"></textarea>
|
||||
<p class="comment">如果你获得的是证书文件,你需要将文件内容拷贝到这里。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>支付宝公钥证书 *</td>
|
||||
<td>
|
||||
<textarea name="paramsAlipayPublicCert" spellcheck="false"></textarea>
|
||||
<p class="comment">如果你获得的是证书文件,你需要将文件内容拷贝到这里。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>支付宝根证书 *</td>
|
||||
<td>
|
||||
<textarea name="paramsAlipayRootCert" spellcheck="false"></textarea>
|
||||
<p class="comment">如果你获得的是证书文件,你需要将文件内容拷贝到这里。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>产品代号 *</td>
|
||||
<td>
|
||||
<input type="text" name="paramsAlipayProductCode" maxlength="100" value="QUICK_WAP_WAY"/>
|
||||
<p class="comment">和支付宝签约的产品代号。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>沙箱应用</td>
|
||||
<td>
|
||||
<checkbox name="paramsAlipayIsSandbox"></checkbox>
|
||||
<p class="comment">选中后,表示当前支付宝应用为沙箱应用,仅用来模拟测试。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
@@ -0,0 +1,4 @@
|
||||
Tea.context(function () {
|
||||
this.parentCode = ""
|
||||
this.clientTypeCode = this.clientTypes[0].code
|
||||
})
|
||||
@@ -0,0 +1,42 @@
|
||||
{$layout}
|
||||
{$template "../menu"}
|
||||
|
||||
<second-menu>
|
||||
<menu-item @click.prevent="createMethod">[添加支付方式]</menu-item>
|
||||
</second-menu>
|
||||
|
||||
<p class="ui message warning" v-if="!enablePay">暂时未启用在线支付,去<a href="/finance/orders/setting">设置</a>。</p>
|
||||
|
||||
<div v-if="methods.length == 0">
|
||||
<not-found-box>暂时还没有支付方式。</not-found-box>
|
||||
</div>
|
||||
|
||||
<table class="ui table selectable celled" v-if="methods.length > 0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="three wide">支付方式</th>
|
||||
<th class="three wide">代号</th>
|
||||
<th>描述</th>
|
||||
<th class="width6">状态</th>
|
||||
<th class="two op">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="method in methods">
|
||||
<td>
|
||||
<a :href="'/finance/orders/methods/method?methodId=' + method.id">{{method.name}}</a>
|
||||
<div v-if="method.parentName.length > 0 || (method.clientType.length > 0 && method.clientType != 'all')">
|
||||
<grey-label v-if="method.parentName.length > 0">{{method.parentName}}</grey-label>
|
||||
<grey-label v-if="method.clientType.length > 0 && method.clientType != 'all'">{{method.clientTypeName}}</grey-label>
|
||||
</div>
|
||||
</td>
|
||||
<td>{{method.code}}</td>
|
||||
<td>{{method.description}}</td>
|
||||
<td>
|
||||
<label-on :v-is-on="method.isOn"></label-on>
|
||||
</td>
|
||||
<td>
|
||||
<a :href="'/finance/orders/methods/method?methodId=' + method.id">详情</a>
|
||||
<a href="" @click.prevent="deleteMethod(method.id)">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
24
EdgeAdmin/web/views/@default/finance/orders/methods/index.js
Normal file
24
EdgeAdmin/web/views/@default/finance/orders/methods/index.js
Normal file
@@ -0,0 +1,24 @@
|
||||
Tea.context(function () {
|
||||
this.createMethod = function () {
|
||||
teaweb.popup("/finance/orders/methods/createPopup", {
|
||||
height: "27em",
|
||||
callback: function () {
|
||||
teaweb.successRefresh("保存成功")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.deleteMethod = function (methodId) {
|
||||
let that = this
|
||||
|
||||
teaweb.confirm("确定要删除此支付方式吗?", function () {
|
||||
that.$post("/finance/orders/methods/method/delete")
|
||||
.params({
|
||||
methodId: methodId
|
||||
})
|
||||
.success(function () {
|
||||
teaweb.successRefresh("删除成功")
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,6 @@
|
||||
<first-menu>
|
||||
<menu-item href="/finance/orders/methods">支付方式</menu-item>
|
||||
<span class="item disabled" style="padding: 0">»</span>
|
||||
<menu-item :href="'/finance/orders/methods/method?methodId=' + method.id" code="index">"{{method.name}}"详情</menu-item>
|
||||
<menu-item :href="'/finance/orders/methods/method/update?methodId=' + method.id" code="update">修改</menu-item>
|
||||
</first-menu>
|
||||
@@ -0,0 +1,4 @@
|
||||
.scroll-box {
|
||||
max-height: 10em;
|
||||
}
|
||||
/*# sourceMappingURL=index.css.map */
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["index.less"],"names":[],"mappings":"AAAA;EACC,gBAAA","file":"index.css"}
|
||||
@@ -0,0 +1,121 @@
|
||||
{$layout}
|
||||
{$template "menu"}
|
||||
|
||||
<table class="ui table selectable definition">
|
||||
<tr>
|
||||
<td class="title">支付方式名称</td>
|
||||
<td>
|
||||
{{method.name}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>状态</td>
|
||||
<td>
|
||||
<label-on :v-is-on="method.isOn"></label-on>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>支付方式代号</td>
|
||||
<td>
|
||||
{{method.code}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>支付方式说明</td>
|
||||
<td>
|
||||
{{method.description}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>支持终端</td>
|
||||
<td>
|
||||
{{method.clientTypeName}}
|
||||
<p class="comment">{{method.clientTypeDescription}}</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>密钥</td>
|
||||
<td>{{method.secret}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>类型</td>
|
||||
<td>
|
||||
<span v-if="method.parentCode.length == 0">自定义</span>
|
||||
<span v-else>{{method.parentName}}</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr v-show="method.clientType == 'mobile'">
|
||||
<td>二维码扫描提示</td>
|
||||
<td>
|
||||
<div v-if="method.qrcodeTitle.length > 0">
|
||||
{{method.qrcodeTitle}}
|
||||
<p class="comment">用来提示用户使用App扫描二维码,类似于"请使用支付宝APP扫描下方二维码完成支付:"。</p>
|
||||
</div>
|
||||
<div v-else><span class="title disabled">没有设置</span></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 自定义支付 -->
|
||||
<tr v-show="method.parentCode.length == 0">
|
||||
<td class="color-border">自定义支付URL</td>
|
||||
<td>
|
||||
{{method.url}}
|
||||
<p class="comment">用户点击此支付方式后,系统将会跳转到这个支付URL并传递<code-label class="grey">{{urlArgs}}</code-label>。</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 支付宝 -->
|
||||
<tbody v-if="method.parentCode == 'alipay'">
|
||||
<tr>
|
||||
<td class="color-border">APPID</td>
|
||||
<td>
|
||||
{{method.params.appId}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="color-border">私钥</td>
|
||||
<td>
|
||||
<pre class="scroll-box">{{method.params.privateKey}}</pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="color-border">应用公钥证书</td>
|
||||
<td>
|
||||
<pre class="scroll-box">{{method.params.appPublicCert}}</pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="color-border">支付宝公钥证书</td>
|
||||
<td>
|
||||
<pre class="scroll-box">{{method.params.alipayPublicCert}}</pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="color-border">支付宝根证书</td>
|
||||
<td>
|
||||
<pre class="scroll-box">{{method.params.alipayRootCert}}</pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="color-border">产品代号</td>
|
||||
<td>
|
||||
{{method.params.productCode}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="color-border">沙箱应用</td>
|
||||
<td>
|
||||
<span v-if="method.params.isSandbox" class="green">Y</span>
|
||||
<span v-else class="disabled">N</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tr v-if="method.payNotifyURL.length > 0">
|
||||
<td class="color-border">支付结果通知URL</td>
|
||||
<td>{{method.payNotifyURL}}
|
||||
<p class="comment">前缀部分默认使用用户节点的第一个访问地址,<a href="/settings/userNodes">修改 »</a> </p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -0,0 +1,7 @@
|
||||
Tea.context(function () {
|
||||
this.urlArgs = ""
|
||||
if (this.method.url.indexOf("?") < 0) {
|
||||
this.urlArgs += "?"
|
||||
}
|
||||
this.urlArgs += "EdgeOrderMethod=" + this.method.code + "&EdgeOrderCode=$订单号&EdgeOrderAmount=$支付金额&EdgeOrderTimestamp=$时间戳&EdgeOrderSign=$参数签名"
|
||||
})
|
||||
@@ -0,0 +1,3 @@
|
||||
.scroll-box {
|
||||
max-height: 10em;
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
{$layout}
|
||||
{$template "menu"}
|
||||
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<csrf-token></csrf-token>
|
||||
|
||||
<input type="hidden" name="methodId" :value="method.id"/>
|
||||
|
||||
<table class="ui table selectable definition">
|
||||
<tr>
|
||||
<td class="title">支付方式名称 *</td>
|
||||
<td>
|
||||
<input type="text" name="name" maxlength="30" ref="focus" v-model="method.name"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>类型</td>
|
||||
<td>
|
||||
<span v-if="method.parentName.length == 0">自定义</span>
|
||||
<span v-else>{{method.parentName}}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>支付方式代号 *</td>
|
||||
<td>
|
||||
<input type="text" name="code" maxlength="60" v-model="method.code"/>
|
||||
<p class="comment">只能包含数字、字母和下划线;自定义支付页面可以根据此代号判断订单来自哪种支付方式。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>支付方式说明 *</td>
|
||||
<td>
|
||||
<textarea rows="3" name="description" maxlength="100" v-model="method.description"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>支持终端</td>
|
||||
<td>
|
||||
<select class="ui dropdown auto-width" name="clientType" v-model="method.clientType">
|
||||
<option v-for="clientType in clientTypes" :value="clientType.code">{{clientType.name}}</option>
|
||||
</select>
|
||||
<p class="comment" v-for="clientType in clientTypes" v-if="clientType.code == method.clientType">{{clientType.description}}</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-show="method.clientType == 'mobile'">
|
||||
<td>二维码扫描提示</td>
|
||||
<td>
|
||||
<input type="text" name="qrcodeTitle" maxlength="100" v-model="method.qrcodeTitle"/>
|
||||
<p class="comment">用来提示用户使用App扫描二维码,类似于"请使用支付宝APP扫描下方二维码完成支付:"。</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 自定义 -->
|
||||
<tbody v-if="method.parentCode == ''">
|
||||
<tr>
|
||||
<td>自定义支付URL *</td>
|
||||
<td>
|
||||
<input type="text" name="url" maxlength="200" v-model="method.url"/>
|
||||
<p class="comment">用户选择此支付方式后,系统会将订单信息放在此URL参数中。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- 支付宝 -->
|
||||
<tbody v-if="method.parentCode == 'alipay'">
|
||||
<tr>
|
||||
<td>APPID *</td>
|
||||
<td>
|
||||
<input type="text" name="paramsAlipayAppId" maxlength="20" v-model="method.params.appId"/>
|
||||
<p class="comment">签约的支付宝应用ID,为一组数字。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>私钥 *</td>
|
||||
<td>
|
||||
<textarea name="paramsAlipayPrivateKey" v-model="method.params.privateKey" spellcheck="false"></textarea>
|
||||
<p class="comment">如果你获得的是证书文件,你需要将文件内容拷贝到这里。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>应用公钥证书 *</td>
|
||||
<td>
|
||||
<textarea name="paramsAlipayAppPublicCert" v-model="method.params.appPublicCert" spellcheck="false"></textarea>
|
||||
<p class="comment">如果你获得的是证书文件,你需要将文件内容拷贝到这里。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>支付宝公钥证书 *</td>
|
||||
<td>
|
||||
<textarea name="paramsAlipayPublicCert" v-model="method.params.alipayPublicCert" spellcheck="false"></textarea>
|
||||
<p class="comment">如果你获得的是证书文件,你需要将文件内容拷贝到这里。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>支付宝根证书 *</td>
|
||||
<td>
|
||||
<textarea name="paramsAlipayRootCert" v-model="method.params.alipayRootCert" spellcheck="false"></textarea>
|
||||
<p class="comment">如果你获得的是证书文件,你需要将文件内容拷贝到这里。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>产品代号 *</td>
|
||||
<td>
|
||||
<input type="text" name="paramsAlipayProductCode" v-model="method.params.productCode" maxlength="100" value=""/>
|
||||
<p class="comment">和支付宝签约的产品代号。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>沙箱应用</td>
|
||||
<td>
|
||||
<checkbox name="paramsAlipayIsSandbox" v-model="method.params.isSandbox"></checkbox>
|
||||
<p class="comment">选中后,表示当前支付宝应用为沙箱应用,仅用来模拟测试。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tr>
|
||||
<td colspan="2"><more-options-indicator></more-options-indicator></td>
|
||||
</tr>
|
||||
<tbody v-show="moreOptionsVisible">
|
||||
<tr >
|
||||
<td>启用</td>
|
||||
<td>
|
||||
<checkbox name="isOn" v-model="method.isOn"></checkbox>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
@@ -0,0 +1,8 @@
|
||||
Tea.context(function () {
|
||||
this.success = function () {
|
||||
let that = this
|
||||
teaweb.success("保存成功", function () {
|
||||
window.location = "/finance/orders/methods/method?methodId=" + that.method.id
|
||||
})
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user