1.测试优化
parent
75bdd43be4
commit
b874920695
|
|
@ -6,7 +6,7 @@
|
|||
<view class="hot-list flex-row flex-warp">
|
||||
<view v-for="(item, index) in items.data" :key="index" :class="items.data.length % 2 == 0 ? 'flex-width-half' : items.data.length === index + 1 ? 'wh-auto' : 'flex-width-half'">
|
||||
<view class="padding-horizontal-main">
|
||||
<view class="flex-row align-c margin-bottom-xs">
|
||||
<view class="flex-row align-c margin-bottom-xs" :data-value="item.url" @tap="url_event">
|
||||
<text class="text-size fw-b single-text">{{ item.title }}</text>
|
||||
<view class="hot-go margin-left-sm">
|
||||
<block v-if="(item.icon || null) !== null">
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<view :class="theme_view">
|
||||
<view :class="'popup ' + (propClassname || '') + ' ' + (propShow ? 'popup-show' : 'popup-hide') + ' ' + (propAnimation ? 'animation' : '')" :disable-scroll="propDisablescroll">
|
||||
<view class="popup-mask" :style="'z-index: ' + propIndex + ';'" v-if="propMask" @tap="on_mask_tap"></view>
|
||||
<view :class="'popup-content bottom-line-exclude popup-' + (propPosition || 'bottom') + ' ' + (propIsBar ? 'popup-bar' : '')" :style="position_style">
|
||||
<view :class="'popup-content popup-' + (propPosition || 'bottom') + ' ' + (propIsBar ? 'popup-bar' : '') + ' ' + (propPosition === 'bottom' ? 'bottom-line-exclude' : '')" :style="position_style">
|
||||
<slot></slot>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
|||
12
pages.json
12
pages.json
|
|
@ -1069,6 +1069,18 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pages/plugins/magic",
|
||||
"pages": [{
|
||||
"path": "detail/detail",
|
||||
"style": {
|
||||
"disableScroll": true,
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationBarTitleText": "魔方"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"globalStyle": {
|
||||
|
|
|
|||
|
|
@ -3,11 +3,14 @@
|
|||
<view :class="popup_status ? 'fixed-top' : ''">
|
||||
<view class="pr" :class="is_single_page == 1 ? 'margin-top-xxxl single-page-top' : ''">
|
||||
<view v-if="category_list.length > 0" class="goods-top-bg pa top-0 left-0 right-0 wh-auto oh">
|
||||
<image :src="theme_static_url + 'top-bg.png'" mode="scaleToFill" class="wh-auto"></image>
|
||||
<image :src="theme_static_url + 'top-bg.png'" mode="widthFix" class="wh-auto"></image>
|
||||
</view>
|
||||
<!-- 搜索框 -->
|
||||
<block v-if="is_single_page == 0">
|
||||
<view class="nav-search padding-horizontal-main pr" :style="'padding-top:' + (status_bar_height + 5) + 'px;'">
|
||||
<view class="goods-top-search-bg pa top-0 left-0 right-0 bottom-0 wh-auto oh">
|
||||
<image :src="theme_static_url + 'top-bg.png'" mode="widthFix" class="wh-auto"></image>
|
||||
</view>
|
||||
<block v-if="is_goods_category_search_alone == 1">
|
||||
<component-search propPlaceholder="输入商品名称搜索"></component-search>
|
||||
</block>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,154 @@
|
|||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="(data || null) != null">
|
||||
<view class="padding-horizontal-main padding-top-main">
|
||||
<!-- 推荐商品 -->
|
||||
<view v-if="(data.goods_list || null) != null && data.goods_list.length > 0">
|
||||
<view class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
|
||||
<view class="title-left">
|
||||
<text class="text-wrapper title-left-border">{{ data.title }}</text>
|
||||
<text class="vice-name margin-left-lg cr-grey">{{ data.describe }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<component-goods-list :propData="{ style_type: 1, goods_list: data.goods_list }" :propCurrencySymbol="currency_symbol"></component-goods-list>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data propStatus="0" propMsg="没有相关商品"></component-no-data>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentNoData from '../../../../components/no-data/no-data';
|
||||
import componentBottomLine from '../../../../components/bottom-line/bottom-line';
|
||||
import componentGoodsList from '../../../../components/goods-list/goods-list';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
currency_symbol: app.globalData.data.currency_symbol,
|
||||
params: null,
|
||||
user: null,
|
||||
data_base: null,
|
||||
data: null,
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentGoodsList,
|
||||
},
|
||||
props: {},
|
||||
|
||||
onLoad(params) {
|
||||
//params['id'] = 1;
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
|
||||
// 获取数据
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if ((status || false) == true) {
|
||||
this.setData({
|
||||
currency_symbol: app.globalData.get_config('currency_symbol'),
|
||||
});
|
||||
} else {
|
||||
app.globalData.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('detail', 'goods', 'magic'),
|
||||
method: 'POST',
|
||||
data: this.params,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
data: data.data || null,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: (data.data || null) != null && (data.data.goods_list || null) != null && data.data.goods_list.length > 0,
|
||||
});
|
||||
|
||||
if ((this.data || null) != null) {
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: this.data.title,
|
||||
desc: this.data.describe,
|
||||
path: '/pages/plugins/magic/detail/detail',
|
||||
query: 'id=' + this.params.id + '&ix=' + this.params.ix,
|
||||
},
|
||||
});
|
||||
// 标题
|
||||
if ((this.data.title || null) != null) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.data.title,
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle(this.share_info);
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: '网络开小差了哦~',
|
||||
});
|
||||
app.globalData.showToast('网络开小差了哦~');
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './detail.css';
|
||||
</style>
|
||||
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
.signin-opration-group {
|
||||
top: calc(156rpx + var(--status-bar-height) + 5px);
|
||||
right: -2rpx;
|
||||
}
|
||||
|
||||
.share,
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<component-nav-back></component-nav-back>
|
||||
<view v-if="(data || null) != null" class="pr signin-bg oh">
|
||||
<image :src="signin_static_url + 'signin-bg.png'" mode="widthFix" class="wh-auto"></image>
|
||||
<view class="signin-opration-group pa right-0 flex-col cr-white">
|
||||
<view class="signin-opration-group pa flex-col cr-white">
|
||||
<view v-if="(data_base.is_share || 0) == 1" class="share oh flex-row">
|
||||
<button type="default" class="content" @tap="share_event">
|
||||
<iconfont name="icon-qiandao-fenxiang" class="pr top-sm" size="32rpx"></iconfont>
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@
|
|||
speed: {
|
||||
// 默认1s滚动100px
|
||||
type: Number,
|
||||
default: 20
|
||||
default: 35
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
|
|
|
|||
Loading…
Reference in New Issue