兼容支付宝小程序样式
parent
c7570e341c
commit
c587a95f14
36
App.vue
36
App.vue
|
|
@ -1699,7 +1699,16 @@
|
|||
// url协议地址处理
|
||||
page_url_protocol(url) {
|
||||
if ((url || null) != null && !this.is_url(url)) {
|
||||
url = this.get_config('config.common_app_h5_url', '') + url;
|
||||
// 拼接H5地址
|
||||
var host = this.get_config('config.common_app_h5_url', '');
|
||||
// #ifdef H5
|
||||
if(host == '') {
|
||||
// H5模式下、未指定H5地址则获取当前host
|
||||
host = window.location.href.split('#')[0]+'#/';
|
||||
}
|
||||
// #endif
|
||||
// 处理中间拼接的斜杠是否重复
|
||||
url = (host + url).replace('#//', '#/');
|
||||
}
|
||||
return url;
|
||||
},
|
||||
|
|
@ -2529,14 +2538,25 @@
|
|||
|
||||
// 页面导航标题处理
|
||||
set_pages_navigation_bar_title() {
|
||||
var arr = [
|
||||
'pages/index/index',
|
||||
'pages/goods-category/goods-category',
|
||||
'pages/cart/cart',
|
||||
'pages/user/user',
|
||||
'pages/plugins/realstore/detail/detail'
|
||||
];
|
||||
// 当前页面地址
|
||||
var url = this.current_page(false);
|
||||
var arr = url.split('/');
|
||||
arr = arr.slice(1);
|
||||
arr = arr.slice(0, -1);
|
||||
var key = 'pages.'+arr.join('-');
|
||||
uni.setNavigationBarTitle({
|
||||
title: i18n.t(key),
|
||||
});
|
||||
// 不增加标题的页面
|
||||
if(arr.indexOf(url) == -1) {
|
||||
var arr = url.split('/');
|
||||
arr = arr.slice(1);
|
||||
arr = arr.slice(0, -1);
|
||||
var key = 'pages.'+arr.join('-');
|
||||
uni.setNavigationBarTitle({
|
||||
title: i18n.t(key),
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 页面加载事件处理
|
||||
|
|
|
|||
|
|
@ -2,17 +2,13 @@
|
|||
<view :class="theme_view">
|
||||
<view class="pa-w" :class="(propFixed ? 'pf z-i left-0 top-0 right-0' : '') + ' ' + propClass" :style="'padding-top:' + (status_bar_height > 0 ? status_bar_height + 5 : 0) + 'px;background-color:rgba(255,255,255,' + opacity + ');' + propStyle">
|
||||
<!-- 返回 -->
|
||||
<!-- #ifndef MP-ALIPAY -->
|
||||
<view v-if="(propName || null) != null || propIsRightSlot || propIsShowBack" class="nav-back padding-horizontal-main round va-m flex-row align-c" :class="(opacity > 0.3 ? 'cr-black ' : 'cr-white ') + (status_bar_height > 0 ? '' : 'padding-vertical-main')">
|
||||
<!-- #ifndef MP-ALIPAY -->
|
||||
<view v-if="(propName || null) != null" :class="'text-size-md tc pa left-0 right-0 padding-top-xs '+propNameClass" :style="propNameOpacity ? (opacity ? 'color:rgba(51,51,51,' + opacity + ')' : '') : ''">{{ propName }}</view>
|
||||
<iconfont v-if="propIsShowBack" name="icon-arrow-left" size="40rpx" @tap="top_nav_left_back_event" propClass="pr top-xs z-i" :color="propColor"></iconfont>
|
||||
<!-- #endif -->
|
||||
<slot v-if="propIsRightSlot" name="right"></slot>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-ALIPAY -->
|
||||
<view class="nav-back"></view>
|
||||
<!-- #endif -->
|
||||
|
||||
<slot name="content"></slot>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -89,7 +85,7 @@
|
|||
opacity: top,
|
||||
});
|
||||
});
|
||||
/* #endif */
|
||||
// #endif
|
||||
},
|
||||
methods: {
|
||||
top_nav_left_back_event() {
|
||||
|
|
|
|||
|
|
@ -113,11 +113,6 @@
|
|||
type: [Number, String],
|
||||
default: 0,
|
||||
},
|
||||
// 跳转第三方链接的重定向
|
||||
propNavStatusIndex: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
// 付款金额
|
||||
propPayPrice: {
|
||||
type: [Number, String],
|
||||
|
|
@ -311,10 +306,12 @@
|
|||
payment_id: payment_id || this.payment_id,
|
||||
};
|
||||
// h5自定义重定向地址
|
||||
// #ifdef H5
|
||||
post_data['redirect_url'] = encodeURIComponent(base64.encode(app.globalData.get_page_url(false) + (this.propNavStatusIndex > 0 ? '?status=' + this.propNavStatusIndex : '')));
|
||||
// paypal支付方式使用respond_url返回地址、移除重定向地址
|
||||
if (payment.payment == 'PayPal') {
|
||||
// #ifdef H5
|
||||
var redirect_url = app.globalData.page_url_protocol(this.propToAppointPage || app.globalData.get_page_url(false));
|
||||
post_data['redirect_url'] = encodeURIComponent(base64.encode(redirect_url));
|
||||
// 指定支付方式使用respond_url返回地址、移除重定向地址
|
||||
var respond_arr = ['PayPal', 'UniPayment'];
|
||||
if (respond_arr.indexOf(payment.payment) != -1) {
|
||||
post_data['respond_url'] = post_data['redirect_url'];
|
||||
delete post_data['redirect_url'];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -201,7 +201,8 @@
|
|||
font-size: 24rpx;
|
||||
padding: 0 32rpx 0 64rpx;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
background: transparent;
|
||||
}
|
||||
.search-content .search-btn {
|
||||
width: 106rpx;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,10 @@
|
|||
padding-top: calc(var(--status-bar-height) + 5px);
|
||||
}
|
||||
.home-top-nav {
|
||||
min-height: 56rpx;
|
||||
min-height: 56rpx;
|
||||
/* #ifdef MP-ALIPAY */
|
||||
padding-left: 60rpx;
|
||||
/* #endif */
|
||||
}
|
||||
.home-top-nav-location {
|
||||
max-width: calc(100% - 200rpx);
|
||||
|
|
@ -61,11 +64,6 @@
|
|||
z-index: 11;
|
||||
width: 100%;
|
||||
}
|
||||
.search-content-input {
|
||||
/* #ifdef MP-ALIPAY */
|
||||
padding-left: 60rpx;
|
||||
/* #endif */
|
||||
}
|
||||
.search-content-fixed-content {
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% auto;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,11 @@ page {
|
|||
/**
|
||||
* 头部内容
|
||||
*/
|
||||
.top-nav-search {
|
||||
/* #ifdef MP-ALIPAY */
|
||||
padding-left: 60rpx;
|
||||
/* #endif */
|
||||
}
|
||||
.header-content {
|
||||
margin-top: 20rpx;
|
||||
/* #ifdef MP-WEIXIN || MP-BAIDU || MP-QQ || MP-KUAISHOU */
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
<view class="header pr z-i">
|
||||
<component-nav-back :propIsShowBack="is_realstore_top_nav_back == 1" :propFixed="false" propColor="#333">
|
||||
<template slot="right" :class="is_mp_env ? 'top-search-width' : 'flex-1 flex-width'">
|
||||
<view :class="'va-m wh-auto '+(is_realstore_top_nav_back == 1 ? 'padding-left-main' : '')">
|
||||
<view :class="'va-m wh-auto top-nav-search '+(is_realstore_top_nav_back == 1 ? 'padding-left-main' : '')">
|
||||
<!-- #ifndef H5 -->
|
||||
<component-search
|
||||
@onsearch="search_button_event"
|
||||
|
|
@ -431,10 +431,12 @@
|
|||
},
|
||||
});
|
||||
|
||||
// #ifdef APP
|
||||
// 标题名称
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.info.name,
|
||||
});
|
||||
// #endif
|
||||
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
|
|
|
|||
Loading…
Reference in New Issue