Commit a2b3f5c0 by 严立

LL - 商品列表,购物车

parent d0ecb2cc
{ {
"pages": [ "pages": [
"pages/commodity/shopping-cart/shopping-cart",
"pages/home/home/home", "pages/home/home/home",
"pages/home/service/service", "pages/home/service/service",
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
"pages/play/strategy-detail/strategy-detail", "pages/play/strategy-detail/strategy-detail",
"pages/commodity/home/home", "pages/commodity/home/home",
"pages/commodity/shopping-cart/shopping-cart",
"pages/commodity/food/food", "pages/commodity/food/food",
"pages/commodity/project/project", "pages/commodity/project/project",
"pages/commodity/snacks/snacks", "pages/commodity/snacks/snacks",
...@@ -60,6 +60,8 @@ ...@@ -60,6 +60,8 @@
"l-avatar": "../miniprogram_npm/lin-ui/avatar/index", "l-avatar": "../miniprogram_npm/lin-ui/avatar/index",
"l-button": "../miniprogram_npm/lin-ui/button/index", "l-button": "../miniprogram_npm/lin-ui/button/index",
"l-card": "../miniprogram_npm/lin-ui/card/index", "l-card": "../miniprogram_npm/lin-ui/card/index",
"l-checkbox": "../miniprogram_npm/lin-ui/checkbox/index",
"l-checkbox-group": "../miniprogram_npm/lin-ui/checkbox-group/index",
"l-capsule-bar": "../miniprogram_npm/lin-ui/capsule-bar/index", "l-capsule-bar": "../miniprogram_npm/lin-ui/capsule-bar/index",
"l-dialog": "../miniprogram_npm/lin-ui/dialog/index", "l-dialog": "../miniprogram_npm/lin-ui/dialog/index",
"l-icon": "../miniprogram_npm/lin-ui/icon/index", "l-icon": "../miniprogram_npm/lin-ui/icon/index",
...@@ -96,20 +98,22 @@ ...@@ -96,20 +98,22 @@
"iconPath": "image/tabbar/home.png", "iconPath": "image/tabbar/home.png",
"selectedIconPath": "image/tabbar/home-s.png", "selectedIconPath": "image/tabbar/home-s.png",
"text": "首页" "text": "首页"
}, }, {
{
"pagePath": "pages/play/home/home", "pagePath": "pages/play/home/home",
"iconPath": "image/tabbar/play.png", "iconPath": "image/tabbar/play.png",
"selectedIconPath": "image/tabbar/play-s.png", "selectedIconPath": "image/tabbar/play-s.png",
"text": "畅玩" "text": "畅玩"
}, }, {
{ "pagePath": "pages/commodity/home/home",
"iconPath": "image/tabbar/play.png",
"selectedIconPath": "image/tabbar/play-s.png",
"text": "服务"
},{
"pagePath": "pages/campsite/home/home", "pagePath": "pages/campsite/home/home",
"iconPath": "image/tabbar/campsite.png", "iconPath": "image/tabbar/campsite.png",
"selectedIconPath": "image/tabbar/campsite-s.png", "selectedIconPath": "image/tabbar/campsite-s.png",
"text": "营地" "text": "营地"
}, }, {
{
"pagePath": "pages/mine/home/home", "pagePath": "pages/mine/home/home",
"iconPath": "image/tabbar/mine.png", "iconPath": "image/tabbar/mine.png",
"selectedIconPath": "image/tabbar/mine-s.png", "selectedIconPath": "image/tabbar/mine-s.png",
......
...@@ -6,30 +6,37 @@ let Development = { ...@@ -6,30 +6,37 @@ let Development = {
miniAppId: 1, miniAppId: 1,
databaseId: '581be62a80bb4f0485abd87abcf64dc0', databaseId: '581be62a80bb4f0485abd87abcf64dc0',
name: '海错图1号馆', name: '海错图1号馆',
logo: 'shopping-cart-logo-4.png',
}, { }, {
miniAppId: 2, miniAppId: 2,
databaseId: '26c40446fc454a02abe61758176597f6', databaseId: '26c40446fc454a02abe61758176597f6',
name: '拾光花坊', name: '拾光花坊',
logo: 'shopping-cart-logo-7.png',
}, { }, {
miniAppId: 3, miniAppId: 3,
databaseId: '2614f117406548718bc091f24368c16e', databaseId: '2614f117406548718bc091f24368c16e',
name: '元养水韵SPA', name: '元养水韵SPA',
logo: '',
}, { }, {
miniAppId: 4, miniAppId: 4,
databaseId: 'd9436d7018de43809824b6ec221ea01f', databaseId: 'd9436d7018de43809824b6ec221ea01f',
name: '原味舒食', name: '原味舒食',
logo: 'shopping-cart-logo-1.png',
}, { }, {
miniAppId: 5, miniAppId: 5,
databaseId: 'c63893bb472f43bca4ec72f890bcb4fd', databaseId: 'c63893bb472f43bca4ec72f890bcb4fd',
name: '原野MOJITO', name: '原野MOJITO',
logo: '',
}, { }, {
miniAppId: 6, miniAppId: 6,
databaseId: '3cfe2e3b8b4342e8b62f8b45daf60d91', databaseId: '3cfe2e3b8b4342e8b62f8b45daf60d91',
name: '5D星空影院', name: '5D星空影院',
logo: '',
}, { }, {
miniAppId: 7, miniAppId: 7,
databaseId: '8a3e59c57f564c569b3d7bb278ea50b3', databaseId: '8a3e59c57f564c569b3d7bb278ea50b3',
name: '儿童营地', name: '儿童营地',
logo: 'shopping-cart-logo-6.png',
} }
] ]
} }
......
{ {
"name": "mini-shimao", "name": "mini-shimao",
"version": "1.0.0", "version": "1.0.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
"lin-ui": { "lin-ui": {
"version": "0.8.6", "version": "0.8.6",
"resolved": "https://registry.npm.taobao.org/lin-ui/download/lin-ui-0.8.6.tgz", "resolved": "https://registry.npm.taobao.org/lin-ui/download/lin-ui-0.8.6.tgz",
"integrity": "sha1-mLXXHCzVzIAutYSCAJyRmlav1KY=" "integrity": "sha1-mLXXHCzVzIAutYSCAJyRmlav1KY="
}
} }
} }
} \ No newline at end of file
{ {
"name": "mini-shimao", "name": "mini-shimao",
"version": "1.0.0", "version": "1.0.0",
"description": "", "description": "",
"main": "app.js", "main": "app.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"lin-ui": "^0.8.6" "lin-ui": "^0.8.6"
} }
} }
\ No newline at end of file
{ {
"usingComponents": { "usingComponents": {
"Tips": "../../../component/Tips/Tips", "Tips": "../../../component/Tips/Tips"
"Blank": "../../../component/Blank/Blank" }
},
"navigationStyle": "default",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "购物车"
} }
\ No newline at end of file
...@@ -3,30 +3,35 @@ Page { ...@@ -3,30 +3,35 @@ Page {
height: 100%; height: 100%;
} }
.header { .navigation {
width: 100%; z-index: 1100;
height: 116rpx; position: fixed;
padding: 16rpx 40rpx; top: 0;
font-size: 30rpx; left: 0;
width: 750rpx;
} }
.header_img { .container {
width: 112rpx; margin-top: 150rpx;
height: 84rpx;
} }
.header_img image { .shop-info {
width: 100%; width: 750rpx;
height: 100%; height: 116rpx;
padding: 16rpx 40rpx;
font-size: 30rpx;
} }
.header_title { .shop-info > image {
flex: 1; width: 400rpx;
color: #c36069; height: 100rpx;
} }
.header_clear { .shop-info > text {
height: 100%; flex-grow: 1;
height: 100rpx;
text-align: right;
line-height: 100rpx;
color: #656e7b; color: #656e7b;
} }
...@@ -36,37 +41,36 @@ Page { ...@@ -36,37 +41,36 @@ Page {
/* 购物车列表 */ /* 购物车列表 */
.shopping-cart-list { .shopping-cart-list {
width: 100%; width: 750rpx;
height: calc(100vh - 390rpx); margin-top: 50rpx;
margin-top: 10rpx; padding-bottom: 200rpx;
} }
.list-item { .list-item {
width: 100%; width: 100%;
height: 250rpx; height: 250rpx;
padding: 0 40rpx; padding: 0 40rpx;
box-sizing: border-box;
} }
.list-item-radio { .list-item-selection,
.list-item-selection-icon {
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
margin: 54rpx 24rpx 0 0;
} }
.list-item-radio radio { .list-item-cover {
transform: scale(0.7); height: 148rpx;
} }
.list-item-cover image { .list-item-cover > image {
width: 148rpx; width: 148rpx;
height: 148rpx; height: 148rpx;
margin-right: 30rpx; margin: 0 30rpx 0 24rpx;
} }
.list-item-info { .list-item-info {
width: 430rpx; width: 430rpx;
height: 168rpx; min-height: 168rpx;
} }
.list-item-name { .list-item-name {
...@@ -107,6 +111,19 @@ Page { ...@@ -107,6 +111,19 @@ Page {
color: #EF4E4E; color: #EF4E4E;
} }
.list-item-price-main .price-special {
width: 78rpx;
height: 32rpx;
border-radius: 4px;
background: linear-gradient(180deg, #3F4357 0%, #252532 100%);
text-align: center;
font-size: 18rpx;
font-weight: 500;
line-height: 30rpx;
color: #E8D0AF;
}
.list-item-price-minor text { .list-item-price-minor text {
height: 32rpx; height: 32rpx;
font-size: 22rpx; font-size: 22rpx;
...@@ -147,6 +164,10 @@ Page { ...@@ -147,6 +164,10 @@ Page {
line-height: 24rpx; line-height: 24rpx;
} }
.list-item-quantity-disable {
color: #CDD1D7;
}
.list-item-quantity-warning { .list-item-quantity-warning {
width: 168rpx; width: 168rpx;
height: 32rpx; height: 32rpx;
...@@ -164,48 +185,63 @@ Page { ...@@ -164,48 +185,63 @@ Page {
.tips-wrapper { .pay-tip {
position: absolute; position: fixed;
left: 0; left: 0;
bottom: 196rpx; bottom: 200rpx;
width: 100%; width: 750rpx;
height: 72rpx;
} }
.footer { /* 结算区域 */
.pay {
position: fixed; position: fixed;
left: 0; left: 0;
bottom: 0; bottom: 0;
width: 100%; width: 750rpx;
height: 196rpx; height: 200rpx;
background-color: #fff;
display: flex;
padding: 0 40rpx 36rpx 36rpx; padding: 0 40rpx 36rpx 36rpx;
box-sizing: border-box; border-top: 1px solid #E2E7EF;
border-top: 1px solid #e2e7ef; background: #FFFFFF;
} }
.all_chk_wrap { .pay-selection {
flex: 3; height: 36rpx;
font-size: 26rpx; font-size: 26rpx;
color: #15191f; font-weight: 400;
line-height: 36rpx;
color: #15191F;
}
.pay-selection text {
margin-left: 8rpx;
} }
.total_price_wrap { .pay-amount {
flex: 5; flex: 5;
text-align: right; text-align: right;
padding-right: 32rpx; padding-right: 32rpx;
} }
.total_price { .pay-amount-total {
color: #86c5e1; height: 53rpx;
font-size: 30rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
line-height: 42rpx;
color: #5DB5DD;
} }
.total_price_text { .pay-amount-total text:nth-child(2) {
font-size: 44rpx; font-size: 38rpx;
} }
.total_discount { .pay-amount-discount {
height: 32rpx;
font-size: 22rpx; font-size: 22rpx;
font-weight: 400;
line-height: 32rpx;
color: #15191F;
} }
.order_pay_wrap { .order_pay_wrap {
...@@ -264,4 +300,4 @@ Page { ...@@ -264,4 +300,4 @@ Page {
image { image {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
\ No newline at end of file
...@@ -3,6 +3,8 @@ let App = getApp() ...@@ -3,6 +3,8 @@ let App = getApp()
Page({ Page({
data: { data: {
shopId: '', shopId: '',
shopName: '',
shopLogo: '',
sideBar: [], // 侧边菜单 sideBar: [], // 侧边菜单
menuTitle: '', // 商品列表标题 menuTitle: '', // 商品列表标题
commodityList: [], // 商品列表 commodityList: [], // 商品列表
...@@ -26,7 +28,9 @@ Page({ ...@@ -26,7 +28,9 @@ Page({
for (let i = 0, l = funcShopId.length; i < l; i++) { for (let i = 0, l = funcShopId.length; i < l; i++) {
if (funcMiniAppId === funcShopId[i].miniAppId) { if (funcMiniAppId === funcShopId[i].miniAppId) {
this.setData({ this.setData({
shopId: funcShopId[i].databaseId shopId: funcShopId[i].databaseId,
shopName: funcShopId[i].name,
shopLogo: funcShopId[i].logo,
}) })
break break
} }
...@@ -157,6 +161,8 @@ Page({ ...@@ -157,6 +161,8 @@ Page({
success: (response) => { success: (response) => {
let funcResponse = response.data let funcResponse = response.data
funcItem.banner = funcResponse.imgs.split('|') funcItem.banner = funcResponse.imgs.split('|')
funcItem.banner.pop()
console.log(funcItem.banner)
this.setData({ this.setData({
commodityDetail: funcItem, commodityDetail: funcItem,
winCommodityDetail: true winCommodityDetail: true
...@@ -233,6 +239,7 @@ Page({ ...@@ -233,6 +239,7 @@ Page({
*/ */
onShoppingCart: function() { onShoppingCart: function() {
console.log(this.data.shoppingCart) console.log(this.data.shoppingCart)
wx.setStorageSync('shopInfoBuffer', { 'id': this.data.shopId, 'name': this.data.shopName, 'logo': this.data.shopLogo })
wx.setStorageSync('shoppingCartBuffer', this.data.shoppingCart) wx.setStorageSync('shoppingCartBuffer', this.data.shoppingCart)
wx.navigateTo({ wx.navigateTo({
url: '/pages/commodity/shopping-cart/shopping-cart', url: '/pages/commodity/shopping-cart/shopping-cart',
......
{ {
"usingComponents": {}, "usingComponents": {}
"navigationBarTitleText": "购物车",
"navigationStyle": "default",
"navigationBarBackgroundColor": "#fff"
} }
\ No newline at end of file
<l-toast show="{{winToast}}" l-image-class="toast-image" l-class="toast-bg" image="/image/success.png" title="添加购物车成功" /> <l-toast show="{{winToast}}" l-image-class="toast-image" l-class="toast-bg" image="/image/success.png" title="添加购物车成功" />
<navigation class="navigation" titleText="{{shopName}}" background="#FFFFFF;" backIcon="/image/back.png"></navigation>
<view class="cates"> <view class="cates">
<view class="cates-container"> <view class="cates-container">
<!-- 侧边菜单 --> <!-- 侧边菜单 -->
...@@ -84,9 +86,20 @@ ...@@ -84,9 +86,20 @@
<!-- 商品详情弹窗 --> <!-- 商品详情弹窗 -->
<l-popup show="{{winCommodityDetail}}" content-align="center" locked="{{true}}"> <l-popup show="{{winCommodityDetail}}" content-align="center" locked="{{true}}">
<view class="popup-wrap"> <view class="popup-wrap">
<view class="popup-img-wrapper"> <view id="banner" class="banner">
<image mode="widthFix" src="./image/popup.png"></image> <swiper autoplay circular class="banner-swiper" interval="5000" duration="500">
<block wx:for="{{commodityDetail.banner}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<swiper-item class="banner-swiper-item">
<image class="banner-swiper-image" src="{{item}}"></image>
</swiper-item>
</block>
</swiper>
<view class="banner-wave">
<image src="/image/ornament-1.png" mode="widthFix"></image>
</view>
</view> </view>
<view class="popup-info-wrapper"> <view class="popup-info-wrapper">
<view class="popuo-info-title">{{commodityDetail.name}}</view> <view class="popuo-info-title">{{commodityDetail.name}}</view>
<view class="popup-info-text">{{commodityDetail.describe}}</view> <view class="popup-info-text">{{commodityDetail.describe}}</view>
...@@ -100,9 +113,12 @@ ...@@ -100,9 +113,12 @@
</view> </view>
<view class="detail-price"> <view class="detail-price">
<text>¥</text> <text>¥</text>
<text>{{commodityDetail.priceDiscount}}</text>
</view>
<view class="popup-price-old">
<text>¥</text>
<text>{{commodityDetail.price}}</text> <text>{{commodityDetail.price}}</text>
</view> </view>
<view class="popup-price-old">¥68.00</view>
</view> </view>
<!-- 业主价样式 --> <!-- 业主价样式 -->
...@@ -112,9 +128,12 @@ ...@@ -112,9 +128,12 @@
</view> </view>
<view class="detail-price"> <view class="detail-price">
<text>¥</text> <text>¥</text>
<text>{{commodityDetail.priceSpecial}}</text>
</view>
<view class="popup-price-old">
<text>¥</text>
<text>{{commodityDetail.price}}</text> <text>{{commodityDetail.price}}</text>
</view> </view>
<view class="popup-price-old">¥68.00</view>
</view> </view>
<!-- 普通价样式 --> <!-- 普通价样式 -->
......
Page { .navigation {
height: 100%; z-index: 1100;
position: fixed;
top: 0;
left: 0;
width: 750rpx;
} }
.cates { .cates {
height: 100%; height: 100%;
margin-top: 150rpx;
} }
.cates-container { .cates-container {
...@@ -145,7 +150,7 @@ Page { ...@@ -145,7 +150,7 @@ Page {
width: 78rpx; width: 78rpx;
height: 32rpx; height: 32rpx;
border-radius: 4px; border-radius: 4px;
background: #D56B52; background: #FAEDEA;
text-align: center; text-align: center;
font-size: 18rpx; font-size: 18rpx;
...@@ -262,7 +267,7 @@ Page { ...@@ -262,7 +267,7 @@ Page {
height: 36rpx; height: 36rpx;
margin-right: 16rpx; margin-right: 16rpx;
border-radius: 4px; border-radius: 4px;
background: #D56B52; background: #FAEDEA;
text-align: center; text-align: center;
font-size: 18rpx; font-size: 18rpx;
...@@ -321,9 +326,47 @@ Page { ...@@ -321,9 +326,47 @@ Page {
} }
.toast-image { .toast-image {
z-index: 1900;
} }
image { image {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
/* 商品详情样式 */
.banner {
position: relative;
width: 606rpx;
height: 382rpx;
border-radius: 4px;
background: #FFFFFF;
}
.banner-swiper,
.banner-swiper-item,
.banner-swiper-image {
position: absolute;
top: 0 !important;
left: 0 !important;
width: 606rpx;
height: 382rpx;
}
.banner-wave {
z-index: 1100;
position: absolute;
bottom: -2rpx;
left: 0;
width: 606rpx;
height: 50rpx;
}
.banner-wave image {
width: 606rpx;
height: 50rpx;
}
\ No newline at end of file
...@@ -70,6 +70,17 @@ Page({ ...@@ -70,6 +70,17 @@ Page({
}) })
}, },
onShareAppMessage: function (res) {
if (res.from === 'button') {
// 来自页面内转发按钮
console.log(res.target)
}
return {
title: '自定义转发标题',
path: '/pages/home/home/home'
}
},
setNavigationLogo: function () { setNavigationLogo: function () {
this.setData({ this.setData({
navigationLogoTop: App.modular.utils.navigationElementCenterMarginTop(60) navigationLogoTop: App.modular.utils.navigationElementCenterMarginTop(60)
......
...@@ -94,6 +94,6 @@ ...@@ -94,6 +94,6 @@
<button class="test-button" data-index="{{5}}" bindtap="onTest3">订单 待付款</button> <button class="test-button" data-index="{{5}}" bindtap="onTest3">订单 待付款</button>
<button class="test-button" data-shop="{{4}}" bindtap="onShop">餐品列表</button> <button class="test-button" data-shop="{{4}}" bindtap="onShop">餐品列表1111</button>
</view> </view>
</view> </view>
\ No newline at end of file
...@@ -140,27 +140,15 @@ ...@@ -140,27 +140,15 @@
}, },
{ {
"id": -1, "id": -1,
<<<<<<< HEAD
"name": "pages/commodity/snacks/snacks",
"pathName": "pages/commodity/snacks/snacks",
=======
"name": "pages/pay/coupon-input/coupon-input", "name": "pages/pay/coupon-input/coupon-input",
"pathName": "pages/pay/coupon-input/coupon-input", "pathName": "pages/pay/coupon-input/coupon-input",
>>>>>>> 667f630dfecbd067586751628eb240b2f54db267
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
<<<<<<< HEAD
"id": 11,
"name": "pages/home/service/service",
"pathName": "pages/home/service/service",
"query": "",
=======
"id": -1, "id": -1,
"name": "pages/pay/coupon-detail/coupon-detail", "name": "pages/pay/coupon-detail/coupon-detail",
"pathName": "pages/pay/coupon-detail/coupon-detail", "pathName": "pages/pay/coupon-detail/coupon-detail",
>>>>>>> 667f630dfecbd067586751628eb240b2f54db267
"scene": null "scene": null
} }
] ]
......
{ {
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
"rules": [{ "rules": [
"action": "allow", {
"page": "*" "action": "allow",
}] "page": "*"
}
]
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment