소스 검색

[返回首页][增加]:[增加返回首页的按钮]

tags/河北版C.8.1.01
meo 5 년 전
부모
커밋
23cc7c3ab9
20개의 변경된 파일187개의 추가작업 그리고 40개의 파일을 삭제
  1. +6
    -0
      app.js
  2. +2
    -1
      app.json
  3. +1
    -0
      components/navbar/img/back.svg
  4. +1
    -0
      components/navbar/img/home.svg
  5. +45
    -0
      components/navbar/navbar.js
  6. +3
    -0
      components/navbar/navbar.json
  7. +14
    -0
      components/navbar/navbar.wxml
  8. +55
    -0
      components/navbar/navbar.wxss
  9. +2
    -0
      pages/bargain/bargain.js
  10. +2
    -1
      pages/bargain/bargain.json
  11. +3
    -2
      pages/bargain/bargain.wxml
  12. +2
    -0
      pages/index/searchbar/index.js
  13. +4
    -1
      pages/index/searchbar/index.json
  14. +33
    -30
      pages/index/searchbar/index.wxml
  15. +3
    -0
      pages/main/index.js
  16. +2
    -1
      pages/main/index.json
  17. +2
    -1
      pages/main/index.wxml
  18. +2
    -0
      pages/user/index.js
  19. +2
    -2
      pages/user/index.json
  20. +3
    -1
      pages/user/index.wxml

+ 6
- 0
app.js 파일 보기

@@ -14,7 +14,13 @@ App({
* 用户登录 * 用户登录
*/ */
that.userLogin(options.scene); that.userLogin(options.scene);
wx.getSystemInfo({
success: res => {
this.statusBarHeight = res.statusBarHeight
}
})
}, },
statusBarHeight: 0,
/** /**
* 用户登录 * 用户登录
*/ */


+ 2
- 1
app.json 파일 보기

