| @@ -18,37 +18,5 @@ | |||||
| "scope.userLocation": { | "scope.userLocation": { | ||||
| "desc": "你的位置信息将用于小程序位置接口的效果展示" | "desc": "你的位置信息将用于小程序位置接口的效果展示" | ||||
| } | } | ||||
| }, | |||||
| "tabBar": { | |||||
| "color": "#7A7E83", | |||||
| "selectedColor": "#3cc51f", | |||||
| "borderStyle": "black", | |||||
| "backgroundColor": "#ffffff", | |||||
| "list": [ | |||||
| { | |||||
| "pagePath": "pages/show/show", | |||||
| "iconPath": "image/gwc1.png", | |||||
| "selectedIconPath": "image/gwc2.png", | |||||
| "text": "首页" | |||||
| }, | |||||
| { | |||||
| "pagePath": "pages/index/index", | |||||
| "iconPath": "image/gwc1.png", | |||||
| "selectedIconPath": "image/gwc2.png", | |||||
| "text": "分类" | |||||
| }, | |||||
| { | |||||
| "pagePath": "pages/index/index", | |||||
| "iconPath": "image/gwc1.png", | |||||
| "selectedIconPath": "image/gwc2.png", | |||||
| "text": "购物车" | |||||
| }, | |||||
| { | |||||
| "pagePath": "pages/index/index", | |||||
| "iconPath": "image/gwc1.png", | |||||
| "selectedIconPath": "image/gwc2.png", | |||||
| "text": "我的" | |||||
| } | |||||
| ] | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,35 +0,0 @@ | |||||
| // component/tabbar/tabbar.js | |||||
| let APP = getApp(); | |||||
| Component({ | |||||
| /** | |||||
| * 组件的属性列表 | |||||
| */ | |||||
| properties: { | |||||
| groupHomeCurrent:0, | |||||
| groupManageCartNum:0, | |||||
| isSHowZDYTabBar:true | |||||
| }, | |||||
| /** | |||||
| * 组件的初始数据 | |||||
| */ | |||||
| data: { | |||||
| isIphoneX: APP.globalData.isIphoneX, | |||||
| }, | |||||
| /** | |||||
| * 组件的方法列表 | |||||
| */ | |||||
| methods: { | |||||
| /** | |||||
| * 跳转板块 | |||||
| */ | |||||
| jumpToGroupPage(e){ | |||||
| wx.reLaunch({ | |||||
| url:'/pages/index/index', | |||||
| success(){}, | |||||
| fail(res){console.log(res);} | |||||
| }); | |||||
| } | |||||
| } | |||||
| }) | |||||
| @@ -1,7 +0,0 @@ | |||||
| { | |||||
| "component": true, | |||||
| "usingComponents": { | |||||
| "component-iphone-x-patcher":"/component/iPhoneXPatcher/iPhoneXPatcher" | |||||
| } | |||||
| } | |||||
| @@ -1,21 +0,0 @@ | |||||
| <!-- 自定义tabbar --> | |||||
| <view class="footer-container {{isIphoneX ? ' iphone-x-patcher-container' : ''}}" hidden="{{isSHowZDYTabBar}}" > | |||||
| <view class="footer-item-container f-home{{groupHomeCurrent == 0 ? ' active' : ''}}" catchtap="jumpToGroupPage" data-url="/pages/show/show"> | |||||
| <text class="nav-msg">首页</text> | |||||
| </view> | |||||
| <view class="footer-item-container f-cate{{groupHomeCurrent == 1 ? ' active' : ''}}" catchtap="jumpToGroupPage" data-url="/pages/index/index"> | |||||
| <text class="nav-msg">分类</text> | |||||
| </view> | |||||
| <view class="footer-item-container f-scan{{groupHomeCurrent == 2 ? ' active' : ''}}" catchtap="jumpToGroupPage" data-url="/pages/index/index" > | |||||
| <view class="scan-jump"></view> | |||||
| </view> | |||||
| <view class="footer-item-container f-cart{{groupHomeCurrent == 3 ? ' active' : ''}}" catchtap="jumpToGroupPage" data-url="/pages/index/index"> | |||||
| <text class="nav-msg">购物车</text> | |||||
| <text class="nav-cart-num" style="display: {{groupManageCartNum <= 0 ? 'none' : ''}};">{{groupManageCartNum}}</text> | |||||
| </view> | |||||
| <view class="footer-item-container f-user{{groupHomeCurrent == 4 ? ' active' : ''}}" catchtap="jumpToGroupPage" data-url="/pages/index/index"> | |||||
| <text class="nav-msg">我的</text> | |||||
| </view> | |||||
| <component-iphone-x-patcher></component-iphone-x-patcher> | |||||
| </view> | |||||
| @@ -1,96 +0,0 @@ | |||||
| .footer-container { | |||||
| position: fixed; | |||||
| left: 0; | |||||
| bottom: 0; | |||||
| width: 100%; | |||||
| background: #fff; | |||||
| display: flex; | |||||
| align-items: stretch; | |||||
| z-index: 9999; | |||||
| box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); | |||||
| } | |||||
| .footer-container .footer-item-container { | |||||
| flex: 1; | |||||
| height: 112rpx; | |||||
| padding: 80rpx 0 0; | |||||
| border-top: 1rpx solid #ededed; | |||||
| display: flex; | |||||
| justify-content: center; | |||||
| align-items: center; | |||||
| background: url("https://shgm.jjyyx.com/m/images/group/icon_home.png") no-repeat center 14rpx; | |||||
| background-size: 48rpx; | |||||
| position: relative; | |||||
| } | |||||
| .footer-container .footer-item-container.f-home.active { | |||||
| background: url("https://shgm.jjyyx.com/m/images/group/icon_home_active.png") no-repeat center 14rpx; | |||||
| background-size: 48rpx; | |||||
| } | |||||
| .footer-container .footer-item-container .nav-msg { | |||||
| font-size: 20rpx; | |||||
| color: var(--blueLight); | |||||
| line-height: 1; | |||||
| } | |||||
| .footer-container .footer-item-container.f-cate { | |||||
| background: url("https://shgm.jjyyx.com/m/images/group/icon_cate.png") no-repeat center 14rpx; | |||||
| background-size: 48rpx; | |||||
| } | |||||
| .footer-container .footer-item-container.f-cate.active { | |||||
| background: url("https://shgm.jjyyx.com/m/images/group/icon_cate_active.png") no-repeat center 14rpx; | |||||
| background-size: 48rpx; | |||||
| } | |||||
| .footer-container .footer-item-container.f-cart { | |||||
| background: url("https://shgm.jjyyx.com/m/images/group/icon_cart.png") no-repeat center 14rpx; | |||||
| background-size: 48rpx; | |||||
| } | |||||
| .footer-container .footer-item-container.f-cart.active { | |||||
| background: url("https://shgm.jjyyx.com/m/images/group/icon_cart_active.png") no-repeat center 14rpx; | |||||
| background-size: 48rpx; | |||||
| } | |||||
| .footer-container .footer-item-container.f-user.active { | |||||
| background: url("https://shgm.jjyyx.com/m/images/group/icon_user_active.png") no-repeat center 14rpx; | |||||
| background-size: 48rpx; | |||||
| } | |||||
| .footer-container .footer-item-container.f-user { | |||||
| background: url("https://shgm.jjyyx.com/m/images/group/icon_user.png") no-repeat center 14rpx; | |||||
| background-size: 48rpx; | |||||
| } | |||||
| .footer-container .footer-item-container .scan-jump{ | |||||
| position: absolute; | |||||
| top: -12rpx; | |||||
| left: 50%; | |||||
| transform: translateX(-50%); | |||||
| width: 112rpx; | |||||
| height: 112rpx; | |||||
| border-radius: 50%; | |||||
| background: var(--blue) url("https://shgm.jjyyx.com/m/images/group/icon_scan.png") no-repeat center center; | |||||
| background-size: 64rpx 64rpx; | |||||
| border: 6rpx solid var(--white); | |||||
| box-sizing: border-box; | |||||
| } | |||||
| .nav-cart-num{ | |||||
| position: absolute; | |||||
| top: 8rpx; | |||||
| left: 50%; | |||||
| margin-left: 24rpx; | |||||
| transform: translate3d(-50%, 0, 0) scale(.5); | |||||
| transform-origin: center top; | |||||
| min-width: 48rpx; | |||||
| padding: 24rpx 16rpx; | |||||
| font-size: 36rpx; | |||||
| text-align: center; | |||||
| line-height: 0rpx; | |||||
| border: 2rpx solid #fff; | |||||
| border-radius: 48rpx; | |||||
| background: #FF4752; | |||||
| color: #fff; | |||||
| } | |||||
| .footer-container.iphone-x-patcher-container { | |||||
| flex-wrap: wrap; | |||||
| height: auto; | |||||
| } | |||||
| @@ -1,315 +1,66 @@ | |||||
| import * as UTIL from '../../utils/util.js'; | |||||
| import * as API from '../../utils/API.js'; | |||||
| // pages/index/index.js | |||||
| Page({ | Page({ | ||||
| /** | |||||
| * 页面的初始数据 | |||||
| */ | |||||
| /** | |||||
| * 页面的初始数据 | |||||
| */ | |||||
| data: { | |||||
| data: { | |||||
| //底部自定义tabbar | |||||
| isSHowZDYTabBar: true, | |||||
| //底部弹框显示 | |||||
| showDownTS: true, | |||||
| //顶部胶囊按钮位置信息rect | |||||
| CustomMenuButton: null, | |||||
| BarMarginLeft: 0, | |||||
| BarWidth: 0, | |||||
| }, | |||||
| list: [], | |||||
| isIPhoneX:false | |||||
| }, | |||||
| /** | |||||
| * 计算bar 高度 | |||||
| */ | |||||
| computeBarLocation() { | |||||
| var that = this; | |||||
| let CustomMenuButton = wx.getMenuButtonBoundingClientRect(); | |||||
| let CustomMenuButton_margin_right = wx.getSystemInfoSync().windowWidth - CustomMenuButton.right; | |||||
| let bar_margin_left = CustomMenuButton_margin_right + CustomMenuButton.width; | |||||
| let bar_width = wx.getSystemInfoSync().windowWidth - CustomMenuButton_margin_right * 2 - CustomMenuButton.width * 2; | |||||
| console.log("bar宽:" + bar_width + ";窗口宽度" + wx.getSystemInfoSync().windowWidth); | |||||
| that.setData({ | |||||
| CustomMenuButton: CustomMenuButton, | |||||
| BarMarginLeft: bar_margin_left, | |||||
| BarWidth: bar_width | |||||
| }); | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面加载 | |||||
| */ | |||||
| onLoad: function (options) { | |||||
| /** | |||||
| * 生命周期函数--监听页面加载 | |||||
| */ | |||||
| onLoad: function (options) { | |||||
| let that = this; | |||||
| that.simulativeData(); | |||||
| that.computeBarLocation(); | |||||
| that.setData({ | |||||
| isIPhoneX:UTIL.isIPhoneX() | |||||
| }) | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面初次渲染完成 | |||||
| */ | |||||
| onReady: function () {}, | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面显示 | |||||
| */ | |||||
| onShow: function () {}, | |||||
| /** | |||||
| * 生命周期函数--监听页面初次渲染完成 | |||||
| */ | |||||
| onReady: function () { | |||||
| /** | |||||
| * 生命周期函数--监听页面隐藏 | |||||
| */ | |||||
| onHide: function () {}, | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面卸载 | |||||
| */ | |||||
| onUnload: function () {}, | |||||
| /** | |||||
| * 生命周期函数--监听页面显示 | |||||
| */ | |||||
| onShow: function () { | |||||
| /** | |||||
| * 页面相关事件处理函数--监听用户下拉动作 | |||||
| */ | |||||
| onPullDownRefresh: function () {}, | |||||
| }, | |||||
| /** | |||||
| * 页面上拉触底事件的处理函数 | |||||
| */ | |||||
| onReachBottom: function () {}, | |||||
| /** | |||||
| * 生命周期函数--监听页面隐藏 | |||||
| */ | |||||
| onHide: function () { | |||||
| /** | |||||
| * 用户点击右上角分享 | |||||
| */ | |||||
| onShareAppMessage: function () {}, | |||||
| }, | |||||
| onItemClickMethod: function (e) { | |||||
| var that = this; | |||||
| var num = parseInt(e.currentTarget.id); | |||||
| console.log(num) | |||||
| switch (num) { | |||||
| case 0: | |||||
| //更新机制 | |||||
| break; | |||||
| case 1: | |||||
| //网络访问 | |||||
| that.httpTestMethod(); | |||||
| break; | |||||
| case 4: | |||||
| //获取地理位置 | |||||
| that.getLocationInfo(); | |||||
| break; | |||||
| case 5: | |||||
| //全局loading | |||||
| that.showLoadingIcon(); | |||||
| break; | |||||
| case 6: | |||||
| that.showModalConentMethod(); | |||||
| break; | |||||
| case 7: | |||||
| that.showModalAllMethod(); | |||||
| break; | |||||
| case 8: | |||||
| that.showMoRenTab(); | |||||
| break; | |||||
| case 9: | |||||
| that.showZDYTab(); | |||||
| break; | |||||
| } | |||||
| }, | |||||
| /** | |||||
| * 默认tab | |||||
| */ | |||||
| showMoRenTab() { | |||||
| console.log('11111') | |||||
| wx.showTabBar({ | |||||
| animation: false, | |||||
| }) | |||||
| this.setData({ | |||||
| isSHowZDYTabBar: true | |||||
| }) | |||||
| } | |||||
| , | |||||
| /** | |||||
| * 自定义tab | |||||
| */ | |||||
| showZDYTab() { | |||||
| wx.hideTabBar({ | |||||
| animation: false, | |||||
| }) | |||||
| this.setData({ | |||||
| isSHowZDYTabBar: false | |||||
| }) | |||||
| } | |||||
| , | |||||
| /** | |||||
| * 获取地理位置 | |||||
| */ | |||||
| getLocationInfo() { | |||||
| UTIL.getLocationFromWX( | |||||
| { | |||||
| success: (res) => { | |||||
| UTIL.showToastNoneIcon("当前经纬度:" + getApp().globalData.setInfo.latitude + "," + getApp().globalData.setInfo.longitude) | |||||
| } | |||||
| , | |||||
| fail: (res) => { | |||||
| wx.navigateTo({ | |||||
| url: '/pages/wxAuth/wxAuth', | |||||
| }) | |||||
| /** | |||||
| * 生命周期函数--监听页面卸载 | |||||
| */ | |||||
| onUnload: function () { | |||||
| } | |||||
| } | |||||
| ); | |||||
| }, | |||||
| } | |||||
| /** | |||||
| * 页面相关事件处理函数--监听用户下拉动作 | |||||
| */ | |||||
| onPullDownRefresh: function () { | |||||
| , | |||||
| /** | |||||
| * loading小图标 | |||||
| */ | |||||
| showLoadingIcon() { | |||||
| }, | |||||
| UTIL.showLoadingHaveMask('数据加载中...'); | |||||
| setTimeout(function () { | |||||
| UTIL.hideLoadingHaveMask(); | |||||
| }, 2000) | |||||
| /** | |||||
| * 页面上拉触底事件的处理函数 | |||||
| */ | |||||
| onReachBottom: function () { | |||||
| } | |||||
| , | |||||
| /** | |||||
| * 显示提示框 | |||||
| */ | |||||
| showModalConentMethod() { | |||||
| UTIL.showModalNoneCancel('温馨提示', '这是一个按钮的弹框', '知道了'); | |||||
| }, | |||||
| }, | |||||
| /** | |||||
| * 显示完整提示框 并监听 | |||||
| */ | |||||
| showModalAllMethod() { | |||||
| UTIL.showModalOnClick('提示', '两个按钮并回调', 'OK', 'NO', | |||||
| { | |||||
| confirm() { | |||||
| UTIL.showToastNoneIcon('点击了OK'); | |||||
| /** | |||||
| * 用户点击右上角分享 | |||||
| */ | |||||
| onShareAppMessage: function () { | |||||
| } | |||||
| , | |||||
| cancel() { | |||||
| UTIL.showToastNoneIcon('点击了NO'); | |||||
| } | |||||
| }); | |||||
| } | |||||
| , | |||||
| //底部弹框允许 | |||||
| okOnClick(e) { | |||||
| console.log("底部弹框-允许"); | |||||
| UTIL.showToastNoneIcon("底部弹框-允许"); | |||||
| this.setData({ | |||||
| showDownTS: true | |||||
| }) | |||||
| }, | |||||
| /** | |||||
| * 底部弹框-黑色背景点击 | |||||
| */ | |||||
| blackOnClick() { | |||||
| this.setData({ | |||||
| showDownTS: true | |||||
| }) | |||||
| } | |||||
| , | |||||
| /** | |||||
| * 底部弹框拒绝 | |||||
| */ | |||||
| refuseOnClick() { | |||||
| console.log("底部弹框-拒绝"); | |||||
| UTIL.showToastNoneIcon("底部弹框-拒绝"); | |||||
| this.setData({ | |||||
| showDownTS: true | |||||
| }) | |||||
| }, | |||||
| bindgetUserProfile(e) { | |||||
| UTIL.getUserInfoFomWX({ | |||||
| success(res){ | |||||
| UTIL.showToastNoneIcon("获取到昵称:"+getApp().globalData.wxUserInfo.nickName); | |||||
| } | |||||
| }); | |||||
| } | |||||
| , | |||||
| /** | |||||
| * 网络访问 | |||||
| */ | |||||
| httpTestMethod() { | |||||
| let sendData = { | |||||
| centerShopId: 10000, | |||||
| centerWarehouseId: 10051, | |||||
| channel: 220, | |||||
| channelType: 22, | |||||
| memberId: 24892, | |||||
| rows: 40, | |||||
| shopId: 10005, | |||||
| token: "LWXAPP1636599316684iv6qkhyqhr4izg", | |||||
| v: 3, | |||||
| warehouseId: 10005 | |||||
| } | } | ||||
| UTIL.httpRequest(API.URL_ZB_RECOMMEND_LIST, sendData, | |||||
| { | |||||
| success: (res) => { | |||||
| if (res._code == API.SUCCESS_CODE) { | |||||
| UTIL.showToastNoneIcon("数据共:" + res._data.length + "条"); | |||||
| } else { | |||||
| UTIL.showToastNoneIcon(res._msg) | |||||
| } | |||||
| }, | |||||
| fail: (res) => { | |||||
| UTIL.showToastNoneIcon(API.MSG_FAIL_HTTP) | |||||
| }, | |||||
| complete: (res) => { | |||||
| } | |||||
| }); | |||||
| } | |||||
| , | |||||
| /** | |||||
| * 模拟数据 | |||||
| */ | |||||
| simulativeData() { | |||||
| let list = [ | |||||
| { | |||||
| title: '更新机制(已嵌入)', | |||||
| },{ | |||||
| title: '网络访问(点击获取)' | |||||
| },{ | |||||
| title: '自动申请微信地理授权(已嵌入)' | |||||
| },{ | |||||
| title: '获取微信OPenId(已嵌入)' | |||||
| },{ | |||||
| title: '获取微信地理位置(点击获取)', | |||||
| tapBtn: 'getLocationInfo' | |||||
| },{ | |||||
| title: 'loading小图标', | |||||
| tapBtn: 'showLoadingIcon' | |||||
| },{ | |||||
| title: 'Modal弹框仅提示', | |||||
| tapBtn: 'showModalConentMethod', | |||||
| },{ | |||||
| title: 'Modal两个按钮并监听', | |||||
| tapBtn: 'showModalAllMethod' | |||||
| },{ | |||||
| title: '底部导航效果(默认)', | |||||
| tapBtn: 'showMoRenTab' | |||||
| },{ | |||||
| title: '底部导航效果(自定义)', | |||||
| tapBtn: 'showZDYTab' | |||||
| } | |||||
| ]; | |||||
| this.setData({ | |||||
| list: list, | |||||
| }) | |||||
| } | |||||
| }) | }) | ||||
| @@ -1,6 +1,5 @@ | |||||
| { | { | ||||
| "usingComponents": { | "usingComponents": { | ||||
| "component-tabbar": "/component/tabbar/tabbar", | |||||
| "icon-loading":"/component/iconLoading/iconLoading" | "icon-loading":"/component/iconLoading/iconLoading" | ||||
| }, | }, | ||||
| "navigationStyle": "custom" | "navigationStyle": "custom" | ||||
| @@ -1,20 +1,7 @@ | |||||
| <view class="container"> | |||||
| <view style="background-color: white; position: sticky;top: 0; height:{{CustomMenuButton.bottom}}px;z-index: 7777;padding-top: {{CustomMenuButton.top}}px;"> | |||||
| <!--自定义 顶部标题样式和位置--> | |||||
| <view class="title singleLinHidenEllipsis" style="height:{{CustomMenuButton.height}}px;line-height:{{CustomMenuButton.height}}px;margin-left: {{BarMarginLeft}}px;width:{{BarWidth}}px;">悦团购</view> | |||||
| </view> | |||||
| <button class="ok_btn" bindtap="bindgetUserProfile">获取用户信息</button> | |||||
| <view class="container" style="background: url('../../image/login/container_bg.jpg') center center no-repeat; background-size: 100% auto;"> | |||||
| <view class="header"> | |||||
| <view class="principal">农村事项审批与记账</view> | |||||
| <view></view> | |||||
| </view> | |||||
| <view>设备是否有刘海屏:{{isIPhoneX}}</view> | |||||
| <scroll-view class="scroll_page"> | |||||
| <view class="page_content"> | |||||
| <block wx:for-items="{{list}}" wx:key="title"> | |||||
| <view class="list-item"> | |||||
| <view class="list-item-tv" bindtap="onItemClickMethod" id='{{index}}'>{{item.title}}</view> | |||||
| </view> | |||||
| </block> | |||||
| </view> | |||||
| </scroll-view> | |||||
| </view> | |||||
| <component-tabbar groupHomeCurrent="1" groupManageCartNum="{{groupManageCartNum}}" isSHowZDYTabBar="{{isSHowZDYTabBar}}"></component-tabbar> | |||||
| <icon-loading inner-text="Some text"></icon-loading> | |||||
| </view> | |||||
| @@ -1,196 +1,9 @@ | |||||
| @import '/template/bottomUserSQ/bottomUserSQ.wxss'; | |||||
| .scroll_page | |||||
| { | |||||
| height: 100vh; | |||||
| } | |||||
| .page_content | |||||
| { | |||||
| width: 100%; | |||||
| height: auto; | |||||
| display: block; | |||||
| } | |||||
| .list-item | |||||
| { | |||||
| height: 35px; | |||||
| } | |||||
| .list-item-tv | |||||
| { | |||||
| width: 80%; | |||||
| height: 100%; | |||||
| margin-left: 10%; | |||||
| } | |||||
| /* .black_bj | |||||
| { | |||||
| position:absolute; | |||||
| bottom: 0rpx; | |||||
| left: 0rpx; | |||||
| .container{ | |||||
| width: 100vw; | width: 100vw; | ||||
| height: 100vh; | |||||
| } | |||||
| .dialog_sq | |||||
| { | |||||
| position:absolute; | |||||
| bottom: 0rpx; | |||||
| left: 0rpx; | |||||
| background: white; | |||||
| width: 100%; | |||||
| height: 500rpx; | |||||
| } */ | |||||
| /**index.wxss**/ | |||||
| .container | |||||
| { | |||||
| width: 100vw; | |||||
| } | |||||
| .title | |||||
| { | |||||
| color: black; | |||||
| text-align: center; | |||||
| width: auto; | |||||
| } | |||||
| .address_top_transverse | |||||
| { | |||||
| display: flex; | |||||
| height: 64rpx; | |||||
| background-color: white; | |||||
| padding-bottom: 16rpx; | |||||
| } | |||||
| .address_top_transverse .address_tap | |||||
| { | |||||
| width: auto; | |||||
| display: flex; | |||||
| align-items: center; | |||||
| } | |||||
| .address_top_transverse .address_tap image | |||||
| { | |||||
| width: 48rpx; | |||||
| height: 48rpx; | |||||
| margin-right: 16rpx; | |||||
| margin-left: 16rpx; | |||||
| } | |||||
| .address_top_transverse .address_tap .choice_address | |||||
| { | |||||
| margin-right: 16rpx; | |||||
| } | |||||
| .address_top_transverse .address_tap .change_view | |||||
| { | |||||
| font-size: 26rpx; | |||||
| width: 80rpx; | |||||
| } | |||||
| .address_top_transverse .search_container | |||||
| { | |||||
| display: flex; | |||||
| width: auto; | |||||
| height: 100%; | |||||
| align-items: center; | |||||
| border-radius: 32rpx; | |||||
| min-width: 130rpx; | |||||
| margin-right: 16rpx; | |||||
| flex: 1; | |||||
| } | |||||
| .address_top_transverse .search_container .search_img | |||||
| { | |||||
| width: 34rpx; | |||||
| height: 34rpx; | |||||
| margin-left: 16rpx; | |||||
| } | |||||
| .address_top_transverse .search_container .input_search | |||||
| { | |||||
| color: #94969c; | |||||
| min-width: 160rpx; | |||||
| height: 64rpx; | |||||
| font-size: 24rpx; | |||||
| line-height: 64rpx; | |||||
| padding-left: 30rpx; | |||||
| } | |||||
| .tab_container | |||||
| { | |||||
| width: 100%; | |||||
| height: 72rpx; | |||||
| position: relative; | |||||
| } | |||||
| .tab_container .right_icon_view | |||||
| { | |||||
| position: absolute; | |||||
| right: 0rpx; | |||||
| top: 0rpx; | |||||
| width: 10vw; | |||||
| height: 72rpx; | |||||
| line-height: 72rpx; | |||||
| text-align: center; | |||||
| } | |||||
| .banner_container | |||||
| { | |||||
| position: relative; | |||||
| } | |||||
| .banner_container .banner_item | |||||
| { | |||||
| width: 100%; | |||||
| height: 100%; | |||||
| margin-top: 16rpx; | |||||
| height: 100vh; | |||||
| } | } | ||||
| .banner_img_sc{ | |||||
| margin-left: 2.5%; | |||||
| border-radius: 16rpx; | |||||
| width: 95%; | |||||
| background: url(https://shgm.jjyyx.com/m/images/banner_w_bg.png) no-repeat center; | |||||
| } | |||||
| .banner_container .banner_toast | |||||
| { | |||||
| position: absolute; | |||||
| bottom: -17rpx; | |||||
| left: 5%; | |||||
| width: 340rpx; | |||||
| height: 50rpx; | |||||
| z-index: 10; | |||||
| } | |||||
| .type_swiper | |||||
| { | |||||
| margin-top: 16rpx; | |||||
| display: block; | |||||
| } | |||||
| .todayAndHot | |||||
| { | |||||
| margin-top:16rpx; | |||||
| display: block; | |||||
| } | |||||
| .secon_kill | |||||
| { | |||||
| margin-top: 16rpx; | |||||
| display: block; | |||||
| } | |||||
| .preSale_collage | |||||
| { | |||||
| margin-top: 16rpx; | |||||
| display: block; | |||||
| } | |||||
| .container .header{ | |||||
| padding-top: 25.61vh; | |||||
| height: 37.3vh; | |||||
| } | |||||
| @@ -1,14 +1,276 @@ | |||||
| // index.js | |||||
| // 获取应用实例 | |||||
| import * as UTIL from '../../utils/util.js' | |||||
| const app = getApp() | |||||
| import * as UTIL from '../../utils/util.js'; | |||||
| import * as API from '../../utils/API.js'; | |||||
| Page({ | Page({ | ||||
| /** | |||||
| * 页面的初始数据 | |||||
| */ | |||||
| data: { | data: { | ||||
| //底部自定义tabbar | |||||
| isSHowZDYTabBar: true, | |||||
| //底部弹框显示 | |||||
| showDownTS: true, | |||||
| //顶部胶囊按钮位置信息rect | |||||
| CustomMenuButton: null, | |||||
| BarMarginLeft: 0, | |||||
| BarWidth: 0, | |||||
| list: [], | |||||
| isIPhoneX:false | |||||
| }, | |||||
| /** | |||||
| * 计算bar 高度 | |||||
| */ | |||||
| computeBarLocation() { | |||||
| var that = this; | |||||
| let CustomMenuButton = wx.getMenuButtonBoundingClientRect(); | |||||
| let CustomMenuButton_margin_right = wx.getSystemInfoSync().windowWidth - CustomMenuButton.right; | |||||
| let bar_margin_left = CustomMenuButton_margin_right + CustomMenuButton.width; | |||||
| let bar_width = wx.getSystemInfoSync().windowWidth - CustomMenuButton_margin_right * 2 - CustomMenuButton.width * 2; | |||||
| console.log("bar宽:" + bar_width + ";窗口宽度" + wx.getSystemInfoSync().windowWidth); | |||||
| that.setData({ | |||||
| CustomMenuButton: CustomMenuButton, | |||||
| BarMarginLeft: bar_margin_left, | |||||
| BarWidth: bar_width | |||||
| }); | |||||
| }, | }, | ||||
| onLoad() { | |||||
| wx.showTabBar({ | |||||
| animation: false, | |||||
| /** | |||||
| * 生命周期函数--监听页面加载 | |||||
| */ | |||||
| onLoad: function (options) { | |||||
| let that = this; | |||||
| that.simulativeData(); | |||||
| that.computeBarLocation(); | |||||
| that.setData({ | |||||
| isIPhoneX:UTIL.isIPhoneX() | |||||
| }) | }) | ||||
| }, | }, | ||||
| }) | |||||
| /** | |||||
| * 生命周期函数--监听页面初次渲染完成 | |||||
| */ | |||||
| onReady: function () {}, | |||||
| /** | |||||
| * 生命周期函数--监听页面显示 | |||||
| */ | |||||
| onShow: function () {}, | |||||
| /** | |||||
| * 生命周期函数--监听页面隐藏 | |||||
| */ | |||||
| onHide: function () {}, | |||||
| /** | |||||
| * 生命周期函数--监听页面卸载 | |||||
| */ | |||||
| onUnload: function () {}, | |||||
| /** | |||||
| * 页面相关事件处理函数--监听用户下拉动作 | |||||
| */ | |||||
| onPullDownRefresh: function () {}, | |||||
| /** | |||||
| * 页面上拉触底事件的处理函数 | |||||
| */ | |||||
| onReachBottom: function () {}, | |||||
| /** | |||||
| * 用户点击右上角分享 | |||||
| */ | |||||
| onShareAppMessage: function () {}, | |||||
| onItemClickMethod: function (e) { | |||||
| var that = this; | |||||
| var num = parseInt(e.currentTarget.id); | |||||
| console.log(num) | |||||
| switch (num) { | |||||
| case 0: | |||||
| //更新机制 | |||||
| break; | |||||
| case 1: | |||||
| //网络访问 | |||||
| that.httpTestMethod(); | |||||
| break; | |||||
| case 4: | |||||
| //获取地理位置 | |||||
| that.getLocationInfo(); | |||||
| break; | |||||
| case 5: | |||||
| //全局loading | |||||
| that.showLoadingIcon(); | |||||
| break; | |||||
| case 6: | |||||
| that.showModalConentMethod(); | |||||
| break; | |||||
| case 7: | |||||
| that.showModalAllMethod(); | |||||
| break; | |||||
| } | |||||
| }, | |||||
| /** | |||||
| * 获取地理位置 | |||||
| */ | |||||
| getLocationInfo() { | |||||
| UTIL.getLocationFromWX( | |||||
| { | |||||
| success: (res) => { | |||||
| UTIL.showToastNoneIcon("当前经纬度:" + getApp().globalData.setInfo.latitude + "," + getApp().globalData.setInfo.longitude) | |||||
| } | |||||
| , | |||||
| fail: (res) => { | |||||
| wx.navigateTo({ | |||||
| url: '/pages/wxAuth/wxAuth', | |||||
| }) | |||||
| } | |||||
| } | |||||
| ); | |||||
| } | |||||
| , | |||||
| /** | |||||
| * loading小图标 | |||||
| */ | |||||
| showLoadingIcon() { | |||||
| UTIL.showLoadingHaveMask('数据加载中...'); | |||||
| setTimeout(function () { | |||||
| UTIL.hideLoadingHaveMask(); | |||||
| }, 2000) | |||||
| } | |||||
| , | |||||
| /** | |||||
| * 显示提示框 | |||||
| */ | |||||
| showModalConentMethod() { | |||||
| UTIL.showModalNoneCancel('温馨提示', '这是一个按钮的弹框', '知道了'); | |||||
| }, | |||||
| /** | |||||
| * 显示完整提示框 并监听 | |||||
| */ | |||||
| showModalAllMethod() { | |||||
| UTIL.showModalOnClick('提示', '两个按钮并回调', 'OK', 'NO', | |||||
| { | |||||
| confirm() { | |||||
| UTIL.showToastNoneIcon('点击了OK'); | |||||
| } | |||||
| , | |||||
| cancel() { | |||||
| UTIL.showToastNoneIcon('点击了NO'); | |||||
| } | |||||
| }); | |||||
| } | |||||
| , | |||||
| //底部弹框允许 | |||||
| okOnClick(e) { | |||||
| console.log("底部弹框-允许"); | |||||
| UTIL.showToastNoneIcon("底部弹框-允许"); | |||||
| this.setData({ | |||||
| showDownTS: true | |||||
| }) | |||||
| }, | |||||
| /** | |||||
| * 底部弹框-黑色背景点击 | |||||
| */ | |||||
| blackOnClick() { | |||||
| this.setData({ | |||||
| showDownTS: true | |||||
| }) | |||||
| } | |||||
| , | |||||
| /** | |||||
| * 底部弹框拒绝 | |||||
| */ | |||||
| refuseOnClick() { | |||||
| console.log("底部弹框-拒绝"); | |||||
| UTIL.showToastNoneIcon("底部弹框-拒绝"); | |||||
| this.setData({ | |||||
| showDownTS: true | |||||
| }) | |||||
| }, | |||||
| bindgetUserProfile(e) { | |||||
| UTIL.getUserInfoFomWX({ | |||||
| success(res){ | |||||
| UTIL.showToastNoneIcon("获取到昵称:"+getApp().globalData.wxUserInfo.nickName); | |||||
| } | |||||
| }); | |||||
| } | |||||
| , | |||||
| /** | |||||
| * 网络访问 | |||||
| */ | |||||
| httpTestMethod() { | |||||
| let sendData = { | |||||
| centerShopId: 10000, | |||||
| centerWarehouseId: 10051, | |||||
| channel: 220, | |||||
| channelType: 22, | |||||
| memberId: 24892, | |||||
| rows: 40, | |||||
| shopId: 10005, | |||||
| token: "LWXAPP1636599316684iv6qkhyqhr4izg", | |||||
| v: 3, | |||||
| warehouseId: 10005 | |||||
| } | |||||
| UTIL.httpRequest(API.URL_ZB_RECOMMEND_LIST, sendData, | |||||
| { | |||||
| success: (res) => { | |||||
| if (res._code == API.SUCCESS_CODE) { | |||||
| UTIL.showToastNoneIcon("数据共:" + res._data.length + "条"); | |||||
| } else { | |||||
| UTIL.showToastNoneIcon(res._msg) | |||||
| } | |||||
| }, | |||||
| fail: (res) => { | |||||
| UTIL.showToastNoneIcon(API.MSG_FAIL_HTTP) | |||||
| }, | |||||
| complete: (res) => { | |||||
| } | |||||
| }); | |||||
| } | |||||
| , | |||||
| /** | |||||
| * 模拟数据 | |||||
| */ | |||||
| simulativeData() { | |||||
| let list = [ | |||||
| { | |||||
| title: '更新机制(已嵌入)', | |||||
| },{ | |||||
| title: '网络访问(点击获取)' | |||||
| },{ | |||||
| title: '自动申请微信地理授权(已嵌入)' | |||||
| },{ | |||||
| title: '获取微信OPenId(已嵌入)' | |||||
| },{ | |||||
| title: '获取微信地理位置(点击获取)', | |||||
| tapBtn: 'getLocationInfo' | |||||
| },{ | |||||
| title: 'loading小图标', | |||||
| tapBtn: 'showLoadingIcon' | |||||
| },{ | |||||
| title: 'Modal弹框仅提示', | |||||
| tapBtn: 'showModalConentMethod', | |||||
| },{ | |||||
| title: 'Modal两个按钮并监听', | |||||
| tapBtn: 'showModalAllMethod' | |||||
| } | |||||
| ]; | |||||
| this.setData({ | |||||
| list: list, | |||||
| }) | |||||
| } | |||||
| }) | |||||
| @@ -1,6 +1,7 @@ | |||||
| { | { | ||||
| "navigationBarTitleText": "String", | "navigationBarTitleText": "String", | ||||
| "usingComponents": { | |||||
| } | |||||
| "usingComponents": { | |||||
| "icon-loading":"/component/iconLoading/iconLoading" | |||||
| } | |||||
| } | } | ||||
| @@ -1,3 +1,19 @@ | |||||
| <view> | |||||
| 1 | |||||
| </view> | |||||
| <view class="container"> | |||||
| <view style="background-color: white; position: sticky;top: 0; height:{{CustomMenuButton.bottom}}px;z-index: 7777;padding-top: {{CustomMenuButton.top}}px;"> | |||||
| <!--自定义 顶部标题样式和位置--> | |||||
| <view class="title singleLinHidenEllipsis" style="height:{{CustomMenuButton.height}}px;line-height:{{CustomMenuButton.height}}px;margin-left: {{BarMarginLeft}}px;width:{{BarWidth}}px;">悦团购</view> | |||||
| </view> | |||||
| <button class="ok_btn" bindtap="bindgetUserProfile">获取用户信息</button> | |||||
| <view>设备是否有刘海屏:{{isIPhoneX}}</view> | |||||
| <scroll-view class="scroll_page"> | |||||
| <view class="page_content"> | |||||
| <block wx:for-items="{{list}}" wx:key="title"> | |||||
| <view class="list-item"> | |||||
| <view class="list-item-tv" bindtap="onItemClickMethod" id='{{index}}'>{{item.title}}</view> | |||||
| </view> | |||||
| </block> | |||||
| </view> | |||||
| </scroll-view> | |||||
| </view> | |||||
| <icon-loading inner-text="Some text"></icon-loading> | |||||
| @@ -1,5 +1,196 @@ | |||||
| .waterFallFlow | |||||
| @import '/template/bottomUserSQ/bottomUserSQ.wxss'; | |||||
| .scroll_page | |||||
| { | { | ||||
| background-color: burlywood; | |||||
| height: 100vh; | |||||
| } | |||||
| .page_content | |||||
| { | |||||
| width: 100%; | |||||
| height: auto; | |||||
| display: block; | |||||
| } | |||||
| .list-item | |||||
| { | |||||
| height: 35px; | |||||
| } | |||||
| .list-item-tv | |||||
| { | |||||
| width: 80%; | |||||
| height: 100%; | |||||
| margin-left: 10%; | |||||
| } | |||||
| /* .black_bj | |||||
| { | |||||
| position:absolute; | |||||
| bottom: 0rpx; | |||||
| left: 0rpx; | |||||
| width: 100vw; | |||||
| height: 100vh; | |||||
| } | |||||
| .dialog_sq | |||||
| { | |||||
| position:absolute; | |||||
| bottom: 0rpx; | |||||
| left: 0rpx; | |||||
| background: white; | |||||
| width: 100%; | |||||
| height: 500rpx; | |||||
| } */ | |||||
| /**index.wxss**/ | |||||
| .container | |||||
| { | |||||
| width: 100vw; | |||||
| } | |||||
| .title | |||||
| { | |||||
| color: black; | |||||
| text-align: center; | |||||
| width: auto; | |||||
| } | |||||
| .address_top_transverse | |||||
| { | |||||
| display: flex; | |||||
| height: 64rpx; | |||||
| background-color: white; | |||||
| padding-bottom: 16rpx; | |||||
| } | |||||
| .address_top_transverse .address_tap | |||||
| { | |||||
| width: auto; | |||||
| display: flex; | |||||
| align-items: center; | |||||
| } | |||||
| .address_top_transverse .address_tap image | |||||
| { | |||||
| width: 48rpx; | |||||
| height: 48rpx; | |||||
| margin-right: 16rpx; | |||||
| margin-left: 16rpx; | |||||
| } | |||||
| .address_top_transverse .address_tap .choice_address | |||||
| { | |||||
| margin-right: 16rpx; | |||||
| } | |||||
| } | |||||
| .address_top_transverse .address_tap .change_view | |||||
| { | |||||
| font-size: 26rpx; | |||||
| width: 80rpx; | |||||
| } | |||||
| .address_top_transverse .search_container | |||||
| { | |||||
| display: flex; | |||||
| width: auto; | |||||
| height: 100%; | |||||
| align-items: center; | |||||
| border-radius: 32rpx; | |||||
| min-width: 130rpx; | |||||
| margin-right: 16rpx; | |||||
| flex: 1; | |||||
| } | |||||
| .address_top_transverse .search_container .search_img | |||||
| { | |||||
| width: 34rpx; | |||||
| height: 34rpx; | |||||
| margin-left: 16rpx; | |||||
| } | |||||
| .address_top_transverse .search_container .input_search | |||||
| { | |||||
| color: #94969c; | |||||
| min-width: 160rpx; | |||||
| height: 64rpx; | |||||
| font-size: 24rpx; | |||||
| line-height: 64rpx; | |||||
| padding-left: 30rpx; | |||||
| } | |||||
| .tab_container | |||||
| { | |||||
| width: 100%; | |||||
| height: 72rpx; | |||||
| position: relative; | |||||
| } | |||||
| .tab_container .right_icon_view | |||||
| { | |||||
| position: absolute; | |||||
| right: 0rpx; | |||||
| top: 0rpx; | |||||
| width: 10vw; | |||||
| height: 72rpx; | |||||
| line-height: 72rpx; | |||||
| text-align: center; | |||||
| } | |||||
| .banner_container | |||||
| { | |||||
| position: relative; | |||||
| } | |||||
| .banner_container .banner_item | |||||
| { | |||||
| width: 100%; | |||||
| height: 100%; | |||||
| margin-top: 16rpx; | |||||
| } | |||||
| .banner_img_sc{ | |||||
| margin-left: 2.5%; | |||||
| border-radius: 16rpx; | |||||
| width: 95%; | |||||
| background: url(https://shgm.jjyyx.com/m/images/banner_w_bg.png) no-repeat center; | |||||
| } | |||||
| .banner_container .banner_toast | |||||
| { | |||||
| position: absolute; | |||||
| bottom: -17rpx; | |||||
| left: 5%; | |||||
| width: 340rpx; | |||||
| height: 50rpx; | |||||
| z-index: 10; | |||||
| } | |||||
| .type_swiper | |||||
| { | |||||
| margin-top: 16rpx; | |||||
| display: block; | |||||
| } | |||||
| .todayAndHot | |||||
| { | |||||
| margin-top:16rpx; | |||||
| display: block; | |||||
| } | |||||
| .secon_kill | |||||
| { | |||||
| margin-top: 16rpx; | |||||
| display: block; | |||||
| } | |||||
| .preSale_collage | |||||
| { | |||||
| margin-top: 16rpx; | |||||
| display: block; | |||||
| } | |||||
| @@ -1,82 +1,82 @@ | |||||
| { | { | ||||
| "description": "项目配置文件", | |||||
| "packOptions": { | |||||
| "ignore": [ | |||||
| { | |||||
| "type": "file", | |||||
| "value": ".eslintrc.js" | |||||
| } | |||||
| ] | |||||
| }, | |||||
| "setting": { | |||||
| "urlCheck": false, | |||||
| "es6": true, | |||||
| "enhance": true, | |||||
| "postcss": true, | |||||
| "preloadBackgroundData": false, | |||||
| "minified": true, | |||||
| "newFeature": false, | |||||
| "coverView": true, | |||||
| "nodeModules": false, | |||||
| "autoAudits": false, | |||||
| "showShadowRootInWxmlPanel": true, | |||||
| "scopeDataCheck": false, | |||||
| "uglifyFileName": false, | |||||
| "checkInvalidKey": true, | |||||
| "checkSiteMap": false, | |||||
| "uploadWithSourceMap": true, | |||||
| "compileHotReLoad": false, | |||||
| "lazyloadPlaceholderEnable": false, | |||||
| "useMultiFrameRuntime": true, | |||||
| "useApiHook": true, | |||||
| "useApiHostProcess": true, | |||||
| "babelSetting": { | |||||
| "ignore": [], | |||||
| "disablePlugins": [], | |||||
| "outputPath": "" | |||||
| "description": "项目配置文件", | |||||
| "packOptions": { | |||||
| "ignore": [ | |||||
| { | |||||
| "type": "file", | |||||
| "value": ".eslintrc.js" | |||||
| } | |||||
| ] | |||||
| }, | }, | ||||
| "enableEngineNative": false, | |||||
| "useIsolateContext": true, | |||||
| "userConfirmedBundleSwitch": false, | |||||
| "packNpmManually": false, | |||||
| "packNpmRelationList": [], | |||||
| "minifyWXSS": true, | |||||
| "disableUseStrict": false, | |||||
| "minifyWXML": true, | |||||
| "showES6CompileOption": false, | |||||
| "useCompilerPlugins": false | |||||
| }, | |||||
| "compileType": "miniprogram", | |||||
| "libVersion": "2.21.1", | |||||
| "appid": "wx90a68c6fdd650f48", | |||||
| "projectname": "WXMB", | |||||
| "debugOptions": { | |||||
| "hidedInDevtools": [] | |||||
| }, | |||||
| "scripts": {}, | |||||
| "staticServerOptions": { | |||||
| "baseURL": "", | |||||
| "servePath": "" | |||||
| }, | |||||
| "isGameTourist": false, | |||||
| "condition": { | |||||
| "search": { | |||||
| "list": [] | |||||
| "setting": { | |||||
| "urlCheck": false, | |||||
| "es6": true, | |||||
| "enhance": true, | |||||
| "postcss": true, | |||||
| "preloadBackgroundData": false, | |||||
| "minified": true, | |||||
| "newFeature": false, | |||||
| "coverView": true, | |||||
| "nodeModules": false, | |||||
| "autoAudits": false, | |||||
| "showShadowRootInWxmlPanel": true, | |||||
| "scopeDataCheck": false, | |||||
| "uglifyFileName": false, | |||||
| "checkInvalidKey": true, | |||||
| "checkSiteMap": false, | |||||
| "uploadWithSourceMap": true, | |||||
| "compileHotReLoad": false, | |||||
| "lazyloadPlaceholderEnable": false, | |||||
| "useMultiFrameRuntime": true, | |||||
| "useApiHook": true, | |||||
| "useApiHostProcess": true, | |||||
| "babelSetting": { | |||||
| "ignore": [], | |||||
| "disablePlugins": [], | |||||
| "outputPath": "" | |||||
| }, | |||||
| "useIsolateContext": false, | |||||
| "userConfirmedBundleSwitch": false, | |||||
| "packNpmManually": false, | |||||
| "packNpmRelationList": [], | |||||
| "minifyWXSS": true, | |||||
| "disableUseStrict": false, | |||||
| "minifyWXML": true, | |||||
| "showES6CompileOption": false, | |||||
| "useCompilerPlugins": false, | |||||
| "ignoreUploadUnusedFiles": true | |||||
| }, | }, | ||||
| "conversation": { | |||||
| "list": [] | |||||
| "compileType": "miniprogram", | |||||
| "libVersion": "2.21.1", | |||||
| "appid": "wx90a68c6fdd650f48", | |||||
| "projectname": "WXMB", | |||||
| "debugOptions": { | |||||
| "hidedInDevtools": [] | |||||
| }, | }, | ||||
| "game": { | |||||
| "list": [] | |||||
| "scripts": {}, | |||||
| "staticServerOptions": { | |||||
| "baseURL": "", | |||||
| "servePath": "" | |||||
| }, | }, | ||||
| "plugin": { | |||||
| "list": [] | |||||
| }, | |||||
| "gamePlugin": { | |||||
| "list": [] | |||||
| }, | |||||
| "miniprogram": { | |||||
| "list": [] | |||||
| "isGameTourist": false, | |||||
| "condition": { | |||||
| "search": { | |||||
| "list": [] | |||||
| }, | |||||
| "conversation": { | |||||
| "list": [] | |||||
| }, | |||||
| "game": { | |||||
| "list": [] | |||||
| }, | |||||
| "plugin": { | |||||
| "list": [] | |||||
| }, | |||||
| "gamePlugin": { | |||||
| "list": [] | |||||
| }, | |||||
| "miniprogram": { | |||||
| "list": [] | |||||
| } | |||||
| } | } | ||||
| } | |||||
| } | } | ||||