微信小程序订单确认开发
parent
d85c957b15
commit
5b8f667c8b
|
|
@ -61,27 +61,22 @@ class Buy extends Common
|
|||
// 基础信息
|
||||
$buy_base = $buy_ret['data']['base'];
|
||||
$buy_goods = $buy_ret['data']['goods'];
|
||||
$buy_extension_data = $buy_ret['data']['extension_data'];
|
||||
|
||||
// 支付方式
|
||||
$payment_list = PaymentService::BuyPaymentList(['is_enable'=>1, 'is_open_user'=>1]);
|
||||
|
||||
// 当前选中的优惠劵
|
||||
$coupon_id = isset($params['coupon_id']) ? intval($params['coupon_id']) : 0;
|
||||
|
||||
// 数据返回组装
|
||||
$result = [
|
||||
'goods_list' => $buy_goods,
|
||||
'payment_list' => $payment_list,
|
||||
'base' => $buy_base,
|
||||
'extension_data' => $buy_extension_data,
|
||||
'common_order_is_booking' => (int) MyC('common_order_is_booking', 0),
|
||||
'common_site_type' => (int) $buy_base['common_site_type'],
|
||||
];
|
||||
|
||||
// 优惠劵
|
||||
$ret = PluginsService::PluginsControlCall(
|
||||
'coupon', 'coupon', 'buy', 'api', ['order_goods'=>$buy_goods, 'coupon_id'=>$coupon_id]);
|
||||
'coupon', 'coupon', 'buy', 'api', ['order_goods'=>$buy_goods, 'params'=>$params]);
|
||||
if($ret['code'] == 0 && isset($ret['data']['code']) && $ret['data']['code'] == 0)
|
||||
{
|
||||
$result['plugins_coupon_data'] = $ret['data']['data'];
|
||||
|
|
|
|||
|
|
@ -307,4 +307,30 @@ Page({
|
|||
this.init();
|
||||
}
|
||||
},
|
||||
|
||||
// 地图查看
|
||||
map_event(e) {
|
||||
var index = e.currentTarget.dataset.index || 0;
|
||||
var data = this.data.goods_list[index] || null;
|
||||
if (data == null)
|
||||
{
|
||||
app.showToast("地址有误");
|
||||
return false;
|
||||
}
|
||||
|
||||
var lng = parseFloat(data.lng || 0);
|
||||
var lat = parseFloat(data.lat || 0);
|
||||
if (lng <= 0 || lat <= 0) {
|
||||
app.showToast("坐标有误");
|
||||
return false;
|
||||
}
|
||||
|
||||
wx.openLocation({
|
||||
latitude: lat,
|
||||
longitude: lng,
|
||||
scale: 18,
|
||||
name: data.name || data.alias || '',
|
||||
address: (data.province_name || '') + (data.city_name || '') + (data.county_name || '') + (data.address || ''),
|
||||
});
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -32,9 +32,20 @@
|
|||
<view class="address-divider spacing-mb"></view>
|
||||
</block>
|
||||
|
||||
<!-- 商品 -->
|
||||
<view class="goods bg-white spacing-mb">
|
||||
<view wx:for="{{goods_list}}" wx:key="key" class="goods-item oh">
|
||||
<!-- 商品数据 -->
|
||||
<view class="goods-group-list bg-white spacing-mb" wx:for="{{goods_list}}" wx:for-item="group" wx:key="key">
|
||||
<!-- 仓库分组 -->
|
||||
<view class="goods-group-hd oh br-b">
|
||||
<view class="fl">
|
||||
<text class="goods-group-title">{{group.name}}</text>
|
||||
<text wx:if="{{(group.alias || null) != null}}" class="goods-group-alias">{{group.alias}}</text>
|
||||
</view>
|
||||
<view wx:if="{{group.lng > 0 && group.lat > 0}}" class="fr">
|
||||
<view class="goods-group-map-submit br" data-index="{{index}}" bindtap="map_event">查看地图</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 商品 -->
|
||||
<view wx:for="{{group.goods_items}}" wx:key="keys" class="goods-item oh">
|
||||
<image class="goods-image fl" src="{{item.images}}" mode="aspectFill" />
|
||||
<view class="goods-base">
|
||||
<view class="goods-title multi-text">{{item.title}}</view>
|
||||
|
|
@ -52,6 +63,20 @@
|
|||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 扩展数据展示 -->
|
||||
<view wx:if="{{group.order_base.extension_data.length > 0}}" class="extension-list spacing-mt">
|
||||
<view wx:for="{{group.order_base.extension_data}}" wx:key="key" class="item oh">
|
||||
<text class="cr-666 fl">{{item.name}}
|
||||
</text>
|
||||
<text class="text-tips fr">{{item.tips}}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 小计 -->
|
||||
<view class="oh tr goods-group-footer spacing-mt spacing-mb">
|
||||
<text wx:if="{{group.order_base.total_price != group.order_base.actual_price}}" class="original-price">{{price_symbol}}{{group.order_base.total_price}}</text>
|
||||
<text class="sales-price">{{price_symbol}}{{group.order_base.actual_price}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 留言 -->
|
||||
|
|
|
|||
|
|
@ -41,14 +41,39 @@
|
|||
/**
|
||||
* 商品
|
||||
*/
|
||||
.goods .goods-item:not(:last-child) {
|
||||
.goods-group-list .goods-item:not(:last-child) {
|
||||
border-bottom: 1px dashed #efefef;
|
||||
}
|
||||
.goods-item {
|
||||
padding: 20rpx 10rpx;
|
||||
.goods-group-list {
|
||||
padding: 0 10rpx 10rpx 10rpx;
|
||||
}
|
||||
.goods-group-hd {
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
.goods-group-title {
|
||||
font-weight: bold;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.goods-group-alias {
|
||||
border: 1px solid #3bb4f2;
|
||||
color: #3bb4f2;
|
||||
padding: 2rpx 10rpx;
|
||||
border-radius: 6rpx;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
.goods-group-footer .original-price {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.goods-group-map-submit {
|
||||
font-size: 24rpx;
|
||||
padding: 5rpx 20rpx;
|
||||
background: #f0f0f0;
|
||||
}
|
||||
.goods-title, .goods-spec {
|
||||
margin-bottom: 10rpx;
|
||||
margin-bottom: 5rpx;
|
||||
}
|
||||
.goods-item {
|
||||
padding: 5rpx 0;
|
||||
}
|
||||
.goods-image {
|
||||
width: 160rpx;
|
||||
|
|
@ -119,6 +144,7 @@
|
|||
*/
|
||||
.extension-list {
|
||||
background-color: #ffffeb;
|
||||
border: 1px solid #ffe2cf;
|
||||
}
|
||||
.extension-list .item {
|
||||
padding: 20rpx 10rpx;
|
||||
|
|
|
|||
Loading…
Reference in New Issue