diff --git a/api/interfaces/pay.js b/api/interfaces/pay.js index 5d8a071..642b0a6 100644 --- a/api/interfaces/pay.js +++ b/api/interfaces/pay.js @@ -19,8 +19,15 @@ const payState = trade_id => req({ data: { trade_id } }) +// 宝付支付 +const bfPay = data => req({ + url: "payments/cashier_desk/baofu", + data +}) + export default ({ info, wechatPay, - payState + payState, + bfPay }) diff --git a/api/request.js b/api/request.js index baffe03..1916203 100644 --- a/api/request.js +++ b/api/request.js @@ -7,9 +7,9 @@ import { errInfo } from './err' import { updToken } from './updateToken' // 正式地址 -const api = "https://api.xuanhuojk.com/api/" +// const api = "https://api.xuanhuojk.com/api/" // 测试地址 -// const api = "https://api.xhtest.douhuofalv.com/api/" +const api = "https://api.xhtest.douhuofalv.com/api/" const header = { "Accept" : "application/json" } diff --git a/app.json b/app.json index 2c15622..0707947 100644 --- a/app.json +++ b/app.json @@ -40,7 +40,8 @@ "pages/refund/logs/logs", "pages/richText/richText", "pages/bag/bag", - "pages/bag/bagConfirm/bagConfirm" + "pages/bag/bagConfirm/bagConfirm", + "pages/store/store" ], "window": { "backgroundTextStyle": "light", @@ -80,8 +81,14 @@ "borderStyle": "white" }, "requiredPrivateInfos": [ - "chooseAddress" + "chooseAddress", + "getFuzzyLocation" ], + "permission": { + "scope.getFuzzyLocation": { + "desc": "位置信息仅用于商品配送" + } + }, "style": "v2", "sitemapLocation": "sitemap.json" } \ No newline at end of file diff --git a/pages/bag/bag.wxml b/pages/bag/bag.wxml index a252556..4e32a89 100644 --- a/pages/bag/bag.wxml +++ b/pages/bag/bag.wxml @@ -1,63 +1,68 @@ - - - - - + + + + + + + + 全选 - 全选 - - - - - - - + + + + + + + + {{ bagList.shop.name }} - {{ bagList.shop.name }} - - - - - - - - {{item.name}} - {{item.sku_name}} - - ¥{{item.price}} - - - - - + + + + + + + + {{item.name}} + {{item.sku_name}} + + ¥{{item.price}} + + - + + + + - - - + + + - - - - - 购物袋中暂无任何商品 - + + + + 购物袋中暂无任何商品 + - - - 未登录,无法获取您的购物车信息 - + + + 合计¥{{allPrice}} + 共计{{bagNumber}}件 + + + - - - 合计¥{{allPrice}} - 共计{{bagNumber}}件 - - + + + + diff --git a/pages/bag/bag.wxss b/pages/bag/bag.wxss index 1d5afc9..6bac960 100644 --- a/pages/bag/bag.wxss +++ b/pages/bag/bag.wxss @@ -108,3 +108,7 @@ .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; } +.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; } diff --git a/pages/bag/bagConfirm/bagConfirm.js b/pages/bag/bagConfirm/bagConfirm.js index 94952ed..cd827c7 100644 --- a/pages/bag/bagConfirm/bagConfirm.js +++ b/pages/bag/bagConfirm/bagConfirm.js @@ -18,8 +18,9 @@ Page({ freight : '', // 运费 weight : '', // 重量 distribution : [ - { type: 0, title: "快递" }, - { type: 1, title: "自提" }, + { type: 0, title: "选择配送方式" }, + { type: 1, title: "快递" }, + { type: 2, title: "自提" }, ], distributionIndex: 0 }, @@ -28,11 +29,9 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad(options) { - console.log(options.skuId) this.setData({ skuId : options.skuId }) - // 获取商品下单信息 this.placeInfo(options.skuId); }, @@ -80,6 +79,13 @@ Page({ * 商品确认下单 */ buyTap() { + if(this.data.distributionIndex == 0){ + wx.showToast({ + title: '请选择配送方式', + icon : 'none' + }) + return + } wx.showLoading({ title: '下单中...', mask : true @@ -90,7 +96,6 @@ Page({ remark : '', delivery_type : this.data.distributionIndex }).then(res => { - wx.redirectTo({ url: '/pages/pay/index?params=' + encodeURIComponent(JSON.stringify(res.data)) }) diff --git a/pages/bag/bagConfirm/bagConfirm.wxml b/pages/bag/bagConfirm/bagConfirm.wxml index c18c1a5..bd82abc 100644 --- a/pages/bag/bagConfirm/bagConfirm.wxml +++ b/pages/bag/bagConfirm/bagConfirm.wxml @@ -1,6 +1,6 @@ - + @@ -20,19 +20,21 @@ - - - {{item.shop.name}} - - - - - {{items.title}} - - 购买数量 x{{items.qty}} - - - ¥{{items.price}} + + + + {{item.shop.name}} + + + + + {{items.title}} + + 购买数量 x{{items.qty}} + + + ¥{{items.price}} + @@ -47,6 +49,10 @@ + diff --git a/pages/bag/bagConfirm/bagConfirm.wxss b/pages/bag/bagConfirm/bagConfirm.wxss index f7f2b99..de1bd19 100644 --- a/pages/bag/bagConfirm/bagConfirm.wxss +++ b/pages/bag/bagConfirm/bagConfirm.wxss @@ -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; diff --git a/pages/pay/index.js b/pages/pay/index.js index 7c37f6f..f8a63dc 100644 --- a/pages/pay/index.js +++ b/pages/pay/index.js @@ -75,8 +75,40 @@ Page({ loding: false }) break; + case 'baofu': + this.baofuPay() + break; } }, + /** + * 宝付微信 + */ + baofuPay(){ + wx.login({ + success: wxCode => { + // wx.getFuzzyLocation({ + // success: locationRes => { + // let { latitude, longitude } = locationRes + let { code } = wxCode; + let data = { + order_type : this.data.modelType, + order_id : this.data.modelId, + code : code, + longitude : '171.21', + latitude : '22.33', + } + wx.$api.pay.bfPay(data).then(res => { + console.log(res) + }).finally(() => { + this.setData({ + loding: false + }) + }) + // } + // }) + } + }) + }, /** * 微信支付 */ diff --git a/pages/pay/index.wxml b/pages/pay/index.wxml index 3042912..80ce6cc 100644 --- a/pages/pay/index.wxml +++ b/pages/pay/index.wxml @@ -31,6 +31,13 @@ + diff --git a/pages/store/store.js b/pages/store/store.js new file mode 100644 index 0000000..0ef6dce --- /dev/null +++ b/pages/store/store.js @@ -0,0 +1,66 @@ +// pages/store/store.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/store/store.json b/pages/store/store.json new file mode 100644 index 0000000..c281f4c --- /dev/null +++ b/pages/store/store.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "自提门店" +} \ No newline at end of file diff --git a/pages/store/store.wxml b/pages/store/store.wxml new file mode 100644 index 0000000..e58eb4d --- /dev/null +++ b/pages/store/store.wxml @@ -0,0 +1,22 @@ + + + 当前所在城市:哈尔滨市 + 请选择自提门店 + + + 华鸿国际自提点 + 黑龙江省哈尔滨市南岗区闽江路73号 + 距离1.0KM + + + 闽江路自提点 + 黑龙江省哈尔滨市南岗区闽江路10号 + 距离1.0KM + + + 金马国际自提点 + 黑龙江省哈尔滨市南岗区嵩山路1号(嵩山路珠江路交口) + 距离1.0KM + + + diff --git a/pages/store/store.wxss b/pages/store/store.wxss new file mode 100644 index 0000000..10c1d47 --- /dev/null +++ b/pages/store/store.wxss @@ -0,0 +1,17 @@ +/* 内容 */ +.content{ background: #f7f8f9; min-height: 100vh; } + +/* 所在城市 */ +.store-city{ background: white; padding: 0 30rpx; line-height: 90rpx; font-size: 30rpx; } + +/* 选择自提门店 */ +.store-title{ background: #f7f8f9; padding: 20rpx 30rpx; font-size: 28rpx; color: gray; } + +/* 自提点 */ +.store-list{ padding: 20rpx 0; background-color: white; } +.store-item{ padding: 20rpx 30rpx; position: relative; padding-right: 200rpx; } +.store-item::after{ position: absolute; right: 0; bottom: 0; left: 30rpx; height: 1rpx; background: #ddd; content: " "; } +.store-item:last-child::after{ display: none; } +.store-item-title{ font-weight: bold; line-height: 50rpx; font-size: 32rpx; } +.store-item-address{ font-size: 28rpx; color: gray; line-height: 40rpx; } +.store-item-km{ position: absolute; right: 30rpx; font-size: 26rpx; color: gray; top: 50%; line-height: 40rpx; margin-top: -20rpx; } diff --git a/project.config.json b/project.config.json index 143ba72..79d7e62 100644 --- a/project.config.json +++ b/project.config.json @@ -36,7 +36,7 @@ "checkInvalidKey": true, "disableUseStrict": false, "useCompilerPlugins": false, - "ignoreUploadUnusedFiles": true + "ignoreUploadUnusedFiles": false }, "compileType": "miniprogram", "condition": {}, diff --git a/project.private.config.json b/project.private.config.json index 9cb3045..5ccf2e7 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -8,6 +8,13 @@ "condition": { "miniprogram": { "list": [ + { + "name": "自提点", + "pathName": "pages/store/store", + "query": "", + "launchMode": "default", + "scene": null + }, { "name": "购物车", "pathName": "pages/bag/bag",