调整购物车样式
This commit is contained in:
@@ -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
|
||||
})
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
11
app.json
11
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"
|
||||
}
|
||||
@@ -1,63 +1,68 @@
|
||||
|
||||
<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">
|
||||
<view>您还未登录,无法查看您的购物车信息</view>
|
||||
<navigator class="auth-btn" url="/pages/login/index">登录</navigator>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -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))
|
||||
})
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
})
|
||||
})
|
||||
// }
|
||||
// })
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 微信支付
|
||||
*/
|
||||
|
||||
@@ -31,6 +31,13 @@
|
||||
</view>
|
||||
<radio class="radio-radio" value="coin" color="#da2b54" checked="{{payType == 'coin'}}"/>
|
||||
</label>
|
||||
<label class="radio-flex" wx:if="{{can.baofu == 1}}">
|
||||
<view class="radio-text">
|
||||
<image class="radio-icon" src="/static/pay/wechat.png"></image>
|
||||
<text>微信支付(宝付)</text>
|
||||
</view>
|
||||
<radio class="radio-radio" value="baofu" color="#da2b54" checked="{{payType == 'baofu'}}"/>
|
||||
</label>
|
||||
</radio-group>
|
||||
<view class="radio-lay" wx:if="{{loding}}"></view>
|
||||
</view>
|
||||
|
||||
66
pages/store/store.js
Normal file
66
pages/store/store.js
Normal file
@@ -0,0 +1,66 @@
|
||||
// pages/store/store.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
||||
4
pages/store/store.json
Normal file
4
pages/store/store.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "自提门店"
|
||||
}
|
||||
22
pages/store/store.wxml
Normal file
22
pages/store/store.wxml
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
<view class="content">
|
||||
<view class="store-city">当前所在城市:哈尔滨市</view>
|
||||
<view class="store-title">请选择自提门店</view>
|
||||
<view class="store-list">
|
||||
<view class="store-item">
|
||||
<view class="store-item-title">华鸿国际自提点</view>
|
||||
<view class="store-item-address">黑龙江省哈尔滨市南岗区闽江路73号</view>
|
||||
<view class="store-item-km">距离1.0KM</view>
|
||||
</view>
|
||||
<view class="store-item">
|
||||
<view class="store-item-title">闽江路自提点</view>
|
||||
<view class="store-item-address">黑龙江省哈尔滨市南岗区闽江路10号</view>
|
||||
<view class="store-item-km">距离1.0KM</view>
|
||||
</view>
|
||||
<view class="store-item">
|
||||
<view class="store-item-title">金马国际自提点</view>
|
||||
<view class="store-item-address">黑龙江省哈尔滨市南岗区嵩山路1号(嵩山路珠江路交口)</view>
|
||||
<view class="store-item-km">距离1.0KM</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
17
pages/store/store.wxss
Normal file
17
pages/store/store.wxss
Normal file
@@ -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; }
|
||||
@@ -36,7 +36,7 @@
|
||||
"checkInvalidKey": true,
|
||||
"disableUseStrict": false,
|
||||
"useCompilerPlugins": false,
|
||||
"ignoreUploadUnusedFiles": true
|
||||
"ignoreUploadUnusedFiles": false
|
||||
},
|
||||
"compileType": "miniprogram",
|
||||
"condition": {},
|
||||
|
||||
@@ -8,6 +8,13 @@
|
||||
"condition": {
|
||||
"miniprogram": {
|
||||
"list": [
|
||||
{
|
||||
"name": "自提点",
|
||||
"pathName": "pages/store/store",
|
||||
"query": "",
|
||||
"launchMode": "default",
|
||||
"scene": null
|
||||
},
|
||||
{
|
||||
"name": "购物车",
|
||||
"pathName": "pages/bag/bag",
|
||||
|
||||
Reference in New Issue
Block a user