diff --git a/api/interfaces/bag.js b/api/interfaces/bag.js index 116bc70..bbd9080 100644 --- a/api/interfaces/bag.js +++ b/api/interfaces/bag.js @@ -35,10 +35,25 @@ const del = cart_id => req({ method : "DELETE" }) +// 购物车确认订单 +const buyCarts = (data) => req({ + url : "mall/buy/carts", + data +}) + +// 购物车下单 +const postCarts = (data) => req({ + url : "mall/buy/carts", + method : "POST", + data +}) + export default ({ count, add, list, putNum, - del + del, + buyCarts, + postCarts }) \ No newline at end of file diff --git a/app.json b/app.json index 7bde636..2c15622 100644 --- a/app.json +++ b/app.json @@ -39,7 +39,8 @@ "pages/refund/deliver/deliver", "pages/refund/logs/logs", "pages/richText/richText", - "pages/bag/bag" + "pages/bag/bag", + "pages/bag/bagConfirm/bagConfirm" ], "window": { "backgroundTextStyle": "light", @@ -64,14 +65,14 @@ { "pagePath": "pages/bag/bag", "text": "购物袋", - "iconPath": "/static/tabBarIcon/tabBar_01.png", - "selectedIconPath": "/static/tabBarIcon/tabBar_selected_01.png" + "iconPath": "/static/tabBarIcon/tabBar_03.png", + "selectedIconPath": "/static/tabBarIcon/tabBar_selected_03.png" }, { "pagePath": "pages/user/index", "text": "我的", - "iconPath": "/static/tabBarIcon/tabBar_03.png", - "selectedIconPath": "/static/tabBarIcon/tabBar_selected_03.png" + "iconPath": "/static/tabBarIcon/tabBar_04.png", + "selectedIconPath": "/static/tabBarIcon/tabBar_selected_04.png" } ], "color": "#999999", diff --git a/pages/bag/bag.js b/pages/bag/bag.js index ff8e400..814538a 100644 --- a/pages/bag/bag.js +++ b/pages/bag/bag.js @@ -253,9 +253,9 @@ Page({ bagOrderLoading:true }) if (this.data.bagId != ''){ - - console.log('提交的数据id:' + this.data.bagId) - + wx.navigateTo({ + url: './bagConfirm/bagConfirm?skuId=' + this.data.bagId + }) // setTimeout(() => { // this.setData({ // bagOrderLoading: false diff --git a/pages/bag/bag.wxml b/pages/bag/bag.wxml index 6aca81d..a252556 100644 --- a/pages/bag/bag.wxml +++ b/pages/bag/bag.wxml @@ -45,7 +45,7 @@ - + 购物袋中暂无任何商品 @@ -57,7 +57,7 @@ 合计¥{{allPrice}} - 共计{{bagNumber}}件,不含运费 + 共计{{bagNumber}}件 diff --git a/pages/bag/bag.wxss b/pages/bag/bag.wxss index 7ce7194..1d5afc9 100644 --- a/pages/bag/bag.wxss +++ b/pages/bag/bag.wxss @@ -1,6 +1,8 @@ .content{ background: #f7f8f9; min-height: 100vh; } +.pack-center {z-index: 9;} + /* 工具栏 */ .bag-header{ border-bottom: solid 1rpx #f1f1f1; padding: 25rpx 30rpx; overflow: hidden; position: fixed; width: 100%; top: 0; left: 0; box-sizing: border-box; line-height: 40rpx; } diff --git a/pages/bag/bagConfirm/bagConfirm.js b/pages/bag/bagConfirm/bagConfirm.js new file mode 100644 index 0000000..94952ed --- /dev/null +++ b/pages/bag/bagConfirm/bagConfirm.js @@ -0,0 +1,100 @@ +/* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ +*/ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + disabled : true, //按钮 + skuId : '', + address : '', // 地址 + goodskData : '', // 数据 + amount : '', // 商品总金额 + total : '', // 支付金额 + freight : '', // 运费 + weight : '', // 重量 + distribution : [ + { type: 0, title: "快递" }, + { type: 1, title: "自提" }, + ], + distributionIndex: 0 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + console.log(options.skuId) + this.setData({ + skuId : options.skuId + }) + + // 获取商品下单信息 + this.placeInfo(options.skuId); + }, + + /** + * 配送方式选择 + */ + distributionChange(e){ + if(e.detail.value === this.data.distributionIndex) return + this.setData({ + distributionIndex: e.detail.value + }) + this.placeInfo(this.data.skuId); + }, + /** + * 商品下单信息 + */ + placeInfo(skuid, type) { + wx.showLoading({ + title: '加载中...', + mask : true + }) + wx.$api.bag.buyCarts({ + cart_ids : skuid, + address_id : this.data.address.address_id || '', + delivery_type: this.data.distributionIndex + }).then(res => { + if(type != 'chooseAdd'){ + this.setData({ + address: res.data.address, + }) + } + this.setData({ + goodskData: res.data.detail, + amount : res.data.amount, + total : res.data.total, + freight : res.data.freight, + weight : res.data.weight + }) + wx.hideLoading() + }) + }, + + /** + * 商品确认下单 + */ + buyTap() { + wx.showLoading({ + title: '下单中...', + mask : true + }) + wx.$api.bag.postCarts({ + cart_ids : this.data.skuId, + address_id : this.data.address.address_id, + remark : '', + delivery_type : this.data.distributionIndex + }).then(res => { + + wx.redirectTo({ + url: '/pages/pay/index?params=' + encodeURIComponent(JSON.stringify(res.data)) + }) + wx.hideLoading() + }).catch(() =>{}).finally(() => {}) + }, +}) \ No newline at end of file diff --git a/pages/bag/bagConfirm/bagConfirm.json b/pages/bag/bagConfirm/bagConfirm.json new file mode 100644 index 0000000..40a0d69 --- /dev/null +++ b/pages/bag/bagConfirm/bagConfirm.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "购物车订单确认" +} \ No newline at end of file diff --git a/pages/bag/bagConfirm/bagConfirm.wxml b/pages/bag/bagConfirm/bagConfirm.wxml new file mode 100644 index 0000000..c18c1a5 --- /dev/null +++ b/pages/bag/bagConfirm/bagConfirm.wxml @@ -0,0 +1,77 @@ + + + + + + + {{address.province.name}}{{address.city.name}} + + {{address.full_address}} + + + {{address.name}}{{address.mobile}} + + + + + 新增收货地址 + + + + + + + + + {{item.shop.name}} + + + + + {{items.title}} + + 购买数量 x{{items.qty}} + + + ¥{{items.price}} + + + + + + + + + 配送方式 + + {{distribution[distributionIndex].title}} + + + + + + + + + 快递 + {{freight == 0 ? '免邮' : '¥' + freight + '元'}} + + + 重量 + {{weight}}g + + + 金额 + ¥{{amount}} + + + + + + + + 合计: + + {{total}} + + 立即支付 + \ No newline at end of file diff --git a/pages/bag/bagConfirm/bagConfirm.wxss b/pages/bag/bagConfirm/bagConfirm.wxss new file mode 100644 index 0000000..f7f2b99 --- /dev/null +++ b/pages/bag/bagConfirm/bagConfirm.wxss @@ -0,0 +1,317 @@ +page { + background-color: #f5f6f8; + padding: 30rpx; + box-sizing: border-box; +} + +.borderBottom { + border-bottom: 110rpx solid transparent; +} + +/* 地址 */ +.address { + background-color: #FFFFFF; + border-radius: 15rpx; + overflow: hidden; + position: relative; + margin-bottom: 30rpx; +} + +.address-arrow { + position: absolute; + right: 15rpx; + top: 78rpx; + width: 50rpx; + height: 50rpx; +} + +.address-cont { + padding: 30rpx; + box-sizing: border-box; +} + +.address-top { + width: calc(100% - 80rpx); +} + +.address-area { + color: #585866; + font-size: 28rpx; + display: flex; + line-height: 40rpx; +} + +.address-icon { + width: 40rpx; + margin-right: 20rpx; +} + +.address-text { + font-weight: 600; + padding: 10px 0; +} + +.address-name text { + color: #585866; + padding-left: 30rpx; +} + +.address-img { + width: 100%; + height: 10rpx; + display: block; +} + +.address-add { + width: 100%; + text-align: center; + padding: 30rpx 30rpx 0; + box-sizing: border-box; +} + +.address-go { + display: inline-block; + font-size: 28rpx; + line-height: 68rpx; + border-radius: 10rpx; + color: #df723a; + padding-bottom: 20rpx; +} + +/* 商品 */ +.more-goods { + background-color: #FFFFFF; + border-radius: 15rpx; +} + +.more-name { + padding: 30rpx 30rpx 0; + box-sizing: border-box; + font-weight: 600; + display: flex; + line-height: 38rpx; +} + +.more-name image { + width: 38rpx; + height: 38rpx; + margin-right: 10rpx; +} + +.list-goods { + background-color: #FFFFFF; + display: flex; + padding: 30rpx; + border-radius: 15rpx; + box-sizing: border-box; +} + +.list-goods-img { + width: 184rpx; + height: 184rpx; + margin-right: 30rpx; + border-radius: 10rpx; +} + +.list-goods-cont { + width: calc(100% - 214rpx); +} + +.list-goods-name { + font-size: 32rpx; +} + +.list-goods-text { + line-height: 90rpx; + display: flex; + font-size: 28rpx; + color: #999999; +} + +.list-goods-text text { + flex: 1; +} + +.list-goods-parice { + font-size: 26rpx; +} + +.list-goods-parice text { + font-size: 34rpx; +} + +/* 规格 */ +.label { + background-color: #FFFFFF; + border-radius: 15rpx; + overflow: hidden; + box-sizing: border-box; + margin-top: 30rpx; +} + +.label-item { + display: flex; + line-height: 100rpx; + color: #585866; + font-size: 30rpx; + padding: 0 30rpx; + box-sizing: border-box; + border-bottom: 2rpx solid rgb(243, 243, 243); +} + +.label-item:last-child { + border: none; +} + +.label-integral { + color: #da2b54; + font-weight: 600; +} + +.label-name { + flex: 1; +} + +.label-picker{ width: 70%; } +.label-picker-val{ text-align: right; display: flex; align-items: center; justify-content: flex-end;} +.label-picker-icon{ width: 24rpx; height: 24rpx; margin-left: 10rpx; } + + +/*checkbox选中后样式 */ +.label-text-checkbox { + margin-right: -14rpx; + margin-left: 10rpx; +} + +.label-text-checkbox .wx-checkbox-input.wx-checkbox-input-checked { + background: #da2b54; + border-color: #da2b54; +} + +.label-text-checkbox .wx-checkbox-input.wx-checkbox-input-checked::before { + width: 30rpx; + height: 30rpx; + line-height: 28rpx; + text-align: center; + font-size: 30rpx; + color: #fff; + background: transparent; + transform: translate(-50%, -50%) scale(1); + -webkit-transform: translate(-50%, -50%) scale(1); +} + +.label-price { + text-align: right; + line-height: 90rpx; + font-size: 30rpx; + font-weight: 600; + padding: 0 30rpx 5rpx; + box-sizing: border-box; +} + +.label-price text { + font-size: 34rpx; + padding: 0 10rpx; +} + +.label-number { + display: flex; + margin-top: 25rpx; + height: 48rpx; + border: 2rpx solid #d7d7d7; + border-radius: 10rpx; +} + +.number-btn { + background-color: transparent; + width: 48rpx; + height: 48rpx; + line-height: 48rpx; + text-align: center; +} + +.number-input { + width: 80rpx; + text-align: center; + height: 48rpx; + border-left: 2rpx solid #d7d7d7; + border-right: 2rpx solid #d7d7d7; +} + +/* 底部 */ +.footer { + width: 100%; + height: 60px; + background-color: #ffffff; + position: fixed; + left: 0; + bottom: 0; + z-index: 9; + box-sizing: border-box; + display: flex; +} + +.number { + flex: 1; + line-height: 60px; + color: #da2b54; + display: flex; + padding: 0 30rpx; + box-sizing: border-box; +} + +.number text { + font-size: 28rpx; + padding-top: 5rpx; +} + +.number-price { + padding: 0 5rpx; + font-size: 40rpx; +} + +.number-vip { + margin-left: 20rpx; + color: #8d97a1; + font-size: 28rpx; +} + +.btn { + height: 100%; + background-color: #da2b54; + text-align: center; + color: #FFFFFF; + padding: 0 70rpx; + line-height: 60px; +} + +.btn-disabled { + line-height: 60px; + text-align: center; + border: none; + border-radius:0; + background-color: #da2b54; + padding: 0; + margin: 0; +} + +button[disabled]{ + padding: 0; + padding: 0; + height: 60px; + line-height: 60px; + background-color: transparent !important; +} + +.btn.active { + background-color: #cacaca; +} + +.detailsBrief-back{ + width: 100%; +} + +.grey { + background-color: #f9f9f9; + z-index: 99999; +} \ No newline at end of file diff --git a/pages/order/details/details.wxml b/pages/order/details/details.wxml index c21a1ea..56a8552 100644 --- a/pages/order/details/details.wxml +++ b/pages/order/details/details.wxml @@ -30,19 +30,17 @@ {{goodsData.shop.name}} {{goodsData.state}} - - - - - {{item.sku.goods_name}} - - 购买数量x{{item.qty}} - - - ¥{{item.price}} - + + + + {{item.sku.goods_name}} + + 购买数量x{{item.qty}} - + + ¥{{item.price}} + + @@ -69,7 +67,7 @@ 订单金额 - {{goodsData.amount}} + ¥{{goodsData.amount}} 实付金额 diff --git a/pages/order/index.wxss b/pages/order/index.wxss index cd6cacc..81107a0 100644 --- a/pages/order/index.wxss +++ b/pages/order/index.wxss @@ -57,6 +57,7 @@ page { .list-goods { display: flex; + margin-bottom: 30rpx; } .list-goods-img { diff --git a/pages/pay/index.js b/pages/pay/index.js index 00763ce..7c37f6f 100644 --- a/pages/pay/index.js +++ b/pages/pay/index.js @@ -14,11 +14,13 @@ Page({ modelId : "", modelType : "", payType : "", + orderNos : [], can : { coin : 0, wechat : 0, }, - loding : false + loding : false, + noShow : false }, /** @@ -31,12 +33,13 @@ Page({ mask : true }) wx.$api.pay.info({ order_id, order_type }).then(res => { - let { can, total, model_type, model_id } = res.data + let { can, total, model_type, model_id, order_nos } = res.data this.setData({ orderNo : order_no, payType : res.data.default, modelId : model_id, modelType : model_type, + orderNos : order_nos, total, can }) @@ -108,5 +111,14 @@ Page({ }) } }) + }, + + /** + * 展开订单号 + */ + noTap() { + this.setData({ + noShow: !this.data.noShow + }) } }) \ No newline at end of file diff --git a/pages/pay/index.wxml b/pages/pay/index.wxml index 1e7da49..3042912 100644 --- a/pages/pay/index.wxml +++ b/pages/pay/index.wxml @@ -3,7 +3,15 @@ 实付金额 {{total}} - 订单号{{orderNo}} + + 支付金额包含订单 + + + 订单号:{{item}} + + + {{noShow ? '收起' : '展开'}} + 选择支付方式 diff --git a/pages/pay/index.wxss b/pages/pay/index.wxss index 125c70e..77accdb 100644 --- a/pages/pay/index.wxss +++ b/pages/pay/index.wxss @@ -1,10 +1,18 @@ .content{ background: white; min-height: 100vh; padding: 0 30rpx; } -.info{ padding:100rpx 50rpx; text-align: center; border-bottom: solid 1rpx #f7f8f9; } +.info{ padding:100rpx 20rpx; text-align: center; border-bottom: solid 1rpx #f7f8f9; } .title{font-weight: bold; line-height: 40rpx;} .price{ font-weight: bold; font-size: 80rpx; padding: 30rpx 0; line-height: 80rpx; } .price text{ font-size: 80%; } -.no{ font-size: 28rpx; color: gray; line-height: 40rpx; } +.no{ font-size: 26rpx; color: gray; line-height: 40rpx; } +.no-list {margin-top: 30rpx; background-color: #f7faff; border-radius: 10rpx; padding: 30rpx 10rpx; box-sizing: border-box; height: 100rpx; position: relative; overflow: hidden;} +.no-list::after {position: absolute; left: calc(50% - 9rpx); top: -18rpx; content: ''; width: 0;height: 0;border-bottom: 18rpx solid #f7faff; border-left: 18rpx solid transparent; border-right: 18rpx solid transparent;} +.no-list-item {line-height: 40rpx; margin-bottom: 30rpx;} +.no-list-item:last-child {margin-bottom: 0;} +.no-list.active {height: auto;} +.no-show {background-color: #f7faff; color: #000000; display: inline-block; padding: 0 40rpx; line-height: 52rpx; border-radius: 0 0 10rpx 10rpx; font-size: 26rpx;} +.no-show image {width: 24rpx; height: 24rpx; vertical-align: -4rpx;transform: rotate(270deg); transition: .2s;} +.no-show.active image {transform: rotate(90deg);} /* 支付方式 */ .radio-title{ font-weight: bold; font-size: 30rpx; padding: 30rpx; } diff --git a/static/icons/carnull_icon.png b/static/icons/carnull_icon.png new file mode 100644 index 0000000..b54a046 Binary files /dev/null and b/static/icons/carnull_icon.png differ diff --git a/static/icons/shopIcon.png b/static/icons/shopIcon.png new file mode 100644 index 0000000..a32a64b Binary files /dev/null and b/static/icons/shopIcon.png differ diff --git a/static/tabBarIcon/tabBar_03.png b/static/tabBarIcon/tabBar_03.png index 4b62d12..75d9a7d 100644 Binary files a/static/tabBarIcon/tabBar_03.png and b/static/tabBarIcon/tabBar_03.png differ diff --git a/static/tabBarIcon/tabBar_04.png b/static/tabBarIcon/tabBar_04.png new file mode 100644 index 0000000..4b62d12 Binary files /dev/null and b/static/tabBarIcon/tabBar_04.png differ diff --git a/static/tabBarIcon/tabBar_selected_03.png b/static/tabBarIcon/tabBar_selected_03.png index da2ff1c..1a6d946 100644 Binary files a/static/tabBarIcon/tabBar_selected_03.png and b/static/tabBarIcon/tabBar_selected_03.png differ diff --git a/static/tabBarIcon/tabBar_selected_04.png b/static/tabBarIcon/tabBar_selected_04.png new file mode 100644 index 0000000..da2ff1c Binary files /dev/null and b/static/tabBarIcon/tabBar_selected_04.png differ