From 00e9ddd2a59eeca1e74add3380eee7a06e7c94bc Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Thu, 10 Feb 2022 11:32:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/css/page.css | 6 + pages.json | 52 +++++++ pages/buy/buy.css | 12 ++ pages/buy/buy.vue | 132 ++++++++++++++---- pages/cart/cart.vue | 2 +- pages/goods-detail/goods-detail.css | 3 + pages/goods-detail/goods-detail.vue | 47 ++++--- pages/user-order-detail/user-order-detail.vue | 2 +- pages/user-order/user-order.vue | 7 +- 9 files changed, 213 insertions(+), 50 deletions(-) diff --git a/common/css/page.css b/common/css/page.css index 41ceee58..d9fba017 100644 --- a/common/css/page.css +++ b/common/css/page.css @@ -327,6 +327,9 @@ button:before { } .br-gray { border: solid 1px #d6d6d6 !important; +} +.br-blue { + border: solid 1px #2196F3 !important; } .br-0 { border: 0 !important; @@ -416,6 +419,9 @@ button:before { } .bg-base { background-color: #f5f5f5 !important; +} +.bg-blue { + background-color: #2196F3 !important; } button[disabled].bg-white { background-color: #fdfdfd !important; diff --git a/pages.json b/pages.json index 21251c20..df4698e1 100644 --- a/pages.json +++ b/pages.json @@ -725,6 +725,58 @@ "enablePullDownRefresh": true, "navigationBarTitleText": "物流详情" } + }, + { + "path": "pages/plugins/realstore/index/index", + "style": { + "enablePullDownRefresh": true, + "navigationBarTitleText": "门店首页" + } + }, + { + "path": "pages/plugins/realstore/detail/detail", + "style": { + // #ifdef MP-WEIXIN || MP-BAIDU || MP-QQ || MP-TOUTIAO + "navigationStyle": "custom", + // #endif + "enablePullDownRefresh": true, + "navigationBarTitleText": "门店详情" + } + }, + { + "path": "pages/plugins/realstore/orderallot-list/orderallot-list", + "style": { + "enablePullDownRefresh": true, + "navigationBarTitleText": "子订单列表" + } + }, + { + "path": "pages/plugins/realstore/orderallot-detail/orderallot-detail", + "style": { + "enablePullDownRefresh": true, + "navigationBarTitleText": "子订单详情" + } + }, + { + "path": "pages/plugins/realstore/batchorder-list/batchorder-list", + "style": { + "enablePullDownRefresh": true, + "navigationBarTitleText": "批次订单" + } + }, + { + "path": "pages/plugins/realstore/frequencycard-list/frequencycard-list", + "style": { + "enablePullDownRefresh": true, + "navigationBarTitleText": "次卡" + } + }, + { + "path": "pages/plugins/realstore/frequencycard-used/frequencycard-used", + "style": { + "enablePullDownRefresh": true, + "navigationBarTitleText": "次卡使用记录" + } } ], "subPackages": [], diff --git a/pages/buy/buy.css b/pages/buy/buy.css index 6c9df430..1b8d7d7a 100644 --- a/pages/buy/buy.css +++ b/pages/buy/buy.css @@ -133,6 +133,18 @@ .buy-header-nav .item { padding: 25rpx 0; width: 50%; +} + +/** + * 数据列表项 + */ +.buy-data-item { + padding: 0 40rpx 0 20rpx; + line-height: 80rpx; +} +.buy-data-item .right-value { + width: calc(100% - 160rpx); + min-height: 80rpx; } /* diff --git a/pages/buy/buy.vue b/pages/buy/buy.vue index a1bb5ebf..4c1d52c8 100644 --- a/pages/buy/buy.vue +++ b/pages/buy/buy.vue @@ -86,6 +86,33 @@ {{currency_symbol}}{{group.order_base.total_price}} {{currency_symbol}}{{group.order_base.actual_price}} + + + + + + 使用{{plugins_points_data.use_integral}}个积分兑换商品 + 使用积分{{plugins_points_data.use_integral}}个 + -{{currency_symbol}}{{plugins_points_data.discount_price}} + + + + + + 你有积分{{plugins_points_data.user_integral}}个 + 你有积分{{plugins_points_data.user_integral}}个,可用{{plugins_points_data.use_integral}}个 + + + + + + {{buy_datetime_info.title}} + + + {{buy_datetime_info.placeholder}} + {{buy_datetime_info.value}} + + @@ -94,24 +121,8 @@ {{user_note_value || '留言'}} - - - - 使用{{plugins_points_data.use_integral}}个积分兑换商品 - 使用积分{{plugins_points_data.use_integral}}个 - -{{currency_symbol}}{{plugins_points_data.discount_price}} - - - - - - 你有积分{{plugins_points_data.user_integral}}个 - 你有积分{{plugins_points_data.user_integral}}个,可用{{plugins_points_data.use_integral}}个 - - - - + @@ -180,7 +191,8 @@ const app = getApp(); import componentQuickNav from "../../components/quick-nav/quick-nav"; import componentPopup from "../../components/popup/popup"; - import componentNoData from "../../components/no-data/no-data"; + import componentNoData from "../../components/no-data/no-data"; + import componentTimeSelect from "../../components/time-select/time-select"; var common_static_url = app.globalData.get_static_url('common'); export default { @@ -210,7 +222,9 @@ ], // 基础配置 currency_symbol: app.globalData.data.currency_symbol, - common_order_is_booking: 0, + common_order_is_booking: 0, + // 下单时间选择 + buy_datetime_info: {}, // 优惠劵 plugins_coupon_data: null, plugins_coupon_list: [], @@ -227,7 +241,8 @@ components: { componentQuickNav, componentPopup, - componentNoData + componentNoData, + componentTimeSelect }, props: {}, @@ -324,14 +339,44 @@ this.setData({ data_list_loding_status: 0 }); - } else { + } else { + // 下单选择时间 + var data_dt = this.buy_datetime_info || {}; + var temp_dt = data.buy_datetime_info || {}; + var datetime = { + // 是否开启时间选择 + is_select: (temp_dt.is_select || 0) == 1, + // 是否必选 + required: (temp_dt.required || 0) == 1, + // 状态 + status: data_dt.status || (temp_dt.status || 0) == 1 || false, + // 默认值 + value: data_dt.value || temp_dt.value || '', + // 标题 + title: temp_dt.title || '时间', + // 占位文本及标题 + placeholder: temp_dt.placeholder || '选择时间', + // 天起始时间 + time_start: temp_dt.time_start || '', + // 天结束时间 + time_end: temp_dt.time_end || '', + // 可选最大天数 + range_day: temp_dt.range_day || 2, + // 禁止选择的时间 + disabled: temp_dt.disabled || '', + // 未选择错误提示 + error_msg: temp_dt.error_msg || '请选择时间' + }; + + // 设置数据 this.setData({ goods_list: data.goods_list, total_price: data.base.actual_price, extension_data: data.extension_data || [], data_list_loding_status: 3, common_site_type: data.common_site_type || 0, - extraction_address: data.base.extraction_address || [], + extraction_address: data.base.extraction_address || [], + buy_datetime_info: datetime, plugins_coupon_data: data.plugins_coupon_data || null, plugins_points_data: data.plugins_points_data || null }); @@ -445,14 +490,29 @@ }); } - if (this.common_order_is_booking != 1) { - validation.push({ - fields: 'payment_id', - msg: '请选择支付方式' - }); - } + if (app.globalData.fields_check(data, validation)) { + // 请求参数处理 + data = this.request_data_ext_params_merge(data); + + // 是否需要选择时间 + var datetime = this.buy_datetime_info || {}; + if((datetime.is_select || false) == true) { + // 是否必选 + if((datetime.required || false) == true && (datetime.value || null) == null) { + app.globalData.showToast(datetime.error_msg || '请选择时间'); + return false; + } + data['buy_datetime_value'] = datetime.value || ''; + } + + // 是否需要选择支付方式 + if (this.total_price > 0 && this.common_order_is_booking != 1) { + if((data.payment_id || null) == null) { + app.globalData.showToast('请选择支付方式'); + return false; + } + } - if (app.globalData.fields_check(data, validation)) { // 加载loding uni.showLoading({ title: '提交中...' @@ -463,7 +523,7 @@ uni.request({ url: app.globalData.get_request_url("add", "buy"), method: "POST", - data: this.request_data_ext_params_merge(data), + data: data, dataType: "json", success: res => { uni.hideLoading(); @@ -644,6 +704,18 @@ // 仓库事件 warehouse_group_event(e) { app.globalData.url_event(e); + }, + + // 下单选择时间 + buy_datetime_event(e) { + var temp = this.buy_datetime_info; + temp['status'] = !temp.status; + if((e || null) != null) { + temp['value'] = e._date || ''; + } + this.setData({ + buy_datetime_info: temp + }) } } }; diff --git a/pages/cart/cart.vue b/pages/cart/cart.vue index ff1e9656..2bda6ab6 100644 --- a/pages/cart/cart.vue +++ b/pages/cart/cart.vue @@ -403,7 +403,7 @@ cart_all_remove_event(e) { uni.showModal({ title: '温馨提示', - content: '挑了这么久,真的要删除吗', + content: '挑了这么久,真的要删除吗?', confirmText: '确认', cancelText: '暂不', success: result => { diff --git a/pages/goods-detail/goods-detail.css b/pages/goods-detail/goods-detail.css index 963214fb..b53e3397 100644 --- a/pages/goods-detail/goods-detail.css +++ b/pages/goods-detail/goods-detail.css @@ -116,6 +116,9 @@ .goods-buy-nav .bus-items .item { width: 33.33%; position: relative; +} +.goods-buy-nav .bus-items-2 .item { + width: 50%; } .goods-buy-nav .btn-items { width: calc(60% - 10rpx); diff --git a/pages/goods-detail/goods-detail.vue b/pages/goods-detail/goods-detail.vue index 2cbe0ba4..ba92a669 100644 --- a/pages/goods-detail/goods-detail.vue +++ b/pages/goods-detail/goods-detail.vue @@ -296,20 +296,31 @@ - - - - {{nav_home_button_info.text}} - - - - - - - - 购物车 - - + + + + + + + 返回 + + + + + + + {{nav_home_button_info.text}} + + + + + + + + 购物车 + + + {{nav_favor_button_info.text}} @@ -647,8 +658,13 @@ }, onLoad(params) { + var params = app.globalData.launch_params_handle(params); this.setData({ - params: app.globalData.launch_params_handle(params) + params: params, + // 是否自定义购买事件 + buy_event_type: params.opt_buy_event_type || 'buy', + // 是否指定开启购买弹窗、默认0否、1是 + popup_status: (parseInt(params.is_opt_buy_status) || 0) == 1 }); // 数据加载 @@ -1076,7 +1092,6 @@ dataType: 'json', success: res => { uni.hideLoading(); - if (res.data.code == 0) { this.setData({ quick_nav_cart_count: res.data.data diff --git a/pages/user-order-detail/user-order-detail.vue b/pages/user-order-detail/user-order-detail.vue index 4623ab21..f648fd4e 100644 --- a/pages/user-order-detail/user-order-detail.vue +++ b/pages/user-order-detail/user-order-detail.vue @@ -3,7 +3,7 @@ - + {{detail.address_data.alias}} {{detail.address_data.name}} diff --git a/pages/user-order/user-order.vue b/pages/user-order/user-order.vue index 4b4d2ddb..d5a216d0 100644 --- a/pages/user-order/user-order.vue +++ b/pages/user-order/user-order.vue @@ -46,14 +46,17 @@ {{item.buy_number_count}}件 合计 {{item.currency_data.currency_symbol}}{{item.total_price}} - + - + + + +