From 57ecb34cee8f4253f9c91c939735617d8d2c6532 Mon Sep 17 00:00:00 2001 From: xindan <2499232802@qq.com> Date: Sat, 9 Oct 2021 17:44:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E6=90=9C=E7=B4=A2=E5=BC=80?= =?UTF-8?q?=E5=8F=91+=E7=BB=86=E8=8A=82=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/css/common.css | 23 +- components/popup/popup.vue | 20 +- pages/buy/buy.vue | 107 +- .../extraction-address/extraction-address.css | 15 + .../extraction-address/extraction-address.vue | 559 ++++--- pages/goods-detail/goods-detail.vue | 32 +- pages/goods-search/goods-search.css | 147 ++ pages/goods-search/goods-search.vue | 1321 +++++++---------- static/images/quick-submit-icon.png | Bin 1246 -> 0 bytes static/images/search-asc-icon.png | Bin 3041 -> 0 bytes static/images/search-default-icon.png | Bin 2900 -> 0 bytes static/images/search-desc-icon.png | Bin 2979 -> 0 bytes static/images/search-submit-icon.png | Bin 3718 -> 0 bytes 13 files changed, 1073 insertions(+), 1151 deletions(-) create mode 100644 pages/extraction-address/extraction-address.css create mode 100644 pages/goods-search/goods-search.css delete mode 100644 static/images/quick-submit-icon.png delete mode 100755 static/images/search-asc-icon.png delete mode 100755 static/images/search-default-icon.png delete mode 100755 static/images/search-desc-icon.png delete mode 100755 static/images/search-submit-icon.png diff --git a/common/css/common.css b/common/css/common.css index 0a40c4ec..d00b92eb 100644 --- a/common/css/common.css +++ b/common/css/common.css @@ -242,17 +242,8 @@ button[disabled]..button-main { /** * 统一颜色 - * 文本主色、次主色、搭配色、基础色、白色、绿色、黑色、灰色、浅灰色、红色 + * 文本基础色、白色、绿色、黑色、灰色、浅灰色、红色、搭配色、次主色、主色 */ -.cr-main { - color: #f6c133 !important; -} -.cr-main-light { - color: #ffebd2 !important; -} -.cr-main-pair { - color: #795548 !important; -} .cr-base { color: #666 !important; } @@ -274,6 +265,15 @@ button[disabled]..button-main { .cr-red { color: #f00 !important; } +.cr-main-pair { + color: #795548 !important; +} +.cr-main-light { + color: #ffebd2 !important; +} +.cr-main { + color: #f6c133 !important; +} /** * 统一背景色 @@ -299,6 +299,9 @@ button[disabled]..button-main { } .bg-gray { background-color: #d6d6d6 !important; +} +.bg-base { + background-color: #f5f5f5 !important; } button[disabled].bg-main { background-color: #fdd178 !important; diff --git a/components/popup/popup.vue b/components/popup/popup.vue index 810f4ef1..aea51460 100644 --- a/components/popup/popup.vue +++ b/components/popup/popup.vue @@ -34,9 +34,7 @@ position: fixed; background: #fff; z-index: 101; - overflow: hidden; - border-top-right-radius: 20rpx; - border-top-left-radius: 20rpx; + overflow: hidden; } .popup-mask { position: fixed; @@ -83,5 +81,21 @@ } .popup.animation .popup-mask { transition: all 0.25s linear; + } + .popup-top { + border-bottom-right-radius: 20rpx; + border-bottom-left-radius: 20rpx; + } + .popup-bottom { + border-top-right-radius: 20rpx; + border-top-left-radius: 20rpx; + } + .popup-left { + border-top-right-radius: 20rpx; + border-bottom-right-radius: 20rpx; + } + .popup-right { + border-top-left-radius: 20rpx; + border-bottom-left-radius: 20rpx; } diff --git a/pages/buy/buy.vue b/pages/buy/buy.vue index f582e129..6fa2ca49 100644 --- a/pages/buy/buy.vue +++ b/pages/buy/buy.vue @@ -23,7 +23,7 @@ {{address.tel}} - + {{address.province_name || ''}}{{address.city_name || ''}}{{address.county_name || ''}}{{address.address || ''}} @@ -234,26 +234,24 @@ onLoad(params) { //params['data'] = '{"buy_type":"goods","goods_id":"1","stock":"1","spec":"[]"}'; - if ((params.data || null) != null && app.globalData.get_length(JSON.parse(decodeURIComponent(params - .data))) > 0) { + if ((params.data || null) != null && app.globalData.get_length(JSON.parse(decodeURIComponent(params.data))) > 0) { this.setData({ params: JSON.parse(decodeURIComponent(params.data)) - }); // 删除地址缓存 - + }); + + // 删除地址缓存 uni.removeStorageSync(app.globalData.data.cache_buy_user_address_select_key); } }, - onShow() { - uni.setNavigationBarTitle({ - title: app.globalData.data.common_pages_title.buy - }); // 数据加载 - + onShow() { + // 数据加载 this.init(); this.setData({ is_first: 0 - }); // 初始化配置 - + }); + + // 初始化配置 this.init_config(); }, @@ -285,21 +283,20 @@ }); uni.stopPullDownRefresh(); return false; - } // 本地缓存地址 - + } + // 本地缓存地址 if (this.is_first == 0) { var cache_address = uni.getStorageSync(app.globalData.data.cache_buy_user_address_select_key); - if ((cache_address || null) != null) { this.setData({ address: cache_address, address_id: cache_address.id }); } - } // 加载loding - + } + // 加载loding uni.showLoading({ title: '加载中...' }); @@ -318,7 +315,6 @@ success: res => { uni.stopPullDownRefresh(); uni.hideLoading(); - if (res.data.code == 0) { var data = res.data.data; @@ -336,46 +332,38 @@ extraction_address: data.base.extraction_address || [], plugins_coupon_data: data.plugins_coupon_data || null, plugins_points_data: data.plugins_points_data || null - }); // 优惠劵选择处理 - + }); + + // 优惠劵选择处理 if ((data.plugins_coupon_data || null) != null) { var plugins_choice_coupon_value = []; - for (var i in data.plugins_coupon_data) { var cupk = data.plugins_coupon_data[i]['warehouse_id']; - if ((data.plugins_coupon_data[i]['coupon_data']['coupon_choice'] || - null) != null) { - plugins_choice_coupon_value[cupk] = data.plugins_coupon_data[i][ - 'coupon_data' - ]['coupon_choice']['coupon']['desc']; + if ((data.plugins_coupon_data[i]['coupon_data']['coupon_choice'] || null) != null) { + plugins_choice_coupon_value[cupk] = data.plugins_coupon_data[i]['coupon_data']['coupon_choice']['coupon']['desc']; } else { - var coupon_count = (data.plugins_coupon_data[i]['coupon_data'][ - 'coupon_list' - ] || null) != null ? data.plugins_coupon_data[i][ - 'coupon_data' - ].coupon_list.length : 0; - plugins_choice_coupon_value[cupk] = coupon_count > 0 ? '可选优惠劵' + - coupon_count + '张' : '暂无可用优惠劵'; + var coupon_count = (data.plugins_coupon_data[i]['coupon_data']['coupon_list'] || null) != null ? data.plugins_coupon_data[i]['coupon_data'].coupon_list.length : 0; + plugins_choice_coupon_value[cupk] = coupon_count > 0 ? '可选优惠劵' +coupon_count + '张' : '暂无可用优惠劵'; } } this.setData({ plugins_choice_coupon_value: plugins_choice_coupon_value }); - } // 地址 - + } + // 地址 this.setData({ address: data.base.address || null, - address_id: (data.base.address || null) != null ? data.base - .address.id : null + address_id: (data.base.address || null) != null ? data.base.address.id : null }); uni.setStorage({ key: app.globalData.data.cache_buy_user_address_select_key, data: data.base.address || null - }); // 支付方式 - + }); + + // 支付方式 this.payment_list_data(data.payment_list); } } else { @@ -383,7 +371,6 @@ data_list_loding_status: 2, data_list_loding_msg: res.data.msg }); - if (app.globalData.is_login_check(res.data, this, 'init')) { app.globalData.showToast(res.data.msg); } @@ -444,10 +431,10 @@ data['address_id'] = this.address_id; data['payment_id'] = this.payment_id; data['user_note'] = this.user_note_value; - data['site_model'] = this.site_model; // 数据验证 - + data['site_model'] = this.site_model; + + // 数据验证 var validation = []; - if (this.common_site_type == 0 || this.common_site_type == 2 || this.common_site_type == 4) { validation.push({ fields: 'address_id', @@ -482,8 +469,7 @@ if (res.data.code == 0) { if (res.data.data.order_status == 1) { uni.redirectTo({ - url: '/pages/user-order/user-order?is_pay=1&order_ids=' + - res.data.data.order_ids.join(',') + url: '/pages/user-order/user-order?is_pay=1&order_ids=' + res.data.data.order_ids.join(',') }); } else { uni.redirectTo({ @@ -520,15 +506,10 @@ // 支付方式数据处理 payment_list_data(data) { if (this.payment_id != 0) { - for (var i in data) { - if (data[i]['id'] == this.payment_id) { - data[i]['selected'] = 'cr-main br-main'; - } else { - data[i]['selected'] = ''; - } + for (var i in data) { + data[i]['selected'] = (data[i]['id'] == this.payment_id) ? 'cr-main br-main' : ''; } } - this.setData({ payment_list: data || [] }); @@ -623,17 +604,18 @@ // 销售+自提 模式选择事件 buy_header_nav_event(e) { var value = e.currentTarget.dataset.value || 0; - if (value != this.site_model) { // 数据设置 this.setData({ address: null, address_id: null, site_model: value - }); // 删除地址缓存 - - uni.removeStorageSync(app.globalData.data.cache_buy_user_address_select_key); // 数据初始化 - + }); + + // 删除地址缓存 + uni.removeStorageSync(app.globalData.data.cache_buy_user_address_select_key); + + // 数据初始化 this.init(); } }, @@ -642,16 +624,14 @@ map_event(e) { var index = e.currentTarget.dataset.index || 0; var data = this.goods_list[index] || null; - if (data == null) { app.globalData.showToast("地址有误"); return false; - } // 打开地图 - + } + // 打开地图 var name = data.alias || data.name || ''; - var address = (data.province_name || '') + (data.city_name || '') + (data.county_name || '') + (data - .address || ''); + var address = (data.province_name || '') + (data.city_name || '') + (data.county_name || '') + (data.address || ''); app.globalData.open_location(data.lng, data.lat, name, address); }, @@ -667,10 +647,9 @@ warehouse_group_event(e) { app.globalData.url_event(e); } - } }; + \ No newline at end of file diff --git a/pages/extraction-address/extraction-address.css b/pages/extraction-address/extraction-address.css new file mode 100644 index 00000000..b5aa17cf --- /dev/null +++ b/pages/extraction-address/extraction-address.css @@ -0,0 +1,15 @@ +.address-logo { + width: 140rpx; + height: 140rpx !important; +} +.address .item-icon { + width: 30rpx; + height: 35rpx !important; +} +.address-alias { + padding: 2rpx 10rpx; +} +.address .text { + line-height: 44rpx; + width: calc(100% - 40rpx); +} \ No newline at end of file diff --git a/pages/extraction-address/extraction-address.vue b/pages/extraction-address/extraction-address.vue index efb8d796..4ccc5aac 100644 --- a/pages/extraction-address/extraction-address.vue +++ b/pages/extraction-address/extraction-address.vue @@ -1,309 +1,262 @@ -