页面diy

master
gongfuxiang 2024-09-27 20:18:34 +08:00
parent d6ac75e1c8
commit f62631eb11
8 changed files with 140 additions and 53 deletions

View File

@ -67,7 +67,7 @@
//
footer_height_value_event(value) {
this.setData({
footer_height_value: (value*2)+40
footer_height_value: (value*2)+20
});
this.$emit('footer-height', value);

View File

@ -2,7 +2,7 @@
<scroll-view :scroll-y="true" class="ht" @scroll="on_scroll_event">
<!-- 头部小程序兼容 -->
<view class="pr header">
<componentDiyHeader v-if="hackReset" :propValue="header_data.com_data"></componentDiyHeader>
<componentDiyHeader v-if="hack_reset" :propValue="header_data.com_data"></componentDiyHeader>
</view>
<view class="content flex-col" :style="'padding-top:' + temp_is_header_top ? temp_header_top : '0'">
<view v-for="(item, index) in tabs_data" :key="item.key">
@ -39,26 +39,34 @@
<componentDiyAuxiliaryBlank v-else-if="item.key == 'auxiliary-blank'" :propValue="item.com_data"></componentDiyAuxiliaryBlank>
</view>
</template>
<!-- diy底部卡槽 -->
<slot name="diy-bottom"></slot>
</template>
<template v-else>
<!-- goods九宫格数据 -->
<!-- 列表 -->
<!-- 商品九宫格列表 -->
<scroll-view :scroll-y="true" class="scroll-box" @scrolltolower="scroll_lower" lower-threshold="60">
<view v-if="goods_list.length > 0" class="padding-horizontal-main padding-top-main oh">
<component-goods-list :propData="{ style_type: goods_show_type_value, goods_list: goods_list, random: random_value }" :propLabel="plugins_label_data" :propCurrencySymbol="currency_symbol" :propIsCartParaCurve="true"></component-goods-list>
</view>
<view v-else>
<template v-else>
<!-- 提示信息 -->
<component-no-data :propStatus="goods_list_loding_status" :propMsg="goods_list_loding_msg"></component-no-data>
</view>
</template>
<!-- 结尾 -->
<component-bottom-line :propStatus="goods_bottom_line_status"></component-bottom-line>
</scroll-view>
</template>
</view>
<view v-if="is_show_footer == 1" class="footer">
<componentDiyFooter v-if="hackReset" :propValue="footer_data.com_data"></componentDiyFooter>
</view>
<!-- 当前diy页面底部菜单非公共底部菜单 -->
<block v-if="is_show_footer == 1">
<componentDiyFooter v-if="hack_reset" :propValue="footer_data.com_data" @footer-height="footer_height_value_event"></componentDiyFooter>
<view v-if="footer_height_value > 0" :style="'height:'+footer_height_value+'rpx;'"></view>
</block>
<!-- 底部卡槽 -->
<slot name="bottom"></slot>
</scroll-view>
</template>
@ -107,7 +115,7 @@
propDataId: {
type: [String, Number],
default: '',
},
}
},
components: {
componentDiyHeader,
@ -194,7 +202,10 @@
data_is_loading: 0,
// key
cache_key: app.globalData.data.cache_diy_data_key,
hackReset: false,
//
hack_reset: false,
//
footer_height_value: 0,
};
},
created() {
@ -209,7 +220,7 @@
init_config(status) {
if ((status || false) == true) {
// diy
var is_show_footer = this.propValue.header.com_data.content.bottom_navigation_show;
var is_show_footer = parseInt(this.propValue.header.com_data.content.bottom_navigation_show || 0) == 1;
var is_tabbar = app.globalData.is_tabbar_pages();
this.setData({
is_show_footer: is_show_footer && !is_tabbar,
@ -223,7 +234,7 @@
init() {
// tabs
this.setData({
hackReset: true,
hack_reset: true,
header_data: this.propValue.header,
footer_data: this.propValue.footer,
diy_data: this.propValue.diy_data,
@ -242,7 +253,7 @@
this.setData({
is_tabs_type: bool,
});
const new_params = {
let new_params = {
...params,
id: tabs_id,
};
@ -265,7 +276,7 @@
dataType: 'json',
success: (res) => {
//
const data = res.data.data.data;
let data = res.data.data.data;
if (res.data.code == 0) {
new_data = data?.config.diy_data || [];
uni.setStorageSync(this.cache_key + tabs_id, new_data);
@ -329,7 +340,7 @@
title: this.$t('common.loading_in_text'),
});
}
const new_data = {
let new_data = {
category_id: this.tabs_id,
page: this.goods_page,
};
@ -407,6 +418,8 @@
},
});
},
//
on_scroll_event(e) {
this.setData({
scroll_top: e.detail.scrollTop,
@ -430,6 +443,13 @@
}
// #endif
},
//
footer_height_value_event(value) {
this.setData({
footer_height_value: (value*2)+20
});
}
},
};
</script>

30
node_modules/jweixin-module/README.md generated vendored Normal file
View File

@ -0,0 +1,30 @@
# jweixin-module
微信JS-SDK
## 安装
### NPM
```shell
npm install jweixin-module --save
```
### UMD
```http
https://unpkg.com/jweixin-module/out/index.js
```
## 使用
```js
var jweixin = require('jweixin-module')
jweixin.ready(function(){
// TODO
});
```
## 完整API
>[微信JS-SDK说明文档](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141115)

1
node_modules/jweixin-module/lib/index.js generated vendored Normal file

File diff suppressed because one or more lines are too long

26
node_modules/jweixin-module/package.json generated vendored Normal file
View File

@ -0,0 +1,26 @@
{
"name": "jweixin-module",
"version": "1.6.0",
"description": "微信JS-SDK",
"main": "lib/index.js",
"scripts": {},
"repository": {
"type": "git",
"url": "git+https://github.com/zhetengbiji/jweixin-module.git"
},
"keywords": [
"wxjssdk",
"weixin",
"jweixin",
"wechat",
"jssdk",
"wx"
],
"author": "Shengqiang Guo",
"license": "ISC",
"bugs": {
"url": "https://github.com/zhetengbiji/jweixin-module/issues"
},
"homepage": "https://github.com/zhetengbiji/jweixin-module#readme",
"devDependencies": {}
}

View File

@ -1,18 +1,20 @@
<template>
<view :class="theme_view">
<view v-if="(data || null) != null">
<block v-if="(data || null) != null">
<!-- diy模块 -->
<componentDiy :propValue="data.config" :propDataId="data.id"></componentDiy>
<componentDiy :propValue="data.config" :propDataId="data.id">
<template slot="diy-bottom">
<!-- 结尾 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
<!-- 结尾 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
</view>
<view v-else>
<!-- 公共 -->
<component-common></component-common>
</template>
</componentDiy>
</block>
<block v-else>
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
</view>
<!-- 公共 -->
<component-common></component-common>
</block>
</view>
</template>
<script>

View File

@ -4,7 +4,18 @@
<!-- diy模式 -->
<block v-if="data_mode == 3">
<block v-if="data_list !== null">
<componentDiy :propValue="data_list.config" :propDataId="data_list.id"></componentDiy>
<componentDiy :propValue="data_list.config" :propDataId="data_list.id">
<template slot="diy-bottom">
<!-- 结尾 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
<!-- 版权信息 -->
<component-copyright></component-copyright>
<!-- 公共 -->
<component-common></component-common>
</template>
</componentDiy>
</block>
</block>
<!-- 自动和手动模式 -->
@ -264,41 +275,38 @@
</view>
</view>
</block>
<!-- 提示信息 -->
<block v-if="load_status == 0">
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg" propPage="home" :propIsHeader="true"></component-no-data>
</block>
</view>
<!-- 页面已加载 -->
<block v-if="load_status == 1">
<!-- 非diy模式 -->
<block v-if="data_mode != 3">
<!-- 结尾 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
<!-- 版权信息 -->
<component-copyright></component-copyright>
<!-- 页面已加载模式 -->
<block v-if="load_status == 1 && data_mode != 3">
<!-- 结尾 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
<!-- 在线客服 -->
<component-online-service :propIsNav="true" :propIsBar="true" :propIsGrayscale="plugins_mourning_data_is_app"></component-online-service>
<!-- 快捷导航 -->
<component-quick-nav :propIsNav="true" :propIsBar="true" :propIsGrayscale="plugins_mourning_data_is_app"></component-quick-nav>
<!-- 用户基础 -->
<component-user-base ref="user_base" :propIsGrayscale="plugins_mourning_data_is_app"></component-user-base>
<!-- app管理 -->
<component-app-admin ref="app_admin"></component-app-admin>
</block>
<!-- 版权信息 -->
<component-copyright></component-copyright>
<!-- 在线客服 -->
<component-online-service :propIsNav="true" :propIsBar="true" :propIsGrayscale="plugins_mourning_data_is_app"></component-online-service>
<!-- 快捷导航 -->
<component-quick-nav :propIsNav="true" :propIsBar="true" :propIsGrayscale="plugins_mourning_data_is_app"></component-quick-nav>
<!-- 用户基础 -->
<component-user-base ref="user_base" :propIsGrayscale="plugins_mourning_data_is_app"></component-user-base>
<!-- app管理 -->
<component-app-admin ref="app_admin"></component-app-admin>
<!-- 公共 -->
<component-common></component-common>
</block>
<!-- 公共 -->
<component-common :propIsFooterSeat="false"></component-common>
</view>
</template>
<script>
const app = getApp();
import componentCommon from '@/components/common/common';

View File

@ -185,7 +185,7 @@
});
});
// #endif
},
},
// H5css sticky
// sticky
checkCssStickyForH5() {