diff --git a/sourcecode/alipay/pages/extraction-address/extraction-address.js b/sourcecode/alipay/pages/extraction-address/extraction-address.js index babff0b66..72e5c032d 100644 --- a/sourcecode/alipay/pages/extraction-address/extraction-address.js +++ b/sourcecode/alipay/pages/extraction-address/extraction-address.js @@ -116,11 +116,6 @@ Page({ var lng = parseFloat(ads.lng || 0); var lat = parseFloat(ads.lat || 0); - if (lng <= 0 || lat <= 0) { - app.showToast("坐标有误"); - return false; - } - my.openLocation({ latitude: lat, longitude: lng, diff --git a/sourcecode/alipay/pages/plugins/distribution/extraction/extraction.js b/sourcecode/alipay/pages/plugins/distribution/extraction/extraction.js index b5a03bc91..95f082c05 100644 --- a/sourcecode/alipay/pages/plugins/distribution/extraction/extraction.js +++ b/sourcecode/alipay/pages/plugins/distribution/extraction/extraction.js @@ -96,10 +96,6 @@ Page({ var ads = this.data.extraction; var lng = parseFloat(ads.lng || 0); var lat = parseFloat(ads.lat || 0); - if (lng <= 0 || lat <= 0) { - return false; - } - my.openLocation({ latitude: lat, longitude: lng, diff --git a/sourcecode/alipay/pages/user-order-detail/user-order-detail.js b/sourcecode/alipay/pages/user-order-detail/user-order-detail.js index 97d6a2b2c..97728f5d5 100644 --- a/sourcecode/alipay/pages/user-order-detail/user-order-detail.js +++ b/sourcecode/alipay/pages/user-order-detail/user-order-detail.js @@ -144,11 +144,6 @@ Page({ var ads = this.data.detail.address_data; var lng = parseFloat(ads.lng || 0); var lat = parseFloat(ads.lat || 0); - if (lng <= 0 || lat <= 0) { - app.showToast("坐标有误"); - return false; - } - my.openLocation({ latitude: lat, longitude: lng, diff --git a/sourcecode/baidu/pages/extraction-address/extraction-address.js b/sourcecode/baidu/pages/extraction-address/extraction-address.js index c8c319ca8..eaf69847a 100644 --- a/sourcecode/baidu/pages/extraction-address/extraction-address.js +++ b/sourcecode/baidu/pages/extraction-address/extraction-address.js @@ -115,11 +115,6 @@ Page({ var lng = parseFloat(ads.lng || 0); var lat = parseFloat(ads.lat || 0); - if (lng <= 0 || lat <= 0) { - app.showToast("坐标有误"); - return false; - } - swan.openLocation({ latitude: lat, longitude: lng, diff --git a/sourcecode/baidu/pages/plugins/distribution/extraction/extraction.js b/sourcecode/baidu/pages/plugins/distribution/extraction/extraction.js index d58df4b66..92ffc8a2b 100644 --- a/sourcecode/baidu/pages/plugins/distribution/extraction/extraction.js +++ b/sourcecode/baidu/pages/plugins/distribution/extraction/extraction.js @@ -95,10 +95,6 @@ Page({ var ads = this.data.extraction; var lng = parseFloat(ads.lng || 0); var lat = parseFloat(ads.lat || 0); - if (lng <= 0 || lat <= 0) { - return false; - } - swan.openLocation({ latitude: lat, longitude: lng, diff --git a/sourcecode/baidu/pages/user-order-detail/user-order-detail.js b/sourcecode/baidu/pages/user-order-detail/user-order-detail.js index 664c50a3b..1f7fa97e4 100755 --- a/sourcecode/baidu/pages/user-order-detail/user-order-detail.js +++ b/sourcecode/baidu/pages/user-order-detail/user-order-detail.js @@ -107,11 +107,6 @@ Page({ var ads = this.data.detail.address_data; var lng = parseFloat(ads.lng || 0); var lat = parseFloat(ads.lat || 0); - if (lng <= 0 || lat <= 0) { - app.showToast("坐标有误"); - return false; - } - swan.openLocation({ latitude: lat, longitude: lng, diff --git a/sourcecode/qq/pages/extraction-address/extraction-address.js b/sourcecode/qq/pages/extraction-address/extraction-address.js index 7e913e39a..7e5d03d2a 100644 --- a/sourcecode/qq/pages/extraction-address/extraction-address.js +++ b/sourcecode/qq/pages/extraction-address/extraction-address.js @@ -116,11 +116,6 @@ Page({ var lng = parseFloat(ads.lng || 0); var lat = parseFloat(ads.lat || 0); - if (lng <= 0 || lat <= 0) { - app.showToast("坐标有误"); - return false; - } - qq.openLocation({ latitude: lat, longitude: lng, diff --git a/sourcecode/qq/pages/user-order-detail/user-order-detail.js b/sourcecode/qq/pages/user-order-detail/user-order-detail.js index f0349e5d1..f0bc1f432 100755 --- a/sourcecode/qq/pages/user-order-detail/user-order-detail.js +++ b/sourcecode/qq/pages/user-order-detail/user-order-detail.js @@ -109,11 +109,6 @@ Page({ var ads = this.data.detail.address_data; var lng = parseFloat(ads.lng || 0); var lat = parseFloat(ads.lat || 0); - if (lng <= 0 || lat <= 0) { - app.showToast("坐标有误"); - return false; - } - qq.openLocation({ latitude: lat, longitude: lng, diff --git a/sourcecode/toutiao/app.js b/sourcecode/toutiao/app.js index 1217c7049..745dbcecb 100755 --- a/sourcecode/toutiao/app.js +++ b/sourcecode/toutiao/app.js @@ -67,15 +67,16 @@ App({ // 请求地址 request_url: "{{request_url}}", - // request_url: 'http://shopxo.com/', - // request_url: 'https://dev.shopxo.net/', + request_url: 'http://shopxo.com/', + request_url: 'https://dev.shopxo.net/', // 基础信息 application_title: "{{application_title}}", application_describe: "{{application_describe}}", // 价格符号 - price_symbol: "{{price_symbol}}" + price_symbol: "{{price_symbol}}", + price_symbol: "¥", }, /** diff --git a/sourcecode/toutiao/app.json b/sourcecode/toutiao/app.json index e8f5f31bb..06b701258 100755 --- a/sourcecode/toutiao/app.json +++ b/sourcecode/toutiao/app.json @@ -4,6 +4,7 @@ "pages/goods-category/goods-category", "pages/cart/cart", "pages/user/user", + "pages/buy/buy", "pages/web-view/web-view", "pages/login/login", "pages/paytips/paytips", @@ -11,7 +12,6 @@ "pages/goods-detail/goods-detail", "pages/goods-comment/goods-comment", "pages/goods-attribute/goods-attribute", - "pages/buy/buy", "pages/user-address/user-address", "pages/user-address-save/user-address-save", "pages/user-order/user-order", diff --git a/sourcecode/toutiao/pages/buy/buy.js b/sourcecode/toutiao/pages/buy/buy.js index 305885a61..cd199b667 100755 --- a/sourcecode/toutiao/pages/buy/buy.js +++ b/sourcecode/toutiao/pages/buy/buy.js @@ -19,31 +19,37 @@ Page({ common_site_type: 0, extraction_address: [], site_model: 0, - buy_header_nav: [ - { name: "快递邮寄", value: 0 }, - { name: "自提点取货", value: 2 } - ], - + buy_header_nav: [{ + name: "快递邮寄", + value: 0 + }, { + name: "自提点取货", + value: 2 + }], // 优惠劵 plugins_coupon_data: null, - plugins_use_coupon_id: 0, - plugins_choice_coupon_value: '选择优惠劵', + plugins_use_coupon_ids: [], + plugins_choice_coupon_value: [], popup_plugins_coupon_status: false, + popup_plugins_coupon_index: null }, + onLoad(params) { //params['data'] = '{"buy_type":"goods","goods_id":"1","stock":"1","spec":"[]"}'; - if((params.data || null) != null && app.get_length(JSON.parse(params.data)) > 0) - { - this.setData({ params: JSON.parse(params.data)}); + if ((params.data || null) != null && app.get_length(JSON.parse(params.data)) > 0) { + this.setData({ + params: JSON.parse(params.data) + }); // 删除地址缓存 - // 删除地址缓存 tt.removeStorageSync(app.data.cache_buy_user_address_select_key); } }, onShow() { this.init(); - this.setData({ is_first: 0 }); + this.setData({ + is_first: 0 + }); }, // 获取数据列表 @@ -52,49 +58,51 @@ Page({ if (this.data.params == null) { this.setData({ data_list_loding_status: 2, - data_list_loding_msg: '订单信息有误', + data_list_loding_msg: '订单信息有误' }); tt.stopPullDownRefresh(); return false; - } + } // 本地缓存地址 - // 本地缓存地址 - if(this.data.is_first == 0) - { + + if (this.data.is_first == 0) { var cache_address = tt.getStorageSync(app.data.cache_buy_user_address_select_key); - if((cache_address || null) != null) - { + + if ((cache_address || null) != null) { this.setData({ address: cache_address, - address_id: cache_address.id, + address_id: cache_address.id }); } - } + } // 加载loding - // 加载loding - tt.showLoading({title: '加载中...'}); + + tt.showLoading({ + title: '加载中...' + }); this.setData({ data_list_loding_status: 1 }); - var data = this.data.params; data['address_id'] = this.data.address_id; data['payment_id'] = this.data.payment_id; - data['coupon_id'] = this.data.plugins_use_coupon_id; data['site_model'] = this.data.site_model; tt.request({ url: app.get_request_url("index", "buy"), method: "POST", - data: data, + data: this.request_data_coupon_merge(data), dataType: "json", success: res => { tt.stopPullDownRefresh(); tt.hideLoading(); + if (res.data.code == 0) { var data = res.data.data; - if (data.goods_list.length == 0) - { - this.setData({data_list_loding_status: 0}); + + if (data.goods_list.length == 0) { + this.setData({ + data_list_loding_status: 0 + }); } else { this.setData({ goods_list: data.goods_list, @@ -104,39 +112,46 @@ Page({ common_order_is_booking: data.common_order_is_booking || 0, common_site_type: data.common_site_type || 0, extraction_address: data.base.extraction_address || [], - plugins_coupon_data: data.plugins_coupon_data || null, - }); + plugins_coupon_data: data.plugins_coupon_data || null + }); // 优惠劵选择处理 - // 优惠劵选择处理 - if ((data.plugins_coupon_data || null) != null) - { - if ((data.plugins_coupon_data.coupon_choice || null) != null) - { - this.setData({ plugins_choice_coupon_value: data.plugins_coupon_data.coupon_choice.coupon.desc }); - } else { - var coupon_count = ((data.plugins_coupon_data.coupon_list || null) != null) ? data.plugins_coupon_data.coupon_list.length : 0; - this.setData({ plugins_choice_coupon_value: (coupon_count > 0) ? '可选优惠劵' + coupon_count + '张' : '暂无可用优惠劵' }); + 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']; + } 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 + '张' : '暂无可用优惠劵'; + } } - } - // 地址 + 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 }); tt.setStorage({ key: app.data.cache_buy_user_address_select_key, - data: data.base.address || null, - }); + data: data.base.address || null + }); // 支付方式 - // 支付方式 this.payment_list_data(data.payment_list); } } else { this.setData({ data_list_loding_status: 2, - data_list_loding_msg: res.data.msg, + data_list_loding_msg: res.data.msg }); + if (app.is_login_check(res.data, this, 'init')) { app.showToast(res.data.msg); } @@ -147,14 +162,26 @@ Page({ tt.hideLoading(); this.setData({ data_list_loding_status: 2, - data_list_loding_msg: '服务器请求出错', + data_list_loding_msg: '服务器请求出错' }); - app.showToast("服务器请求出错"); } }); }, + // 请求参数合并优惠券参数 + request_data_coupon_merge(data) { + var coupon_ids = this.data.plugins_use_coupon_ids; + + if ((coupon_ids || null) != null && coupon_ids.length > 0) { + for (var i in coupon_ids) { + data['coupon_id_' + i] = coupon_ids[i]; + } + } + + return data; + }, + // 下拉刷新 onPullDownRefresh() { this.init(); @@ -162,7 +189,9 @@ Page({ // 用户留言事件 bind_user_note_event(e) { - this.setData({user_note_value: e.detail.value}); + this.setData({ + user_note_value: e.detail.value + }); }, // 提交订单 @@ -172,47 +201,63 @@ Page({ data['address_id'] = this.data.address_id; data['payment_id'] = this.data.payment_id; data['user_note'] = this.data.user_note_value; - data['coupon_id'] = this.data.plugins_use_coupon_id; - data['site_model'] = this.data.site_model; + data['site_model'] = this.data.site_model; // 数据验证 - // 数据验证 var validation = []; - if (this.data.common_site_type == 0 || this.data.common_site_type == 2 || this.data.common_site_type == 4) - { - validation.push({ fields: 'address_id', msg: '请选择地址', is_can_zero: 1 }); + + if (this.data.common_site_type == 0 || this.data.common_site_type == 2 || this.data.common_site_type == 4) { + validation.push({ + fields: 'address_id', + msg: '请选择地址', + is_can_zero: 1 + }); } + if (this.data.common_order_is_booking != 1) { - validation.push({ fields: 'payment_id', msg: '请选择支付方式' }); + validation.push({ + fields: 'payment_id', + msg: '请选择支付方式' + }); } + if (app.fields_check(data, validation)) { // 加载loding - tt.showLoading({title: '提交中...'}); - this.setData({ buy_submit_disabled_status: true }); - + tt.showLoading({ + title: '提交中...' + }); + this.setData({ + buy_submit_disabled_status: true + }); tt.request({ url: app.get_request_url("add", "buy"), method: "POST", - data: data, + data: this.request_data_coupon_merge(data), dataType: "json", success: res => { tt.hideLoading(); + if (res.data.code == 0) { - if (res.data.data.order.status == 1) { + if (res.data.data.order_status == 1) { tt.redirectTo({ - url: '/pages/user-order/user-order?is_pay=1&order_id=' + res.data.data.order.id + url: '/pages/user-order/user-order?is_pay=1&order_ids=' + res.data.data.order_ids.join(',') }); } else { - tt.redirectTo({url: '/pages/user-order/user-order'}); + tt.redirectTo({ + url: '/pages/user-order/user-order' + }); } } else { app.showToast(res.data.msg); - this.setData({ buy_submit_disabled_status: false }); + this.setData({ + buy_submit_disabled_status: false + }); } }, fail: () => { tt.hideLoading(); - this.setData({buy_submit_disabled_status: false}); - + this.setData({ + buy_submit_disabled_status: false + }); app.showToast("服务器请求出错"); } }); @@ -221,7 +266,9 @@ Page({ // 支付方式选择 payment_event(e) { - this.setData({ payment_id: e.currentTarget.dataset.value}); + this.setData({ + payment_id: e.currentTarget.dataset.value + }); this.payment_list_data(this.data.payment_list); this.init(); }, @@ -237,48 +284,63 @@ Page({ } } } - this.setData({payment_list: data || []}); + + this.setData({ + payment_list: data || [] + }); }, // 优惠劵弹层开启 plugins_coupon_open_event(e) { - this.setData({ popup_plugins_coupon_status: true}); + var index = e.currentTarget.dataset.index; + this.setData({ + popup_plugins_coupon_status: true, + popup_plugins_coupon_index: index + }); }, // 优惠劵弹层关闭 plugins_coupon_close_event(e) { - this.setData({ popup_plugins_coupon_status: false }); + this.setData({ + popup_plugins_coupon_status: false + }); }, // 优惠劵选择 plugins_coupon_use_event(e) { - var index = e.currentTarget.dataset.index; + var wid = e.currentTarget.dataset.wid; var value = e.currentTarget.dataset.value; - this.setData({ - plugins_use_coupon_id: value, - popup_plugins_coupon_status: false, - }); - this.init(); + var temp = this.data.plugins_use_coupon_ids; // 是否已选择优惠券id + + if (temp.indexOf(value) == -1) { + temp[wid] = value; + this.setData({ + plugins_use_coupon_ids: temp, + popup_plugins_coupon_status: false + }); + this.init(); + } }, // 不使用优惠劵 plugins_coupon_not_use_event(e) { + var wid = e.currentTarget.dataset.wid; + var temp = this.data.plugins_use_coupon_ids; + temp[wid] = 0; this.setData({ - plugins_use_coupon_id: 0, - popup_plugins_coupon_status: false, + plugins_use_coupon_ids: temp, + popup_plugins_coupon_status: false }); this.init(); }, // 地址选择事件 address_event(e) { - if (this.data.common_site_type == 0 || (this.data.common_site_type == 4 && this.data.site_model == 0)) - { + if (this.data.common_site_type == 0 || this.data.common_site_type == 4 && this.data.site_model == 0) { tt.navigateTo({ url: '/pages/user-address/user-address?is_back=1' }); - } else if (this.data.common_site_type == 2 || (this.data.common_site_type == 4 && this.data.site_model == 2)) - { + } else if (this.data.common_site_type == 2 || this.data.common_site_type == 4 && this.data.site_model == 2) { tt.navigateTo({ url: '/pages/extraction-address/extraction-address?is_back=1' }); @@ -290,20 +352,47 @@ Page({ // 销售+自提 模式选择事件 buy_header_nav_event(e) { var value = e.currentTarget.dataset.value || 0; - if (value != this.data.site_model) - { + + if (value != this.data.site_model) { // 数据设置 this.setData({ address: null, address_id: null, - site_model: value, - }); + site_model: value + }); // 删除地址缓存 - // 删除地址缓存 - tt.removeStorageSync(app.data.cache_buy_user_address_select_key); + tt.removeStorageSync(app.data.cache_buy_user_address_select_key); // 数据初始化 - // 数据初始化 this.init(); } }, -}); + + // 地图查看 + map_event(e) { + if((e.is_power || 0) == 0) + { + e['is_power'] = 1; + app.location_authorize(this, 'map_event', e); + return false; + } + + var index = e.currentTarget.dataset.index || 0; + var data = this.data.goods_list[index] || null; + + if (data == null) { + app.showToast("地址有误"); + return false; + } + + var lng = parseFloat(data.lng || 0); + var lat = parseFloat(data.lat || 0); + tt.openLocation({ + latitude: lat, + longitude: lng, + scale: 18, + name: data.name || data.alias || '', + address: (data.province_name || '') + (data.city_name || '') + (data.county_name || '') + (data.address || '') + }); + } + +}); \ No newline at end of file diff --git a/sourcecode/toutiao/pages/buy/buy.ttml b/sourcecode/toutiao/pages/buy/buy.ttml index 41efc0d7d..d5792b4be 100755 --- a/sourcecode/toutiao/pages/buy/buy.ttml +++ b/sourcecode/toutiao/pages/buy/buy.ttml @@ -32,9 +32,20 @@ - - - + + + + + + {{group.name}} + {{group.alias}} + + + 查看地图 + + + + {{item.title}} @@ -52,6 +63,25 @@ + + + 优惠劵 + {{((plugins_choice_coupon_value || null) != null && (plugins_choice_coupon_value[group.id] || null) != null) ? plugins_choice_coupon_value[group.id] : '请选择优惠券'}} + + + + + {{item.name}} + + {{item.tips}} + + + + + + {{price_symbol}}{{group.order_base.total_price}} + {{price_symbol}}{{group.order_base.actual_price}} + @@ -60,22 +90,6 @@ {{user_note_value || '留言'}} - - - 优惠劵 - {{plugins_choice_coupon_value}} - - - - - - {{item.name}} - - {{item.tips}} - - - - @@ -105,18 +119,19 @@ + - + - 不使用优惠劵 + 不使用优惠劵 - - + + {{price_symbol}} @@ -127,9 +142,9 @@ {{item.coupon.use_limit_type_name}} {{item.time_start_text}} 至 {{item.time_end_text}} - + - {{plugins_use_coupon_id == item.id ? '已选' : '选择'}} + {{tools.indexOf(plugins_use_coupon_ids, item.id) ? '已选' : '选择'}} diff --git a/sourcecode/toutiao/pages/buy/buy.ttss b/sourcecode/toutiao/pages/buy/buy.ttss index 76e55ea29..99657b11f 100755 --- a/sourcecode/toutiao/pages/buy/buy.ttss +++ b/sourcecode/toutiao/pages/buy/buy.ttss @@ -41,14 +41,40 @@ /** * 商品 */ -.goods .goods-item:not(:last-child) { +.goods-group-list .goods-item:not(:last-child) { border-bottom: 1px dashed #efefef; } -.goods-item { - padding: 20rpx 10rpx; +.goods-group-list { + padding: 0 10rpx 10rpx 10rpx; +} +.goods-group-hd { + padding: 20rpx 0; +} +.goods-group-title { + font-weight: bold; + vertical-align: middle; +} +.goods-group-alias { + border: 1px solid #3bb4f2; + color: #3bb4f2; + padding: 2rpx 10rpx; + border-radius: 6rpx; + margin-left: 10rpx; +} +.goods-group-footer .original-price { + margin-right: 10rpx; +} +.goods-group-map-submit { + font-size: 24rpx; + padding: 5rpx 20rpx; + background: #f0f0f0; + border-radius: 6rpx; } .goods-title, .goods-spec { - margin-bottom: 10rpx; + margin-bottom: 5rpx; +} +.goods-item { + padding: 10rpx 0; } .goods-image { width: 160rpx; @@ -119,6 +145,7 @@ */ .extension-list { background-color: #ffffeb; + border: 1px solid #ffe2cf; } .extension-list .item { padding: 20rpx 10rpx; @@ -136,6 +163,7 @@ .content-textarea-view, .content-textarea-view textarea { height: 180rpx; + padding: 5rpx; } .content-textarea-view view { padding: 12rpx; diff --git a/sourcecode/toutiao/pages/extraction-address/extraction-address.js b/sourcecode/toutiao/pages/extraction-address/extraction-address.js index 7d96de72f..03f642194 100644 --- a/sourcecode/toutiao/pages/extraction-address/extraction-address.js +++ b/sourcecode/toutiao/pages/extraction-address/extraction-address.js @@ -106,11 +106,13 @@ Page({ // 地图查看 address_map_event(e) { - app.location_authorize(this, 'address_map_handle', e); - }, + if((e.is_power || 0) == 0) + { + e['is_power'] = 1; + app.location_authorize(this, 'address_map_event', e); + return false; + } - // 地图查看处理 - address_map_handle(e) { var index = e.currentTarget.dataset.index || 0; var ads = this.data.data_list[index] || null; if (ads == null) @@ -121,11 +123,6 @@ Page({ var lng = parseFloat(ads.lng || 0); var lat = parseFloat(ads.lat || 0); - if (lng <= 0 || lat <= 0) { - app.showToast("坐标有误"); - return false; - } - tt.openLocation({ latitude: lat, longitude: lng, diff --git a/sourcecode/toutiao/pages/goods-category/goods-category.js b/sourcecode/toutiao/pages/goods-category/goods-category.js index e66573fde..f8beb98c2 100755 --- a/sourcecode/toutiao/pages/goods-category/goods-category.js +++ b/sourcecode/toutiao/pages/goods-category/goods-category.js @@ -1,66 +1,71 @@ const app = getApp(); Page({ data: { - tab_active: 0, - tab_active_text_color: '#d2364c', - tab_active_line_color: '#d2364c', data_list_loding_status: 1, - data_bottom_line_status: false, + nav_active_index: 0, data_list: [], - data_content: [], + category_show_level: 3, + data_content: null }, onShow() { - tt.setNavigationBarTitle({title: app.data.common_pages_title.goods_category}); - this.init(); + tt.setNavigationBarTitle({ + title: app.data.common_pages_title.goods_category + }); + this.init(); // 显示分享菜单 + + app.show_share_menu(); }, // 获取数据 init() { // 加载loding this.setData({ - data_list_loding_status: 1, - }); + data_list_loding_status: 1 + }); // 加载loding - // 加载loding tt.request({ url: app.get_request_url("category", "goods"), method: "POST", data: {}, dataType: "json", - header: { 'content-type': 'application/x-www-form-urlencoded' }, + header: { + 'content-type': 'application/x-www-form-urlencoded' + }, success: res => { tt.stopPullDownRefresh(); - if (res.data.code == 0) { - var data = res.data.data; - var data_content = []; - if (data.length > 0) - { - data[0]['active'] = 'nav-active'; - data_content = data[0]['items']; - } - this.setData({ - data_list: data, - data_content: data_content, - data_list_loding_status: data.length == 0 ? 0 : 3, - data_bottom_line_status: true, - }); - } else { - this.setData({ - data_list_loding_status: 0, - data_bottom_line_status: true, - }); - app.showToast(res.data.msg); + if (res.data.code == 0) { + var category = res.data.data.category; + var data_content = []; + var index = this.data.nav_active_index || 0; + + if (category.length > 0) { + category[index]['active'] = 'nav-active'; + data_content = category[index]; } + + this.setData({ + data_list: category, + category_show_level: res.data.data.category_show_level || 3, + data_content: data_content, + data_list_loding_status: category.length == 0 ? 0 : 3, + data_bottom_line_status: true + }); + } else { + this.setData({ + data_list_loding_status: 0, + data_bottom_line_status: true + }); + app.showToast(res.data.msg); + } }, fail: () => { tt.stopPullDownRefresh(); this.setData({ data_list_loding_status: 2, - data_bottom_line_status: true, + data_bottom_line_status: true }); - app.showToast("服务器请求出错"); } }); @@ -75,29 +80,34 @@ Page({ nav_event(e) { var index = e.currentTarget.dataset.index; var temp_data = this.data.data_list; - for(var i in temp_data) - { - temp_data[i]['active'] = (index == i) ? 'nav-active' : ''; + + for (var i in temp_data) { + temp_data[i]['active'] = index == i ? 'nav-active' : ''; } + this.setData({ data_list: temp_data, - data_content: temp_data[index]['items'], + data_content: temp_data[index], + nav_active_index: index }); }, // 事件 category_event(e) { - tt.navigateTo({ url: '/pages/goods-search/goods-search?category_id=' + e.currentTarget.dataset.value}); + tt.navigateTo({ + url: '/pages/goods-search/goods-search?category_id=' + e.currentTarget.dataset.value + }); }, // 自定义分享 onShareAppMessage() { var user = app.get_user_cache_info() || null; - var user_id = (user != null && (user.id || null) != null) ? user.id : 0; + var user_id = user != null && (user.id || null) != null ? user.id : 0; return { title: app.data.application_title, desc: app.data.application_describe, path: '/pages/goods-category/goods-category?referrer=' + user_id }; - }, + } + }); \ No newline at end of file diff --git a/sourcecode/toutiao/pages/goods-category/goods-category.json b/sourcecode/toutiao/pages/goods-category/goods-category.json index b55b5a254..1e3ffd8f1 100755 --- a/sourcecode/toutiao/pages/goods-category/goods-category.json +++ b/sourcecode/toutiao/pages/goods-category/goods-category.json @@ -1,4 +1,5 @@ { + "enablePullDownRefresh": true, "usingComponents": { } } \ No newline at end of file diff --git a/sourcecode/toutiao/pages/goods-category/goods-category.ttml b/sourcecode/toutiao/pages/goods-category/goods-category.ttml index 7fa87ecdd..44ffe2b19 100755 --- a/sourcecode/toutiao/pages/goods-category/goods-category.ttml +++ b/sourcecode/toutiao/pages/goods-category/goods-category.ttml @@ -1,23 +1,77 @@ - - - - {{item.name}} + + + + + + + + + {{v.name}} + + + - - - - - - - {{v.name}} + + + + + + {{item.name}} + + + + + + + + {{data_content.vice_name}} + {{data_content.describe}} + + + + + + + + + + + {{v.name}} + + + + + + + + + + {{v.name}} + + + + + + {{vs.name}} + + + + + + + + + + + + - + - + \ No newline at end of file diff --git a/sourcecode/toutiao/pages/goods-category/goods-category.ttss b/sourcecode/toutiao/pages/goods-category/goods-category.ttss index 5f7b6b686..fcdc037b2 100755 --- a/sourcecode/toutiao/pages/goods-category/goods-category.ttss +++ b/sourcecode/toutiao/pages/goods-category/goods-category.ttss @@ -1,10 +1,10 @@ /** - 左侧导航 -*/ + * 左侧导航 + */ .left-nav { height: 100vh; - background: #ececec; - width: 230rpx; + background: #fff; + width: 210rpx; overflow-x: hidden; overflow-y: auto; } @@ -15,44 +15,77 @@ padding: 0 10rpx; text-align: center; color: #666; - border-left: 3px solid #ececec; - border-right: 3px solid #ececec; + border-left: 3px solid #fff; + border-right: 3px solid #fff; overflow: hidden; } .left-nav .items:not(:last-child) { - border-bottom: 1px solid #e6e6e6; + border-bottom: 1px solid #f1f1f1; } .nav-active { + background: #f5f5f5; border-left: 3px solid #e23f36 !important; - border-right: 3px solid #fff !important; - color: #e23f36; - background: #fff; + border-right: 3px solid #f5f5f5 !important; + color: #e23f36 !important; } - /** - 右侧内容 -*/ -.right-content { + * 右侧内容 + */ +.right-container { height: 100vh; - width: calc( 100% - 230rpx ); + width: calc( 100% - 210rpx ); overflow-x: hidden; overflow-y: auto; position: absolute; top: 0; right: 0; + background: #f5f5f5; } -.content-items { - float: left; - width: calc(33.33% - 20rpx); - padding: 20rpx 10rpx; - text-align: center; +.right-content { + padding: 0 20rpx 20rpx 20rpx; } -.content-items .text { - font-size: 28rpx; - line-height: 46rpx; +.one-content { + padding: 20rpx; } -.content-items .icon { - width: 100%; - height: 120rpx; +.one-content, .two-content { + margin-top: 20rpx; +} +.one-vice-name { + font-size: 30rpx; + font-weight: 500; +} +.one-desc { + color: #999; + margin-top: 10rpx; +} +.two-name { + font-weight: bold; + font-size: 32rpx; + background: #f5f5f5; + padding: 20rpx 10rpx; +} +.content-item { + display: -webkit-inline-box; + width: calc(33.33% - 20rpx); + padding: 10rpx; + text-align: center; +} +.content-item .content { + margin: 0 auto; + padding: 15rpx 0; +} +.content-item .text { + font-size: 28rpx; + line-height: 46rpx; +} +.content-item .icon { + width: 100%; + height: 120rpx; +} +.model-one { + padding: 10rpx; +} +.model-one .content-item:nth-child(3n) { + border-right: 0; } \ No newline at end of file diff --git a/sourcecode/toutiao/pages/plugins/distribution/extraction/extraction.js b/sourcecode/toutiao/pages/plugins/distribution/extraction/extraction.js index 05ef162a7..dca087e34 100644 --- a/sourcecode/toutiao/pages/plugins/distribution/extraction/extraction.js +++ b/sourcecode/toutiao/pages/plugins/distribution/extraction/extraction.js @@ -91,11 +91,13 @@ Page({ // 地图查看 address_map_event(e) { - app.location_authorize(this, 'address_map_handle', e); - }, + if((e.is_power || 0) == 0) + { + e['is_power'] = 1; + app.location_authorize(this, 'address_map_event', e); + return false; + } - // 地图查看 - address_map_handle(e) { if ((this.data.extraction || null) == null) { return false; } @@ -103,11 +105,6 @@ Page({ var ads = this.data.extraction; var lng = parseFloat(ads.lng || 0); var lat = parseFloat(ads.lat || 0); - - if (lng <= 0 || lat <= 0) { - return false; - } - tt.openLocation({ latitude: lat, longitude: lng, diff --git a/sourcecode/toutiao/pages/user-order-detail/user-order-detail.js b/sourcecode/toutiao/pages/user-order-detail/user-order-detail.js index a7177cd2d..e15929825 100755 --- a/sourcecode/toutiao/pages/user-order-detail/user-order-detail.js +++ b/sourcecode/toutiao/pages/user-order-detail/user-order-detail.js @@ -45,12 +45,13 @@ Page({ self.setData({ detail: data.data, detail_list:[ - {name: "订单号", value: data.data.order_no || ''}, + {name: "出货仓库", value: data.data.warehouse_name || ''}, {name: "订单模式", value: data.data.order_model_name || '' }, - {name: "状态", value: data.data.status_name || ''}, + {name: "订单编号", value: data.data.order_no || ''}, + {name: "订单状态", value: data.data.status_name || ''}, {name: "支付状态", value: data.data.pay_status_name || ''}, - {name: "单价", value: data.data.price || ''}, - {name: "总价", value: data.data.total_price || ''}, + {name: "支付单价", value: data.data.price || ''}, + {name: "支付总价", value: data.data.total_price || ''}, {name: "优惠金额", value: data.data.preferential_price || ''}, {name: "增加金额", value: data.data.increase_price || '' }, {name: "支付金额", value: data.data.pay_price || ''}, @@ -99,11 +100,13 @@ Page({ // 地图查看 address_map_event(e) { - app.location_authorize(this, 'address_map_handle', e); - }, + if((e.is_power || 0) == 0) + { + e['is_power'] = 1; + app.location_authorize(this, 'address_map_event', e); + return false; + } - // 地图查看处理 - address_map_handle(e) { if ((this.data.detail.address_data || null) == null) { app.showToast("地址有误"); @@ -113,11 +116,6 @@ Page({ var ads = this.data.detail.address_data; var lng = parseFloat(ads.lng || 0); var lat = parseFloat(ads.lat || 0); - if (lng <= 0 || lat <= 0) { - app.showToast("坐标有误"); - return false; - } - tt.openLocation({ latitude: lat, longitude: lng, diff --git a/sourcecode/toutiao/pages/user-order-detail/user-order-detail.ttml b/sourcecode/toutiao/pages/user-order-detail/user-order-detail.ttml index ae3c0b0bb..8f77bc1db 100755 --- a/sourcecode/toutiao/pages/user-order-detail/user-order-detail.ttml +++ b/sourcecode/toutiao/pages/user-order-detail/user-order-detail.ttml @@ -10,7 +10,7 @@ {{detail.address_data.province_name}}{{detail.address_data.city_name}}{{detail.address_data.county_name}}{{detail.address_data.address}} - 查看位置 + 查看位置 @@ -48,10 +48,8 @@ - - - - 未配置数据 + + 未配置数据 diff --git a/sourcecode/toutiao/pages/user-order/user-order.js b/sourcecode/toutiao/pages/user-order/user-order.js index a991ddf7b..fc975a75d 100755 --- a/sourcecode/toutiao/pages/user-order/user-order.js +++ b/sourcecode/toutiao/pages/user-order/user-order.js @@ -13,22 +13,34 @@ Page({ is_show_payment_popup: false, payment_list: [], payment_id: 0, - temp_pay_value: 0, - temp_pay_index: 0, - nav_status_list: [ - { name: "全部", value: "-1" }, - { name: "待付款", value: "1" }, - { name: "待发货", value: "2" }, - { name: "待收货", value: "3" }, - { name: "已完成", value: "4" }, - { name: "已失效", value: "5,6" }, - ], + temp_pay_value: '', + nav_status_list: [{ + name: "全部", + value: "-1" + }, { + name: "待付款", + value: "1" + }, { + name: "待发货", + value: "2" + }, { + name: "待收货", + value: "3" + }, { + name: "已完成", + value: "4" + }, { + name: "已失效", + value: "5,6" + }], nav_status_index: 0, + order_select_ids: [] }, onLoad(params) { // 是否指定状态 var nav_status_index = 0; + if ((params.status || null) != null) { for (var i in this.data.nav_status_list) { if (this.data.nav_status_list[i]['value'] == params.status) { @@ -40,17 +52,20 @@ Page({ this.setData({ params: params, - nav_status_index: nav_status_index, + nav_status_index: nav_status_index }); this.init(); }, onShow() { - tt.setNavigationBarTitle({title: app.data.common_pages_title.user_order}); + tt.setNavigationBarTitle({ + title: app.data.common_pages_title.user_order + }); }, init() { var user = app.get_user_info(this, 'init'); + if (user != false) { // 用户未绑定用户则转到登录页面 if (app.user_is_need_login(user)) { @@ -65,14 +80,16 @@ Page({ } else { this.setData({ data_list_loding_status: 0, - data_bottom_line_status: false, + data_bottom_line_status: false }); } }, // 输入框事件 input_event(e) { - this.setData({input_keyword_value: e.detail.value}); + this.setData({ + input_keyword_value: e.detail.value + }); }, // 获取数据 @@ -82,18 +99,18 @@ Page({ if (this.data.data_bottom_line_status == true) { return false; } - } + } // 加载loding - // 加载loding - tt.showLoading({title: "加载中..." }); + + tt.showLoading({ + title: "加载中..." + }); this.setData({ data_list_loding_status: 1 - }); + }); // 参数 - // 参数 - var order_status = ((this.data.nav_status_list[this.data.nav_status_index] || null) == null) ? -1 : this.data.nav_status_list[this.data.nav_status_index]['value']; + var order_status = (this.data.nav_status_list[this.data.nav_status_index] || null) == null ? -1 : this.data.nav_status_list[this.data.nav_status_index]['value']; // 获取数据 - // 获取数据 tt.request({ url: app.get_request_url("index", "order"), method: "POST", @@ -101,39 +118,32 @@ Page({ page: this.data.data_page, keywords: this.data.input_keyword_value || "", status: order_status, - is_more: 1, + is_more: 1 }, dataType: "json", success: res => { tt.hideLoading(); tt.stopPullDownRefresh(); + if (res.data.code == 0) { if (res.data.data.data.length > 0) { if (this.data.data_page <= 1) { - var temp_data_list = res.data.data.data; + var temp_data_list = res.data.data.data; // 下订单支付处理 - // 下订单支付处理 - if(this.data.load_status == 0) - { - if((this.data.params.is_pay || 0) == 1 && (this.data.params.order_id || 0) != 0) - { - for(var i in temp_data_list) - { - if(this.data.params.order_id == temp_data_list[i]['id']) - { - this.pay_handle(this.data.params.order_id, i); - break; - } - } + if (this.data.load_status == 0) { + if ((this.data.params.is_pay || 0) == 1 && (this.data.params.order_ids || null) != null) { + this.pay_handle(this.data.params.order_ids); } } } else { var temp_data_list = this.data.data_list; var temp_data = res.data.data.data; + for (var i in temp_data) { temp_data_list.push(temp_data[i]); } } + this.setData({ data_list: temp_data_list, data_total: res.data.data.total, @@ -141,29 +151,32 @@ Page({ data_list_loding_status: 3, data_page: this.data.data_page + 1, load_status: 1, - payment_list: res.data.data.payment_list || [], - }); + payment_list: res.data.data.payment_list || [] + }); // 是否还有数据 - // 是否还有数据 - if (this.data.data_page > 1 && this.data.data_page > this.data.data_page_total) - { - this.setData({ data_bottom_line_status: true }); + if (this.data.data_page > 1 && this.data.data_page > this.data.data_page_total) { + this.setData({ + data_bottom_line_status: true + }); } else { - this.setData({data_bottom_line_status: false}); + this.setData({ + data_bottom_line_status: false + }); } } else { this.setData({ data_list_loding_status: 0, load_status: 1, data_list: [], - data_bottom_line_status: false, + data_bottom_line_status: false }); } } else { this.setData({ data_list_loding_status: 0, - load_status: 1, + load_status: 1 }); + if (app.is_login_check(res.data, this, 'get_data_list')) { app.showToast(res.data.msg); } @@ -172,10 +185,9 @@ Page({ fail: () => { tt.hideLoading(); tt.stopPullDownRefresh(); - this.setData({ data_list_loding_status: 2, - load_status: 1, + load_status: 1 }); app.showToast("服务器请求出错"); } @@ -200,90 +212,98 @@ Page({ this.setData({ is_show_payment_popup: true, temp_pay_value: e.currentTarget.dataset.value, - temp_pay_index: e.currentTarget.dataset.index, + order_select_ids: [] }); }, // 支付弹窗关闭 payment_popup_event_close(e) { - this.setData({ is_show_payment_popup: false }); + this.setData({ + is_show_payment_popup: false + }); }, // 支付弹窗发起支付 popup_payment_event(e) { var payment_id = e.currentTarget.dataset.value || 0; - this.setData({payment_id: payment_id}); + this.setData({ + payment_id: payment_id + }); this.payment_popup_event_close(); - this.pay_handle(this.data.temp_pay_value, this.data.temp_pay_index); + this.pay_handle(this.data.temp_pay_value); }, // 支付方法 - pay_handle(order_id, index) { - var self = this; - // 加载loding - tt.showLoading({title: "请求中..." }); + pay_handle(order_ids) { + var self = this; // 加载loding + tt.showLoading({ + title: "请求中..." + }); tt.request({ - url: app.get_request_url("pay", "toutiao"), + url: app.get_request_url("pay", "order"), method: "POST", data: { - id: order_id, - payment_id: this.data.payment_id, + ids: order_ids, + payment_id: this.data.payment_id }, dataType: "json", success: res => { tt.hideLoading(); + if (res.data.code == 0) { // 支付方式类型 switch (res.data.data.is_payment_type) { // 正常线上支付 - case 0 : - tt.pay({ - orderInfo: res.data.data.order_info, - service: res.data.data.service, - success(res) { - // if (res.code == 0) { - // // 数据设置 - // self.order_item_pay_success_handle(index); + case 0: + tt.requestPayment({ + timeStamp: res.data.data.data.timeStamp, + nonceStr: res.data.data.data.nonceStr, + package: res.data.data.data.package, + signType: res.data.data.data.signType, + paySign: res.data.data.data.paySign, + success: function (res) { + // 数据设置 + self.order_item_pay_success_handle(order_ids); // 跳转支付页面 - // // 跳转支付页面 - // wx.navigateTo({ - // url: "/pages/paytips/paytips?code=9000&total_price=" + - // self.data.data_list[index]['total_price'] - // }); - // } else { - // app.showToast('支付失败'); - // } - - // 由于头条支付无法监听支付状态,这里就不做接口轮询了,直接刷新页面 - self.setData({ - data_page: 1 + tt.navigateTo({ + url: "/pages/paytips/paytips?code=9000" }); - self.get_data_list(1); }, - fail(res) { - console.log(res, 'pay-fail'); - app.showToast('调起收银台失败-'+res.data.code); + fail: function (res) { + app.showToast('支付失败'); } }); break; - // 线下支付 - case 1 : - var temp_data_list = self.data.data_list; - temp_data_list[index]['is_under_line'] = 1; - self.setData({ data_list: temp_data_list }); - app.alert({ msg: res.data.msg, is_show_cancel: 0}); - break; + case 1: + var order_ids_arr = order_ids.split(','); + var temp_data_list = self.data.data_list; + + for (var i in temp_data_list) { + if (order_ids_arr.indexOf(temp_data_list[i]['id']) != -1) { + temp_data_list[i]['is_under_line'] = 1; + } + } + + self.setData({ + data_list: temp_data_list + }); + app.alert({ + msg: res.data.msg, + is_show_cancel: 0 + }); + break; // 钱包支付 - case 2 : - self.order_item_pay_success_handle(index); + + case 2: + self.order_item_pay_success_handle(order_ids); app.showToast('支付成功', 'success'); break; - // 默认 - default : + + default: app.showToast('支付类型有误'); } } else { @@ -292,35 +312,43 @@ Page({ }, fail: () => { tt.hideLoading(); - app.showToast("服务器请求出错"); + app.showToast('服务器请求出错'); } }); }, // 支付成功数据设置 - order_item_pay_success_handle(index) { - // 数据设置 - var temp_data_list = this.data.data_list; - switch (parseInt(temp_data_list[index]['order_model'])) { - // 销售模式 - case 0: - temp_data_list[index]['status'] = 2; - temp_data_list[index]['status_name'] = '待发货'; - break; + order_item_pay_success_handle(order_ids) { + var order_ids_arr = order_ids.split(','); + var temp_data_list = this.data.data_list; // 数据设置 - // 自提模式 - case 2: - temp_data_list[index]['status'] = 2; - temp_data_list[index]['status_name'] = '待取货'; - break; + for (var i in temp_data_list) { + if (order_ids_arr.indexOf(temp_data_list[i]['id']) != -1) { + switch (parseInt(temp_data_list[i]['order_model'])) { + // 销售模式 + case 0: + temp_data_list[i]['status'] = 2; + temp_data_list[i]['status_name'] = '待发货'; + break; + // 自提模式 - // 虚拟模式 - case 3: - temp_data_list[index]['status'] = 3; - temp_data_list[index]['status_name'] = '待收货'; - break; + case 2: + temp_data_list[i]['status'] = 2; + temp_data_list[i]['status_name'] = '待取货'; + break; + // 虚拟模式 + + case 3: + temp_data_list[i]['status'] = 3; + temp_data_list[i]['status_name'] = '待收货'; + break; + } + } } - this.setData({ data_list: temp_data_list }); + + this.setData({ + data_list: temp_data_list + }); }, // 取消 @@ -334,24 +362,28 @@ Page({ if (result.confirm) { // 参数 var id = e.currentTarget.dataset.value; - var index = e.currentTarget.dataset.index; - - // 加载loding - tt.showLoading({title: "处理中..." }); + var index = e.currentTarget.dataset.index; // 加载loding + tt.showLoading({ + title: "处理中..." + }); tt.request({ url: app.get_request_url("cancel", "order"), method: "POST", - data: {id: id}, + data: { + id: id + }, dataType: "json", success: res => { tt.hideLoading(); + if (res.data.code == 0) { var temp_data_list = this.data.data_list; temp_data_list[index]['status'] = 5; temp_data_list[index]['status_name'] = '已取消'; - this.setData({data_list: temp_data_list}); - + this.setData({ + data_list: temp_data_list + }); app.showToast(res.data.msg, "success"); } else { app.showToast(res.data.msg); @@ -378,24 +410,28 @@ Page({ if (result.confirm) { // 参数 var id = e.currentTarget.dataset.value; - var index = e.currentTarget.dataset.index; - - // 加载loding - tt.showLoading({title: "处理中..." }); + var index = e.currentTarget.dataset.index; // 加载loding + tt.showLoading({ + title: "处理中..." + }); tt.request({ url: app.get_request_url("collect", "order"), method: "POST", - data: {id: id}, + data: { + id: id + }, dataType: "json", success: res => { tt.hideLoading(); + if (res.data.code == 0) { var temp_data_list = this.data.data_list; temp_data_list[index]['status'] = 4; temp_data_list[index]['status_name'] = '已完成'; - this.setData({data_list: temp_data_list}); - + this.setData({ + data_list: temp_data_list + }); app.showToast(res.data.msg, "success"); } else { app.showToast(res.data.msg); @@ -421,7 +457,9 @@ Page({ this.setData({ nav_status_index: e.currentTarget.dataset.index || 0, data_page: 1, - }); + order_select_ids: [] + }); // 重新拉取数据 + this.get_data_list(1); }, @@ -429,15 +467,15 @@ Page({ orderaftersale_event(e) { var oid = e.currentTarget.dataset.oid || 0; var did = e.currentTarget.dataset.did || 0; - if(oid == 0 || did == 0) - { + + if (oid == 0 || did == 0) { app.showToast("参数有误"); return false; - } - - // 进入售后页面 + } // 进入售后页面 + + tt.navigateTo({ - url: "/pages/user-orderaftersale-detail/user-orderaftersale-detail?oid=" + oid+"&did="+did + url: "/pages/user-orderaftersale-detail/user-orderaftersale-detail?oid=" + oid + "&did=" + did }); }, @@ -447,4 +485,33 @@ Page({ url: "/pages/user-order-comments/user-order-comments?id=" + e.currentTarget.dataset.value }); }, -}); + + // 选中处理 + selected_event(e) { + var oid = e.currentTarget.dataset.oid || 0; + var temp_select_ids = this.data.order_select_ids; + + if (temp_select_ids.indexOf(oid) == -1) { + temp_select_ids.push(oid); + } else { + for (var i in temp_select_ids) { + if (temp_select_ids[i] == oid) { + temp_select_ids.splice(i, 1); + } + } + } + + this.setData({ + order_select_ids: temp_select_ids + }); + }, + + // 合并支付 + pay_merge_event(e) { + this.setData({ + is_show_payment_popup: true, + temp_pay_value: this.data.order_select_ids.join(',') + }); + } + +}); \ No newline at end of file diff --git a/sourcecode/toutiao/pages/user-order/user-order.ttml b/sourcecode/toutiao/pages/user-order/user-order.ttml index b74eda9aa..e125bfcf5 100755 --- a/sourcecode/toutiao/pages/user-order/user-order.ttml +++ b/sourcecode/toutiao/pages/user-order/user-order.ttml @@ -1,3 +1,4 @@ + @@ -11,22 +12,25 @@ - {{item.add_time}} - - {{item.status_name}}({{item.is_under_line_text}}) - + + + + + + {{item.warehouse_name}} + {{item.status_name}}({{item.is_under_line_text}}) - {{detail.title}} + {{detail.title}} {{spec.type}}:{{spec.value}} - {{detail.orderaftersale_btn_text}} + {{detail.orderaftersale_btn_text}} {{price_symbol}}{{detail.price}} @@ -56,6 +60,11 @@ + + + + + diff --git a/sourcecode/toutiao/pages/user-order/user-order.ttss b/sourcecode/toutiao/pages/user-order/user-order.ttss index 4ec527203..addcc5dde 100755 --- a/sourcecode/toutiao/pages/user-order/user-order.ttss +++ b/sourcecode/toutiao/pages/user-order/user-order.ttss @@ -85,4 +85,25 @@ height: 50rpx !important; vertical-align: middle; margin-right: 10rpx; +} + +/** + * 选择 + */ + .selected .icon { + width: 35rpx; + height: 35rpx !important; + margin: 0 20rpx 0 10rpx; + vertical-align: middle; +} + +/** + * 合并支付按钮 + */ +.pay-merge-submit { + width: 220rpx; + height: 70rpx !important; + line-height: 70rpx !important; + left: calc(50% - 110rpx); + bottom: 50rpx; } \ No newline at end of file diff --git a/sourcecode/toutiao/utils/tools.sjs b/sourcecode/toutiao/utils/tools.sjs new file mode 100644 index 000000000..3ba62093a --- /dev/null +++ b/sourcecode/toutiao/utils/tools.sjs @@ -0,0 +1,8 @@ +function indexOf(arr, value) { + if (arr.indexOf(value) < 0) { + return false; + } else { + return true; + } +} +module.exports.indexOf = indexOf; \ No newline at end of file diff --git a/sourcecode/weixin/pages/extraction-address/extraction-address.js b/sourcecode/weixin/pages/extraction-address/extraction-address.js index 49495dfd9..fa562ea97 100644 --- a/sourcecode/weixin/pages/extraction-address/extraction-address.js +++ b/sourcecode/weixin/pages/extraction-address/extraction-address.js @@ -116,11 +116,6 @@ Page({ var lng = parseFloat(ads.lng || 0); var lat = parseFloat(ads.lat || 0); - if (lng <= 0 || lat <= 0) { - app.showToast("坐标有误"); - return false; - } - wx.openLocation({ latitude: lat, longitude: lng, diff --git a/sourcecode/weixin/pages/plugins/distribution/extraction/extraction.js b/sourcecode/weixin/pages/plugins/distribution/extraction/extraction.js index ba453d1c4..cfea4f246 100644 --- a/sourcecode/weixin/pages/plugins/distribution/extraction/extraction.js +++ b/sourcecode/weixin/pages/plugins/distribution/extraction/extraction.js @@ -95,10 +95,6 @@ Page({ var ads = this.data.extraction; var lng = parseFloat(ads.lng || 0); var lat = parseFloat(ads.lat || 0); - if (lng <= 0 || lat <= 0) { - return false; - } - wx.openLocation({ latitude: lat, longitude: lng, diff --git a/sourcecode/weixin/pages/user-order-detail/user-order-detail.js b/sourcecode/weixin/pages/user-order-detail/user-order-detail.js index 3e7b663b5..879f6fa52 100755 --- a/sourcecode/weixin/pages/user-order-detail/user-order-detail.js +++ b/sourcecode/weixin/pages/user-order-detail/user-order-detail.js @@ -109,11 +109,6 @@ Page({ var ads = this.data.detail.address_data; var lng = parseFloat(ads.lng || 0); var lat = parseFloat(ads.lat || 0); - if (lng <= 0 || lat <= 0) { - app.showToast("坐标有误"); - return false; - } - wx.openLocation({ latitude: lat, longitude: lng,