pay
parent
7dacfecc7e
commit
b18dadfd62
|
|
@ -78,17 +78,17 @@ textarea {
|
|||
|
||||
|
||||
/* 边框 */
|
||||
.br { border: solid 1rpx #efefef; }
|
||||
.br-b { border-bottom: solid 1rpx #efefef; }
|
||||
.br-t { border-top: solid 1rpx #efefef; }
|
||||
.br-l { border-left: solid 1rpx #efefef; }
|
||||
.br-r { border-right: solid 1rpx #efefef; }
|
||||
.br { border: solid 1px #efefef; }
|
||||
.br-b { border-bottom: solid 1px #efefef; }
|
||||
.br-t { border-top: solid 1px #efefef; }
|
||||
.br-l { border-left: solid 1px #efefef; }
|
||||
.br-r { border-right: solid 1px #efefef; }
|
||||
|
||||
/* 虚线边框 */
|
||||
.br-b-dashed { border-bottom: dashed 1rpx #efefef; }
|
||||
.br-t-dashed { border-top: dashed 1rpx #efefef; }
|
||||
.br-l-dashed { border-left: dashed 1rpx #efefef; }
|
||||
.br-r-dashed { border-right: dashed 1rpx #efefef; }
|
||||
.br-b-dashed { border-bottom: dashed 1px #efefef; }
|
||||
.br-t-dashed { border-top: dashed 1px #efefef; }
|
||||
.br-l-dashed { border-left: dashed 1px #efefef; }
|
||||
.br-r-dashed { border-right: dashed 1px #efefef; }
|
||||
|
||||
/* 箭头符号 */
|
||||
.arrow-right { background-image: url('data:image/svg+xml;charset=utf-8,<svg width="16" height="26" viewBox="0 0 16 26" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="UI-KIT_基础元件" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="9.9基础元件" transform="translate(-5809.000000, -8482.000000)" fill="#C7C7CC"><polygon id="Disclosure-Indicator" points="5811 8482 5809 8484 5820.5 8495 5809 8506 5811 8508 5825 8495"></polygon></g></g></svg>'); background-size: 15px 10px; background-repeat: no-repeat; background-position: center right; }
|
||||
|
|
|
|||
|
|
@ -101,6 +101,10 @@
|
|||
vertical-align: middle;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.payment-list .selected {
|
||||
border: 1px solid #d2364c;
|
||||
color: #d2364c;
|
||||
}
|
||||
|
||||
/**
|
||||
* 扩展数据
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
<!-- 支付方式 -->
|
||||
<view a:if="{{payment_list.length > 0}}" class="payment-list bg-white oh">
|
||||
<view class="item tc fl" a:for="{{payment_list}}">
|
||||
<view class="item-content br" data-value="{{item.id}}" onTap="payment_event">
|
||||
<view class="item-content br {{(item.selected || '')}}" data-value="{{item.id}}" onTap="payment_event">
|
||||
<image a:if="{{(item.logo || null) != null}}" class="icon" src="{{item.logo}}" mode="widthFix" />
|
||||
<text>{{item.name}}</text>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -172,7 +172,18 @@ Page({
|
|||
// 支付方式选择
|
||||
payment_event(e) {
|
||||
var payment_id = e.currentTarget.dataset.value || 0;
|
||||
this.setData({ payment_id: payment_id});
|
||||
var temp_payment_list = this.data.payment_list;
|
||||
for(var i in temp_payment_list) {
|
||||
if(temp_payment_list[i]['id'] == payment_id) {
|
||||
temp_payment_list[i]['selected'] = 'selected';
|
||||
} else {
|
||||
temp_payment_list[i]['selected'] = '';
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
payment_id: payment_id,
|
||||
payment_list: temp_payment_list
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -331,7 +331,7 @@ Page({
|
|||
var goods_attribute_choose = this.data.goods_attribute_choose;
|
||||
var temp_attribute_active = this.data.temp_attribute_active;
|
||||
var attr_count = goods_attribute_choose.length;
|
||||
var attribute_all = [];
|
||||
var attribute_all = {};
|
||||
if(attr_count > 0)
|
||||
{
|
||||
var attr_active_count = app.get_length(temp_attribute_active);
|
||||
|
|
@ -345,7 +345,7 @@ Page({
|
|||
} else {
|
||||
for(var i in temp_attribute_active)
|
||||
{
|
||||
attribute_all.push(goods_attribute_choose[i]['id']+':'+goods_attribute_choose[i]['find'][temp_attribute_active[i]]['id']);
|
||||
attribute_all[goods_attribute_choose[i]['id']] = goods_attribute_choose[i]['find'][temp_attribute_active[i]]['id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -354,12 +354,12 @@ Page({
|
|||
switch (this.data.buy_event_type) {
|
||||
case 'buy' :
|
||||
// 进入订单确认页面
|
||||
var data = [{
|
||||
var data = {
|
||||
"buy_type": "goods",
|
||||
"goods_id": this.data.goods.id,
|
||||
"stock": this.data.temp_buy_number,
|
||||
"attr": attribute_all.join(',')
|
||||
}];
|
||||
"attr": JSON.stringify(attribute_all)
|
||||
};
|
||||
my.navigateTo({
|
||||
url: '/pages/buy/buy?data=' + JSON.stringify(data)
|
||||
});
|
||||
|
|
|
|||
|
|
@ -24,6 +24,9 @@
|
|||
line-height: 85rpx;
|
||||
}
|
||||
|
||||
.goods-base {
|
||||
min-height: 160rpx;
|
||||
}
|
||||
.goods .goods-item:not(:last-child) {
|
||||
border-bottom: 1px dashed #efefef;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,11 +21,11 @@
|
|||
{{attr.attr_type_name}}:{{attr.attr_name}}
|
||||
</view>
|
||||
</block>
|
||||
<view class="oh goods-price">
|
||||
<text class="sales-price">¥{{item.price}}</text>
|
||||
<text a:if="{{item.original_price > 0}}" class="original-price">¥{{item.original_price}}</text>
|
||||
<text class="buy-number">x{{item.buy_number}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="oh goods-price">
|
||||
<text class="sales-price">¥{{item.price}}</text>
|
||||
<text a:if="{{item.original_price > 0}}" class="original-price">¥{{item.original_price}}</text>
|
||||
<text class="buy-number">x{{item.buy_number}}</text>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ Page({
|
|||
{name: "总价", value: data.total_price},
|
||||
{name: "优惠", value: data.preferential_price},
|
||||
{name: "支付金额", value: data.pay_price},
|
||||
{name: "支付方式", value: data.payment_name},
|
||||
{name: "快递公司", value: data.express_name},
|
||||
{name: "快递单号", value: data.expres_number},
|
||||
{name: "用户留言", value: data.user_note},
|
||||
|
|
|
|||
|
|
@ -29,9 +29,6 @@
|
|||
.search-btn .search-icon{
|
||||
margin: 8rpx 0;
|
||||
}
|
||||
/*
|
||||
end 头部搜索框
|
||||
*/
|
||||
|
||||
/*
|
||||
主体
|
||||
|
|
@ -39,7 +36,9 @@
|
|||
.scroll-box{
|
||||
height: calc(100vh - 120rpx);
|
||||
}
|
||||
|
||||
.goods-base {
|
||||
min-height: 160rpx;
|
||||
}
|
||||
.goods-title {
|
||||
line-height: 36rpx;
|
||||
}
|
||||
|
|
@ -77,4 +76,24 @@
|
|||
}
|
||||
.item-operation button {
|
||||
padding: 0 35rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付方式
|
||||
*/
|
||||
.payment-list {
|
||||
padding: 40rpx 0;
|
||||
}
|
||||
.payment-list .item {
|
||||
width: 50%;
|
||||
}
|
||||
.payment-list .item-content {
|
||||
margin: 20rpx;
|
||||
padding: 20rpx 10rpx;
|
||||
}
|
||||
.payment-list .item-content image {
|
||||
width: 50rpx;
|
||||
height: 50rpx !important;
|
||||
vertical-align: middle;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
<!-- 搜索 -->
|
||||
<view class="search-content bg-white">
|
||||
<view class="search-box oh">
|
||||
<input class="search" type="text" onInput="input_event" placeholder="收件人/电话/单号" />
|
||||
|
|
@ -6,6 +7,8 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 订单列表 -->
|
||||
<scroll-view scroll-y="{{true}}" class="scroll-box" onScrollToLower="scroll_lower" lower-threshold="30">
|
||||
<view class="list-content spacing">
|
||||
<view class="list-item bg-white spacing-mb" a:if="{{data_list.length > 0}}" a:for="{{data_list}}">
|
||||
|
|
@ -23,11 +26,11 @@
|
|||
{{attr.attr_type_name}}:{{attr.attr_name}}
|
||||
</view>
|
||||
</block>
|
||||
<view class="oh goods-price">
|
||||
<text class="sales-price">¥{{detail.price}}</text>
|
||||
<text a:if="{{detail.original_price > 0}}" class="original-price">¥{{detail.original_price}}</text>
|
||||
<text class="buy-number">x{{detail.buy_number}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="oh goods-price">
|
||||
<text class="sales-price">¥{{detail.price}}</text>
|
||||
<text a:if="{{detail.original_price > 0}}" class="original-price">¥{{detail.original_price}}</text>
|
||||
<text class="buy-number">x{{detail.buy_number}}</text>
|
||||
</view>
|
||||
</navigator>
|
||||
<view class="item-describe tr cr-666">{{item.describe}}
|
||||
|
|
@ -48,8 +51,22 @@
|
|||
<template is="nodata" data="{{status: data_list_loding_status}}">
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
<import src="/pages/common/bottom_line.axml" />
|
||||
<template is="bottom_line" data="{{status: data_bottom_line_status}}">
|
||||
</template>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<import src="/pages/common/bottom_line.axml" />
|
||||
<template is="bottom_line" data="{{status: data_bottom_line_status}}">
|
||||
</template>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 支付方式 popup -->
|
||||
<popup show="{{is_show_payment_popup}}" position="bottom" onClose="payment_popup_event_close">
|
||||
<view a:if="{{payment_list.length > 0}}" class="payment-list oh bg-white">
|
||||
<view class="item tc fl" a:for="{{payment_list}}">
|
||||
<view class="item-content br" data-value="{{item.id}}" onTap="popup_payment_event">
|
||||
<image a:if="{{(item.logo || null) != null}}" class="icon" src="{{item.logo}}" mode="widthFix" />
|
||||
<text>{{item.name}}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view a:else class="payment-list oh bg-white tc cr-888">没有支付方式</view>
|
||||
</popup>
|
||||
|
|
@ -9,6 +9,11 @@ Page({
|
|||
params: null,
|
||||
input_keyword_value: '',
|
||||
load_status: 0,
|
||||
is_show_payment_popup: false,
|
||||
payment_list: [],
|
||||
payment_id: 0,
|
||||
temp_pay_value: 0,
|
||||
temp_pay_index: 0,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
|
|
@ -110,6 +115,7 @@ Page({
|
|||
data_list_loding_status: 3,
|
||||
data_page: this.data.data_page + 1,
|
||||
load_status: 1,
|
||||
payment_list: res.data.data.payment_list || [],
|
||||
});
|
||||
|
||||
// 是否还有数据
|
||||
|
|
@ -167,10 +173,25 @@ Page({
|
|||
},
|
||||
|
||||
// 支付
|
||||
pay_event(e, order_id, index) {
|
||||
var id = e.target.dataset.value;
|
||||
var index = e.target.dataset.index;
|
||||
this.pay_handle(id, index);
|
||||
pay_event(e) {
|
||||
this.setData({
|
||||
is_show_payment_popup: true,
|
||||
temp_pay_value: e.target.dataset.value,
|
||||
temp_pay_index: e.target.dataset.index,
|
||||
});
|
||||
},
|
||||
|
||||
// 支付弹窗关闭
|
||||
payment_popup_event_close(e) {
|
||||
this.setData({ is_show_payment_popup: false });
|
||||
},
|
||||
|
||||
// 支付弹窗发起支付
|
||||
popup_payment_event(e) {
|
||||
var payment_id = e.target.dataset.value || 0;
|
||||
this.setData({payment_id: payment_id});
|
||||
this.payment_popup_event_close();
|
||||
this.pay_handle(this.data.temp_pay_value, this.data.temp_pay_index);
|
||||
},
|
||||
|
||||
// 支付方法
|
||||
|
|
@ -182,7 +203,8 @@ Page({
|
|||
url: app.get_request_url("Pay", "Order"),
|
||||
method: "POST",
|
||||
data: {
|
||||
id: order_id
|
||||
id: order_id,
|
||||
payment_id: this.data.payment_id,
|
||||
},
|
||||
dataType: "json",
|
||||
success: res => {
|
||||
|
|
@ -191,18 +213,23 @@ Page({
|
|||
// 线下支付成功
|
||||
if (res.data.data.is_under_line == 1) {
|
||||
var temp_data_list = this.data.data_list;
|
||||
temp_data_list[index]["status"] = 2;
|
||||
temp_data_list[index]['status'] = 2;
|
||||
temp_data_list[index]['status_name'] = '待发货';
|
||||
this.setData({ data_list: temp_data_list });
|
||||
|
||||
my.showToast({
|
||||
type: "success",
|
||||
content: '支付成功'
|
||||
});
|
||||
} else {
|
||||
my.tradePay({
|
||||
orderStr: res.data.data.data,
|
||||
tradeNO: res.data.data.data,
|
||||
success: res => {
|
||||
// 数据设置
|
||||
if (res.resultCode == "9000") {
|
||||
if (res.resultCode == 9000) {
|
||||
var temp_data_list = this.data.data_list;
|
||||
temp_data_list[index]["status"] = 2;
|
||||
temp_data_list[index]['status_text'] = '待发货';
|
||||
temp_data_list[index]['status'] = 2;
|
||||
temp_data_list[index]['status_name'] = '待发货';
|
||||
this.setData({ data_list: temp_data_list });
|
||||
}
|
||||
|
||||
|
|
@ -212,7 +239,7 @@ Page({
|
|||
"/pages/paytips/paytips?code=" +
|
||||
res.resultCode +
|
||||
"&total_price=" +
|
||||
temp_data_list[index]['total_price']
|
||||
this.data.data_list[index]['total_price']
|
||||
});
|
||||
},
|
||||
fail: res => {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
{
|
||||
"pullRefresh": true
|
||||
"pullRefresh": true,
|
||||
"usingComponents": {
|
||||
"popup": "mini-antui/es/popup/index"
|
||||
}
|
||||
}
|
||||
|
|
@ -48,7 +48,7 @@ class BuyController extends CommonController
|
|||
public function Index()
|
||||
{
|
||||
// 获取商品列表
|
||||
$params = $this->data_post;
|
||||
$params = $_POST;
|
||||
$params['user'] = $this->user;
|
||||
$ret = BuyService::BuyTypeGoodsList($params);
|
||||
|
||||
|
|
@ -94,7 +94,7 @@ class BuyController extends CommonController
|
|||
*/
|
||||
public function Add()
|
||||
{
|
||||
$params = $this->data_post;
|
||||
$params = $_POST;
|
||||
$params['user'] = $this->user;
|
||||
$ret = BuyService::OrderAdd($params);
|
||||
$this->ajaxReturn($ret['msg'], $ret['code'], $ret['data']);
|
||||
|
|
|
|||
|
|
@ -65,11 +65,15 @@ class OrderController extends CommonController
|
|||
);
|
||||
$data = OrderService::OrderList($data_params);
|
||||
|
||||
// 支付方式
|
||||
$payment_list = ResourcesService::BuyPaymentList(['is_enable'=>1, 'is_open_user'=>1]);
|
||||
|
||||
// 返回数据
|
||||
$result = [
|
||||
'total' => $total,
|
||||
'page_total' => $page_total,
|
||||
'data' => $data['data'],
|
||||
'payment_list' => $payment_list,
|
||||
];
|
||||
$this->ajaxReturn(L('common_operation_success'), 0, $result);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -344,10 +344,6 @@ class BuyService
|
|||
$goods[0]['total_price'] = $params['stock']*$goods[0]['price'];
|
||||
|
||||
// 属性
|
||||
if(!empty($params['attr']))
|
||||
{
|
||||
$params['attr'] = json_decode($params['attr'], true);
|
||||
}
|
||||
$goods[0]['attribute'] = self::GoodsAttrParsing($params);
|
||||
|
||||
return DataReturn(L('common_operation_success'), 0, $goods);
|
||||
|
|
|
|||
|
|
@ -560,9 +560,6 @@ class OrderService
|
|||
$order_pay_status = L('common_order_pay_status');
|
||||
foreach($data as &$v)
|
||||
{
|
||||
// 订单基础
|
||||
$v['payment_name'] = '';
|
||||
|
||||
// 状态
|
||||
$v['status_name'] = $order_status_list[$v['status']]['name'];
|
||||
|
||||
|
|
@ -572,6 +569,9 @@ class OrderService
|
|||
// 快递公司
|
||||
$v['express_name'] = ResourcesService::ExpressName($v['express_id']);
|
||||
|
||||
// 支付方式
|
||||
$v['payment_name'] = ($v['status'] <= 1) ? null : ResourcesService::OrderPaymentName($v['id']);
|
||||
|
||||
// 收件人地址
|
||||
$v['receive_province_name'] = ResourcesService::RegionName($v['receive_province']);
|
||||
$v['receive_city_name'] = ResourcesService::RegionName($v['receive_city']);
|
||||
|
|
|
|||
|
|
@ -39,6 +39,20 @@ class ResourcesService
|
|||
return empty($express_id) ? null : M('Express')->where(['id'=>intval($express_id)])->getField('name');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单支付名称
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-09-19
|
||||
* @desc description
|
||||
* @param [int] $order_id [订单id]
|
||||
*/
|
||||
public static function OrderPaymentName($order_id = 0)
|
||||
{
|
||||
return empty($order_id) ? null : M('PayLog')->where(['order_id'=>intval($order_id)])->getField('payment_name');
|
||||
}
|
||||
|
||||
/**
|
||||
* 快递列表
|
||||
* @author Devil
|
||||
|
|
|
|||
Loading…
Reference in New Issue