修改轮播处理

master
于肖磊 2024-10-23 16:59:43 +08:00
parent 5db27b891f
commit 985182deb7
2 changed files with 178 additions and 407 deletions

561
App.vue
View File

@ -7,12 +7,10 @@
data: {
//
//
request_url: 'http://shopxo.com/',
// request_url:'https://new.shopxo.vip/',
request_url: 'https://d1.shopxo.vip/',
// publicpublichttps://d1.shopxo.vip/public/
static_url: 'http://shopxo.com/',
// static_url:'https://new.shopxo.vip/',
static_url: 'https://d1.shopxo.vip/',
// default
system_type: 'default',
@ -25,10 +23,10 @@
application_logo: '',
// : v1.0.0
version: 'v6.3',
version: 'v6.2',
// app: v1.0.0 20180118
app_version_info: 'v6.3 20241022',
app_version_info: 'v6.2 20240704',
//
currency_symbol: '¥',
@ -50,18 +48,10 @@
// 2.lang
default_language: 'zh',
// tabbar
system_tabbar: [
'/pages/index/index',
'/pages/goods-category/goods-category',
'/pages/cart/cart',
'/pages/user/user'
],
// tabbar
tabbar_pages: ['/pages/index/index', '/pages/goods-category/goods-category', '/pages/cart/cart', '/pages/user/user'],
//
// 使0, 1
is_use_native_tabbar: 0,
// 使0, 1
is_share_use_image: 1,
@ -95,8 +85,9 @@
// 0, 1
is_distribution_map_force_location: 0,
// 0, 1
// 0, 1
is_weixin_privacy_setting: 1,
weixin_privacy_setting_timer: null,
// 0, 1
get_user_location_status: 0,
@ -112,7 +103,7 @@
is_home_logo_use_text: 0,
// 0, 1logo
is_home_location_choice: 1,
is_home_location_choice: 0,
// 0, 1
is_realstore_top_nav_back: 1,
@ -191,26 +182,6 @@
// key
cache_goods_data_key: 'cache_goods_data_key',
// key
cache_design_page_data_key: 'cache_design_page_data_key',
// key
cache_footer_active_key: 'cache_footer_active_key',
// diykey
cache_diy_data_key: 'cache_diy_data_key',
// diykey
cache_diy_page_data_key: 'cache_diy_page_data_key',
// apptabbar
cache_app_tabbar_height_key: 'cache_app_tabbar_height_key',
// apptabbar
cache_tabbar_badge_key: 'cache_tabbar_badge_key',
//
cache_search_history_key: 'cache_search_history_key',
//
default_user_head_src: '/static/images/common/user.png',
@ -224,7 +195,6 @@
//
common_data_init_status: 0,
common_data_init_timer: null,
common_data_init_back_timer: null,
//
network_type_page_record_timer: null,
//
@ -245,7 +215,7 @@
if ((params.scene || null) != null) {
params = this.url_params_to_json(decodeURIComponent(params.scene));
}
// idid使id
// id使id
if ((params['referrer'] || null) == null && cache_params != null && (cache_params.referrer || null) != null) {
params['referrer'] = cache_params.referrer;
}
@ -344,7 +314,6 @@
var token = user == null ? '' : user.token || '';
var uuid = this.request_uuid();
var client_value = this.application_client_type();
var client_brand = this.application_client_brand();
//
var params = this.get_launch_cache_info();
var referrer = params == null ? null : params.referrer || null;
@ -354,12 +323,10 @@
var user_location_params = (user_location || null) != null && (user_location.status || 0) == 1 ? '&user_lng=' + user_location.lng + '&user_lat=' + user_location.lat : '';
//
var lang = this.get_language_value();
//
var theme = this.get_theme_value();
//
var join = url.indexOf('?') == -1 ? '?' : '&';
return url + join + 'system_type=' + this.data.system_type + '&application=app&application_client_type=' + client_value + '&application_client_brand=' + client_brand + '&token=' + token + '&uuid=' + uuid + referrer_params + user_location_params + '&lang=' + lang+'&theme='+theme;
return url + join + 'system_type=' + this.data.system_type + '&application=app&application_client_type=' + client_value + '&token=' + token + '&uuid=' + uuid + referrer_params + user_location_params + '&lang=' + lang;
},
/**
@ -560,7 +527,7 @@
login_confirm_tips_modal(self, object, method, params) {
// tabbar
var page = self.current_page(false);
var is_tabbar = self.is_system_tabbar_pages('/'+page);
var is_tabbar = self.is_tabbar_pages('/'+page);
// tabbar
if(method == 'init' && !is_tabbar) {
uni.redirectTo({
@ -897,10 +864,7 @@
return s_x;
},
/**
* url主要部分
* url url地址
*/
// url
get_url_main_part(url) {
if (url.indexOf('?') == -1) {
var value = url;
@ -910,76 +874,24 @@
}
return value;
},
/**
* 底部菜单高度数据存储
* value 高度
*/
app_tabbar_height_save(value) {
uni.setStorageSync(this.data.cache_app_tabbar_height_key, value);
},
/**
* 底部菜单高度数据读取
*/
app_tabbar_height_value() {
return parseInt(uni.getStorageSync(this.data.cache_app_tabbar_height_key) || 0);
},
/**
* 底部菜单页面数tabbar
*/
app_tabbar_pages() {
var temp_tabbar = this.data.system_tabbar;
var app_tabber = this.get_config('app_tabber') || null;
if(app_tabber != null && (app_tabber.content || null) != null && (app_tabber.content.nav_content || null) != null) {
temp_tabbar = app_tabber.content.nav_content.map(function(v) {
if((v.link || null) != null && (v.link.page || null) != null) {
return v.link.page;
}
});
}
return temp_tabbar;
},
/**
* 当前地址是否存在底部菜单tabbar中
*/
is_tabbar_pages(url = null) {
var pages = (this.data.is_use_native_tabbar == 1) ? this.data.system_tabbar : this.app_tabbar_pages();
return this.is_tabbar_pages_handle(pages, url);
},
/**
* 当前地址是否存在系统tabbar中
*/
is_system_tabbar_pages(url = null) {
return this.is_tabbar_pages_handle(this.data.system_tabbar, url);
},
/**
* 当前地址是否存在tabbar中
* pages tabbar页面
* url url地址
*/
is_tabbar_pages_handle(pages, url = null) {
var value = (url == null) ? '/'+this.current_page() : url;
is_tabbar_pages(url) {
var value = this.get_url_main_part(url);
if ((value || null) == null) {
return false;
}
if(pages.indexOf(value) != -1) {
return true;
var temp_tabbar_pages = this.data.tabbar_pages;
for (var i in temp_tabbar_pages) {
if (temp_tabbar_pages[i] == value) {
return true;
}
}
return false;
},
//
system_hide_tabbar() {
if(this.data.is_use_native_tabbar != 1) {
uni.hideTabBar();
}
},
/**
* 事件操作
*/
@ -994,7 +906,7 @@
break;
//
case 1:
if (this.is_system_tabbar_pages(value)) {
if (this.is_tabbar_pages(value)) {
var temp = value.split('?');
if (temp.length > 1 && (temp[1] || null) != null) {
value = temp[0];
@ -1002,13 +914,11 @@
uni.setStorageSync(this.data.cache_page_tabbar_switch_params, query);
}
uni.switchTab({
url: value
url: value,
});
//tabbar
this.system_hide_tabbar();
} else {
uni.navigateTo({
url: value
url: value,
});
}
break;
@ -1168,50 +1078,41 @@
},
/**
* 读取底部导航badge
* type 类型标识如购物车 cart
* 设置导航reddot
* index tabBar 的哪一项从左边算起0开始
* type 0 移出, 1 添加 默认 0 移出
*/
get_tab_bar_badge(type) {
if ((type || null) != null) {
return uni.getStorageSync(this.data.cache_tabbar_badge_key+'-'+type) || null;
set_tab_bar_reddot(index, type) {
if (index !== undefined && index !== null) {
if ((type || 0) == 0) {
uni.hideTabBarRedDot({
index: Number(index),
});
} else {
uni.showTabBarRedDot({
index: Number(index),
});
}
}
return null;
},
/**
* 设置底部导航badge
* type 类型标识如购物车 cart
* value 显示的文本超过 4 个字符则显示成 ...type参数为1的情况下有效
* 设置导航车badge
* index tabBar 的哪一项从左边算起0开始
* type 0 移出, 1 添加 默认 0 移出
* value 显示的文本超过 4 个字符则显示成 ...type参数为1的情况下有效
*/
set_tab_bar_badge(type, value = 0) {
// 使
if(this.data.is_use_native_tabbar == 1) {
if(type == 'cart') {
if ((value || 0) == 0) {
uni.removeTabBarBadge({
index: 2
});
} else {
uni.setTabBarBadge({
index: 2,
text: value.toString()
});
}
}
} else {
//
if ((type || null) != null) {
var key = this.data.cache_tabbar_badge_key+'-'+type;
if ((value || null) == null) {
uni.removeStorageSync(key);
} else {
uni.setStorageSync(key, value);
}
}
//
var obj = this.get_page_object() || null;
if(obj != null && (obj.$vm || null) != null && (obj.$vm.$refs || null) != null && (obj.$vm.$refs.common || null) != null) {
obj.$vm.$refs.common.footer_init();
set_tab_bar_badge(index, type, value) {
if (index !== undefined && index !== null) {
if ((type || 0) == 0) {
uni.removeTabBarBadge({
index: Number(index),
});
} else {
uni.setTabBarBadge({
index: Number(index),
text: value.toString(),
});
}
}
},
@ -1220,13 +1121,13 @@
page_share_handle(share = null) {
//
var pages = getCurrentPages();
var obj = pages[pages.length - 1] || null;
var obj = pages[pages.length - 1];
//
if ((share || null) == null) {
share = {};
}
//
if (obj != null && Object.keys(share).length <= 0) {
if (Object.keys(share).length <= 0) {
share = obj.share_info || {};
}
//
@ -1324,35 +1225,6 @@
});
// #endif
},
/**
* 数据可指定key和默认值
* data 数据
* key 数据key支持多级读取 . 分割key名称
* default_value 默认值
*/
get_key_data(data, key, default_value = null) {
var value = default_value;
if ((data || null) != null) {
var arr = key.split('.');
if (arr.length == 1) {
if(data[key] != undefined) {
value = data[key];
}
} else {
value = data;
for (var i in arr) {
if (value[arr[i]] != undefined) {
value = value[arr[i]];
} else {
value = default_value;
break;
}
}
}
}
return value;
},
/**
* 获取配置信息可指定key和默认值
@ -1485,24 +1357,15 @@
* 配置是否有效(100毫秒检验一次最多检验100次)
* object 回调操作对象
* method 回调操作对象的函数
* params 回调操请求参数
*/
is_config(object, method, params) {
is_config(object, method) {
var self = this;
var count = 0;
var is_config_count = 0;
var timer = setInterval(function () {
if (self.get_config('status') == 1) {
clearInterval(timer);
if (typeof object === 'object' && (method || null) != null) {
object[method](true, params);
}
} else {
//
if(is_config_count < 1 && self.data.common_data_init_status == 1) {
is_config_count++;
self.data.common_data_init_status = 0;
self.init_config();
object[method](true);
}
}
count++;
@ -1632,30 +1495,19 @@
//
url_event(e) {
if((e.currentTarget || null) != null && (e.currentTarget.dataset || null) != null) {
// url
var value = e.currentTarget.dataset.value || null;
// url
var value = e.currentTarget.dataset.value || null;
//
if (this.data.is_forbid_to_goods_detail == 1 && value.indexOf('/pages/goods-detail/goods-detail') != -1) {
return false;
}
//
var is_redirect = parseInt(e.currentTarget.dataset.redirect || 0) == 1;
//
var tabbar = this.app_tabbar_pages();
if(tabbar.indexOf(value) != -1 && this.data.system_tabbar.indexOf(value) == -1) {
var page = this.prev_page();
if(page != null && this.data.system_tabbar.indexOf(page) == -1) {
is_redirect = true;
}
}
// url
this.url_open(value, is_redirect);
//
if (this.data.is_forbid_to_goods_detail == 1 && value.indexOf('/pages/goods-detail/goods-detail') != -1) {
return false;
}
//
var is_redirect = parseInt(e.currentTarget.dataset.redirect || 0) == 1;
// url
this.url_open(value, is_redirect);
},
// url
@ -1688,41 +1540,29 @@
}
// #endif
// web
if (this.is_url(value)) {
// web
this.open_web_view(value, is_redirect);
//
} else if (value.substr(0, 8) == 'appid://') {
// appid|/pages/index/index?pv=hello|extraData|envVersion
var values = value.substr(8).split('|');
uni.navigateToMiniProgram({
appId: values[0],
path: values[1] || '',
extraData: values[2] || '',
envVersion: values[3] || 'release'
});
} else if (value.substr(0, 12) == 'shortlink://') {
//
uni.navigateToMiniProgram({
shortLink: value.substr(12)
appId: value.substr(8),
});
//
} else if (value.substr(0, 6) == 'map://') {
// ||lng|lat
var values = value.substr(6).split('|');
if (values.length != 4) {
this.showToast(i18n.t('shopxo-uniapp.app.5y1c52'));
return false;
}
this.open_location(values[2], values[3], values[0], values[1]);
} else if (value.substr(0, 6) == 'tel://') {
//
} else if (value.substr(0, 6) == 'tel://') {
this.call_tel(value.substr(6));
} else if (value.substr(0, 7) == 'scan://') {
//
this.scan_handle();
} else {
//
} else {
if (this.is_page(value)) {
if (this.is_system_tabbar_pages(value)) {
if (this.is_tabbar_pages(value)) {
var temp = value.split('?');
if (temp.length > 1 && (temp[1] || null) != null) {
value = temp[0];
@ -1730,18 +1570,16 @@
uni.setStorageSync(this.data.cache_page_tabbar_switch_params, query);
}
uni.switchTab({
url: value
url: value,
});
//tabbar
this.system_hide_tabbar();
} else {
if (is_redirect) {
uni.redirectTo({
url: value
url: value,
});
} else {
uni.navigateTo({
url: value
url: value,
});
}
}
@ -1874,12 +1712,6 @@
return value;
},
// app
application_client_brand(e) {
var value = this.get_system_info('brand', null, true);
return (value === null) ? '' : value.toLowerCase();
},
//
auth_check(object, method, scope, msg) {
var self = this;
@ -1945,7 +1777,7 @@
url = this.page_url_protocol(url);
// #endif
// #ifdef H5
url = window.location.href;
var url = window.location.href;
// #endif
if (is_whole == false) {
var temp = url.split('?');
@ -1981,7 +1813,7 @@
},
// webopenid
is_user_weixin_web_openid(order_ids, payment_id = 0, page = null) {
is_user_weixin_web_openid(order_ids, payment_id = 0) {
// web_openid
if (this.is_weixin_env()) {
var web_openid = this.get_user_cache_info('weixin_web_openid') || null;
@ -2016,7 +1848,7 @@
order_ids: typeof order_ids == 'array' ? order_ids.join(',') : order_ids,
payment_id: payment_id,
});
var page_url = (page || null) == null ? this.get_page_url() : this.page_url_protocol(page);
var page_url = this.get_page_url();
page_url += page_url.indexOf('?') == -1 ? '?' : '&';
page_url += 'is_weixin_auth_web_openid=1';
var request_url = encodeURIComponent(base64.encode(page_url));
@ -2084,7 +1916,7 @@
var result = {
title: data.title || share_config.title || this.get_application_title(),
desc: data.desc || share_config.desc || this.get_application_describe(),
path: data.path || this.app_tabbar_pages()[0],
path: data.path || this.data.tabbar_pages[0],
query: this.share_query_handle(data.query || ''),
img: data.img || share_config.pic || this.get_application_logo_square(),
};
@ -2092,7 +1924,7 @@
// #ifdef H5 || APP
// url#
if(this.is_url(result['url'])) {
result['url'] = this.page_url_protocol(result.url.split('#')[0] + '#' + ((result.path || null) != null && result.path.substr(0, 1) == '/' ? '' : '/') + (result.path || '') + (result.query || ''));
result['url'] = this.page_url_protocol(result.url.split('#')[0] + '#' + (result.path.substr(0, 1) == '/' ? '' : '/') + result.path + result.query);
}
// #endif
return result;
@ -2120,19 +1952,15 @@
},
//
get_page_object(page = null) {
get_page_object(page) {
var result = [];
var pages = getCurrentPages();
if(page == null) {
return pages[pages.length - 1];
} else {
var result = [];
for (var i = 0; i < pages.length; i++) {
if (pages[i]['route'] == page) {
result.push(pages[i]);
}
for (var i = 0; i < pages.length; i++) {
if (pages[i]['route'] == page) {
result.push(pages[i]);
}
return result;
}
return result;
},
//
@ -2164,7 +1992,9 @@
page_back_prev_event() {
var prev_page = this.prev_page();
if (prev_page == null) {
this.url_open(this.app_tabbar_pages()[0]);
uni.switchTab({
url: this.data.tabbar_pages[0],
});
} else {
uni.navigateBack();
}
@ -2175,14 +2005,6 @@
if ((page || null) == null) {
return '';
}
//
if((page.$page || null) != null && (page.$page.fullPath || null) != null) {
var path = page.$page.fullPath;
return path.substr(0, 1) == '/' ? path.substr(1) : path;
}
//
var route = page.route;
var options = page.options || {};
var query = '';
@ -2468,6 +2290,30 @@
}
},
//
weixin_privacy_setting() {
if (this.data.is_weixin_privacy_setting == 1) {
var self = this;
self.weixin_privacy_setting_timer = setInterval(function () {
var page = self.get_page_url(false);
if ('/' + page == self.data.tabbar_pages[0]) {
uni.getPrivacySetting({
success: (res) => {
if (res.needAuthorization) {
//
uni.navigateTo({
url: '/pages/common/agreement/agreement',
});
}
},
});
//
clearInterval(self.weixin_privacy_setting_timer);
}
}, 100);
}
},
//
// is_light false, true
get_theme_color(theme, is_light = false) {
@ -2529,60 +2375,41 @@
//
set_tabbar(theme) {
if(this.data.is_use_native_tabbar == 1) {
//
if ((theme || null) == null) {
theme = this.get_theme_value();
}
//
uni.setTabBarStyle({
selectedColor: this.get_theme_color(theme),
color: '#333',
backgroundColor: '#fff',
borderStyle: 'black'
});
//
uni.setTabBarItem({
index: 0,
iconPath: 'static/images/common/tabbar/home.png',
selectedIconPath: 'static/images/' + theme + '/tabbar/home.png',
text: i18n.t('common.home'),
});
uni.setTabBarItem({
index: 1,
iconPath: 'static/images/common/tabbar/category.png',
selectedIconPath: 'static/images/' + theme + '/tabbar/category.png',
text: i18n.t('common.category'),
});
uni.setTabBarItem({
index: 2,
iconPath: 'static/images/common/tabbar/cart.png',
selectedIconPath: 'static/images/' + theme + '/tabbar/cart.png',
text: i18n.t('common.cart'),
});
uni.setTabBarItem({
index: 3,
iconPath: 'static/images/common/tabbar/user.png',
selectedIconPath: 'static/images/' + theme + '/tabbar/user.png',
text: i18n.t('common.my'),
});
//
if ((theme || null) == null) {
theme = this.get_theme_value();
}
},
//
group_arry(arry, sub_group_length) {
let index = 0;
let new_arry = [];
if (arry.length > sub_group_length) {
while (index < arry.length) {
new_arry.push(arry.slice(index, (index += sub_group_length)));
}
} else {
new_arry = [arry];
}
return new_arry;
//
uni.setTabBarStyle({
selectedColor: this.get_theme_color(theme),
});
//
uni.setTabBarItem({
index: 0,
iconPath: 'static/images/common/tabbar/home.png',
selectedIconPath: 'static/images/' + theme + '/tabbar/home.png',
text: i18n.t('common.home'),
});
uni.setTabBarItem({
index: 1,
iconPath: 'static/images/common/tabbar/category.png',
selectedIconPath: 'static/images/' + theme + '/tabbar/category.png',
text: i18n.t('common.category'),
});
uni.setTabBarItem({
index: 2,
iconPath: 'static/images/common/tabbar/cart.png',
selectedIconPath: 'static/images/' + theme + '/tabbar/cart.png',
text: i18n.t('common.cart'),
});
uni.setTabBarItem({
index: 3,
iconPath: 'static/images/common/tabbar/user.png',
selectedIconPath: 'static/images/' + theme + '/tabbar/user.png',
text: i18n.t('common.my'),
});
},
//
@ -2694,10 +2521,6 @@
//
scan_handle() {
// #ifdef H5
this.showToast(i18n.t('common.not_supported_scan_tips'));
// #endif
// #ifndef H5
var self = this;
uni.scanCode({
success: function (res) {
@ -2768,7 +2591,6 @@
}
},
});
// #endif
},
//
@ -2778,15 +2600,6 @@
//
choose_user_location_event() {
//
var key = this.data.cache_userlocation_key;
var result = uni.getStorageSync(key) || null;
if(result != null) {
result['status'] = 2;
uni.setStorageSync(key, result);
}
//
uni.navigateTo({
url: '/pages/common/open-setting-location/open-setting-location',
});
@ -2799,7 +2612,6 @@
//
choice_user_location_init() {
// status 0123
var result = uni.getStorageSync(this.data.cache_userlocation_key) || null;
var user_location = { status: 0 };
if (result != null) {
@ -2810,17 +2622,11 @@
address: result.address || null,
lat: result.latitude || null,
lng: result.longitude || null,
status: result.status || 1,
status: 1,
},
};
}
//
var default_name = i18n.t('shopxo-uniapp.app.4v6q86');
//
if(user_location.status == 3 && user_location.name != default_name) {
user_location.status = 1;
}
user_location['text'] = user_location.name || user_location.address || default_name;
user_location['text'] = user_location.status == 0 ? i18n.t('shopxo-uniapp.app.4v6q86') : (user_location.name || user_location.address || '');
return user_location;
},
@ -2896,8 +2702,6 @@
clear_interval_handle() {
//
clearInterval(this.data.common_data_init_timer);
//
clearInterval(this.data.common_data_init_back_timer);
//
var network = this.data.network_type_page_record_timer || null;
if (network != null) {
@ -2908,6 +2712,8 @@
}
}
this.data.network_type_page_record_timer = null;
//
clearInterval(this.data.weixin_privacy_setting_timer);
//
clearInterval(this.data.get_user_location_timer);
},
@ -2944,7 +2750,7 @@
'pages/plugins/ask/index/index',
];
// tab
if(this.is_system_tabbar_pages('/'+url) != -1 || pages_always.indexOf(url) != -1) {
if(this.data.tabbar_pages.indexOf('/'+url) != -1 || pages_always.indexOf(url) != -1) {
value = '';
}
}
@ -2958,7 +2764,7 @@
//
var value = i18n.t(key);
//
if(this.app_tabbar_pages()[0] == '/'+url) {
if(this.data.tabbar_pages[0] == '/'+url) {
value = this.get_application_title();
}
}
@ -2968,72 +2774,30 @@
});
},
//
set_navigation_bar_color(is_white = null) {
var color = '#000000';
var bg_color = '#ffffff';
var arr = [
'pages/index/index',
];
var page = this.current_page(false);
if(is_white === true || (is_white === null && arr.indexOf(page) != -1)) {
color = '#ffffff';
bg_color = '#000000';
}
uni.setNavigationBarColor({
frontColor: color,
backgroundColor: bg_color,
});
},
//
bottom_fixed_style_handle() {
var obj = this.get_page_object();
if(obj != null) {
// undefined
var temp = obj.bottom_fixed_style == undefined ? ((obj.data || null) == null ? undefined : obj.data.bottom_fixed_style) : '';
if(temp !== undefined && this.is_tabbar_pages()) {
obj.$vm.setData(
{
bottom_fixed_style: 'bottom:'+(((this.app_tabbar_height_value()-8)*2)+20)+'rpx'
});
}
}
},
//
page_event_onload_handle(params) {
//
this.set_tabbar();
//
this.get_user_location();
},
//
page_event_onshow_handle() {
//tabbar
this.system_hide_tabbar();
//
this.bottom_fixed_style_handle();
//
this.set_tabbar();
//
this.set_pages_navigation_bar_title();
//
this.set_navigation_bar_color();
},
},
//
onLaunch(params) {
//tabbar
this.globalData.system_hide_tabbar();
},
onLaunch(params) {},
//
onShow(params) {
//tabbar
this.globalData.system_hide_tabbar();
//
this.globalData.init_config();
@ -3048,6 +2812,11 @@
//
this.globalData.common_data_init_handle();
// #ifdef MP-WEIXIN
//
this.globalData.weixin_privacy_setting();
// #endif
},
//

View File

@ -6,10 +6,12 @@
<swiper-item v-for="(item, index) in new_list" :key="index">
<view class="flex-row align-c wt-auto ht-auto" :data-value="item.carousel_link.page" @tap="url_open">
<view class="swiper-item" :style="img_style" :class="['scale-defalt', { 'scale-1': animationData === index }]">
<imageEmpty :propImageSrc="item.carousel_img[0]" :propStyle="img_style" :propImgFit="img_fit" propErrorStyle="width: 100rpx;height: 100rpx;"></imageEmpty>
<view class="wh-auto ht-auto">
<imageEmpty :propImageSrc="item.carousel_img[0]" :propStyle="img_style" :propImgFit="img_fit" propErrorStyle="width: 100rpx;height: 100rpx;"></imageEmpty>
</view>
</view>
<view v-if="new_style.video_is_show == '1' && item.carousel_video.length > 0" :class="{ 'x-middle': new_style.video_location == 'center', 'right-0': new_style.video_location == 'flex-end' }" class="video-class pa oh" :style="{'bottom': new_style.video_bottom * 2 + 'rpx'}">
<view class="flex-row gap-10 align-c" :style="video_style" :data-value="item.carousel_video" @tap.stop="video_play">
<view class="flex-row gap-5 align-c" :style="video_style" :data-value="item.carousel_video" @tap.stop="video_play">
<block v-if="new_style.video_type == 'img'">
<view class="video_img">
<imageEmpty :propImageSrc="new_style.video_img[0]" propImgFit="aspectFill" propErrorStyle="width: 28rpx;height: 28rpx;"></imageEmpty>
@ -26,12 +28,12 @@
</block>
<block v-else>
<swiper-item v-for="(item, index) in new_list" :key="index">
<view class="wh-auto ht-auto" :style="['oneDragOne', 'twoDragOne'].includes(form.carousel_type) ? 'padding-right:' + new_style.image_spacing * 2 + 'rpx;' : ''" :data-value="item.carousel_link.page" @tap="url_open">
<view class="ht-auto" :style="['oneDragOne', 'twoDragOne'].includes(form.carousel_type) ? 'padding-right:' + new_style.image_spacing * 2 + 'rpx;' : ''" :data-value="item.carousel_link.page" @tap="url_open">
<view class="wh-auto ht-auto pr" :style="img_style">
<imageEmpty :propImageSrc="item.carousel_img[0]" :propStyle="img_style" :propImgFit="img_fit" propErrorStyle="width: 100rpx;height: 100rpx;"></imageEmpty>
</view>
<view v-if="new_style.video_is_show == '1' && item.carousel_video.length > 0" :class="{ 'x-middle': new_style.video_location == 'center', 'right-0': new_style.video_location == 'flex-end' }" class="video-class pa oh" :style="{'bottom': new_style.video_bottom * 2 + 'rpx'}">
<view class="flex-row gap-10 align-c" :style="video_style" :data-value="item.carousel_video" @tap.stop="video_play">
<view class="flex-row gap-5 align-c" :style="video_style" :data-value="item.carousel_video" @tap.stop="video_play">
<block v-if="new_style.video_type == 'img'">
<view class="video_img">
<imageEmpty :propImageSrc="new_style.video_img[0]" propImgFit="aspectFill" propErrorStyle="width: 28rpx;height: 28rpx;"></imageEmpty>
@ -173,21 +175,21 @@
});
//
if (new_form.carousel_type == 'card') {
this.$nextTick(() => {
// this.$nextTick(() => {
this.setData({
previousMargin: '82rpx',
nextMargin: '82rpx',
previousMargin: '41px',
nextMargin: '41px',
animationData: 0,
});
});
// });
} else if (new_form.carousel_type != 'inherit') {
//
this.$nextTick(() => {
// this.$nextTick(() => {
this.setData({
nextMargin: '100rpx',
nextMargin: '50px',
slides_per_group: new_form.carousel_type == 'twoDragOne' ? 2 : 1,
});
});
// });
}
// this.setData({
// hackReset: false,