小程序优化

This commit is contained in:
devil_gong 2019-11-05 15:50:22 +08:00
parent c83c693fc3
commit 41e830079b
60 changed files with 845 additions and 457 deletions

View File

@ -87,6 +87,15 @@
</select>
</div>
<div class="am-form-group">
<label>{{$data.common_app_is_head_vice_nav.name}}<span class="am-form-group-label-tips">{{$data.common_app_is_head_vice_nav.describe}}</span></label>
<select name="{{$data.common_app_is_head_vice_nav.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.common_app_is_head_vice_nav.error_tips}}" required>
{{foreach $common_is_text_list as $v}}
<option value="{{$v.id}}" {{if isset($data['common_app_is_head_vice_nav']['value']) and $data['common_app_is_head_vice_nav']['value'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
{{/foreach}}
</select>
</div>
<div class="am-form-group am-form-group-refreshing">
<input type="hidden" name="nav_type" value="{{$nav_type}}" />
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block" data-am-loading="{loadingText:'处理中...'}">保存</button>

View File

@ -0,0 +1,37 @@
{{include file="public/header" /}}
<!-- right content start -->
<div class="content-right">
<div class="content">
<!-- table nav start -->
{{include file="site/nav" /}}
<!-- table nav end -->
<!-- form start -->
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/site/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/site/index', ['nav_type'=>'exhibition'])}}" enctype="multipart/form-data">
<div class="am-form-group">
<label>{{$data.common_is_exhibition_mode.name}}<span class="am-form-group-label-tips">{{$data.common_is_exhibition_mode.describe}}</span></label>
<select name="{{$data.common_is_exhibition_mode.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.common_is_exhibition_mode.error_tips}}" required>
{{foreach $common_is_text_list as $v}}
<option value="{{$v.id}}" {{if isset($data['common_is_exhibition_mode']['value']) and $data['common_is_exhibition_mode']['value'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
{{/foreach}}
</select>
</div>
<div class="am-form-group">
<label>{{$data.common_is_exhibition_mode_btn_text.name}}<span class="am-form-group-label-tips">{{$data.common_is_exhibition_mode_btn_text.describe}}</span></label>
<input type="text" name="{{$data.common_is_exhibition_mode_btn_text.only_tag}}" placeholder="{{$data.common_is_exhibition_mode_btn_text.describe}}" data-validation-message="{{$data.common_is_exhibition_mode_btn_text.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_is_exhibition_mode_btn_text.value}}"{{/if}} />
</div>
<div class="am-form-group am-form-group-refreshing">
<input type="hidden" name="nav_type" value="{{$nav_type}}" />
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block" data-am-loading="{loadingText:'处理中...'}">保存</button>
</div>
</form>
<!-- form end -->
</div>
</div>
<!-- right content end -->
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end

View File

@ -5,6 +5,9 @@
<li {{if $nav_type eq 'beian'}}class="am-active"{{/if}} data-type="beian">
<a href="{{:MyUrl('admin/site/index', ['nav_type'=>'beian'])}}">备案信息</a>
</li>
<li {{if $nav_type eq 'exhibition'}}class="am-active"{{/if}} data-type="exhibition">
<a href="{{:MyUrl('admin/site/index', ['nav_type'=>'exhibition'])}}">站点类型</a>
</li>
<li {{if $nav_type eq 'register'}}class="am-active"{{/if}} data-type="register">
<a href="{{:MyUrl('admin/site/index', ['nav_type'=>'register'])}}">用户注册</a>
</li>

View File

@ -47,15 +47,12 @@ class Cart extends Common
public function Index()
{
$ret = BuyService::CartList(['user'=>$this->user]);
if(APPLICATION_CLIENT_TYPE != 'weixin')
{
$ret['data'] = [
'data' => $ret['data'],
'customer_service_tel' => MyC('common_app_customer_service_tel', null, true),
'common_is_exhibition_mode_btn_text'=> MyC('common_is_exhibition_mode_btn_text', null, true),
'common_is_exhibition_mode' => (int) MyC('common_is_exhibition_mode', 1),
];
}
$ret['data'] = [
'data' => $ret['data'],
'customer_service_tel' => MyC('common_app_customer_service_tel', null, true),
'common_is_exhibition_mode_btn_text'=> MyC('common_is_exhibition_mode_btn_text', null, true),
'common_is_exhibition_mode' => (int) MyC('common_is_exhibition_mode', 0),
];
return $ret;
}

View File

@ -130,7 +130,7 @@ class Goods extends Common
'common_cart_total' => BuyService::UserCartTotal(['user'=>$this->user]),
'customer_service_tel' => MyC('common_app_customer_service_tel', null, true),
'common_is_exhibition_mode_btn_text'=> MyC('common_is_exhibition_mode_btn_text', null, true),
'common_is_exhibition_mode' => (int) MyC('common_is_exhibition_mode', 1),
'common_is_exhibition_mode' => (int) MyC('common_is_exhibition_mode', 0),
// 优惠劵
'plugins_coupon_data' => $this->PluginsCouponGoods($goods_id),

View File

@ -446,6 +446,7 @@ class User extends Common
'common_message_total' => $common_message_total,
'navigation' => AppCenterNavService::AppCenterNav(),
'common_app_is_online_service' => (int) MyC('common_app_is_online_service', 0),
'common_app_is_head_vice_nav' => (int) MyC('common_app_is_head_vice_nav', 0),
);
// 返回数据

File diff suppressed because one or more lines are too long

View File

@ -638,4 +638,11 @@ App({
}
},
// 拨打电话
call_tel(value) {
if ((value || null) != null) {
my.makePhoneCall({ number: value });
}
},
});

View File

@ -1,7 +1,7 @@
/**
* 商品列表
*/
.page {
.page {
padding-bottom: 120rpx;
}
.goods-item {
@ -118,9 +118,6 @@
.nav-submit button {
border-radius: 0;
}
.page {
padding-bottom: 120rpx;
}
.selected .icon {
width: 50rpx;
height: 50rpx !important;
@ -132,4 +129,14 @@
}
.buy-nav .sales-price {
max-width: calc(100% - 40px);
}
/*
* 展示型
*/
.exhibition-mode {
padding: 0 10rpx;
}
.exhibition-mode-data .items {
padding-left: 0;
}

View File

@ -1,8 +1,8 @@
<view a:if="{{data_list.length > 0}}" class="page">
<view a:for="{{data_list}}" class="goods-item oh bg-white">
<view a:if="{{data_list.length > 0}}" class="{{common_is_exhibition_mode == 1 ? '' : 'page'}}">
<view a:for="{{data_list}}" class="goods-item oh bg-white {{common_is_exhibition_mode == 1 ? 'exhibition-mode-data' : ''}}">
<swipe-action index="{{index}}" restore="{{swipe_index === null || swipe_index !== index}}" right="{{item.right}}" onRightItemClick="right_item_event" onSwipeStart="swipe_start_event" extra="{{index}}">
<!-- 选择 -->
<view onTap="selectedt_event" data-type="node" data-index="{{index}}" class="fl selected">
<view a:if="{{common_is_exhibition_mode != 1}}" onTap="selectedt_event" data-type="node" data-index="{{index}}" class="fl selected">
<image class="icon" src="/images/default-select{{(item.is_error || 0) == 1 ? '-disabled' : ((item.selected || false) ? '-active' : '')}}-icon.png" mode="widthFix" />
</view>
@ -42,20 +42,29 @@
<!-- 操作导航 -->
<view a:if="{{data_list.length > 0}}" class="buy-nav oh wh-auto br-t">
<view class="nav-base bg-white fl single-text">
<view onTap="selectedt_event" data-type="all" class="fl selected">
<image a:if="{{is_selected_all}}" class="icon" src="/images/default-select-active-icon.png" mode="widthFix" />
<image a:else class="icon" src="/images/default-select-icon.png" mode="widthFix" />
<text>全选</text>
<!-- 展示型 -->
<block a:if="{{common_is_exhibition_mode == 1}}">
<view class="exhibition-mode">
<button class="bg-main wh-auto" type="default" onTap="exhibition_submit_event" hover-class="none">{{common_is_exhibition_mode_btn_text}}</button>
</view>
<view class="fr price">
<view class="sales-price single-text fr">¥{{total_price}}</view>
<view class="fr">合计:</view>
</block>
<!-- 销售型 -->
<block a:else>
<view class="nav-base bg-white fl single-text">
<view onTap="selectedt_event" data-type="all" class="fl selected">
<image class="icon" src="/images/default-select{{is_selected_all ? '-active' : ''}}-icon.png" mode="widthFix" />
<text>全选</text>
</view>
<view class="fr price">
<view class="sales-price single-text fr">¥{{total_price}}</view>
<view class="fr">合计:</view>
</view>
</view>
</view>
<view class="fr nav-submit">
<button class="bg-main wh-auto" type="default" onTap="buy_submit_event" disabled="{{buy_submit_disabled_status}}" hover-class="none">结算</button>
</view>
<view class="fr nav-submit">
<button class="bg-main wh-auto" type="default" onTap="buy_submit_event" disabled="{{buy_submit_disabled_status}}" hover-class="none">结算</button>
</view>
</block>
</view>
</view>

View File

@ -9,6 +9,11 @@ Page({
total_price: '0.00',
is_selected_all: false,
buy_submit_disabled_status: true,
// 是否展示型
common_is_exhibition_mode: 0,
common_is_exhibition_mode_btn_text: null,
customer_service_tel: null,
},
onShow() {
@ -73,16 +78,25 @@ Page({
my.stopPullDownRefresh();
if (res.data.code == 0) {
var data = res.data.data;
if (data.length > 0) {
for (var i in data) {
data[i]['right'] = [{ type: 'edit', text: '加入收藏' }, { type: 'delete', text: '删除' }];
// 购物车操作数据处理
if (data.data.length > 0) {
for (var i in data.data) {
data.data[i]['right'] = [{ type: 'edit', text: '加入收藏' }, { type: 'delete', text: '删除' }];
}
}
// 数据赋值
this.setData({
data_list: data,
data_list_loding_status: data.length == 0 ? 0 : 3,
data_list: data.data,
data_list_loding_status: data.data.length == 0 ? 0 : 3,
data_bottom_line_status: true,
data_list_loding_msg: '购物车空空如也',
// 是否展示型
common_is_exhibition_mode: data.common_is_exhibition_mode || 0,
common_is_exhibition_mode_btn_text: data.common_is_exhibition_mode_btn_text || '立即咨询',
customer_service_tel: data.customer_service_tel || null,
});
} else {
this.setData({
@ -308,9 +322,13 @@ Page({
// 选中计算
selected_calculate() {
var total_price = 0;
var data_count = 0;
var selected_count = 0;
var temp_data_list = this.data.data_list;
for (var i in temp_data_list) {
if ((temp_data_list[i]['is_error'] || 0) == 0) {
data_count++;
}
if ((temp_data_list[i]['selected'] || false) == true) {
total_price += temp_data_list[i]['stock'] * temp_data_list[i]['price'];
selected_count++;
@ -320,7 +338,7 @@ Page({
this.setData({
total_price: total_price.toFixed(2),
buy_submit_disabled_status: (selected_count <= 0),
is_selected_all: (selected_count >= temp_data_list.length),
is_selected_all: (selected_count >= data_count),
});
},
@ -349,6 +367,11 @@ Page({
my.navigateTo({
url: '/pages/buy/buy?data=' + JSON.stringify(data)
});
}
},
// 展示型事件
exhibition_submit_event(e) {
app.call_tel(this.data.customer_service_tel);
},
});

View File

@ -313,4 +313,11 @@
position: absolute;
top: -5px;
left: calc(50% + 10rpx);
}
/*
* 展示型
*/
.goods-buy-nav .exhibition-mode button {
width: 100%;
}

View File

@ -120,9 +120,17 @@
<image src="{{goods_favor_icon}}" mode="scaleToFill" />
<text class="dis-block cr-888">{{goods_favor_text}}</text>
</view>
<view class="fr">
<button class="bg-warning fl" type="default" onTap="cart_submit_event" hover-class="none" disabled="{{nav_submit_is_disabled}}">加入购物车</button>
<button class="bg-main fl" type="default" onTap="buy_submit_event" hover-class="none" disabled="{{nav_submit_is_disabled}}">{{nav_submit_text}}</button>
<view class="fr {{common_is_exhibition_mode == 1 ? 'exhibition-mode' : ''}}">
<!-- 展示型 -->
<block a:if="{{common_is_exhibition_mode == 1}}">
<button class="bg-main fl" type="default" onTap="exhibition_submit_event" hover-class="none">{{nav_submit_text}}</button>
</block>
<!-- 销售型 -->
<block a:else>
<button class="bg-warning fl" type="default" onTap="cart_submit_event" hover-class="none" disabled="{{nav_submit_is_disabled}}">加入购物车</button>
<button class="bg-main fl" type="default" onTap="buy_submit_event" hover-class="none" disabled="{{nav_submit_is_disabled}}">{{nav_submit_text}}</button>
</block>
</view>
</view>

View File

@ -46,6 +46,10 @@ Page({
// 购物车快捷导航
quick_nav_cart_count: 0,
// 是否展示型
common_is_exhibition_mode: 0,
customer_service_tel: null,
},
onLoad(params) {
@ -104,10 +108,8 @@ Page({
temp_buy_number: data.goods.buy_min_number || 1,
goods_favor_text: (data.goods.is_favor == 1) ? '已收藏' : '收藏',
goods_favor_icon: '/images/goods-detail-favor-icon-' + data.goods.is_favor+'.png',
nav_submit_text: ((data.common_order_is_booking || 0) == 0) ? '立即购买' : '立即预约',
data_bottom_line_status: true,
data_list_loding_status: 3,
nav_submit_is_disabled: (data.goods.is_shelves == 1 && data.goods.inventory > 0) ? false : true,
goods_spec_base_price: data.goods.price,
goods_spec_base_original_price: data.goods.original_price,
@ -146,19 +148,32 @@ Page({
// 不能选择规格处理
this.goods_specifications_choose_handle_dont(0);
// 购买按钮处理
var nav_submit_text = ((data.common_order_is_booking || 0) == 0) ? '立即购买' : '立即预约';
var nav_submit_is_disabled = (data.goods.is_shelves == 1 && data.goods.inventory > 0) ? false : true;
if (data.goods.is_shelves != 1) {
this.setData({
nav_submit_text: '商品已下架',
nav_submit_is_disabled: true,
});
nav_submit_text = '已下架';
nav_submit_is_disabled = true;
} else {
if(data.goods.inventory <= 0) {
this.setData({
nav_submit_text: '商品卖光了',
nav_submit_is_disabled: true,
});
nav_submit_text = '卖光了';
nav_submit_is_disabled = true;
}
}
// 是否展示型
var common_is_exhibition_mode = data.common_is_exhibition_mode || 0;
if (common_is_exhibition_mode == 1) {
nav_submit_text = data.common_is_exhibition_mode_btn_text || '立即咨询';
}
// 数据赋值
this.setData({
nav_submit_text: nav_submit_text,
nav_submit_is_disabled: nav_submit_is_disabled,
common_is_exhibition_mode: common_is_exhibition_mode,
customer_service_tel: data.customer_service_tel || null,
});
} else {
self.setData({
data_bottom_line_status: false,
@ -766,6 +781,11 @@ Page({
}
},
// 展示型事件
exhibition_submit_event(e) {
app.call_tel(this.data.customer_service_tel);
},
// 自定义分享
onShareAppMessage() {

View File

@ -3,6 +3,9 @@
padding-top: 30rpx;
font-size: 24rpx;
}
.head-item {
padding-bottom: 30rpx;
}
.head-item .avatar {
width: 160rpx;
height: 160rpx;
@ -21,7 +24,6 @@
.head-nav {
padding: 5px 0;
background: rgba(0,0,0,0.1);
margin-top: 30rpx;
}
.head-nav-item {
width: 25%;

View File

@ -1,42 +1,46 @@
<!-- 头部 -->
<view class="head-box bg-main">
<view class="head-item oh tc">
<image onTap="preview_event" onError="user_avatar_error" class="avatar" src="{{avatar}}" mode="widthFix" />
<text class="item-name dis-block cr-fff">{{nickname}}</text>
</view>
<view class="head-item oh tc">
<image onTap="preview_event" onError="user_avatar_error" class="avatar" src="{{avatar}}" mode="widthFix" />
<text class="item-name dis-block cr-fff">{{nickname}}</text>
</view>
<view a:if="{{head_nav_list.length > 0}}" class="head-nav oh wh-auto">
<block a:for="{{head_nav_list}}">
<navigator url="/pages/{{item.url}}/{{item.url}}" hover-class="none">
<view class="head-nav-item tc fl">
<view>{{item.count}}</view>
<view>{{item.name}}</view>
</view>
</navigator>
</block>
</view>
<view class="message-nav">
<navigator url="/pages/message/message" hover-class="none">
<image src="/images/user-head-message-icon.png" mode="aspectFill" />
<text>消息</text>
<text>{{message_total}}</text>
<!-- 副导航 -->
<view a:if="{{common_app_is_head_vice_nav == 1 && head_nav_list.length > 0}}" class="head-nav oh wh-auto">
<block a:for="{{head_nav_list}}">
<navigator url="/pages/{{item.url}}/{{item.url}}" hover-class="none">
<view class="head-nav-item tc fl">
<view>{{item.count}}</view>
<view>{{item.name}}</view>
</view>
</navigator>
</view>
</block>
</view>
<!-- 右上角 -->
<view class="message-nav">
<navigator url="/pages/message/message" hover-class="none">
<image src="/images/user-head-message-icon.png" mode="aspectFill" />
<text>消息</text>
<text>{{message_total}}</text>
</navigator>
</view>
</view>
<!-- 导航 -->
<view class="nav-box bg-white">
<block a:for="{{nav_lists}}">
<view a:if="{{item.is_show == 1}}">
<navigator url="/pages/{{item.url}}/{{item.url}}" class="nav-item br-b" hover-class="none">
<view class="arrow-right">
<image src="/images/{{item.icon}}.png" class="item-icon" mode="widthFix" />
<text class="item-name">{{item.name}}</text>
</view>
</navigator>
<block a:for="{{navigation}}" a:key="ckey">
<!-- 主导航 -->
<view data-value="{{item.event_value}}" data-type="{{item.event_type}}" onTap="navigation_event" class="nav-item br-b" >
<view class="arrow-right">
<image src="{{item.images_url}}" class="item-icon" mode="widthFix" />
<text class="item-name">{{item.name}}</text>
<text a:if="{{(item.desc || null) != null}}" class="item-desc fr tr single-text cr-ccc">{{item.desc}}</text>
</view>
</view>
<view a:if="{{item.url == 'user-order' && user_order_status_list.length > 0}}" class="items-list br-b oh">
<!-- 订单自定义副导航 -->
<view a:if="{{item.event_value == '/pages/user-order/user-order' && user_order_status_list.length > 0}}" class="items-list br-b oh">
<block a:for="{{user_order_status_list}}" a:for-item="items">
<navigator url="{{items.url}}" hover-class="none">
<view class="items fl tc">
@ -49,17 +53,6 @@
</view>
</block>
<!-- 远程自定义导航 -->
<block a:for="{{navigation}}" a:key="ckey">
<view data-value="{{item.event_value}}" data-type="{{item.event_type}}" onTap="navigation_event" class="nav-item br-b" >
<view class="arrow-right">
<image src="{{item.images_url}}" class="item-icon" mode="widthFix" />
<text class="item-name">{{item.name}}</text>
<text a:if="{{(item.desc || null) != null}}" class="item-desc fr tr single-text cr-ccc">{{item.desc}}</text>
</view>
</view>
</block>
<view class="nav-item br-b" onTap="clear_storage">
<image src="/images/user-nav-cache-icon.png" class="item-icon" mode="widthFix" />
<text class="item-name">清除缓存</text>

View File

@ -19,17 +19,11 @@ Page({
{ name: "已完成", status: 4, count: 0, url: "/pages/user-order/user-order?status=4" },
{ name: "退款/售后", status: 101, count: 0, url: "/pages/user-orderaftersale/user-orderaftersale" },
],
nav_lists: [
{
url: "user-order",
icon: "user-nav-order-icon",
is_show: 1,
name: "我的订单",
}
],
// 远程自定义导航
navigation: [],
common_app_is_head_vice_nav: 0,
},
onShow() {
@ -109,6 +103,7 @@ Page({
message_total: ((data.common_message_total || 0) == 0) ? 0 : data.common_message_total,
head_nav_list: temp_head_nav_list,
navigation: data.navigation || [],
common_app_is_head_vice_nav: data.common_app_is_head_vice_nav || 0,
});
} else {
app.showToast(res.data.msg);
@ -133,7 +128,7 @@ Page({
{
app.showToast('客服电话有误');
} else {
my.makePhoneCall({ number: this.data.customer_service_tel });
app.call_tel(this.data.customer_service_tel);
}
},

View File

@ -61,12 +61,12 @@ App({
// 请求地址
request_url: "{{request_url}}",
// request_url: 'http://tp5-dev.com/',
request_url: 'http://tp5-dev.com/',
// request_url: 'https://test.shopxo.net/',
// 基础信息
application_title: "{{application_title}}",
application_describe: "{{application_describe}}"
application_title: "ShopXO",
application_describe: "国内领先企业级B2C开源电商系统"
},
/**
@ -490,6 +490,13 @@ App({
}
});
return arr;
}
},
// 拨打电话
call_tel(value) {
if ((value || null) != null) {
swan.makePhoneCall({ phoneNumber: value });
}
},
});

View File

@ -30,7 +30,7 @@
"pages/user-coupon/user-coupon"
],
"window": {
"navigationBarTitleText": "{{application_title}}",
"navigationBarTitleText": "ShopXO",
"navigationBarBackgroundColor": "#d2364c"
},
"tabBar": {

View File

@ -1,7 +1,7 @@
/**
* 商品列表
*/
.page {
.page {
padding-bottom: 120rpx;
}
.goods-item {
@ -124,9 +124,6 @@
.nav-submit button {
border-radius: 0;
}
.page {
padding-bottom: 120rpx;
}
.selected .icon {
width: 50rpx;
height: 50rpx !important;
@ -138,4 +135,14 @@
}
.buy-nav .sales-price {
max-width: calc(100% - 40px);
}
/*
* 展示型
*/
.exhibition-mode {
padding: 0 10rpx;
}
.exhibition-mode-data .items {
padding-left: 0;
}

View File

@ -8,7 +8,12 @@ Page({
swipe_index: null,
total_price: '0.00',
is_selected_all: false,
buy_submit_disabled_status: true
buy_submit_disabled_status: true,
// 是否展示型
common_is_exhibition_mode: 0,
common_is_exhibition_mode_btn_text: null,
customer_service_tel: null,
},
onShow() {
@ -63,16 +68,18 @@ Page({
swan.stopPullDownRefresh();
if (res.data.code == 0) {
var data = res.data.data;
if (data.length > 0) {
for (var i in data) {
data[i]['right'] = [{ type: 'edit', text: '加入收藏' }, { type: 'delete', text: '删除' }];
}
}
// 数据赋值
this.setData({
data_list: data,
data_list_loding_status: data.length == 0 ? 0 : 3,
data_list: data.data,
data_list_loding_status: data.data.length == 0 ? 0 : 3,
data_bottom_line_status: true,
data_list_loding_msg: '购物车空空如也'
data_list_loding_msg: '购物车空空如也',
// 是否展示型
common_is_exhibition_mode: data.common_is_exhibition_mode || 0,
common_is_exhibition_mode_btn_text: data.common_is_exhibition_mode_btn_text || '立即咨询',
customer_service_tel: data.customer_service_tel || null,
});
} else {
this.setData({
@ -287,9 +294,13 @@ Page({
// 选中计算
selected_calculate() {
var total_price = 0;
var data_count = 0;
var selected_count = 0;
var temp_data_list = this.data.data_list;
for (var i in temp_data_list) {
if ((temp_data_list[i]['is_error'] || 0) == 0) {
data_count++;
}
if ((temp_data_list[i]['selected'] || false) == true) {
total_price += temp_data_list[i]['stock'] * temp_data_list[i]['price'];
selected_count++;
@ -298,8 +309,8 @@ Page({
this.setData({
total_price: total_price.toFixed(2),
buy_submit_disabled_status: selected_count <= 0,
is_selected_all: selected_count >= temp_data_list.length
buy_submit_disabled_status: (selected_count <= 0),
is_selected_all: (selected_count >= data_count),
});
},
@ -328,6 +339,11 @@ Page({
swan.navigateTo({
url: '/pages/buy/buy?data=' + JSON.stringify(data)
});
}
},
// 展示型事件
exhibition_submit_event(e) {
app.call_tel(this.data.customer_service_tel);
},
});

View File

@ -1,7 +1,7 @@
<view s-if="data_list.length > 0" class="page">
<view s-for="item, index in data_list" s-key="key" class="goods-item oh bg-white">
<view s-for="item, index in data_list" s-key="key" class="goods-item oh bg-white {{common_is_exhibition_mode == 1 ? 'exhibition-mode-data' : ''}}">
<!-- 选择 -->
<view bindtap="selectedt_event" data-type="node" data-index="{{index}}" class="fl selected">
<view s-if="common_is_exhibition_mode != 1" bindtap="selectedt_event" data-type="node" data-index="{{index}}" class="fl selected">
<image class="icon" src="/images/default-select{{(item.is_error || 0) == 1 ? '-disabled' : ((item.selected || false) ? '-active' : '')}}-icon.png" mode="widthFix" />
</view>
@ -45,20 +45,29 @@
<!-- 操作导航 -->
<view s-if="data_list.length > 0" class="buy-nav oh wh-auto br-t">
<view class="nav-base bg-white fl single-text">
<view bindtap="selectedt_event" data-type="all" class="fl selected">
<image s-if="is_selected_all" class="icon" src="/images/default-select-active-icon.png" mode="widthFix" />
<image s-else class="icon" src="/images/default-select-icon.png" mode="widthFix" />
<text>全选</text>
<!-- 展示型 -->
<block s-if="common_is_exhibition_mode == 1">
<view class="exhibition-mode">
<button class="bg-main wh-auto" type="default" bindtap="exhibition_submit_event" hover-class="none">{{common_is_exhibition_mode_btn_text}}</button>
</view>
<view class="fr price">
<view class="sales-price single-text fr">¥{{total_price}}</view>
<view class="fr">合计:</view>
</block>
<!-- 销售型 -->
<block s-else>
<view class="nav-base bg-white fl single-text">
<view bindtap="selectedt_event" data-type="all" class="fl selected">
<image class="icon" src="/images/default-select{{is_selected_all ? '-active' : ''}}-icon.png" mode="widthFix" />
<text>全选</text>
</view>
<view class="fr price">
<view class="sales-price single-text fr">¥{{total_price}}</view>
<view class="fr">合计:</view>
</view>
</view>
</view>
<view class="fr nav-submit">
<button class="bg-main wh-auto" type="default" bindtap="buy_submit_event" disabled="{{buy_submit_disabled_status}}" hover-class="none">结算</button>
</view>
<view class="fr nav-submit">
<button class="bg-main wh-auto" type="default" bindtap="buy_submit_event" disabled="{{buy_submit_disabled_status}}" hover-class="none">结算</button>
</view>
</block>
</view>
</view>

View File

@ -342,4 +342,11 @@
position: absolute;
top: -5px;
left: calc(50% + 23rpx);
}
/*
* 展示型
*/
.goods-buy-nav .exhibition-mode button {
width: 100%;
}

View File

@ -49,6 +49,10 @@ Page({
// 购物车快捷导航
quick_nav_cart_count: 0,
// 是否展示型
common_is_exhibition_mode: 0,
customer_service_tel: null,
},
onLoad(params) {
@ -106,10 +110,8 @@ Page({
temp_buy_number: data.goods.buy_min_number || 1,
goods_favor_text: data.goods.is_favor == 1 ? '已收藏' : '收藏',
goods_favor_icon: '/images/goods-detail-favor-icon-' + data.goods.is_favor + '.png',
nav_submit_text: (data.common_order_is_booking || 0) == 0 ? '立即购买' : '立即预约',
data_bottom_line_status: true,
data_list_loding_status: 3,
nav_submit_is_disabled: data.goods.is_shelves == 1 && data.goods.inventory > 0 ? false : true,
goods_spec_base_price: data.goods.price,
goods_spec_base_original_price: data.goods.original_price,
@ -137,22 +139,35 @@ Page({
// 不能选择规格处理
this.goods_specifications_choose_handle_dont(0);
// 页面信息设置
this.set_page_info();
// 购买按钮处理
var nav_submit_text = ((data.common_order_is_booking || 0) == 0) ? '立即购买' : '立即预约';
var nav_submit_is_disabled = (data.goods.is_shelves == 1 && data.goods.inventory > 0) ? false : true;
if (data.goods.is_shelves != 1) {
this.setData({
nav_submit_text: '商品已下架',
nav_submit_is_disabled: true
});
nav_submit_text = '已下架';
nav_submit_is_disabled = true;
} else {
if (data.goods.inventory <= 0) {
this.setData({
nav_submit_text: '商品卖光了',
nav_submit_is_disabled: true
});
if(data.goods.inventory <= 0) {
nav_submit_text = '卖光了';
nav_submit_is_disabled = true;
}
}
// 是否展示型
var common_is_exhibition_mode = data.common_is_exhibition_mode || 0;
if (common_is_exhibition_mode == 1) {
nav_submit_text = data.common_is_exhibition_mode_btn_text || '立即咨询';
}
// 数据赋值
this.setData({
nav_submit_text: nav_submit_text,
nav_submit_is_disabled: nav_submit_is_disabled,
common_is_exhibition_mode: common_is_exhibition_mode,
customer_service_tel: data.customer_service_tel || null,
});
// 页面信息设置
this.set_page_info();
} else {
self.setData({
data_bottom_line_status: false,
@ -718,6 +733,11 @@ Page({
}
},
// 展示型事件
exhibition_submit_event(e) {
app.call_tel(this.data.customer_service_tel);
},
// 自定义分享
onShareAppMessage() {
var user = app.get_user_cache_info(this, 'onShareAppMessage') || null;

View File

@ -124,9 +124,17 @@
<image src="{{goods_favor_icon}}" mode="scaleToFill" />
<text class="dis-block cr-888">{{goods_favor_text}}</text>
</view>
<view class="fr">
<button class="bg-warning fl" type="default" bindtap="cart_submit_event" hover-class="none" disabled="{{nav_submit_is_disabled}}">加入购物车</button>
<button class="bg-main fl" type="default" bindtap="buy_submit_event" hover-class="none" disabled="{{nav_submit_is_disabled}}">{{nav_submit_text}}</button>
<view class="fr {{common_is_exhibition_mode == 1 ? 'exhibition-mode' : ''}}">
<!-- 展示型 -->
<block s-if="common_is_exhibition_mode == 1">
<button class="bg-main fl" type="default" bindtap="exhibition_submit_event" hover-class="none">{{nav_submit_text}}</button>
</block>
<!-- 销售型 -->
<block s-else>
<button class="bg-warning fl" type="default" bindtap="cart_submit_event" hover-class="none" disabled="{{nav_submit_is_disabled}}">加入购物车</button>
<button class="bg-main fl" type="default" bindtap="buy_submit_event" hover-class="none" disabled="{{nav_submit_is_disabled}}">{{nav_submit_text}}</button>
</block>
</view>
</view>

View File

@ -3,6 +3,9 @@
padding-top: 30rpx;
font-size: 24rpx;
}
.head-item {
padding-bottom: 30rpx;
}
.head-item .avatar {
width: 160rpx;
height: 160rpx;
@ -21,7 +24,6 @@
.head-nav {
padding: 5px 0;
background: rgba(0,0,0,0.1);
margin-top: 30rpx;
}
.head-nav-item {
width: 25%;

View File

@ -29,6 +29,7 @@ Page({
navigation: [],
common_app_is_online_service: 0,
common_app_is_head_vice_nav: 0,
},
onShow() {
@ -108,6 +109,7 @@ Page({
head_nav_list: temp_head_nav_list,
navigation: data.navigation || [],
common_app_is_online_service: data.common_app_is_online_service || 0,
common_app_is_head_vice_nav: data.common_app_is_head_vice_nav || 0,
});
} else {
app.showToast(res.data.msg);
@ -131,7 +133,7 @@ Page({
if (this.data.customer_service_tel == null) {
app.showToast("客服电话有误");
} else {
swan.makePhoneCall({ phoneNumber: this.data.customer_service_tel });
app.call_tel(this.data.customer_service_tel);
}
},

View File

@ -1,40 +1,47 @@
<!-- 头部 -->
<view class="head-box bg-main">
<view class="head-item oh tc">
<image bindtap="preview_event" class="avatar" src="{{avatar}}" mode="widthFix" binderror="user_avatar_error" />
<text class="item-name dis-block cr-fff">{{nickname}}</text>
</view>
<view class="head-item oh tc">
<image bindtap="preview_event" class="avatar" src="{{avatar}}" mode="widthFix" binderror="user_avatar_error" />
<text class="item-name dis-block cr-fff">{{nickname}}</text>
</view>
<view s-if="head_nav_list.length > 0" class="head-nav oh wh-auto">
<block s-for="item, index in head_nav_list" s-key="key">
<navigator url="/pages/{{item.url}}/{{item.url}}" hover-class="none">
<view class="head-nav-item tc fl">
<view>{{item.count}}</view>
<view>{{item.name}}</view>
</view>
</navigator>
</block>
</view>
<view class="message-nav">
<navigator url="/pages/message/message" hover-class="none">
<image src="/images/user-head-message-icon.png" mode="aspectFill" />
<text>消息</text>
<text>{{message_total}}</text>
<!-- 副导航 -->
<view s-if="common_app_is_head_vice_nav == 1 && head_nav_list.length > 0" class="head-nav oh wh-auto">
<block s-for="item, index in head_nav_list" s-key="key">
<navigator url="/pages/{{item.url}}/{{item.url}}" hover-class="none">
<view class="head-nav-item tc fl">
<view>{{item.count}}</view>
<view>{{item.name}}</view>
</view>
</navigator>
</view>
</block>
</view>
<!-- 右上角 -->
<view class="message-nav">
<navigator url="/pages/message/message" hover-class="none">
<image src="/images/user-head-message-icon.png" mode="aspectFill" />
<text>消息</text>
<text>{{message_total}}</text>
</navigator>
</view>
</view>
<!-- 导航 -->
<view class="nav-box bg-white">
<block s-for="item, index in nav_lists" s-key="key">
<navigator url="/pages/{{item.url}}/{{item.url}}" class="nav-item br-b" hover-class="none">
<!-- 远程自定义导航 -->
<block s-for="item, index in navigation" s-key="ckey">
<!-- 主导航 -->
<view data-value="{{item.event_value}}" data-type="{{item.event_type}}" bindtap="navigation_event" class="nav-item br-b">
<view class="arrow-right">
<image src="/images/{{item.icon}}.png" class="item-icon" mode="widthFix" />
<image src="{{item.images_url}}" class="item-icon" mode="widthFix" />
<text class="item-name">{{item.name}}</text>
<text s-if="(item.desc || null) != null" class="item-desc fr tr single-text cr-ccc">{{item.desc}}</text>
</view>
</navigator>
<view s-if="item.url == 'user-order' && user_order_status_list.length > 0" class="items-list br-b oh">
</view>
<!-- 订单自定义副导航 -->
<view s-if="item.event_value == '/pages/user-order/user-order' && user_order_status_list.length > 0" class="items-list br-b oh">
<block s-for="items, index in user_order_status_list" s-key="key">
<navigator url="{{items.url}}" hover-class="none">
<view class="items fl tc">
@ -49,17 +56,6 @@
</view>
</block>
<!-- 远程自定义导航 -->
<block s-for="item, index in navigation" s-key="ckey">
<view data-value="{{item.event_value}}" data-type="{{item.event_type}}" bindtap="navigation_event" class="nav-item br-b">
<view class="arrow-right">
<image src="{{item.images_url}}" class="item-icon" mode="widthFix" />
<text class="item-name">{{item.name}}</text>
<text s-if="(item.desc || null) != null" class="item-desc fr tr single-text cr-ccc">{{item.desc}}</text>
</view>
</view>
</block>
<view class="nav-item br-b" bindtap="clear_storage">
<image src="/images/user-nav-cache-icon.png" class="item-icon" mode="widthFix" />
<text class="item-name">清除缓存</text>

View File

@ -66,8 +66,8 @@ App({
// 请求地址
request_url: "{{request_url}}",
// request_url: 'http://tp5-dev.com/',
// request_url: 'https://test.shopxo.net/',
request_url: 'http://tp5-dev.com/',
//request_url: 'https://test.shopxo.net/',
// 基础信息
application_title: "{{application_title}}",
@ -514,6 +514,13 @@ App({
}
}
return json;
}
},
// 拨打电话
call_tel(value) {
if ((value || null) != null) {
qq.makePhoneCall({ phoneNumber: value });
}
},
});

View File

@ -30,7 +30,7 @@
"pages/user-coupon/user-coupon"
],
"window": {
"navigationBarTitleText": "{{application_title}}",
"navigationBarTitleText": "ShopXO",
"navigationBarBackgroundColor": "#d2364c"
},
"tabBar": {

View File

@ -9,6 +9,11 @@ Page({
total_price: '0.00',
is_selected_all: false,
buy_submit_disabled_status: true,
// 是否展示型
common_is_exhibition_mode: 0,
common_is_exhibition_mode_btn_text: null,
customer_service_tel: null,
},
onShow() {
@ -63,16 +68,18 @@ Page({
qq.stopPullDownRefresh();
if (res.data.code == 0) {
var data = res.data.data;
if (data.length > 0) {
for (var i in data) {
data[i]['right'] = [{ type: 'edit', text: '加入收藏' }, { type: 'delete', text: '删除' }];
}
}
// 数据赋值
this.setData({
data_list: data,
data_list_loding_status: data.length == 0 ? 0 : 3,
data_list: data.data,
data_list_loding_status: data.data.length == 0 ? 0 : 3,
data_bottom_line_status: true,
data_list_loding_msg: '购物车空空如也',
// 是否展示型
common_is_exhibition_mode: data.common_is_exhibition_mode || 0,
common_is_exhibition_mode_btn_text: data.common_is_exhibition_mode_btn_text || '立即咨询',
customer_service_tel: data.customer_service_tel || null,
});
} else {
this.setData({
@ -289,9 +296,13 @@ Page({
// 选中计算
selected_calculate() {
var total_price = 0;
var data_count = 0;
var selected_count = 0;
var temp_data_list = this.data.data_list;
for (var i in temp_data_list) {
if ((temp_data_list[i]['is_error'] || 0) == 0) {
data_count++;
}
if ((temp_data_list[i]['selected'] || false) == true) {
total_price += temp_data_list[i]['stock'] * temp_data_list[i]['price'];
selected_count++;
@ -301,7 +312,7 @@ Page({
this.setData({
total_price: total_price.toFixed(2),
buy_submit_disabled_status: (selected_count <= 0),
is_selected_all: (selected_count >= temp_data_list.length),
is_selected_all: (selected_count >= data_count),
});
},
@ -330,6 +341,11 @@ Page({
qq.navigateTo({
url: '/pages/buy/buy?data=' + JSON.stringify(data)
});
}
},
// 展示型事件
exhibition_submit_event(e) {
app.call_tel(this.data.customer_service_tel);
},
});

View File

@ -1,7 +1,7 @@
<view qq:if="{{data_list.length > 0}}" class="page">
<view qq:for="{{data_list}}" qq:key="key" class="goods-item oh bg-white">
<view qq:for="{{data_list}}" qq:key="key" class="goods-item oh bg-white {{common_is_exhibition_mode == 1 ? 'exhibition-mode-data' : ''}}">
<!-- -->
<view bindtap="selectedt_event" data-type="node" data-index="{{index}}" class="fl selected">
<view qq:if="{{common_is_exhibition_mode != 1}}" bindtap="selectedt_event" data-type="node" data-index="{{index}}" class="fl selected">
<image class="icon" src="/images/default-select{{(item.is_error || 0) == 1 ? '-disabled' : ((item.selected || false) ? '-active' : '')}}-icon.png" mode="widthFix" />
</view>
@ -43,20 +43,29 @@
<!-- -->
<view qq:if="{{data_list.length > 0}}" class="buy-nav oh wh-auto br-t">
<view class="nav-base bg-white fl single-text">
<view bindtap="selectedt_event" data-type="all" class="fl selected">
<image qq:if="{{is_selected_all}}" class="icon" src="/images/default-select-active-icon.png" mode="widthFix" />
<image wx:else class="icon" src="/images/default-select-icon.png" mode="widthFix" />
<text></text>
<!-- -->
<block qq:if="{{common_is_exhibition_mode == 1}}">
<view class="exhibition-mode">
<button class="bg-main wh-auto" type="default" bindtap="exhibition_submit_event" hover-class="none">{{common_is_exhibition_mode_btn_text}}</button>
</view>
<view class="fr price">
<view class="sales-price single-text fr">{{total_price}}</view>
<view class="fr"></view>
</block>
<!-- -->
<block qq:else>
<view class="nav-base bg-white fl single-text">
<view bindtap="selectedt_event" data-type="all" class="fl selected">
<image class="icon" src="/images/default-select{{is_selected_all ? '-active' : ''}}-icon.png" mode="widthFix" />
<text></text>
</view>
<view class="fr price">
<view class="sales-price single-text fr">{{total_price}}</view>
<view class="fr"></view>
</view>
</view>
</view>
<view class="fr nav-submit">
<button class="bg-main wh-auto" type="default" bindtap="buy_submit_event" disabled="{{buy_submit_disabled_status}}" hover-class="none"></button>
</view>
<view class="fr nav-submit">
<button class="bg-main wh-auto" type="default" bindtap="buy_submit_event" disabled="{{buy_submit_disabled_status}}" hover-class="none"></button>
</view>
</block>
</view>
</view>

View File

@ -1,7 +1,7 @@
/**
* 商品列表
*/
.page {
.page {
padding-bottom: 120rpx;
}
.goods-item {
@ -125,9 +125,6 @@
.nav-submit button {
border-radius: 0;
}
.page {
padding-bottom: 120rpx;
}
.selected .icon {
width: 50rpx;
height: 50rpx !important;
@ -139,4 +136,14 @@
}
.buy-nav .sales-price {
max-width: calc(100% - 40px);
}
/*
* 展示型
*/
.exhibition-mode {
padding: 0 10rpx;
}
.exhibition-mode-data .items {
padding-left: 0;
}

View File

@ -52,6 +52,10 @@ Page({
// 购物车快捷导航
quick_nav_cart_count: 0,
// 是否展示型
common_is_exhibition_mode: 0,
customer_service_tel: null,
},
onLoad(params) {
@ -114,10 +118,8 @@ Page({
temp_buy_number: data.goods.buy_min_number || 1,
goods_favor_text: (data.goods.is_favor == 1) ? '已收藏' : '收藏',
goods_favor_icon: '/images/goods-detail-favor-icon-' + data.goods.is_favor+'.png',
nav_submit_text: ((data.common_order_is_booking || 0) == 0) ? '立即购买' : '立即预约',
data_bottom_line_status: true,
data_list_loding_status: 3,
nav_submit_is_disabled: (data.goods.is_shelves == 1 && data.goods.inventory > 0) ? false : true,
goods_spec_base_price: data.goods.price,
goods_spec_base_original_price: data.goods.original_price,
@ -145,19 +147,32 @@ Page({
// 不能选择规格处理
this.goods_specifications_choose_handle_dont(0);
// 购买按钮处理
var nav_submit_text = ((data.common_order_is_booking || 0) == 0) ? '立即购买' : '立即预约';
var nav_submit_is_disabled = (data.goods.is_shelves == 1 && data.goods.inventory > 0) ? false : true;
if (data.goods.is_shelves != 1) {
this.setData({
nav_submit_text: '商品已下架',
nav_submit_is_disabled: true,
});
nav_submit_text = '已下架';
nav_submit_is_disabled = true;
} else {
if(data.goods.inventory <= 0) {
this.setData({
nav_submit_text: '商品卖光了',
nav_submit_is_disabled: true,
});
nav_submit_text = '卖光了';
nav_submit_is_disabled = true;
}
}
// 是否展示型
var common_is_exhibition_mode = data.common_is_exhibition_mode || 0;
if (common_is_exhibition_mode == 1) {
nav_submit_text = data.common_is_exhibition_mode_btn_text || '立即咨询';
}
// 数据赋值
this.setData({
nav_submit_text: nav_submit_text,
nav_submit_is_disabled: nav_submit_is_disabled,
common_is_exhibition_mode: common_is_exhibition_mode,
customer_service_tel: data.customer_service_tel || null,
});
} else {
self.setData({
data_bottom_line_status: false,
@ -802,6 +817,11 @@ Page({
}
},
// 展示型事件
exhibition_submit_event(e) {
app.call_tel(this.data.customer_service_tel);
},
// 自定义分享
onShareAppMessage() {
var user = app.get_user_cache_info(this, 'goods_favor_event') || null;

View File

@ -131,9 +131,17 @@
<image src="{{goods_favor_icon}}" mode="scaleToFill" />
<text class="dis-block cr-888">{{goods_favor_text}}</text>
</view>
<view class="fr">
<button class="bg-warning fl" type="default" bindtap="cart_submit_event" hover-class="none" disabled="{{nav_submit_is_disabled}}"></button>
<button class="bg-main fl" type="default" bindtap="buy_submit_event" hover-class="none" disabled="{{nav_submit_is_disabled}}">{{nav_submit_text}}</button>
<view class="fr {{common_is_exhibition_mode == 1 ? 'exhibition-mode' : ''}}">
<!-- -->
<block qq:if="{{common_is_exhibition_mode == 1}}">
<button class="bg-main fl" type="default" bindtap="exhibition_submit_event" hover-class="none">{{nav_submit_text}}</button>
</block>
<!-- -->
<block qq:else>
<button class="bg-warning fl" type="default" bindtap="cart_submit_event" hover-class="none" disabled="{{nav_submit_is_disabled}}"></button>
<button class="bg-main fl" type="default" bindtap="buy_submit_event" hover-class="none" disabled="{{nav_submit_is_disabled}}">{{nav_submit_text}}</button>
</block>
</view>
</view>

View File

@ -338,4 +338,11 @@
position: absolute;
top: -5px;
left: calc(50% + 23rpx);
}
/*
* 展示型
*/
.goods-buy-nav .exhibition-mode button {
width: 100%;
}

View File

@ -19,18 +19,12 @@ Page({
{ name: "已完成", status: 4, count: 0, url: "/pages/user-order/user-order?status=4" },
{ name: "退款/售后", status: 101, count: 0, url: "/pages/user-orderaftersale/user-orderaftersale" },
],
nav_lists: [
{
url: "user-order",
icon: "user-nav-order-icon",
name: "我的订单",
}
],
// 远程自定义导航
navigation: [],
common_app_is_online_service: 0,
common_app_is_head_vice_nav: 0,
},
onShow() {
@ -109,6 +103,7 @@ Page({
message_total: ((data.common_message_total || 0) == 0) ? 0 : data.common_message_total,
head_nav_list: temp_head_nav_list,
navigation: data.navigation || [],
common_app_is_head_vice_nav: data.common_app_is_head_vice_nav || 0,
});
} else {
app.showToast(res.data.msg);
@ -133,7 +128,7 @@ Page({
{
app.showToast("客服电话有误");
} else {
qq.makePhoneCall({ phoneNumber: this.data.customer_service_tel });
app.call_tel(this.data.customer_service_tel);
}
},

View File

@ -1,40 +1,46 @@
<!-- -->
<view class="head-box bg-main">
<view class="head-item oh tc">
<image bindtap="preview_event" binderror="user_avatar_error" class="avatar" src="{{avatar}}" mode="widthFix" />
<text class="item-name dis-block cr-fff">{{nickname}}</text>
</view>
<view class="head-item oh tc">
<image bindtap="preview_event" binderror="user_avatar_error" class="avatar" src="{{avatar}}" mode="widthFix" />
<text class="item-name dis-block cr-fff">{{nickname}}</text>
</view>
<view qq:if="{{head_nav_list.length > 0}}" class="head-nav oh wh-auto">
<block qq:for="{{head_nav_list}}" qq:key="key">
<navigator url="/pages/{{item.url}}/{{item.url}}" hover-class="none">
<view class="head-nav-item tc fl">
<view>{{item.count}}</view>
<view>{{item.name}}</view>
</view>
</navigator>
</block>
</view>
<view class="message-nav">
<navigator url="/pages/message/message" hover-class="none">
<image src="/images/user-head-message-icon.png" mode="aspectFill" />
<text></text>
<text>{{message_total}}</text>
<!-- -->
<view qq:if="{{common_app_is_head_vice_nav == 1 && head_nav_list.length > 0}}" class="head-nav oh wh-auto">
<block qq:for="{{head_nav_list}}" qq:key="key">
<navigator url="/pages/{{item.url}}/{{item.url}}" hover-class="none">
<view class="head-nav-item tc fl">
<view>{{item.count}}</view>
<view>{{item.name}}</view>
</view>
</navigator>
</view>
</block>
</view>
<!-- -->
<view class="message-nav">
<navigator url="/pages/message/message" hover-class="none">
<image src="/images/user-head-message-icon.png" mode="aspectFill" />
<text></text>
<text>{{message_total}}</text>
</navigator>
</view>
</view>
<!-- -->
<view class="nav-box bg-white">
<block qq:for="{{nav_lists}}" qq:key="key">
<navigator url="/pages/{{item.url}}/{{item.url}}" class="nav-item br-b" hover-class="none">
<block qq:for="{{navigation}}" qq:key="ckey">
<!-- -->
<view data-value="{{item.event_value}}" data-type="{{item.event_type}}" bindtap="navigation_event" class="nav-item br-b" >
<view class="arrow-right">
<image src="/images/{{item.icon}}.png" class="item-icon" mode="widthFix" />
<image src="{{item.images_url}}" class="item-icon" mode="widthFix" />
<text class="item-name">{{item.name}}</text>
<text qq:if="{{(item.desc || null) != null}}" class="item-desc fr tr single-text cr-ccc">{{item.desc}}</text>
</view>
</navigator>
<view qq:if="{{item.url == 'user-order' && user_order_status_list.length > 0}}" class="items-list br-b oh">
</view>
<!-- -->
<view qq:if="{{item.event_value == '/pages/user-order/user-order' && user_order_status_list.length > 0}}" class="items-list br-b oh">
<block qq:for="{{user_order_status_list}}" qq:key="key" qq:for-item="items">
<navigator url="{{items.url}}" hover-class="none">
<view class="items fl tc">
@ -49,17 +55,6 @@
</view>
</block>
<!-- -->
<block qq:for="{{navigation}}" qq:key="ckey">
<view data-value="{{item.event_value}}" data-type="{{item.event_type}}" bindtap="navigation_event" class="nav-item br-b" >
<view class="arrow-right">
<image src="{{item.images_url}}" class="item-icon" mode="widthFix" />
<text class="item-name">{{item.name}}</text>
<text qq:if="{{(item.desc || null) != null}}" class="item-desc fr tr single-text cr-ccc">{{item.desc}}</text>
</view>
</view>
</block>
<view class="nav-item br-b" bindtap="clear_storage">
<image src="/images/user-nav-cache-icon.png" class="item-icon" mode="widthFix" />
<text class="item-name"></text>

View File

@ -3,6 +3,9 @@
padding-top: 30rpx;
font-size: 24rpx;
}
.head-item {
padding-bottom: 30rpx;
}
.head-item .avatar {
width: 160rpx;
height: 160rpx;
@ -21,7 +24,6 @@
.head-nav {
padding: 5px 0;
background: rgba(0,0,0,0.1);
margin-top: 30rpx;
}
.head-nav-item {
width: 25%;

View File

@ -581,4 +581,11 @@ App({
});
},
// 拨打电话
call_tel(value) {
if ((value || null) != null) {
tt.makePhoneCall({ phoneNumber: value });
}
},
});

View File

@ -9,6 +9,11 @@ Page({
total_price: '0.00',
is_selected_all: false,
buy_submit_disabled_status: true,
// 是否展示型
common_is_exhibition_mode: 0,
common_is_exhibition_mode_btn_text: null,
customer_service_tel: null,
},
onShow() {
@ -63,16 +68,18 @@ Page({
tt.stopPullDownRefresh();
if (res.data.code == 0) {
var data = res.data.data;
if (data.length > 0) {
for (var i in data) {
data[i]['right'] = [{ type: 'edit', text: '加入收藏' }, { type: 'delete', text: '删除' }];
}
}
// 数据赋值
this.setData({
data_list: data,
data_list_loding_status: data.length == 0 ? 0 : 3,
data_list: data.data,
data_list_loding_status: data.data.length == 0 ? 0 : 3,
data_bottom_line_status: true,
data_list_loding_msg: '购物车空空如也',
// 是否展示型
common_is_exhibition_mode: data.common_is_exhibition_mode || 0,
common_is_exhibition_mode_btn_text: data.common_is_exhibition_mode_btn_text || '立即咨询',
customer_service_tel: data.customer_service_tel || null,
});
} else {
this.setData({
@ -289,9 +296,13 @@ Page({
// 选中计算
selected_calculate() {
var total_price = 0;
var data_count = 0;
var selected_count = 0;
var temp_data_list = this.data.data_list;
for (var i in temp_data_list) {
if ((temp_data_list[i]['is_error'] || 0) == 0) {
data_count++;
}
if ((temp_data_list[i]['selected'] || false) == true) {
total_price += temp_data_list[i]['stock'] * temp_data_list[i]['price'];
selected_count++;
@ -301,7 +312,7 @@ Page({
this.setData({
total_price: total_price.toFixed(2),
buy_submit_disabled_status: (selected_count <= 0),
is_selected_all: (selected_count >= temp_data_list.length),
is_selected_all: (selected_count >= data_count),
});
},
@ -330,6 +341,11 @@ Page({
tt.navigateTo({
url: '/pages/buy/buy?data=' + JSON.stringify(data)
});
}
},
// 展示型事件
exhibition_submit_event(e) {
app.call_tel(this.data.customer_service_tel);
},
});

View File

@ -1,7 +1,7 @@
<view tt:if="{{data_list.length > 0}}" class="page">
<view tt:for="{{data_list}}" tt:key="key" class="goods-item oh bg-white">
<view tt:for="{{data_list}}" tt:key="key" class="goods-item oh bg-white {{common_is_exhibition_mode == 1 ? 'exhibition-mode-data' : ''}}">
<!-- 选择 -->
<view bindtap="selectedt_event" data-type="node" data-index="{{index}}" class="fl selected">
<view tt:if="{{common_is_exhibition_mode != 1}}" bindtap="selectedt_event" data-type="node" data-index="{{index}}" class="fl selected">
<image class="icon" src="/images/default-select{{(item.is_error || 0) == 1 ? '-disabled' : ((item.selected || false) ? '-active' : '')}}-icon.png" mode="widthFix" />
</view>
@ -45,8 +45,7 @@
<view tt:if="{{data_list.length > 0}}" class="buy-nav oh wh-auto br-t">
<view class="nav-base bg-white fl single-text">
<view bindtap="selectedt_event" data-type="all" class="fl selected">
<image tt:if="{{is_selected_all}}" class="icon" src="/images/default-select-active-icon.png" mode="widthFix" />
<image wx:else class="icon" src="/images/default-select-icon.png" mode="widthFix" />
<image class="icon" src="/images/default-select{{is_selected_all ? '-active' : ''}}-icon.png" mode="widthFix" />
<text>全选</text>
</view>
<view class="fr price">

View File

@ -1,7 +1,7 @@
/**
* 商品列表
*/
.page {
.page {
padding-bottom: 120rpx;
}
.goods-item {
@ -125,9 +125,6 @@
.nav-submit button {
border-radius: 0;
}
.page {
padding-bottom: 120rpx;
}
.selected .icon {
width: 50rpx;
height: 50rpx !important;
@ -139,4 +136,14 @@
}
.buy-nav .sales-price {
max-width: calc(100% - 40px);
}
/*
* 展示型
*/
.exhibition-mode {
padding: 0 10rpx;
}
.exhibition-mode-data .items {
padding-left: 0;
}

View File

@ -47,6 +47,10 @@ Page({
// 购物车快捷导航
quick_nav_cart_count: 0,
// 是否展示型
common_is_exhibition_mode: 0,
customer_service_tel: null,
},
onLoad(params) {
@ -109,10 +113,8 @@ Page({
temp_buy_number: data.goods.buy_min_number || 1,
goods_favor_text: (data.goods.is_favor == 1) ? '已收藏' : '收藏',
goods_favor_icon: '/images/goods-detail-favor-icon-' + data.goods.is_favor+'.png',
nav_submit_text: ((data.common_order_is_booking || 0) == 0) ? '立即购买' : '立即预约',
data_bottom_line_status: true,
data_list_loding_status: 3,
nav_submit_is_disabled: (data.goods.is_shelves == 1 && data.goods.inventory > 0) ? false : true,
goods_spec_base_price: data.goods.price,
goods_spec_base_original_price: data.goods.original_price,
@ -140,19 +142,32 @@ Page({
// 不能选择规格处理
this.goods_specifications_choose_handle_dont(0);
// 购买按钮处理
var nav_submit_text = ((data.common_order_is_booking || 0) == 0) ? '立即购买' : '立即预约';
var nav_submit_is_disabled = (data.goods.is_shelves == 1 && data.goods.inventory > 0) ? false : true;
if (data.goods.is_shelves != 1) {
this.setData({
nav_submit_text: '商品已下架',
nav_submit_is_disabled: true,
});
nav_submit_text = '已下架';
nav_submit_is_disabled = true;
} else {
if(data.goods.inventory <= 0) {
this.setData({
nav_submit_text: '商品卖光了',
nav_submit_is_disabled: true,
});
nav_submit_text = '卖光了';
nav_submit_is_disabled = true;
}
}
// 是否展示型
var common_is_exhibition_mode = data.common_is_exhibition_mode || 0;
if (common_is_exhibition_mode == 1) {
nav_submit_text = data.common_is_exhibition_mode_btn_text || '立即咨询';
}
// 数据赋值
this.setData({
nav_submit_text: nav_submit_text,
nav_submit_is_disabled: nav_submit_is_disabled,
common_is_exhibition_mode: common_is_exhibition_mode,
customer_service_tel: data.customer_service_tel || null,
});
} else {
self.setData({
data_bottom_line_status: false,
@ -797,6 +812,11 @@ Page({
}
},
// 展示型事件
exhibition_submit_event(e) {
app.call_tel(this.data.customer_service_tel);
},
// 自定义分享
onShareAppMessage() {
var user = app.get_user_cache_info(this, 'goods_favor_event') || null;

View File

@ -131,9 +131,17 @@
<image src="{{goods_favor_icon}}" mode="scaleToFill" />
<text class="dis-block cr-888">{{goods_favor_text}}</text>
</view>
<view class="fr">
<button class="bg-warning fl" type="default" bindtap="cart_submit_event" hover-class="none" disabled="{{nav_submit_is_disabled}}">加入购物车</button>
<button class="bg-main fl" type="default" bindtap="buy_submit_event" hover-class="none" disabled="{{nav_submit_is_disabled}}">{{nav_submit_text}}</button>
<view class="fr {{common_is_exhibition_mode == 1 ? 'exhibition-mode' : ''}}">
<!-- 展示型 -->
<block tt:if="{{common_is_exhibition_mode == 1}}">
<button class="bg-main fl" type="default" bindtap="exhibition_submit_event" hover-class="none">{{nav_submit_text}}</button>
</block>
<!-- 销售型 -->
<block tt:else>
<button class="bg-warning fl" type="default" bindtap="cart_submit_event" hover-class="none" disabled="{{nav_submit_is_disabled}}">加入购物车</button>
<button class="bg-main fl" type="default" bindtap="buy_submit_event" hover-class="none" disabled="{{nav_submit_is_disabled}}">{{nav_submit_text}}</button>
</block>
</view>
</view>

View File

@ -338,4 +338,11 @@
position: absolute;
top: -5px;
left: calc(50% + 23rpx);
}
/*
* 展示型
*/
.goods-buy-nav .exhibition-mode button {
width: 100%;
}

View File

@ -19,16 +19,11 @@ Page({
{ name: "已完成", status: 4, count: 0, url: "/pages/user-order/user-order?status=4" },
{ name: "退款/售后", status: 101, count: 0, url: "/pages/user-orderaftersale/user-orderaftersale" },
],
nav_lists: [
{
url: "user-order",
icon: "user-nav-order-icon",
name: "我的订单",
}
],
// 远程自定义导航
navigation: [],
common_app_is_head_vice_nav: 0,
},
onShow() {
@ -107,6 +102,7 @@ Page({
message_total: ((data.common_message_total || 0) == 0) ? 0 : data.common_message_total,
head_nav_list: temp_head_nav_list,
navigation: data.navigation || [],
common_app_is_head_vice_nav: data.common_app_is_head_vice_nav || 0,
});
} else {
app.showToast(res.data.msg);
@ -131,7 +127,7 @@ Page({
{
app.showToast("客服电话有误");
} else {
tt.makePhoneCall({ phoneNumber: this.data.customer_service_tel });
app.call_tel(this.data.customer_service_tel);
}
},

View File

@ -1,40 +1,46 @@
<!-- 头部 -->
<view class="head-box bg-main">
<view class="head-item oh tc">
<image bindtap="preview_event" binderror="user_avatar_error" class="avatar" src="{{avatar}}" mode="widthFix" />
<text class="item-name dis-block cr-fff">{{nickname}}</text>
</view>
<view class="head-item oh tc">
<image bindtap="preview_event" binderror="user_avatar_error" class="avatar" src="{{avatar}}" mode="widthFix" />
<text class="item-name dis-block cr-fff">{{nickname}}</text>
</view>
<view tt:if="{{head_nav_list.length > 0}}" class="head-nav oh wh-auto">
<block tt:for="{{head_nav_list}}" tt:key="key">
<navigator url="/pages/{{item.url}}/{{item.url}}" hover-class="none">
<view class="head-nav-item tc fl">
<view>{{item.count}}</view>
<view>{{item.name}}</view>
</view>
</navigator>
</block>
</view>
<view class="message-nav">
<navigator url="/pages/message/message" hover-class="none">
<image src="/images/user-head-message-icon.png" mode="aspectFill" />
<text>消息</text>
<text>{{message_total}}</text>
<!-- 副导航 -->
<view tt:if="{{common_app_is_head_vice_nav == 1 && head_nav_list.length > 0}}" class="head-nav oh wh-auto">
<block tt:for="{{head_nav_list}}" tt:key="key">
<navigator url="/pages/{{item.url}}/{{item.url}}" hover-class="none">
<view class="head-nav-item tc fl">
<view>{{item.count}}</view>
<view>{{item.name}}</view>
</view>
</navigator>
</view>
</block>
</view>
<!-- 右上角 -->
<view class="message-nav">
<navigator url="/pages/message/message" hover-class="none">
<image src="/images/user-head-message-icon.png" mode="aspectFill" />
<text>消息</text>
<text>{{message_total}}</text>
</navigator>
</view>
</view>
<!-- 导航 -->
<view class="nav-box bg-white">
<block tt:for="{{nav_lists}}" tt:key="key">
<navigator url="/pages/{{item.url}}/{{item.url}}" class="nav-item br-b" hover-class="none">
<block tt:for="{{navigation}}" tt:key="ckey">
<!-- 主导航 -->
<view data-value="{{item.event_value}}" data-type="{{item.event_type}}" bindtap="navigation_event" class="nav-item br-b" >
<view class="arrow-right">
<image src="/images/{{item.icon}}.png" class="item-icon" mode="widthFix" />
<image src="{{item.images_url}}" class="item-icon" mode="widthFix" />
<text class="item-name">{{item.name}}</text>
<text tt:if="{{(item.desc || null) != null}}" class="item-desc fr tr single-text cr-ccc">{{item.desc}}</text>
</view>
</navigator>
<view tt:if="{{item.url == 'user-order' && user_order_status_list.length > 0}}" class="items-list br-b oh">
</view>
<!-- 订单自定义副导航 -->
<view tt:if="{{item.event_value == '/pages/user-order/user-order' && user_order_status_list.length > 0}}" class="items-list br-b oh">
<block tt:for="{{user_order_status_list}}" tt:key="key" tt:for-item="items">
<navigator url="{{items.url}}" hover-class="none">
<view class="items fl tc">
@ -49,17 +55,6 @@
</view>
</block>
<!-- 远程自定义导航 -->
<block tt:for="{{navigation}}" tt:key="ckey">
<view data-value="{{item.event_value}}" data-type="{{item.event_type}}" bindtap="navigation_event" class="nav-item br-b" >
<view class="arrow-right">
<image src="{{item.images_url}}" class="item-icon" mode="widthFix" />
<text class="item-name">{{item.name}}</text>
<text tt:if="{{(item.desc || null) != null}}" class="item-desc fr tr single-text cr-ccc">{{item.desc}}</text>
</view>
</view>
</block>
<view class="nav-item br-b" bindtap="clear_storage">
<image src="/images/user-nav-cache-icon.png" class="item-icon" mode="widthFix" />
<text class="item-name">清除缓存</text>

View File

@ -3,6 +3,9 @@
padding-top: 30rpx;
font-size: 24rpx;
}
.head-item {
padding-bottom: 30rpx;
}
.head-item .avatar {
width: 160rpx;
height: 160rpx;
@ -21,7 +24,6 @@
.head-nav {
padding: 5px 0;
background: rgba(0,0,0,0.1);
margin-top: 30rpx;
}
.head-nav-item {
width: 25%;

View File

@ -66,7 +66,7 @@ App({
// 请求地址
request_url: "{{request_url}}",
// request_url: 'http://tp5-dev.com/',
request_url: 'http://tp5-dev.com/',
// request_url: 'https://test.shopxo.net/',
// 基础信息
@ -514,6 +514,13 @@ App({
}
}
return json;
}
},
// 拨打电话
call_tel(value) {
if ((value || null) != null) {
wx.makePhoneCall({ phoneNumber: value });
}
},
});

View File

@ -9,6 +9,11 @@ Page({
total_price: '0.00',
is_selected_all: false,
buy_submit_disabled_status: true,
// 是否展示型
common_is_exhibition_mode: 0,
common_is_exhibition_mode_btn_text: null,
customer_service_tel: null,
},
onShow() {
@ -63,16 +68,18 @@ Page({
wx.stopPullDownRefresh();
if (res.data.code == 0) {
var data = res.data.data;
if (data.length > 0) {
for (var i in data) {
data[i]['right'] = [{ type: 'edit', text: '加入收藏' }, { type: 'delete', text: '删除' }];
}
}
// 数据赋值
this.setData({
data_list: data,
data_list_loding_status: data.length == 0 ? 0 : 3,
data_list: data.data,
data_list_loding_status: data.data.length == 0 ? 0 : 3,
data_bottom_line_status: true,
data_list_loding_msg: '购物车空空如也',
// 是否展示型
common_is_exhibition_mode: data.common_is_exhibition_mode || 0,
common_is_exhibition_mode_btn_text: data.common_is_exhibition_mode_btn_text || '立即咨询',
customer_service_tel: data.customer_service_tel || null,
});
} else {
this.setData({
@ -289,9 +296,13 @@ Page({
// 选中计算
selected_calculate() {
var total_price = 0;
var data_count = 0;
var selected_count = 0;
var temp_data_list = this.data.data_list;
for (var i in temp_data_list) {
if ((temp_data_list[i]['is_error'] || 0) == 0) {
data_count++;
}
if ((temp_data_list[i]['selected'] || false) == true) {
total_price += temp_data_list[i]['stock'] * temp_data_list[i]['price'];
selected_count++;
@ -301,7 +312,7 @@ Page({
this.setData({
total_price: total_price.toFixed(2),
buy_submit_disabled_status: (selected_count <= 0),
is_selected_all: (selected_count >= temp_data_list.length),
is_selected_all: (selected_count >= data_count),
});
},
@ -330,6 +341,11 @@ Page({
wx.navigateTo({
url: '/pages/buy/buy?data=' + JSON.stringify(data)
});
}
},
// 展示型事件
exhibition_submit_event(e) {
app.call_tel(this.data.customer_service_tel);
},
});

View File

@ -1,7 +1,7 @@
<view wx:if="{{data_list.length > 0}}" class="page">
<view wx:for="{{data_list}}" wx:key="key" class="goods-item oh bg-white">
<view wx:for="{{data_list}}" wx:key="key" class="goods-item oh bg-white {{common_is_exhibition_mode == 1 ? 'exhibition-mode-data' : ''}}">
<!-- 选择 -->
<view bindtap="selectedt_event" data-type="node" data-index="{{index}}" class="fl selected">
<view wx:if="{{common_is_exhibition_mode != 1}}" bindtap="selectedt_event" data-type="node" data-index="{{index}}" class="fl selected">
<image class="icon" src="/images/default-select{{(item.is_error || 0) == 1 ? '-disabled' : ((item.selected || false) ? '-active' : '')}}-icon.png" mode="widthFix" />
</view>
@ -43,20 +43,29 @@
<!-- 操作导航 -->
<view wx:if="{{data_list.length > 0}}" class="buy-nav oh wh-auto br-t">
<view class="nav-base bg-white fl single-text">
<view bindtap="selectedt_event" data-type="all" class="fl selected">
<image wx:if="{{is_selected_all}}" class="icon" src="/images/default-select-active-icon.png" mode="widthFix" />
<image wx:else class="icon" src="/images/default-select-icon.png" mode="widthFix" />
<text>全选</text>
<!-- 展示型 -->
<block wx:if="{{common_is_exhibition_mode == 1}}">
<view class="exhibition-mode">
<button class="bg-main wh-auto" type="default" bindtap="exhibition_submit_event" hover-class="none">{{common_is_exhibition_mode_btn_text}}</button>
</view>
<view class="fr price">
<view class="sales-price single-text fr">¥{{total_price}}</view>
<view class="fr">合计:</view>
</block>
<!-- 销售型 -->
<block wx:else>
<view class="nav-base bg-white fl single-text">
<view bindtap="selectedt_event" data-type="all" class="fl selected">
<image class="icon" src="/images/default-select{{is_selected_all ? '-active' : ''}}-icon.png" mode="widthFix" />
<text>全选</text>
</view>
<view class="fr price">
<view class="sales-price single-text fr">¥{{total_price}}</view>
<view class="fr">合计:</view>
</view>
</view>
</view>
<view class="fr nav-submit">
<button class="bg-main wh-auto" type="default" bindtap="buy_submit_event" disabled="{{buy_submit_disabled_status}}" hover-class="none">结算</button>
</view>
<view class="fr nav-submit">
<button class="bg-main wh-auto" type="default" bindtap="buy_submit_event" disabled="{{buy_submit_disabled_status}}" hover-class="none">结算</button>
</view>
</block>
</view>
</view>

View File

@ -1,7 +1,7 @@
/**
* 商品列表
*/
.page {
.page {
padding-bottom: 120rpx;
}
.goods-item {
@ -125,9 +125,6 @@
.nav-submit button {
border-radius: 0;
}
.page {
padding-bottom: 120rpx;
}
.selected .icon {
width: 50rpx;
height: 50rpx !important;
@ -139,4 +136,14 @@
}
.buy-nav .sales-price {
max-width: calc(100% - 40px);
}
/*
* 展示型
*/
.exhibition-mode {
padding: 0 10rpx;
}
.exhibition-mode-data .items {
padding-left: 0;
}

View File

@ -65,6 +65,10 @@ Page({
// 购物车快捷导航
quick_nav_cart_count: 0,
// 是否展示型
common_is_exhibition_mode: 0,
customer_service_tel: null,
},
onLoad(params) {
@ -127,10 +131,8 @@ Page({
temp_buy_number: data.goods.buy_min_number || 1,
goods_favor_text: (data.goods.is_favor == 1) ? '已收藏' : '收藏',
goods_favor_icon: '/images/goods-detail-favor-icon-' + data.goods.is_favor+'.png',
nav_submit_text: ((data.common_order_is_booking || 0) == 0) ? '立即购买' : '立即预约',
data_bottom_line_status: true,
data_list_loding_status: 3,
nav_submit_is_disabled: (data.goods.is_shelves == 1 && data.goods.inventory > 0) ? false : true,
goods_spec_base_price: data.goods.price,
goods_spec_base_original_price: data.goods.original_price,
@ -169,19 +171,32 @@ Page({
// 不能选择规格处理
this.goods_specifications_choose_handle_dont(0);
// 购买按钮处理
var nav_submit_text = ((data.common_order_is_booking || 0) == 0) ? '立即购买' : '立即预约';
var nav_submit_is_disabled = (data.goods.is_shelves == 1 && data.goods.inventory > 0) ? false : true;
if (data.goods.is_shelves != 1) {
this.setData({
nav_submit_text: '商品已下架',
nav_submit_is_disabled: true,
});
nav_submit_text = '已下架';
nav_submit_is_disabled = true;
} else {
if(data.goods.inventory <= 0) {
this.setData({
nav_submit_text: '商品卖光了',
nav_submit_is_disabled: true,
});
nav_submit_text = '卖光了';
nav_submit_is_disabled = true;
}
}
// 是否展示型
var common_is_exhibition_mode = data.common_is_exhibition_mode || 0;
if (common_is_exhibition_mode == 1) {
nav_submit_text = data.common_is_exhibition_mode_btn_text || '立即咨询';
}
// 数据赋值
this.setData({
nav_submit_text: nav_submit_text,
nav_submit_is_disabled: nav_submit_is_disabled,
common_is_exhibition_mode: common_is_exhibition_mode,
customer_service_tel: data.customer_service_tel || null,
});
} else {
self.setData({
data_bottom_line_status: false,
@ -836,6 +851,11 @@ Page({
}
},
// 展示型事件
exhibition_submit_event(e) {
app.call_tel(this.data.customer_service_tel);
},
// 自定义分享
onShareAppMessage() {
var user = app.get_user_cache_info(this, 'goods_favor_event') || null;

View File

@ -129,9 +129,17 @@
<image src="{{goods_favor_icon}}" mode="scaleToFill" />
<text class="dis-block cr-888">{{goods_favor_text}}</text>
</view>
<view class="fr">
<button class="bg-warning fl" type="default" bindtap="cart_submit_event" hover-class="none" disabled="{{nav_submit_is_disabled}}">加入购物车</button>
<button class="bg-main fl" type="default" bindtap="buy_submit_event" hover-class="none" disabled="{{nav_submit_is_disabled}}">{{nav_submit_text}}</button>
<view class="fr {{common_is_exhibition_mode == 1 ? 'exhibition-mode' : ''}}">
<!-- 展示型 -->
<block wx:if="{{common_is_exhibition_mode == 1}}">
<button class="bg-main fl" type="default" bindtap="exhibition_submit_event" hover-class="none">{{nav_submit_text}}</button>
</block>
<!-- 销售型 -->
<block wx:else>
<button class="bg-warning fl" type="default" bindtap="cart_submit_event" hover-class="none" disabled="{{nav_submit_is_disabled}}">加入购物车</button>
<button class="bg-main fl" type="default" bindtap="buy_submit_event" hover-class="none" disabled="{{nav_submit_is_disabled}}">{{nav_submit_text}}</button>
</block>
</view>
</view>

View File

@ -337,4 +337,11 @@
position: absolute;
top: -5px;
left: calc(50% + 23rpx);
}
/*
* 展示型
*/
.goods-buy-nav .exhibition-mode button {
width: 100%;
}

View File

@ -19,18 +19,12 @@ Page({
{ name: "已完成", status: 4, count: 0, url: "/pages/user-order/user-order?status=4" },
{ name: "退款/售后", status: 101, count: 0, url: "/pages/user-orderaftersale/user-orderaftersale" },
],
nav_lists: [
{
url: "user-order",
icon: "user-nav-order-icon",
name: "我的订单",
}
],
// 远程自定义导航
navigation: [],
common_app_is_online_service: 0,
common_app_is_head_vice_nav: 0,
},
onShow() {
@ -110,6 +104,7 @@ Page({
head_nav_list: temp_head_nav_list,
navigation: data.navigation || [],
common_app_is_online_service: data.common_app_is_online_service || 0,
common_app_is_head_vice_nav: data.common_app_is_head_vice_nav || 0,
});
} else {
app.showToast(res.data.msg);
@ -134,7 +129,7 @@ Page({
{
app.showToast("客服电话有误");
} else {
wx.makePhoneCall({ phoneNumber: this.data.customer_service_tel });
app.call_tel(this.data.customer_service_tel);
}
},

View File

@ -1,40 +1,46 @@
<!-- 头部 -->
<view class="head-box bg-main">
<view class="head-item oh tc">
<image bindtap="preview_event" binderror="user_avatar_error" class="avatar" src="{{avatar}}" mode="widthFix" />
<text class="item-name dis-block cr-fff">{{nickname}}</text>
</view>
<view class="head-item oh tc">
<image bindtap="preview_event" binderror="user_avatar_error" class="avatar" src="{{avatar}}" mode="widthFix" />
<text class="item-name dis-block cr-fff">{{nickname}}</text>
</view>
<view wx:if="{{head_nav_list.length > 0}}" class="head-nav oh wh-auto">
<block wx:for="{{head_nav_list}}" wx:key="key">
<navigator url="/pages/{{item.url}}/{{item.url}}" hover-class="none">
<view class="head-nav-item tc fl">
<view>{{item.count}}</view>
<view>{{item.name}}</view>
</view>
</navigator>
</block>
</view>
<view class="message-nav">
<navigator url="/pages/message/message" hover-class="none">
<image src="/images/user-head-message-icon.png" mode="aspectFill" />
<text>消息</text>
<text>{{message_total}}</text>
<!-- 副导航 -->
<view wx:if="{{common_app_is_head_vice_nav == 1 && head_nav_list.length > 0}}" class="head-nav oh wh-auto">
<block wx:for="{{head_nav_list}}" wx:key="key">
<navigator url="/pages/{{item.url}}/{{item.url}}" hover-class="none">
<view class="head-nav-item tc fl">
<view>{{item.count}}</view>
<view>{{item.name}}</view>
</view>
</navigator>
</view>
</block>
</view>
<!-- 右上角 -->
<view class="message-nav">
<navigator url="/pages/message/message" hover-class="none">
<image src="/images/user-head-message-icon.png" mode="aspectFill" />
<text>消息</text>
<text>{{message_total}}</text>
</navigator>
</view>
</view>
<!-- 导航 -->
<view class="nav-box bg-white">
<block wx:for="{{nav_lists}}" wx:key="key">
<navigator url="/pages/{{item.url}}/{{item.url}}" class="nav-item br-b" hover-class="none">
<block wx:for="{{navigation}}" wx:key="ckey">
<!-- 主导航 -->
<view data-value="{{item.event_value}}" data-type="{{item.event_type}}" bindtap="navigation_event" class="nav-item br-b" >
<view class="arrow-right">
<image src="/images/{{item.icon}}.png" class="item-icon" mode="widthFix" />
<image src="{{item.images_url}}" class="item-icon" mode="widthFix" />
<text class="item-name">{{item.name}}</text>
<text wx:if="{{(item.desc || null) != null}}" class="item-desc fr tr single-text cr-ccc">{{item.desc}}</text>
</view>
</navigator>
<view wx:if="{{item.url == 'user-order' && user_order_status_list.length > 0}}" class="items-list br-b oh">
</view>
<!-- 订单自定义副导航 -->
<view wx:if="{{item.event_value == '/pages/user-order/user-order' && user_order_status_list.length > 0}}" class="items-list br-b oh">
<block wx:for="{{user_order_status_list}}" wx:key="key" wx:for-item="items">
<navigator url="{{items.url}}" hover-class="none">
<view class="items fl tc">
@ -49,17 +55,6 @@
</view>
</block>
<!-- 远程自定义导航 -->
<block wx:for="{{navigation}}" wx:key="ckey">
<view data-value="{{item.event_value}}" data-type="{{item.event_type}}" bindtap="navigation_event" class="nav-item br-b" >
<view class="arrow-right">
<image src="{{item.images_url}}" class="item-icon" mode="widthFix" />
<text class="item-name">{{item.name}}</text>
<text wx:if="{{(item.desc || null) != null}}" class="item-desc fr tr single-text cr-ccc">{{item.desc}}</text>
</view>
</view>
</block>
<view class="nav-item br-b" bindtap="clear_storage">
<image src="/images/user-nav-cache-icon.png" class="item-icon" mode="widthFix" />
<text class="item-name">清除缓存</text>

View File

@ -3,6 +3,9 @@
padding-top: 30rpx;
font-size: 24rpx;
}
.head-item {
padding-bottom: 30rpx;
}
.head-item .avatar {
width: 160rpx;
height: 160rpx;
@ -21,7 +24,6 @@
.head-nav {
padding: 5px 0;
background: rgba(0,0,0,0.1);
margin-top: 30rpx;
}
.head-nav-item {
width: 25%;

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB