[最新更新]
This commit is contained in:
@@ -1,63 +1,69 @@
|
||||
|
||||
<view class="content">
|
||||
<!-- 工具栏 -->
|
||||
<view class="bag-header">
|
||||
<view class="bag-header-add-select">
|
||||
<view class="checkbox allCheckbox">
|
||||
<checkbox checked="{{allCheckbox}}" bindtap="allCheckbox"></checkbox>
|
||||
<block wx:if="{{isUser}}">
|
||||
<!-- 工具栏 -->
|
||||
<view class="bag-header">
|
||||
<view class="bag-header-add-select">
|
||||
<view class="checkbox allCheckbox">
|
||||
<checkbox checked="{{allCheckbox}}" bindtap="allCheckbox"></checkbox>
|
||||
</view>
|
||||
全选
|
||||
</view>
|
||||
全选
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 购物袋 -->
|
||||
<view class="bag-content" wx:if="{{bags.length > 0}}">
|
||||
<view class="bag-content-mall" wx:for="{{bags}}" wx:key="bagList" wx:for-item="bagList" wx:for-index="sellerIndex">
|
||||
<view class="bag-content-mall-name nowrap">
|
||||
<view class="checkbox sellerCheckbox">
|
||||
<checkbox checked="{{bagList.shop.mallState}}" data-seller="{{sellerIndex}}" bindtap="sellerCheckbox"></checkbox>
|
||||
<!-- 购物袋 -->
|
||||
<view class="bag-content" wx:if="{{bags.length > 0}}">
|
||||
<view class="bag-content-mall" wx:for="{{bags}}" wx:key="bagList" wx:for-item="bagList" wx:for-index="sellerIndex">
|
||||
<view class="bag-content-mall-name nowrap">
|
||||
<view class="checkbox sellerCheckbox">
|
||||
<checkbox checked="{{bagList.shop.mallState}}" data-seller="{{sellerIndex}}" bindtap="sellerCheckbox"></checkbox>
|
||||
</view>
|
||||
{{ bagList.shop.name }}
|
||||
</view>
|
||||
{{ bagList.shop.name }}
|
||||
</view>
|
||||
<view class="bag-content-mall-goods" wx:for="{{bagList.items}}" wx:key="mallGood" wx:for-index="goodsIndex">
|
||||
<view class="checkbox">
|
||||
<checkbox checked="{{item.state}}" data-seller="{{sellerIndex}}" data-goods="{{goodsIndex}}" bindtap="checkbox"></checkbox>
|
||||
</view>
|
||||
<image class="mall-good-cover" src="{{item.cover}}" mode="aspectFill"></image>
|
||||
<view class="mall-good-content">
|
||||
<view class="mall-good-title nowrap">{{item.name}}</view>
|
||||
<view class="mall-good-value nowrap">{{item.sku_name}}</view>
|
||||
<view class="mall-good-price nowrap">
|
||||
¥{{item.price}}
|
||||
<view class="mall-good-number">
|
||||
<view class="mall-good-number-btn" data-seller="{{sellerIndex}}" data-goods="{{goodsIndex}}" bindtap="goodsNumber" data-type="remove">-</view>
|
||||
<input class="mall-good-number-input" data-seller="{{sellerIndex}}" data-goods="{{goodsIndex}}" value="{{item.qty}}" type="number" bindblur="goodsNumberInput"></input>
|
||||
<view class="mall-good-number-btn" data-seller="{{sellerIndex}}" data-goods="{{goodsIndex}}" bindtap="goodsNumber" data-type="plus">+</view>
|
||||
<view class="bag-content-mall-goods" wx:for="{{bagList.items}}" wx:key="mallGood" wx:for-index="goodsIndex">
|
||||
<view class="checkbox">
|
||||
<checkbox checked="{{item.state}}" data-seller="{{sellerIndex}}" data-goods="{{goodsIndex}}" bindtap="checkbox"></checkbox>
|
||||
</view>
|
||||
<image class="mall-good-cover" src="{{item.cover}}" mode="aspectFill"></image>
|
||||
<view class="mall-good-content">
|
||||
<view class="mall-good-title nowrap">{{item.name}}</view>
|
||||
<view class="mall-good-value nowrap">{{item.sku_name}}</view>
|
||||
<view class="mall-good-price nowrap">
|
||||
¥{{item.price}}
|
||||
<view class="mall-good-number">
|
||||
<view class="mall-good-number-btn" data-seller="{{sellerIndex}}" data-goods="{{goodsIndex}}" bindtap="goodsNumber" data-type="remove">-</view>
|
||||
<input class="mall-good-number-input" data-seller="{{sellerIndex}}" data-goods="{{goodsIndex}}" value="{{item.qty}}" type="number" bindblur="goodsNumberInput"></input>
|
||||
<view class="mall-good-number-btn" data-seller="{{sellerIndex}}" data-goods="{{goodsIndex}}" bindtap="goodsNumber" data-type="plus">+</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mall-good-more" bindtap="actionSheet" data-seller="{{sellerIndex}}" data-goods="{{goodsIndex}}">
|
||||
<image src="/static/icons/bag_more_icon.png" mode="widthFix"></image>
|
||||
<view class="mall-good-more" bindtap="actionSheet" data-seller="{{sellerIndex}}" data-goods="{{goodsIndex}}">
|
||||
<image src="/static/icons/bag_more_icon.png" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 购物袋为空 -->
|
||||
<view class="pack-center pages-hint" wx:else>
|
||||
<image src="/static/icons/carnull_icon.png"></image>
|
||||
<view>购物袋中暂无任何商品</view>
|
||||
</view>
|
||||
<!-- 购物袋为空 -->
|
||||
<view class="pack-center pages-hint" wx:else>
|
||||
<image src="/static/icons/carnull_icon.png"></image>
|
||||
<view>购物袋中暂无任何商品</view>
|
||||
</view>
|
||||
|
||||
<!-- 用户未登录 -->
|
||||
<view class="pack-center pages-loding" wx:if="{{!isUser}}">
|
||||
<view>未登录,无法获取您的购物车信息</view>
|
||||
</view>
|
||||
<!-- 结算 -->
|
||||
<view class="bag-footer">
|
||||
<view class="bag-footer-price">合计<text>¥{{allPrice}}</text></view>
|
||||
<view class="bag-footer-rests">共计{{bagNumber}}件</view>
|
||||
<button class="bag-footer-btn" size="mini" bindtap="bagOrder" disabled="{{bagOrderLoading}}" loading="{{bagOrderLoading}}">结算</button>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<!-- 结算 -->
|
||||
<view class="bag-footer">
|
||||
<view class="bag-footer-price">合计<text>¥{{allPrice}}</text></view>
|
||||
<view class="bag-footer-rests">共计{{bagNumber}}件</view>
|
||||
<button class="bag-footer-btn" size="mini" bindtap="bagOrder" disabled="{{bagOrderLoading}}" loading="{{bagOrderLoading}}">结算</button>
|
||||
</view>
|
||||
<block wx:else>
|
||||
<!-- 用户未登录 -->
|
||||
<view class="pack-center pages-loding auth-login">
|
||||
<image src="/static/icons/carnull_icon.png"></image>
|
||||
<view>您还未登录,无法查看您的购物车信息</view>
|
||||
<navigator class="auth-btn" url="/pages/login/index">登录</navigator>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
@@ -108,3 +108,8 @@
|
||||
.checkbox checkbox .wx-checkbox-input{ background: white; border-radius: 50%; border:solid 3rpx #464854; height: 34rpx; width: 34rpx; }
|
||||
.checkbox checkbox .wx-checkbox-input.wx-checkbox-input-checked{ background: #da2b54; border-color: #da2b54; }
|
||||
.checkbox checkbox .wx-checkbox-input.wx-checkbox-input-checked:before{ top: 18rpx; right: 5rpx; color: white; line-height: 34rpx; text-align: center; width: 36rpx; height: 36rpx; font-size:36rpx; }
|
||||
|
||||
/* 未登录 */
|
||||
.auth-login{ text-align: center; font-size: 28rpx; color: gray; background: white; }
|
||||
.auth-login image{ width: 218rpx; height: 218rpx; margin-bottom: 30rpx; }
|
||||
.auth-btn{ background: #da2b54; display: inline-block; width: 240rpx; height: 80rpx; line-height: 80rpx; border-radius: 40rpx; font-size: 32rpx; color: white; margin-top: 100rpx; }
|
||||
|
||||
@@ -18,21 +18,21 @@ Page({
|
||||
freight : '', // 运费
|
||||
weight : '', // 重量
|
||||
distribution : [
|
||||
{ type: 2, title: "选择配送方式" },
|
||||
{ type: 0, title: "快递" },
|
||||
{ type: 1, title: "自提" },
|
||||
],
|
||||
distributionIndex: 0
|
||||
distributionIndex: 0,
|
||||
distributionType : 2
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
console.log(options.skuId)
|
||||
this.setData({
|
||||
skuId : options.skuId
|
||||
})
|
||||
|
||||
// 获取商品下单信息
|
||||
this.placeInfo(options.skuId);
|
||||
},
|
||||
@@ -43,7 +43,8 @@ Page({
|
||||
distributionChange(e){
|
||||
if(e.detail.value === this.data.distributionIndex) return
|
||||
this.setData({
|
||||
distributionIndex: e.detail.value
|
||||
distributionIndex : e.detail.value,
|
||||
distributionType : this.data.distribution[e.detail.value].type
|
||||
})
|
||||
this.placeInfo(this.data.skuId);
|
||||
},
|
||||
@@ -80,6 +81,13 @@ Page({
|
||||
* 商品确认下单
|
||||
*/
|
||||
buyTap() {
|
||||
if(this.data.distributionIndex == 0){
|
||||
wx.showToast({
|
||||
title: '请选择配送方式',
|
||||
icon : 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
wx.showLoading({
|
||||
title: '下单中...',
|
||||
mask : true
|
||||
@@ -88,10 +96,8 @@ Page({
|
||||
cart_ids : this.data.skuId,
|
||||
address_id : this.data.address.address_id,
|
||||
remark : '',
|
||||
delivery_type : this.data.distributionIndex
|
||||
delivery_type : this.data.distributionType
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
return
|
||||
wx.redirectTo({
|
||||
url: '/pages/pay/index?params=' + encodeURIComponent(JSON.stringify(res.data))
|
||||
})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<view class="borderBottom">
|
||||
<!-- 地址 -->
|
||||
<view class="address" wx:if="{{distributionIndex == 0}}">
|
||||
<view class="address" wx:if="{{distributionIndex == 1}}">
|
||||
<navigator hover-class="none" url="/pages/site/index?type=goodsAddress&skuid={{skuId}}&qty={{goodsQty}}" class="address-cont" wx:if="{{address}}">
|
||||
<view class="address-top">
|
||||
<view class="address-area">
|
||||
@@ -20,19 +20,21 @@
|
||||
</view>
|
||||
|
||||
<!-- 商品 -->
|
||||
<view class="more-goods" wx:for="{{goodskData}}" wx:key="stockData">
|
||||
<view class="more-name">
|
||||
<image src="/static/icons/shopIcon.png"></image>{{item.shop.name}}
|
||||
</view>
|
||||
<view class="list-goods" wx:for="{{item.items}}" wx:key="items" wx:for-item="items">
|
||||
<image class="list-goods-img" mode="aspectFill" src="{{items.cover ? items.cover : '/static/ls/1.jpg'}}"></image>
|
||||
<view class="list-goods-cont">
|
||||
<view class="nowrap list-goods-name">{{items.title}}</view>
|
||||
<view class="list-goods-text">
|
||||
<text>购买数量</text> x{{items.qty}}
|
||||
</view>
|
||||
<view class="list-goods-parice">
|
||||
¥<text>{{items.price}}</text>
|
||||
<view class="more-goods-block">
|
||||
<view class="more-goods" wx:for="{{goodskData}}" wx:key="stockData">
|
||||
<view class="more-name">
|
||||
<image src="/static/icons/shopIcon.png"></image>{{item.shop.name}}
|
||||
</view>
|
||||
<view class="list-goods" wx:for="{{item.items}}" wx:key="items" wx:for-item="items">
|
||||
<image class="list-goods-img" mode="aspectFill" src="{{items.cover ? items.cover : '/static/ls/1.jpg'}}"></image>
|
||||
<view class="list-goods-cont">
|
||||
<view class="nowrap list-goods-name">{{items.title}}</view>
|
||||
<view class="list-goods-text">
|
||||
<text>购买数量</text> x{{items.qty}}
|
||||
</view>
|
||||
<view class="list-goods-parice">
|
||||
¥<text>{{items.price}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -47,6 +49,10 @@
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
<!-- <navigator class="label-item" wx:if="{{distributionIndex == 1}}" url="/pages/store/store">
|
||||
<view class="label-name">自提门店</view>
|
||||
<view class="label-text">华鸿国际自提点<image class="label-picker-icon" src="/static/icons/arrow_more.png"></image></view>
|
||||
</navigator> -->
|
||||
</view>
|
||||
|
||||
<!-- 规格 -->
|
||||
|
||||
@@ -79,11 +79,16 @@ page {
|
||||
}
|
||||
|
||||
/* 商品 */
|
||||
.more-goods {
|
||||
.more-goods-block{
|
||||
background-color: #FFFFFF;
|
||||
border-radius: 15rpx;
|
||||
}
|
||||
|
||||
.more-goods {
|
||||
border-bottom: solid 1rpx #f7f8f9;
|
||||
}
|
||||
.more-goods:last-child{
|
||||
border-bottom: none;
|
||||
}
|
||||
.more-name {
|
||||
padding: 30rpx 30rpx 0;
|
||||
box-sizing: border-box;
|
||||
|
||||
Reference in New Issue
Block a user