commit
126b6b59bb
@ -0,0 +1,77 @@
|
||||
package au.com.royalpay.payment.manage.billqrcode.bean;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class NewBillQrCodeBean {
|
||||
|
||||
private BigDecimal order_amount;
|
||||
|
||||
private String currency = "AUD";
|
||||
|
||||
private String remark;
|
||||
|
||||
private String cancle_time;
|
||||
|
||||
private String client_order_id;
|
||||
|
||||
public JSONObject toJson(){
|
||||
JSONObject record = new JSONObject();
|
||||
if(order_amount != null){
|
||||
record.put("order_amount",order_amount);
|
||||
}
|
||||
if(StringUtils.isNotEmpty(remark)){
|
||||
record.put("remark",remark);
|
||||
}
|
||||
if(StringUtils.isNotEmpty(client_order_id)){
|
||||
record.put("client_order_id",client_order_id);
|
||||
}
|
||||
if (StringUtils.isNotEmpty(cancle_time)) {
|
||||
record.put("cancle_time",cancle_time);
|
||||
}
|
||||
record.put("currency",currency);
|
||||
return record;
|
||||
}
|
||||
|
||||
public BigDecimal getOrder_amount() {
|
||||
return order_amount;
|
||||
}
|
||||
|
||||
public void setOrder_amount(BigDecimal order_amount) {
|
||||
this.order_amount = order_amount;
|
||||
}
|
||||
|
||||
public String getCurrency() {
|
||||
return currency;
|
||||
}
|
||||
|
||||
public void setCurrency(String currency) {
|
||||
this.currency = currency;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getCancle_time() {
|
||||
return cancle_time;
|
||||
}
|
||||
|
||||
public void setCancle_time(String cancle_time) {
|
||||
this.cancle_time = cancle_time;
|
||||
}
|
||||
|
||||
public String getClient_order_id() {
|
||||
return client_order_id;
|
||||
}
|
||||
|
||||
public void setClient_order_id(String client_order_id) {
|
||||
this.client_order_id = client_order_id;
|
||||
}
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package au.com.royalpay.payment.manage.billqrcode.bean;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* Created by yuan on 2018/5/9.
|
||||
*/
|
||||
public class QueryBillBean {
|
||||
private int limit = 10;
|
||||
private int page = 1;
|
||||
private String status;
|
||||
private String client_order_id;
|
||||
|
||||
public JSONObject toJson(){
|
||||
JSONObject jason = new JSONObject();
|
||||
if(StringUtils.isNotEmpty(status)){
|
||||
jason.put("status",status);
|
||||
}
|
||||
if(StringUtils.isNotEmpty(client_order_id)){
|
||||
jason.put("client_order_id",client_order_id);
|
||||
}
|
||||
return jason;
|
||||
}
|
||||
|
||||
public int getLimit() {
|
||||
return limit;
|
||||
}
|
||||
|
||||
public void setLimit(int limit) {
|
||||
this.limit = limit;
|
||||
}
|
||||
|
||||
public int getPage() {
|
||||
return page;
|
||||
}
|
||||
|
||||
public void setPage(int page) {
|
||||
this.page = page;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getClient_order_id() {
|
||||
return client_order_id;
|
||||
}
|
||||
|
||||
public void setClient_order_id(String client_order_id) {
|
||||
this.client_order_id = client_order_id;
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package au.com.royalpay.payment.manage.billqrcode.core;
|
||||
|
||||
import au.com.royalpay.payment.manage.billqrcode.bean.NewBillQrCodeBean;
|
||||
import au.com.royalpay.payment.manage.billqrcode.bean.QueryBillBean;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by yuan on 2018/5/3.
|
||||
*/
|
||||
public interface PartnerBillService {
|
||||
String saveBill(JSONObject partner, NewBillQrCodeBean newBillQrCodeBean);
|
||||
|
||||
List<JSONObject> listBills(JSONObject partner, QueryBillBean queryBillBean);
|
||||
|
||||
void dailyCheckDirectedBillCode();
|
||||
|
||||
void disableBills(JSONObject partner,String bill_code_id);
|
||||
}
|
@ -0,0 +1,126 @@
|
||||
package au.com.royalpay.payment.manage.billqrcode.core.impl;
|
||||
|
||||
import au.com.royalpay.payment.manage.billqrcode.bean.NewBillQrCodeBean;
|
||||
import au.com.royalpay.payment.manage.billqrcode.bean.QueryBillBean;
|
||||
import au.com.royalpay.payment.manage.billqrcode.core.PartnerBillService;
|
||||
import au.com.royalpay.payment.manage.mappers.billqrcode.DirectedBillCodeMapper;
|
||||
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
|
||||
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
|
||||
import au.com.royalpay.payment.tools.env.PlatformEnvironment;
|
||||
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
|
||||
import au.com.royalpay.payment.tools.exceptions.NotFoundException;
|
||||
import au.com.royalpay.payment.tools.utils.QRCodeUtils;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.miemiedev.mybatis.paginator.domain.Order;
|
||||
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
|
||||
import org.apache.commons.lang3.RandomStringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
import org.apache.commons.lang3.time.DateUtils;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by yuan on 2018/5/3.
|
||||
*/
|
||||
@Service
|
||||
public class PartnerBillServiceImpl implements PartnerBillService {
|
||||
private org.slf4j.Logger logger = LoggerFactory.getLogger(getClass());
|
||||
@Resource
|
||||
private ClientMapper clientMapper;
|
||||
|
||||
@Resource
|
||||
private ClientManager clientManager;
|
||||
|
||||
@Resource
|
||||
private DirectedBillCodeMapper directedBillCodeMapper;
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public String saveBill(JSONObject partner, NewBillQrCodeBean newBillQrCodeBean) {
|
||||
JSONObject client = clientMapper.findClientByMoniker(partner.getString("client_moniker"));
|
||||
if (client == null) {
|
||||
throw new NotFoundException("client info not found");
|
||||
}
|
||||
if(StringUtils.isNotEmpty(newBillQrCodeBean.getClient_order_id())){
|
||||
JSONObject bill = directedBillCodeMapper.findOne(newBillQrCodeBean.getClient_order_id());
|
||||
if(bill != null){
|
||||
if(bill.getIntValue("status") == 2){
|
||||
throw new BadRequestException("该订单已关闭,请确认");
|
||||
}
|
||||
if(bill.getIntValue("status") == 3){
|
||||
throw new BadRequestException("该订单已完成,请确认");
|
||||
}
|
||||
if(bill.getIntValue("status") == 1){
|
||||
if(bill.getBigDecimal("order_amount") == newBillQrCodeBean.getOrder_amount()){
|
||||
return QRCodeUtils.qrcodeImageCode(bill.getString("code_url"), 250, false);
|
||||
}
|
||||
throw new BadRequestException("已有相同订单号正在被支付,详情请查看订单列表");
|
||||
}
|
||||
}
|
||||
}
|
||||
JSONObject record = newBillQrCodeBean.toJson();
|
||||
if(record.getString("client_order_id") == null){
|
||||
record.put("client_order_id","Bill_" + DateFormatUtils.format(new Date(), "yyyyMMddHHmmss") + "_" + RandomStringUtils.random(5, true, true).toUpperCase());
|
||||
}
|
||||
record.put("client_id",partner.getIntValue("client_id"));
|
||||
record.put("create_time", new Date());
|
||||
record.put("status",1);
|
||||
directedBillCodeMapper.save(record);
|
||||
String code_url = getQRCodeImg(record);
|
||||
record.put("code_url",code_url);
|
||||
directedBillCodeMapper.update(record);
|
||||
return QRCodeUtils.qrcodeImageCode(code_url, 250, false);
|
||||
}
|
||||
|
||||
private String getQRCodeImg(JSONObject bill){
|
||||
return PlatformEnvironment.getEnv().concatUrl("api/v1.0/share_code/business/bills/"+bill.getString("bill_code_id"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> listBills(JSONObject partner, QueryBillBean queryBillBean) {
|
||||
int client_id = partner.getInteger("client_id");
|
||||
JSONObject client = clientManager.getClientInfo(client_id);
|
||||
if (client == null) {
|
||||
throw new NotFoundException("client info not found");
|
||||
}
|
||||
JSONObject params = queryBillBean.toJson();
|
||||
params.put("client_id",client_id);
|
||||
List<JSONObject> bills = directedBillCodeMapper.findByClientId(params,new PageBounds(queryBillBean.getPage(),queryBillBean.getLimit(), Order.formString("create_time.desc")));
|
||||
bills.stream().filter(t->StringUtils.isNotEmpty(t.getString("code_url"))).forEach(t->t.put("code_url",QRCodeUtils.qrcodeImageCode(t.getString("code_url"), 250, false)));
|
||||
return bills;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableBills(JSONObject partner, String bill_code_id) {
|
||||
int client_id = partner.getInteger("client_id");
|
||||
JSONObject client = clientManager.getClientInfo(client_id);
|
||||
if (client == null) {
|
||||
throw new NotFoundException("client info not found");
|
||||
}
|
||||
JSONObject bill = directedBillCodeMapper.findOneByBillCodeId(bill_code_id);
|
||||
if(bill.getIntValue("status")==1){
|
||||
if(bill.getString("order_id") != null){
|
||||
bill.put("status",2);
|
||||
directedBillCodeMapper.update(bill);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dailyCheckDirectedBillCode() {
|
||||
List<JSONObject> listAllBill = directedBillCodeMapper.listAllBills();
|
||||
for (JSONObject bill: listAllBill) {
|
||||
if(DateUtils.addDays(bill.getDate("cancle_time"),1).before(new Date())){
|
||||
bill.put("status",2);
|
||||
directedBillCodeMapper.update(bill);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package au.com.royalpay.payment.manage.billqrcode.web;
|
||||
|
||||
import au.com.royalpay.payment.manage.billqrcode.bean.NewBillQrCodeBean;
|
||||
import au.com.royalpay.payment.manage.billqrcode.bean.QueryBillBean;
|
||||
import au.com.royalpay.payment.manage.billqrcode.core.PartnerBillService;
|
||||
import au.com.royalpay.payment.manage.permission.manager.PartnerMapping;
|
||||
import au.com.royalpay.payment.tools.CommonConsts;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by yuan on 2018/5/3.
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/partner/qrcode")
|
||||
public class PartnerBillController {
|
||||
|
||||
@Resource
|
||||
private PartnerBillService partnerBillService;
|
||||
|
||||
@PartnerMapping(value = "/bills", method = RequestMethod.POST)
|
||||
public String addBill(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, @RequestBody NewBillQrCodeBean newBillQrCodeBean) {
|
||||
return partnerBillService.saveBill(partner, newBillQrCodeBean);
|
||||
}
|
||||
|
||||
@PartnerMapping(value = "", method = RequestMethod.GET)
|
||||
public List<JSONObject> listBills(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, QueryBillBean queryBillBean) {
|
||||
return partnerBillService.listBills(partner,queryBillBean);
|
||||
}
|
||||
@PartnerMapping(value = "/{bill_code_id}", method = RequestMethod.DELETE)
|
||||
public void disableBills(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner,@PathVariable String bill_code_id) {
|
||||
partnerBillService.disableBills(partner,bill_code_id);
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package au.com.royalpay.payment.manage.mappers.billqrcode;
|
||||
|
||||
import cn.yixblog.support.mybatis.autosql.annotations.AdvanceSelect;
|
||||
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
|
||||
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
|
||||
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@AutoMapper(tablename = "pmt_directed_bill_code", pkName = "bill_code_id")
|
||||
public interface DirectedBillCodeMapper {
|
||||
@AutoSql(type = SqlType.INSERT)
|
||||
int save(JSONObject record);
|
||||
|
||||
@AutoSql(type = SqlType.SELECT)
|
||||
JSONObject findOne(@Param("client_order_id") String client_order_id);
|
||||
|
||||
@AutoSql(type = SqlType.SELECT)
|
||||
JSONObject findOneByBillCodeId(@Param("bill_code_id") String bill_code_id);
|
||||
|
||||
@AutoSql(type = SqlType.UPDATE)
|
||||
int update(JSONObject record);
|
||||
|
||||
@AutoSql(type = SqlType.SELECT)
|
||||
List<JSONObject> findByClientId(JSONObject params, PageBounds pageBounds);
|
||||
|
||||
@AutoSql(type = SqlType.SELECT)
|
||||
@AdvanceSelect(addonWhereClause = "status=1")
|
||||
List<JSONObject> listAllBills();
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package au.com.royalpay.payment.manage.system.web;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = "/mailgun")
|
||||
public class MailCallBackController {
|
||||
Logger logger = LoggerFactory.getLogger(getClass());
|
||||
@RequestMapping(value = "/callback", method = RequestMethod.POST)
|
||||
public void contractList(@RequestBody String content, HttpServletRequest req) {
|
||||
logger.info(content);
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package au.com.royalpay.payment.manage.task;
|
||||
|
||||
import au.com.royalpay.payment.manage.billqrcode.core.PartnerBillService;
|
||||
import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* Created by yuan on 2018/5/4.
|
||||
*/
|
||||
@Component
|
||||
@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true")
|
||||
public class DirectedBillCodeStatusDailyCheck {
|
||||
@Resource
|
||||
private PartnerBillService partnerBillService;
|
||||
@Resource
|
||||
private SynchronizedScheduler synchronizedScheduler;
|
||||
|
||||
@Scheduled(cron = "0 30 5 * * ?")
|
||||
public void statusDailyCheck() {
|
||||
synchronizedScheduler.executeProcess("manage_task:dailyCheckDirected", 120_000,
|
||||
() -> partnerBillService.dailyCheckDirectedBillCode());
|
||||
}
|
||||
}
|
@ -1,23 +1,35 @@
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Client</th>
|
||||
<th>Send Name</th>
|
||||
<th>Act Name</th>
|
||||
<th>Operation</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="client in clients">
|
||||
<td>{{client.short_name}}({{client.client_moniker}})</td>
|
||||
<td ng-bind="client.send_name"></td>
|
||||
<td ng-bind="client.act_name"></td>
|
||||
<td>
|
||||
<a role="button" ng-click="editClientInfo(client)"><i class="fa fa-cog"></i></a>
|
||||
<a role="button" ng-click="deleteClient(client)" class="text-danger"><i class="fa fa-trash"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="box box-warning">
|
||||
<div class="box-header">
|
||||
<div class="form-inline">
|
||||
<div class="form-group">
|
||||
<button class="btn btn-success" type="button" ng-click="addAttendClient()"><i class="fa fa-plus"></i> New Attend Partner</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="box box-warning">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Client</th>
|
||||
<th>Send Name</th>
|
||||
<th>Act Name</th>
|
||||
<th>Operation</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="client in clients">
|
||||
<td>{{client.short_name}}({{client.client_moniker}})</td>
|
||||
<td ng-bind="client.send_name"></td>
|
||||
<td ng-bind="client.act_name"></td>
|
||||
<td>
|
||||
<a role="button" ng-click="editClientInfo(client)"><i class="fa fa-cog"></i></a>
|
||||
<a role="button" ng-click="deleteClient(client)" class="text-danger"><i class="fa fa-trash"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,37 +1,206 @@
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Client Moniker</th>
|
||||
<th>status</th>
|
||||
<th>Order Amount</th>
|
||||
<th>Create Time</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="order in orders">
|
||||
<td>{{order.client_moniker}}</td>
|
||||
<td>{{order.status|send_status}}</td>
|
||||
<td>{{order.order_amount}}</td>
|
||||
<td>{{order.create_time}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="box box-warning">
|
||||
<div class="box-header">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="form-horizontal">
|
||||
<div class="form-group col-xs-12 col-sm-12">
|
||||
<label class="control-label col-xs-4 col-sm-2">Date Range</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="form-control-static form-inline">
|
||||
<div style="display: inline-block">
|
||||
<input class="form-control" id="date-from-input"
|
||||
ng-model="analysis.begin"
|
||||
uib-datepicker-popup size="10" placeholder="From"
|
||||
is-open="analysis_dateBegin.open" ng-click="analysis_dateBegin.open=true"
|
||||
datepicker-options="{maxDate:analysis.end||today}">
|
||||
</div>
|
||||
~
|
||||
<div style="display: inline-block">
|
||||
<input class="form-control" id="date-to-input" ng-model="analysis.end"
|
||||
uib-datepicker-popup size="10" placeholder="To"
|
||||
is-open="analysis_dateTo.open" ng-click="analysis_dateTo.open=true"
|
||||
datepicker-options="{minDate:analysis.begin,maxDate:today}">
|
||||
</div>
|
||||
|
||||
<div class="box-footer" ng-if="orders.length">
|
||||
<uib-pagination class="pagination"
|
||||
total-items="redpack_order_pagination.totalCount"
|
||||
boundary-links="true"
|
||||
ng-model="redpack_order_pagination.page"
|
||||
items-per-page="redpack_order_pagination.limit"
|
||||
max-size="10"
|
||||
ng-change="listOrders()"
|
||||
previous-text="‹"
|
||||
next-text="›"
|
||||
first-text="«"
|
||||
last-text="»"></uib-pagination>
|
||||
<!--<div class="btn-group">-->
|
||||
<!--<a role="button" class="btn btn-default btn-sm"-->
|
||||
<!--ng-click="chooseToday()">Today</a>-->
|
||||
<!--</div>-->
|
||||
<!--<div class="btn-group">-->
|
||||
<!--<a role="button" class="btn btn-default btn-sm"-->
|
||||
<!--ng-click="chooseYesterday()">Yesterday</a>-->
|
||||
<!--</div>-->
|
||||
<div class="btn-group">
|
||||
<a role="button" class="btn btn-default btn-sm"
|
||||
ng-click="chooseLast7Days()">Last 7 Days</a>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<a role="button" class="btn btn-default btn-sm"
|
||||
ng-click="thisMonth()">This Month</a>
|
||||
</div>
|
||||
<!--<div class="btn-group">-->
|
||||
<!--<a role="button" class="btn btn-default btn-sm"-->
|
||||
<!--ng-click="lastMonth()">Last Month</a>-->
|
||||
<!--</div>-->
|
||||
<!--<div class="btn-group">-->
|
||||
<!--<a role="button" class="btn btn-default btn-sm"-->
|
||||
<!--ng-click="thisYear()">This Year</a>-->
|
||||
<!--</div>-->
|
||||
<!--<div class="btn-group" uib-dropdown ng-if="currentUser.client.has_children">-->
|
||||
<!--<button id="single-button" type="button" class="btn btn-primary"-->
|
||||
<!--uib-dropdown-toggle ng-disabled="disabled">-->
|
||||
<!--{{chooseShow}} <span class="caret"></span>-->
|
||||
<!--</button>-->
|
||||
<!--<ul class="dropdown-menu" uib-dropdown-menu aria-labelledby="single-button" style="min-width: 80px">-->
|
||||
<!--<li><a ng-click="chooseClient('All')">All</a></li>-->
|
||||
<!--<li ng-repeat="client in clients"><a ng-click="chooseClient(client)">{{client.short_name}}</a></li>-->
|
||||
<!--</ul>-->
|
||||
<!--</div>-->
|
||||
<button class="btn btn-success" type="button"
|
||||
ng-click="doAnalysis()">
|
||||
<i class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="box-body">
|
||||
<div class="chart col-md-12" echarts="customerRedPackSendLogsHistory" style="height: 300px"
|
||||
ng-class="{nodata:customerRedPackSendLogsHistory.nodata}"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box box-warning">
|
||||
<div class="box-header">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">Total Records:{{redpack_order_pagination.totalCount}};Total Pages:{{redpack_order_pagination.totalPages}}</div>
|
||||
<div class="col-sm-12">
|
||||
<div class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-4" for="partner-search">Partner Name</label>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<input type="text" class="form-control" id="partner-search"
|
||||
ng-enter="listOrders(1)"
|
||||
ng-model="params.short_name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-4" for="code-search">Partner Code</label>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<input type="text" class="form-control" id="code-search"
|
||||
ng-enter="listOrders(1)"
|
||||
ng-model="params.client_moniker">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-2 col-sm-4" for="sub-merchant-search">
|
||||
<span ng-bind='act.channel'></span>
|
||||
Nickname</label>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<input type="text" class="form-control" id="sub-merchant-search"
|
||||
ng-enter="listOrders(1)"
|
||||
ng-model="params.nickname">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-xs-12 col-sm-12">
|
||||
<label class="control-label col-xs-4 col-sm-2">Date Range</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="form-control-static form-inline">
|
||||
|
||||
<div style="display: inline-block">
|
||||
<input class="form-control" id="date-from-input-logs"
|
||||
ng-model="params.begin"
|
||||
uib-datepicker-popup size="10" placeholder="From"
|
||||
is-open="dateBegin.open" ng-click="dateBegin.open=true"
|
||||
datepicker-options="{maxDate:params.end||today}">
|
||||
</div>
|
||||
~
|
||||
<div style="display: inline-block">
|
||||
<input class="form-control" id="date-to-input-logs"
|
||||
ng-model="params.end"
|
||||
uib-datepicker-popup size="10" placeholder="To"
|
||||
is-open="dateTo.open" ng-click="dateTo.open=true"
|
||||
datepicker-options="{minDate:params.begin,maxDate:today}">
|
||||
</div>
|
||||
|
||||
<div class="btn-group">
|
||||
<a role="button" class="btn btn-default btn-sm"
|
||||
ng-click="chooseTodayForLogs()">Today</a>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<a role="button" class="btn btn-default btn-sm"
|
||||
ng-click="chooseYesterdayForLogs()">Yesterday</a>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<a role="button" class="btn btn-default btn-sm"
|
||||
ng-click="chooseLast7DaysForLogs()">Last 7 Days</a>
|
||||
</div>
|
||||
<button class="btn btn-success" type="button"
|
||||
ng-click="listOrders(1)">
|
||||
<i class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
Orders<span style="font-size: smaller;color: grey">(总共红包{{luckyMoneyAnalysis.total_counts}}|{{luckyMoneyAnalysis.total_amount}}¥;
|
||||
已发红包{{luckyMoneyAnalysis.send_counts}}|{{luckyMoneyAnalysis.send_amount}}¥;客户所得红包{{luckyMoneyAnalysis.receive_counts}}|{{luckyMoneyAnalysis.receive_amount}}¥
|
||||
待发送红包{{luckyMoneyAnalysis.unsend_counts}}|{{luckyMoneyAnalysis.unsend_amount}}¥)</span></div>
|
||||
<div class="panel-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Client Moniker</th>
|
||||
<th>Lucky Money</th>
|
||||
<th>Order Amount</th>
|
||||
<th>Nick Name</th>
|
||||
<th>status</th>
|
||||
<th>Event Time</th>
|
||||
<th>Create Time</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="order in orders">
|
||||
<td>{{order.client_moniker}}</td>
|
||||
<td>{{order.red_packet_amount}}</td>
|
||||
<td>{{order.order_amount}}</td>
|
||||
<td><span><img style="height: 30px;width: 30px" class="img-circle"
|
||||
ng-src="{{order.headimg}}"> {{order.nickname}}</span></td>
|
||||
<td>{{order.status|send_status}}</td>
|
||||
<td>{{order.event_time}}</td>
|
||||
<td>{{order.create_time}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="box-footer" ng-if="orders.length">
|
||||
<uib-pagination class="pagination"
|
||||
total-items="redpack_order_pagination.totalCount"
|
||||
boundary-links="true"
|
||||
ng-model="redpack_order_pagination.page"
|
||||
items-per-page="redpack_order_pagination.limit"
|
||||
max-size="10"
|
||||
ng-change="listOrders()"
|
||||
previous-text="‹"
|
||||
next-text="›"
|
||||
first-text="«"
|
||||
last-text="»"></uib-pagination>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">Total Records:{{redpack_order_pagination.totalCount}};Total Pages:{{redpack_order_pagination.totalPages}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
@ -0,0 +1,51 @@
|
||||
<div class="modal-header">
|
||||
<h4>Edit Client{{client.act_id}}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<form name="clientForm" novalidate>
|
||||
<label class="control-label col-sm-6" for="act-name-input">Partner Code</label>
|
||||
<div class="col-sm-6">
|
||||
<input class="form-control" ng-model="client.client_moniker"
|
||||
type="text"
|
||||
name="act_name"
|
||||
id="client_moniker-input">
|
||||
</div>
|
||||
<div class="form-group"
|
||||
ng-class="{'has-error':clientForm.client_moniker.$invalid && clientForm.client_moniker.$dirty}">
|
||||
<label class="control-label col-sm-6" for="send-name-input">Send Name</label>
|
||||
|
||||
<div class="col-sm-6">
|
||||
<input class="form-control" ng-model="client.send_name"
|
||||
type="text"
|
||||
name="send_name"
|
||||
id="send-name-input">
|
||||
</div>
|
||||
|
||||
<label class="control-label col-sm-6" for="act-name-input">Act Name</label>
|
||||
<div class="col-sm-6">
|
||||
<input class="form-control" ng-model="client.act_name"
|
||||
type="text"
|
||||
name="act_name"
|
||||
id="act-name-input">
|
||||
</div>
|
||||
<label class="control-label col-sm-6" for="wishing-input">Wishing</label>
|
||||
<div class="col-sm-6">
|
||||
<input class="form-control" ng-model="client.wishing"
|
||||
type="text"
|
||||
name="wishing"
|
||||
id="wishing-input">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<div class="alert alert-danger" ng-if="errmsg" ng-bind="errmsg"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-danger" ng-click="$dismiss()">Cancel</button>
|
||||
<button type="button" class="btn btn-success" ng-click="doAddClientInfo()">save</button>
|
||||
</div>
|
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.7 KiB |
@ -0,0 +1,180 @@
|
||||
<style>
|
||||
.delete {
|
||||
text-decoration-line: line-through;
|
||||
}
|
||||
</style>
|
||||
<div ui-view>
|
||||
<section class="content-header">
|
||||
<h1>Bill QR Code</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li>
|
||||
<i class="fa fa-sitemap"></i> Bill QR Code
|
||||
</li>
|
||||
<li class="active">Bill QR Code Management</li>
|
||||
</ol>
|
||||
</section>
|
||||
|
||||
<div class="content">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="box-solid">
|
||||
<div class="box box-warning">
|
||||
<div class="box-header">
|
||||
<div class="form-horizontal col-sm-8">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-4 col-sm-3">* Order Amount</label>
|
||||
<div class="col-xs-8 col-sm-6">
|
||||
<div class="input-group">
|
||||
<input type="number" step="0.01" name="order_amount" class="form-control form-control-float"
|
||||
ng-model="new_bill.order_amount" required
|
||||
onkeyup="this.value=this.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
|
||||
aria-describedby="basic-addon2">
|
||||
<span class="input-group-addon" id="basic-addon2">$</span>
|
||||
</div>
|
||||
<p class="small text-info"></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-4 col-sm-3">* Expire Date</label>
|
||||
<div class="col-xs-8 col-sm-6">
|
||||
<input class="form-control" ng-model="new_bill.cancle_time"
|
||||
uib-datepicker-popup size="10" is-open="ctrl.dateInput"
|
||||
ng-click="ctrl.dateInput=true"
|
||||
datepicker-options="{minDate:minDate,maxDate:maxDate}" name="cancle_time" required>
|
||||
<p class="small text-info">The date of expiry should not exceed fifteen days</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-4 col-sm-3">Reference NO</label>
|
||||
<div class="col-xs-8 col-sm-6">
|
||||
<input class="form-control" ng-model="new_bill.client_order_id">
|
||||
<p class="small text-info"> System will automatically generate when the Reference NO is empty</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-4 col-sm-3">Remark</label>
|
||||
<div class="col-xs-8 col-sm-6">
|
||||
<textarea maxlength="100" class="form-control" ng-model="new_bill.remark"></textarea>
|
||||
<p class="small text-info">within 100 characters</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-4 col-sm-3"></label>
|
||||
<div class="col-sm-6">
|
||||
<button class="btn btn-success" ng-click="generateBill()">generate
|
||||
</button>
|
||||
<button class="btn btn-primary" ng-click="clearBill()">clear</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4" style="text-align: center" ng-if="code_url">
|
||||
<a class="thumbnail" download ng-href="{{code_url}}" uib-tooltip="Download">
|
||||
<img ng-src="{{code_url}}">
|
||||
</a>
|
||||
<p>
|
||||
<a ng-href="{{code_url}}" download><i class="fa fa-download"></i> Download Bill QR
|
||||
Code Image</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box box-warning">
|
||||
<div class="box-header">
|
||||
<div class="form-inline">
|
||||
<div class="form-group">
|
||||
<label class="control-label">Bill Status</label>
|
||||
|
||||
<a role="button" ng-class="{'bg-primary':params.status==null}"
|
||||
ng-click="params.status=null;loadBills(1)">All</a> |
|
||||
<a role="button" ng-class="{'bg-primary':params.status==3}"
|
||||
ng-click="params.status=3;loadBills(1)">Success</a> |
|
||||
<a role="button" ng-class="{'bg-primary':params.status==2}"
|
||||
ng-click="params.status=2;loadBills(1)">Disabled</a>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label" >Reference NO</label>
|
||||
<input type="text" class="form-control"
|
||||
ng-model="params.client_order_id"
|
||||
ng-enter="loadBills(1)">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button class="btn btn-primary" type="button" ng-click="loadBills(1)"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">
|
||||
Bill List
|
||||
</h3>
|
||||
</div>
|
||||
<div class="box-body table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Order Amount</th>
|
||||
<th>Reference NO</th>
|
||||
<th>Payer</th>
|
||||
<th>Order Status</th>
|
||||
<th>Bill Status</th>
|
||||
<th>Expire Date</th>
|
||||
<th>Remark</th>
|
||||
<th>Create time</th>
|
||||
<th>Operation</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="bill in bills"
|
||||
ng-class="{'delete':bill.status==2}">
|
||||
<td ng-bind="bill.order_amount | currency:'AUD '"></td>
|
||||
<th ng-bind="bill.client_order_id"></th>
|
||||
<td ng-bind="bill.nickname"></td>
|
||||
<th ng-bind="bill.order_status|tradeStatus"></th>
|
||||
<th ng-bind="bill.status|billStatus"></th>
|
||||
<td ng-bind="bill.cancle_time |limitTo:10"></td>
|
||||
<td ng-bind="bill.remark|remarkCut:true:10:'...'"></td>
|
||||
<td ng-bind="bill.create_time"></td>
|
||||
<td>
|
||||
<a ng-if="bill.order_id&&bill.status!=2" class="text-primary" role="button" title="Detail"
|
||||
ng-click="showTradeDetail(bill)">
|
||||
<i class="fa fa-search"></i>
|
||||
</a>
|
||||
<a ng-if="bill.code_url&&bill.status==1" ng-href="{{bill.code_url}}" download><i
|
||||
class="fa fa-download"
|
||||
uib-tooltip="Download Bill QR Code Image"></i></a>
|
||||
<a ng-if="!bill.order_id&&bill.status==1"
|
||||
class="text-bold text-danger" role="button" ng-click="disableBill(bill)">Disable</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="box-footer" ng-if="bills.length">
|
||||
<uib-pagination class="pagination"
|
||||
total-items="pagination.totalCount"
|
||||
boundary-links="true"
|
||||
ng-model="pagination.page"
|
||||
items-per-page="pagination.limit"
|
||||
max-size="10"
|
||||
ng-change="loadBills(1)"
|
||||
previous-text="‹"
|
||||
next-text="›"
|
||||
first-text="«"
|
||||
last-text="»"></uib-pagination>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">Total Records:{{pagination.totalCount}};Total
|
||||
Pages:{{pagination.totalPages}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -1,158 +1,146 @@
|
||||
<div ui-view>
|
||||
<section class="content-header">
|
||||
<h1>List of Products Sold</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li>
|
||||
<i class="fa fa-sitemap"></i> Products & Sale
|
||||
</li>
|
||||
<li class="active">Sale</li>
|
||||
</ol>
|
||||
</section>
|
||||
|
||||
<div class="content">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="box-solid">
|
||||
<div class="box box-warning">
|
||||
<div class="box-header">
|
||||
<div class="form-inline">
|
||||
<div class="form-group col-xs-12">
|
||||
<label class="control-label col-xs-4 col-sm-2">Status</label>
|
||||
<div class="col-sm-10 col-xs-8">
|
||||
<p class="form-control-static">
|
||||
<a role="button" ng-class="{'bg-primary':params.status=='ALL'}"
|
||||
ng-click="params.status='ALL';loadGoodOrders(1)">All</a> |
|
||||
<a role="button" ng-class="{'bg-primary':params.status=='PAID'}"
|
||||
ng-click="params.status='1';loadGoodOrders(1)">Payment Success</a> |
|
||||
<a role="button" ng-class="{'bg-primary':params.status=='UNPAID'}"
|
||||
ng-click="params.status='0';loadGoodOrders(1)">Waiting for Payment</a>
|
||||
</p>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="box-solid">
|
||||
<div class="box box-warning">
|
||||
<div class="box-header">
|
||||
<div class="form-inline">
|
||||
<div class="form-group col-xs-12">
|
||||
<label class="control-label col-xs-4 col-sm-2">Status</label>
|
||||
<div class="col-sm-10 col-xs-8">
|
||||
<p class="form-control-static">
|
||||
<a role="button" ng-class="{'bg-primary':params.status=='ALL'}"
|
||||
ng-click="params.status='ALL';loadGoodOrders(1)">All</a> |
|
||||
<a role="button" ng-class="{'bg-primary':params.status=='PAID'}"
|
||||
ng-click="params.status='1';loadGoodOrders(1)">Payment Success</a> |
|
||||
<a role="button" ng-class="{'bg-primary':params.status=='UNPAID'}"
|
||||
ng-click="params.status='0';loadGoodOrders(1)">Waiting for Payment</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-xs-12">
|
||||
<label class="control-label col-xs-4 col-sm-2">Date Range</label>
|
||||
<div class="col-sm-10 col-xs-8">
|
||||
<div class="form-control-static form-inline">
|
||||
<div style="display: inline-block">
|
||||
<input class="form-control" id="date-from-input" ng-model="params.datefrom"
|
||||
uib-datepicker-popup size="10" placeholder="From"
|
||||
is-open="dateBegin.open" ng-click="dateBegin.open=true"
|
||||
datepicker-options="{maxDate:params.dateto||today}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-xs-12">
|
||||
<label class="control-label col-xs-4 col-sm-2">Date Range</label>
|
||||
<div class="col-sm-10 col-xs-8">
|
||||
<div class="form-control-static form-inline">
|
||||
<div style="display: inline-block">
|
||||
<input class="form-control" id="date-from-input" ng-model="params.datefrom"
|
||||
uib-datepicker-popup size="10" placeholder="From"
|
||||
is-open="dateBegin.open" ng-click="dateBegin.open=true"
|
||||
datepicker-options="{maxDate:params.dateto||today}">
|
||||
</div>
|
||||
~
|
||||
<div style="display: inline-block">
|
||||
<input class="form-control" id="date-to-input" ng-model="params.dateto"
|
||||
uib-datepicker-popup size="10" placeholder="To"
|
||||
is-open="dateTo.open" ng-click="dateTo.open=true"
|
||||
datepicker-options="{minDate:params.datefrom,maxDate:today}">
|
||||
</div>
|
||||
|
||||
<div class="btn-group">
|
||||
<a role="button" class="btn btn-default btn-sm"
|
||||
ng-click="chooseToday()">Today</a>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<a role="button" class="btn btn-default btn-sm"
|
||||
ng-click="chooseYesterday()">Yesterday</a>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<a role="button" class="btn btn-default btn-sm"
|
||||
ng-click="chooseLast7Days()">Last 7
|
||||
Days</a>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<a role="button" class="btn btn-default btn-sm" ng-click="thisMonth()">This
|
||||
Month</a>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<a role="button" class="btn btn-default btn-sm" ng-click="lastMonth()">Last
|
||||
Month</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
~
|
||||
<div style="display: inline-block">
|
||||
<input class="form-control" id="date-to-input" ng-model="params.dateto"
|
||||
uib-datepicker-popup size="10" placeholder="To"
|
||||
is-open="dateTo.open" ng-click="dateTo.open=true"
|
||||
datepicker-options="{minDate:params.datefrom,maxDate:today}">
|
||||
</div>
|
||||
|
||||
<div class="btn-group">
|
||||
<a role="button" class="btn btn-default btn-sm"
|
||||
ng-click="chooseToday()">Today</a>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<a role="button" class="btn btn-default btn-sm"
|
||||
ng-click="chooseYesterday()">Yesterday</a>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<a role="button" class="btn btn-default btn-sm"
|
||||
ng-click="chooseLast7Days()">Last 7
|
||||
Days</a>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<a role="button" class="btn btn-default btn-sm" ng-click="thisMonth()">This
|
||||
Month</a>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<a role="button" class="btn btn-default btn-sm" ng-click="lastMonth()">Last
|
||||
Month</a>
|
||||
</div>
|
||||
</div>
|
||||
<!--<div class="form-group">-->
|
||||
<!--<label class="control-label" for="short-name-search">Partner Name</label>-->
|
||||
<!--<input type="text" class="form-control" id="short-name-search"-->
|
||||
<!--ng-model="params.short_name">-->
|
||||
<!--</div>-->
|
||||
<button class="btn btn-success" type="button" ng-click="loadGoodOrders(1)">
|
||||
<i class="fa fa-search"></i> Search
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--<div class="form-group">-->
|
||||
<!--<label class="control-label" for="short-name-search">Partner Name</label>-->
|
||||
<!--<input type="text" class="form-control" id="short-name-search"-->
|
||||
<!--ng-model="params.short_name">-->
|
||||
<!--</div>-->
|
||||
<button class="btn btn-success" type="button" ng-click="loadGoodOrders(1)">
|
||||
<i class="fa fa-search"></i> Search
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">List of Products Sold</h3>
|
||||
</div>
|
||||
|
||||
<div class="box-body no-padding table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Sale ID</th>
|
||||
<th>Payment Order ID</th>
|
||||
<th>Product Name</th>
|
||||
<th>Unit Price</th>
|
||||
<th>Quantity</th>
|
||||
<th>Order Total</th>
|
||||
<th>Order Status</th>
|
||||
<th>Create Time</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="goodOrder in sales">
|
||||
|
||||
<!--<td><span ng-bind="good.goodId"></span><i class="fa fa-sitemap" ng-if="good.parent_client_id" title="Sub Partner"></i></td>-->
|
||||
<td ng-bind="goodOrder.id"></td>
|
||||
<td ng-bind="goodOrder.order_id"></td>
|
||||
<td ng-bind="goodOrder.title"></td>
|
||||
<td ng-bind="goodOrder.price"></td>
|
||||
<td ng-bind="goodOrder.count"></td>
|
||||
<td ng-bind="goodOrder.order_total"></td>
|
||||
<!--<td ng-bind="good.is_using"></td>-->
|
||||
<td>
|
||||
<span ng-if="goodOrder.order_status==1">PAID</span>
|
||||
<span ng-if="goodOrder.order_status==0">NOT PAID</span>
|
||||
<span ng-if="goodOrder.order_status==2">CLOSED</span>
|
||||
</td>
|
||||
<td ng-bind="goodOrder.create_time"></td>
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">List of Products Sold</h3>
|
||||
</div>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="box-body no-padding table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Sale ID</th>
|
||||
<th>Payment Order ID</th>
|
||||
<th>Product Name</th>
|
||||
<th>Unit Price</th>
|
||||
<th>Quantity</th>
|
||||
<th>Order Total</th>
|
||||
<th>Order Status</th>
|
||||
<th>Create Time</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="goodOrder in sales">
|
||||
|
||||
<!--<td><span ng-bind="good.goodId"></span><i class="fa fa-sitemap" ng-if="good.parent_client_id" title="Sub Partner"></i></td>-->
|
||||
<td ng-bind="goodOrder.id"></td>
|
||||
<td ng-bind="goodOrder.order_id"></td>
|
||||
<td ng-bind="goodOrder.title"></td>
|
||||
<td ng-bind="goodOrder.price"></td>
|
||||
<td ng-bind="goodOrder.count"></td>
|
||||
<td ng-bind="goodOrder.order_total"></td>
|
||||
<!--<td ng-bind="good.is_using"></td>-->
|
||||
<td>
|
||||
<span ng-if="goodOrder.order_status==1">PAID</span>
|
||||
<span ng-if="goodOrder.order_status==0">NOT PAID</span>
|
||||
<span ng-if="goodOrder.order_status==2">CLOSED</span>
|
||||
</td>
|
||||
<td ng-bind="goodOrder.create_time"></td>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<div class="box-footer" ng-if="goods.length">
|
||||
<uib-pagination class="pagination"
|
||||
total-items="pagination.totalCount"
|
||||
boundary-links="true"
|
||||
ng-model="pagination.page"
|
||||
items-per-page="pagination.limit"
|
||||
max-size="10"
|
||||
ng-change="loadGoodOrders()"
|
||||
previous-text="‹"
|
||||
next-text="›"
|
||||
first-text="«"
|
||||
last-text="»"></uib-pagination>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">Total Records:{{pagination.totalCount}};Total Pages:{{pagination.totalPages}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer" ng-if="goods.length">
|
||||
<uib-pagination class="pagination"
|
||||
total-items="pagination.totalCount"
|
||||
boundary-links="true"
|
||||
ng-model="pagination.page"
|
||||
items-per-page="pagination.limit"
|
||||
max-size="10"
|
||||
ng-change="loadGoodOrders()"
|
||||
previous-text="‹"
|
||||
next-text="›"
|
||||
first-text="«"
|
||||
last-text="»"></uib-pagination>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">Total Records:{{pagination.totalCount}};Total
|
||||
Pages:{{pagination.totalPages}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,135 +1,150 @@
|
||||
<div ui-view>
|
||||
<section class="content-header">
|
||||
<h1>Product Management</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li>
|
||||
<i class="fa fa-sitemap"></i> Products & Sale
|
||||
</li>
|
||||
<li class="active">Product Management</li>
|
||||
</ol>
|
||||
</section>
|
||||
|
||||
<div class="content">
|
||||
<section class="content-header">
|
||||
<h1>Product & Sale</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li>
|
||||
<i class="fa fa-sitemap"></i> Products & Sale
|
||||
</li>
|
||||
<li class="active">Product & Sale Management</li>
|
||||
</ol>
|
||||
</section>
|
||||
<div class="content">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="box-solid">
|
||||
<div class="box box-warning">
|
||||
<div class="box-header">
|
||||
<div class="form-inline">
|
||||
<!--<div class="form-group">-->
|
||||
<!--<label class="control-label" for="good-code-search">Good Code</label>-->
|
||||
<!--<input class="form-control" id="good-code-search" ng-model="params.code">-->
|
||||
<!--</div>-->
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="good-title-search">Product Name</label>
|
||||
<input type="number" class="form-control" id="good-title-search"
|
||||
ng-model="params.title">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="good-type-search">Product Type</label>
|
||||
<input type="number" class="form-control" id="good-type-search"
|
||||
ng-model="params.type">
|
||||
</div>
|
||||
<!--<div class="form-group">-->
|
||||
<!--<label class="control-label" for="short-name-search">Partner Name</label>-->
|
||||
<!--<input type="text" class="form-control" id="short-name-search"-->
|
||||
<!--ng-model="params.short_name">-->
|
||||
<!--</div>-->
|
||||
<div class="form-group">
|
||||
<button class="btn btn-primary" type="button" ng-click="loadGood(1)"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="nav-tabs-custom">
|
||||
<ul class="nav nav-tabs">
|
||||
<li ui-sref-active-eq="active">
|
||||
<a ui-sref="goods">Product</a>
|
||||
</li>
|
||||
<li ui-sref-active="active">
|
||||
<a ui-sref="goods.sale">Sale</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content" ui-view>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="box-solid">
|
||||
<div class="box box-warning">
|
||||
<div class="box-header">
|
||||
<div class="form-inline">
|
||||
<!--<div class="form-group">-->
|
||||
<!--<label class="control-label" for="good-code-search">Good Code</label>-->
|
||||
<!--<input class="form-control" id="good-code-search" ng-model="params.code">-->
|
||||
<!--</div>-->
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="good-title-search">Product Name</label>
|
||||
<input type="number" class="form-control" id="good-title-search"
|
||||
ng-model="params.title">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="good-type-search">Product Type</label>
|
||||
<input type="number" class="form-control" id="good-type-search"
|
||||
ng-model="params.type">
|
||||
</div>
|
||||
<!--<div class="form-group">-->
|
||||
<!--<label class="control-label" for="short-name-search">Partner Name</label>-->
|
||||
<!--<input type="text" class="form-control" id="short-name-search"-->
|
||||
<!--ng-model="params.short_name">-->
|
||||
<!--</div>-->
|
||||
<div class="form-group">
|
||||
<button class="btn btn-primary" type="button" ng-click="loadGood(1)"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
<a role="button" class="btn btn-info pull-right" ui-sref=".new" title="Add Product">
|
||||
<i class="fa fa-plus"></i>
|
||||
Add Product
|
||||
</a>
|
||||
</div>
|
||||
<a role="button" class="btn btn-info pull-right" ui-sref=".new" title="Add Product">
|
||||
<i class="fa fa-plus"></i>
|
||||
Add Product
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">List of Products</h3>
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">List of Products</h3>
|
||||
</div>
|
||||
|
||||
<div class="box-body no-padding table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Product Image</th>
|
||||
<th>Product Name</th>
|
||||
<th>Price (AUD)</th>
|
||||
<th>Current Price (AUD)</th>
|
||||
<th>Price (CNY)</th>
|
||||
<th>Current Price(CNY)</th>
|
||||
<th>Product Type</th>
|
||||
<th>Stocks Available</th>
|
||||
<th>Origin</th>
|
||||
<th>Status</th>
|
||||
<th>Operation</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="good in goods">
|
||||
<div class="box-body no-padding table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Product Image</th>
|
||||
<th>Product Name</th>
|
||||
<th>Price (AUD)</th>
|
||||
<th>Current Price (AUD)</th>
|
||||
<th>Price (CNY)</th>
|
||||
<th>Current Price(CNY)</th>
|
||||
<th>Product Type</th>
|
||||
<th>Stocks Available</th>
|
||||
<th>Origin</th>
|
||||
<th>Status</th>
|
||||
<th>Operation</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="good in goods">
|
||||
|
||||
<!--<td><span ng-bind="good.goodId"></span><i class="fa fa-sitemap" ng-if="good.parent_client_id" title="Sub Partner"></i></td>-->
|
||||
<td><img ng-if="good.thumbnailUrl" src="{{good.thumbnailUrl}}"></td>
|
||||
<td ng-bind="good.title"></td>
|
||||
<td ng-bind="good.price"></td>
|
||||
<td ng-bind="good.actual_price"></td>
|
||||
<td ng-bind="good.cny_price"></td>
|
||||
<td ng-bind="good.actual_cny_price"></td>
|
||||
<td ng-bind="good.type"></td>
|
||||
<td ng-bind="good.inventory"></td>
|
||||
<td ng-bind="good.origin"></td>
|
||||
<!--<td ng-bind="good.is_using"></td>-->
|
||||
<td>
|
||||
<span ng-if="good.is_using==1">On Sale</span>
|
||||
<span ng-if="good.is_using==0">Out Of Stock</span>
|
||||
</td>
|
||||
<td>
|
||||
<a class="text-primary" role="button" title="Detail"
|
||||
ui-sref=".detail({goodId:good.id})">
|
||||
<i class="fa fa-search"></i> Detail
|
||||
</a>|
|
||||
<a class="text-primary" role="button" title="Delete"
|
||||
ng-click="deleteGoods(good.id)">
|
||||
<i class="fa fa-trash-o"></i> Delete
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<!--<td><span ng-bind="good.goodId"></span><i class="fa fa-sitemap" ng-if="good.parent_client_id" title="Sub Partner"></i></td>-->
|
||||
<td><img ng-if="good.thumbnailUrl" src="{{good.thumbnailUrl}}"></td>
|
||||
<td ng-bind="good.title"></td>
|
||||
<td ng-bind="good.price"></td>
|
||||
<td ng-bind="good.actual_price"></td>
|
||||
<td ng-bind="good.cny_price"></td>
|
||||
<td ng-bind="good.actual_cny_price"></td>
|
||||
<td ng-bind="good.type"></td>
|
||||
<td ng-bind="good.inventory"></td>
|
||||
<td ng-bind="good.origin"></td>
|
||||
<!--<td ng-bind="good.is_using"></td>-->
|
||||
<td>
|
||||
<span ng-if="good.is_using==1">On Sale</span>
|
||||
<span ng-if="good.is_using==0">Out Of Stock</span>
|
||||
</td>
|
||||
<td>
|
||||
<a class="text-primary" role="button" title="Detail"
|
||||
ui-sref=".detail({goodId:good.id})">
|
||||
<i class="fa fa-search"></i> Detail
|
||||
</a>|
|
||||
<a class="text-primary" role="button" title="Delete"
|
||||
ng-click="deleteGoods(good.id)">
|
||||
<i class="fa fa-trash-o"></i> Delete
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<div class="box-footer" ng-if="goods.length">
|
||||
<uib-pagination class="pagination"
|
||||
total-items="pagination.totalCount"
|
||||
boundary-links="true"
|
||||
ng-model="pagination.page"
|
||||
items-per-page="pagination.limit"
|
||||
max-size="10"
|
||||
ng-change="loadGoods()"
|
||||
previous-text="‹"
|
||||
next-text="›"
|
||||
first-text="«"
|
||||
last-text="»"></uib-pagination>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">Total Records:{{pagination.totalCount}};Total Pages:{{pagination.totalPages}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="box-footer" ng-if="goods.length">
|
||||
<uib-pagination class="pagination"
|
||||
total-items="pagination.totalCount"
|
||||
boundary-links="true"
|
||||
ng-model="pagination.page"
|
||||
items-per-page="pagination.limit"
|
||||
max-size="10"
|
||||
ng-change="loadGoods()"
|
||||
previous-text="‹"
|
||||
next-text="›"
|
||||
first-text="«"
|
||||
last-text="»"></uib-pagination>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">Total Records:{{pagination.totalCount}};Total Pages:{{pagination.totalPages}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,79 @@
|
||||
/**
|
||||
* Created by yixian on 2016-07-15.
|
||||
*/
|
||||
$(document).ready(function () {
|
||||
'use strict';
|
||||
decode();
|
||||
function decode() {
|
||||
var redirect = window.redirect;
|
||||
while(redirect.indexOf('://')<0){
|
||||
redirect = decodeURIComponent(redirect);
|
||||
if(redirect==window.redirect){
|
||||
break;
|
||||
}
|
||||
window.redirect = redirect;
|
||||
}
|
||||
}
|
||||
var dataCache = {paying: false};
|
||||
$('#key_P').bind('touchstart', startPay);
|
||||
function startPay() {
|
||||
$('#wdiv').show();
|
||||
if (dataCache.paying) {
|
||||
return;
|
||||
}
|
||||
dataCache.paying = true;
|
||||
|
||||
$.ajax({
|
||||
url: '/api/v1.0/alipay/partners/' + window.client_moniker + '/orders/'+window.order_id+'/order_params',
|
||||
method: 'GET',
|
||||
dataType: 'json',
|
||||
success: function (pay) {
|
||||
if (pay.direct_paid) {
|
||||
location.href = window.redirect;
|
||||
return;
|
||||
}
|
||||
if (window.AlipayJSBridge) {
|
||||
callPayment();
|
||||
} else {
|
||||
// 如果没有注入则监听注入的事件
|
||||
document.addEventListener('AlipayJSBridgeReady', callPayment, false);
|
||||
}
|
||||
|
||||
function callPayment() {
|
||||
try {
|
||||
AlipayJSBridge.call('tradePay', {
|
||||
tradeNO: pay.trade_no
|
||||
}, function (res) {
|
||||
dataCache.paying = false;
|
||||
if (res.resultCode == '9000') {
|
||||
AlipayJSBridge.call('startApp', {
|
||||
appId: '20000056',
|
||||
param: {
|
||||
actionType: 'showSuccPage',
|
||||
payResult: res.result
|
||||
},
|
||||
closeCurrentApp: false
|
||||
});
|
||||
location.href = window.redirect;
|
||||
} else {
|
||||
alert(res.memo);
|
||||
}
|
||||
$('#wdiv').hide();
|
||||
})
|
||||
} catch (err) {
|
||||
alert(err);
|
||||
$('#wdiv').hide();
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function (jqXhr) {
|
||||
alert(jqXhr.responseJSON.message);
|
||||
$('#wdiv').hide();
|
||||
dataCache.paying = false;
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
});
|
@ -0,0 +1,120 @@
|
||||
.weui_cell_ft {
|
||||
max-width: 60%;
|
||||
white-space: normal
|
||||
}
|
||||
.pay-container{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
.pay-container>img{
|
||||
display: block;
|
||||
margin: auto;
|
||||
width: 250px;
|
||||
}
|
||||
div,span,img,button,a,p{
|
||||
box-sizing: border-box;
|
||||
}
|
||||
body{
|
||||
background: #fff;
|
||||
}
|
||||
.royal-container{
|
||||
margin-top: 20%;
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 10px 30px;
|
||||
}
|
||||
|
||||
.royal-container .royal-row{
|
||||
border-bottom: 1px solid #d1d2d4;
|
||||
padding: 5px 0;
|
||||
}
|
||||
.royal-container .royal-row.brand{
|
||||
text-align: center;
|
||||
}
|
||||
.royal-container .royal-row.brand img{
|
||||
display: block;
|
||||
max-width: 60%;
|
||||
max-height: 100px;
|
||||
margin: auto;
|
||||
}
|
||||
.royal-container .royal-row.brand .name{
|
||||
display: block;
|
||||
margin: auto;
|
||||
font-size: 1.6em;
|
||||
}
|
||||
.text-title{
|
||||
color: #888888;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.text-main{
|
||||
color: #333333;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
.royal-pay-btn{
|
||||
background: #30af69;
|
||||
color: #fff;
|
||||
width: 96%;
|
||||
display: block;
|
||||
margin: 10px auto 30px;
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
font-size: 1.4em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.alipay .royal-pay-btn{
|
||||
background: #108ee9;
|
||||
}
|
||||
|
||||
.alipay .amount_title{
|
||||
background: #108ee9;
|
||||
}
|
||||
|
||||
.amount_title{
|
||||
height: 14%;
|
||||
z-index: 10;
|
||||
background: #30af69;
|
||||
max-height: 200px;
|
||||
min-height: 120px;
|
||||
width: 100%;
|
||||
}
|
||||
.amount_title_logo{
|
||||
float: left;
|
||||
max-width: 90px;
|
||||
min-width: 80px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
.amount_title_content{
|
||||
float: left;
|
||||
}
|
||||
.amount_title_content_amount{
|
||||
font-family: Avenir-Roman;
|
||||
font-size: 30px;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.amount_title_content_text{
|
||||
font-family: PingFangSC-Regular;
|
||||
font-size: 17px;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.merchant_info{
|
||||
height: 100px;
|
||||
z-index: 1;
|
||||
position: absolute;
|
||||
width: 94%;
|
||||
margin: -5% 0% 0px 3%;
|
||||
text-align: center;
|
||||
background-color: #FFFFFF;
|
||||
box-shadow: 0px 0px 8px 0px rgba(171,171,171,0.50);
|
||||
}
|
||||
|
||||
.merchant_info img{
|
||||
max-height: 60px;
|
||||
min-height: 50px;
|
||||
}
|
@ -0,0 +1,106 @@
|
||||
|
||||
$(document).ready(function () {
|
||||
'use strict';
|
||||
decode();
|
||||
|
||||
function decode() {
|
||||
var redirect = window.redirect;
|
||||
while (redirect.indexOf('://') < 0) {
|
||||
redirect = decodeURIComponent(redirect);
|
||||
if (redirect == window.redirect) {
|
||||
break;
|
||||
}
|
||||
window.redirect = redirect;
|
||||
}
|
||||
}
|
||||
|
||||
var dataCache = {paying: false};
|
||||
$('#key_P').bind('touchstart', startPay);
|
||||
|
||||
function startPay() {
|
||||
$('#wdiv').show();
|
||||
if (dataCache.paying) {
|
||||
return;
|
||||
}
|
||||
dataCache.paying = true;
|
||||
|
||||
$.ajax({
|
||||
url: '/api/payment/v1.0/wechat_jsapi_payment/partners/' + window.client_moniker + '/orders/' + window.order_id + '/preorder',
|
||||
method: 'get',
|
||||
dataType: 'json',
|
||||
success: function (pay) {
|
||||
try {
|
||||
if (pay.direct_paid) {
|
||||
dataCache.paying = false;
|
||||
location.href = window.redirect;
|
||||
}
|
||||
var paydata = pay.jsapi;
|
||||
invokePay(paydata);
|
||||
}catch (e) {
|
||||
alert("Unexpected Error:" + e);
|
||||
$('#wdiv').hide();
|
||||
dataCache.paying = false;
|
||||
}
|
||||
},
|
||||
error: function (jqXhr) {
|
||||
var respText = jqXhr.responseText;
|
||||
try {
|
||||
alert(JSON.parse(respText).message);
|
||||
$('#wdiv').hide();
|
||||
dataCache.paying = false;
|
||||
} catch (e) {
|
||||
alert("Unexpected Error:" + respText);
|
||||
$('#wdiv').hide();
|
||||
dataCache.paying = false;
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
function invokePay(paydata) {
|
||||
WeixinJSBridge.invoke('getBrandWCPayRequest', {
|
||||
'appId': paydata.appId,
|
||||
'timeStamp': paydata.timeStamp,
|
||||
'nonceStr': paydata.nonceStr,
|
||||
'package': paydata.package,
|
||||
'signType': paydata.signType,
|
||||
'paySign': paydata.paySign
|
||||
}, function (res) {
|
||||
dataCache.paying = false;
|
||||
if (res.err_msg == 'get_brand_wcpay_request:ok') {
|
||||
startCheckOrder(window.order_id)
|
||||
} else {
|
||||
if (res.err_msg != 'get_brand_wcpay_request:cancel' && res.err_msg != 'get_brand_wcpay_request:fail') {
|
||||
alert('WeChat Error:' + res.err_msg);
|
||||
}
|
||||
if (window.paydata) {
|
||||
location.href = window.redirect + (window.redirect.indexOf('?') < 0 ? '?' : '&') + 'success=false';
|
||||
}
|
||||
}
|
||||
//todo get status from server
|
||||
$('#wdiv').hide();
|
||||
})
|
||||
}
|
||||
|
||||
function startCheckOrder(orderId) {
|
||||
function checkOrderStd() {
|
||||
$.ajax({
|
||||
url: '/api/v1.0/payment/orders/' + orderId + '/status',
|
||||
method: 'GET',
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
if (res.paid) {
|
||||
location.href = window.redirect + (window.redirect.indexOf('?') < 0 ? '?' : '&') + 'success=true';
|
||||
} else {
|
||||
setTimeout(checkOrderStd, 500);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
checkOrderStd();
|
||||
}
|
||||
});
|
Loading…
Reference in new issue