@@ -111,7 +111,8 @@
"backgroundTextStyle": "dark", "backgroundTextStyle": "dark",
"navigationBarBackgroundColor": "#FFFFFF", "navigationBarBackgroundColor": "#FFFFFF",
"navigationBarTitleText": "", "navigationBarTitleText": "",
"navigationBarTextStyle": "black"
"navigationBarTextStyle": "black",
"navigationStyle": "custom"
}, },
"networkTimeout": { "networkTimeout": {
"request": 30000, "request": 30000,


+ 1
- 0
components/navbar/img/back.svg 파일 보기

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="128px" height="128.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#202020" d="M711.1 928.3c-13.2 0-26.3-5-36.4-15.2L297.8 532.9c-20.1-20.2-20.1-53.1 0-73.3L674.7 79.2c20.1-20.3 52.6-20.3 72.7 0 20.1 20.2 20.1 53.1 0 73.3L406.9 496.2l340.5 343.6c20.1 20.3 20.1 53.1 0 73.3-10 10.1-23.2 15.2-36.3 15.2z" /></svg>

+ 1
- 0
components/navbar/img/home.svg 파일 보기

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="128px" height="128.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#202020" d="M962.986667 480.426667l-422.4-379.733334a42.666667 42.666667 0 0 0-57.173334 0l-422.4 379.733334a42.666667 42.666667 0 0 0 57.173334 63.146666l9.813333-8.533333V896a42.666667 42.666667 0 0 0 42.666667 42.666667h682.666666a42.666667 42.666667 0 0 0 42.666667-42.666667v-360.96l9.813333 8.533333a42.666667 42.666667 0 0 0 28.586667 11.093334 42.666667 42.666667 0 0 0 31.573333-14.08 42.666667 42.666667 0 0 0-2.986666-60.16zM469.333333 853.333333v-170.666666h85.333334v170.666666z m341.333334-384v384h-170.666667v-213.333333a42.666667 42.666667 0 0 0-42.666667-42.666667h-170.666666a42.666667 42.666667 0 0 0-42.666667 42.666667v213.333333H213.333333v-384a61.013333 61.013333 0 0 0 0-9.386666l298.666667-270.08 298.666667 270.08a61.013333 61.013333 0 0 0 0 9.386666z" /></svg>

+ 45
- 0
components/navbar/navbar.js 파일 보기

@@ -0,0 +1,45 @@
const app = getApp()

Component({

properties: {
background: {
type: String,
value: '#F4F5F9'
},
color: {
type: String,
value: '#000'
},
text: {
type: String,
value: 'Wechat'
},
back: {
type: Boolean,
value: false
},
home: {
type: Boolean,
value: false
}
},

data: {
statusBarHeight: app.statusBarHeight + 'px',
navigationBarHeight: (app.statusBarHeight + 44) + 'px'
},

methods: {
backHome: function () {
wx.switchTab({
url: '/pages/main/index',
})
},
back: function () {
wx.navigateBack({
delta: 1
})
}
}
})

+ 3
- 0
components/navbar/navbar.json 파일 보기

@@ -0,0 +1,3 @@
{
"component": true
}

+ 14
- 0
components/navbar/navbar.wxml 파일 보기

@@ -0,0 +1,14 @@
<view class="navbar" style="{{'height: ' + navigationBarHeight}};background:{{background}}!important;">
<view style="{{'height: ' + statusBarHeight}}"></view>
<view class='title-container'>
<view class='capsule' wx:if="{{ back || home}}">
<view bindtap='back' wx:if="{{back}}">
<image style="left:36%;" src='img/back.svg'></image>
</view>
<view bindtap='backHome' wx:if="{{home}}">
<image src='img/home.svg' style="width:90%;"></image>
</view>
</view>
<view class='title' style="color:{{color}}!important">{{text}}</view>
</view>
</view>

+ 55
- 0
components/navbar/navbar.wxss 파일 보기

@@ -0,0 +1,55 @@
.navbar {
width: 100vw;
background-color: #F4F5F9;
position: fixed;
z-index: 4;
}

.title-container {
height: 44px;
display: flex;
align-items: center;
position: relative;
}

.capsule {
margin-left: 10px;
height: 32px;
border: 2px solid #f2f2f2;
border-radius: 60px;
display: flex;
background: #fbfbfd;
align-items: center;
padding: 0 20rpx;
}

.capsule > view {
width: 35px;
height: 60%;
position: relative;
}

.capsule > view:nth-child(2) {
border-left: 1px solid #777;
}

.capsule image {
width: 70%;
height: 100%;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
}

.title {
color: #000;
position: absolute;
left: 104px;
right: 104px;
font-size: 14px;
text-align: center;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

+ 2
- 0
pages/bargain/bargain.js 파일 보기

@@ -1,3 +1,4 @@
const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px'
var config = require("../../config/config.js"); var config = require("../../config/config.js");
const Http = require("../../utils/HttpBasics"); const Http = require("../../utils/HttpBasics");
const imgurl = require("../../utils/imgurl"); const imgurl = require("../../utils/imgurl");
@@ -6,6 +7,7 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
navigationBarHeight,
noCoupon: imgurl.noCoupon.url, noCoupon: imgurl.noCoupon.url,
orangeImg: imgurl.orange.url, orangeImg: imgurl.orange.url,
blueImg: imgurl.blue.url, blueImg: imgurl.blue.url,


+ 2
- 1
pages/bargain/bargain.json 파일 보기

@@ -6,6 +6,7 @@
"usingComponents": { "usingComponents": {
"c-banner": "../../components/spellbanner/index", "c-banner": "../../components/spellbanner/index",
"i-tab": "../../../dist/tab/index", "i-tab": "../../../dist/tab/index",
"i-tabs": "../../../dist/tabs/index"
"i-tabs": "../../../dist/tabs/index",
"navbar": "../../components/navbar/navbar"
} }
} }

+ 3
- 2
pages/bargain/bargain.wxml 파일 보기

@@ -1,5 +1,6 @@
<button class='goback' bindtap='goback'><image src='{{wmhome}}' mode="widthFix"></image></button>
<view class="page" hover-class="none" hover-stop-propagation="false">
<!-- <button class='goback' bindtap='goback'><image src='{{wmhome}}' mode="widthFix"></image></button> -->
<navbar back home text="砍价专场"></navbar>
<view class="page" hover-class="none" hover-stop-propagation="false" style="padding-top:{{navigationBarHeight}};">
<!-- <view class='top' wx:if="{{bargaingoods&&list.length>0}}"> <!-- <view class='top' wx:if="{{bargaingoods&&list.length>0}}">
<view class="banner" wx:if="{{list.length>0}}" hover-class="none" hover-stop-propagation="false"> <view class="banner" wx:if="{{list.length>0}}" hover-class="none" hover-stop-propagation="false">
<c-banner wx:key="unique" list="{{list}}" /> <c-banner wx:key="unique" list="{{list}}" />


+ 2
- 0
pages/index/searchbar/index.js 파일 보기

@@ -1,3 +1,4 @@
const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px'
const Http = require("../../../utils/HttpBasics"); const Http = require("../../../utils/HttpBasics");
const imgurl = require("../../../utils/imgurl"); const imgurl = require("../../../utils/imgurl");
const config = require("../../../config/config"); const config = require("../../../config/config");
@@ -8,6 +9,7 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
navigationBarHeight,
lists: [], lists: [],
merchantVoList:[], merchantVoList:[],
indexId: 0, indexId: 0,


+ 4
- 1
pages/index/searchbar/index.json 파일 보기

@@ -1,5 +1,8 @@
{ {
"navigationBarTitleText": "门店", "navigationBarTitleText": "门店",
"navigationBarBackgroundColor": "#F4F5F9", "navigationBarBackgroundColor": "#F4F5F9",
"navigationBarTextStyle": "black"
"navigationBarTextStyle": "black",
"usingComponents": {
"navbar": "../../../components/navbar/navbar"
}
} }

+ 33
- 30
pages/index/searchbar/index.wxml 파일 보기

@@ -1,40 +1,43 @@
<navbar text="门店"></navbar>
<!-- 左侧滚动栏 --> <!-- 左侧滚动栏 -->
<view class='under_line'></view>
<view style='float: left' class='left'>
<scroll-view scroll-y scroll-with-animation scroll-left="{{scrollLength}}" class='scrollY' style='height: {{windowHeight}}px'>
<view class='all clear'>
<block wx:for="{{lists}}" wx:key="{{index}}">
<view bindtap='jumpIndex' data-menuindex='{{item.id}}'>
<view class="{{indexId==item.id?'text-style':'text-styleHover'}}">
<text class="{{indexId==item.id?'active1':''}}">{{item.title}}</text>
<text class="{{indexId==item.id?'active':''}}"></text>
<view style="padding-top:{{navigationBarHeight}}">
<view class='under_line'></view>
<view style='float: left' class='left'>
<scroll-view scroll-y scroll-with-animation scroll-left="{{scrollLength}}" class='scrollY' style='height: {{windowHeight}}px'>
<view class='all clear'>
<block wx:for="{{lists}}" wx:key="{{index}}">
<view bindtap='jumpIndex' data-menuindex='{{item.id}}'>
<view class="{{indexId==item.id?'text-style':'text-styleHover'}}">
<text class="{{indexId==item.id?'active1':''}}">{{item.title}}</text>
<text class="{{indexId==item.id?'active':''}}"></text>
</view>
</view> </view>
</view>
</block>
</view>
</scroll-view>
</view>
</block>
</view>
</scroll-view>
</view>


<view class='lists'>
<view class='posi' wx:if="{{merchantVoList.length>0}}">
<view class='posi_logo' wx:for="{{merchantVoList}}" wx:key="index">
<view class='merchants' bindtap='gotoDetail' data-id='{{item.id}}'>
<view style=' margin-left: 24rpx;margin-top: 24rpx;'>
<image src='{{item.merchantImgUrl}}'></image>
</view>
<view>
<text class='merchantName'>{{item.merchantName}}</text>
<view class='shopVo'>
<view class='shopVoList' wx:for="{{item.shopVoList}}" wx:key="{{index}}" wx:for-item="itemName">
<text>{{itemName.buildingName}}{{itemName.floorName}}--{{itemName.shopNumber}}</text><text class='douhao' wx:if="{{item.shopVoList.length>1}}">,</text>
<view class='lists'>
<view class='posi' wx:if="{{merchantVoList.length>0}}">
<view class='posi_logo' wx:for="{{merchantVoList}}" wx:key="index">
<view class='merchants' bindtap='gotoDetail' data-id='{{item.id}}'>
<view style=' margin-left: 24rpx;margin-top: 24rpx;'>
<image src='{{item.merchantImgUrl}}'></image>
</view>
<view>
<text class='merchantName'>{{item.merchantName}}</text>
<view class='shopVo'>
<view class='shopVoList' wx:for="{{item.shopVoList}}" wx:key="{{index}}" wx:for-item="itemName">
<text>{{itemName.buildingName}}{{itemName.floorName}}--{{itemName.shopNumber}}</text><text class='douhao' wx:if="{{item.shopVoList.length>1}}">,</text>
</view>
</view> </view>
</view> </view>
</view> </view>
<image wx:if="{{item.linkLinePhone}}" bindtap='phone' data-merchantLinkPhone='{{item.linkLinePhone}}' class="tel" src="{{teljpgUrl}}" mode="widthFix" />
</view> </view>
<image wx:if="{{item.linkLinePhone}}" bindtap='phone' data-merchantLinkPhone='{{item.linkLinePhone}}' class="tel" src="{{teljpgUrl}}" mode="widthFix" />
</view> </view>
</view>
<view class='position' wx:if="{{merchantVoList.length==0}}">
暂无数据
<view class='position' wx:if="{{merchantVoList.length==0}}">
暂无数据
</view>
</view> </view>
</view> </view>

+ 3
- 0
pages/main/index.js 파일 보기

@@ -1,3 +1,4 @@
const navigationBarHeight = (getApp().statusBarHeight + 60) + 'px'
const Http = require("../../utils/HttpBasics"); const Http = require("../../utils/HttpBasics");
const imgurl = require("../../utils/imgurl"); const imgurl = require("../../utils/imgurl");
const config = require("../../config/config"); const config = require("../../config/config");
@@ -7,6 +8,8 @@ const bgColor = require("../../utils/bgColor.js")
let app = getApp(); let app = getApp();
Page({ Page({
data: { data: {
navigationBarTitle: '首页',
navigationBarHeight,
chengzhangBox: bgColor.colorFirst.main.chengzhangBox, chengzhangBox: bgColor.colorFirst.main.chengzhangBox,
activeColor: bgColor.colorFirst.main.activeColor, activeColor: bgColor.colorFirst.main.activeColor,
qg: bgColor.colorFirst.main.qg, qg: bgColor.colorFirst.main.qg,


+ 2
- 1
pages/main/index.json 파일 보기

@@ -7,7 +7,8 @@
"c-coupons": "./coupons/index", "c-coupons": "./coupons/index",
"g-entry": "../../components/gameentry/gentry", "g-entry": "../../components/gameentry/gentry",
"c-rushtobyCard": "./rushtobyCard/index", "c-rushtobyCard": "./rushtobyCard/index",
"c-hot": "../../components/hot/index"
"c-hot": "../../components/hot/index",
"navbar": "../../components/navbar/navbar"
}, },
"navigationBarTitleText": "首页", "navigationBarTitleText": "首页",
"enablePullDownRefresh": true, "enablePullDownRefresh": true,


+ 2
- 1
pages/main/index.wxml 파일 보기

@@ -1,4 +1,5 @@
<view class="container">
<navbar text="首页"></navbar>
<view class="container" style="padding-top:{{navigationBarHeight}};">
<!-- 会员信息 --> <!-- 会员信息 -->
<view class='userinfo clearfix' > <view class='userinfo clearfix' >
<!-- 头像 --> <!-- 头像 -->


+ 2
- 0
pages/user/index.js 파일 보기

@@ -1,3 +1,4 @@
const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px'
const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {} const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {}
var config = require("../../config/config.js"); var config = require("../../config/config.js");
var app = getApp(); var app = getApp();
@@ -10,6 +11,7 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
navigationBarHeight,
banneColor: bgColor.colorFirst.user.banneColor, banneColor: bgColor.colorFirst.user.banneColor,
levelBg: bgColor.colorFirst.user.levelBg, levelBg: bgColor.colorFirst.user.levelBg,
view: bgColor.colorFirst.user.view, view: bgColor.colorFirst.user.view,


+ 2
- 2
pages/user/index.json 파일 보기

@@ -1,8 +1,8 @@
{ {
"usingComponents": { "usingComponents": {
"i-button": "../../dist/button/index"
"i-button": "../../dist/button/index",
"navbar": "../../components/navbar/navbar"
}, },
"navigationBarTitleText": "我的",
"navigationBarBackgroundColor": "#FD832D", "navigationBarBackgroundColor": "#FD832D",
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",
"disableScroll": true "disableScroll": true

+ 3
- 1
pages/user/index.wxml 파일 보기

@@ -1,4 +1,6 @@
<view class="user">
<navbar text="我的" background='#FD832D' color="white"></navbar>
<view class="user" style="padding-top:{{navigationBarHeight}};">
<view class="top" style='background:{{banneColor}}'></view> <view class="top" style='background:{{banneColor}}'></view>
<view class='user_title '> <view class='user_title '>
<view class="user-avatar" bindtap='gotoedit'> <view class="user-avatar" bindtap='gotoedit'>


불러오는 중...
취소
저장