first commit
This commit is contained in:
1
衣莎项目/源码/YiShaXiYi/component/navbar/.pydio
Normal file
1
衣莎项目/源码/YiShaXiYi/component/navbar/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
7d98dc12-1217-4f78-9dc2-dbec623b916f
|
||||
112
衣莎项目/源码/YiShaXiYi/component/navbar/navbar.js
Normal file
112
衣莎项目/源码/YiShaXiYi/component/navbar/navbar.js
Normal file
@@ -0,0 +1,112 @@
|
||||
const app = getApp();
|
||||
const model = app.loadModel("index")
|
||||
const regeneratorRuntime = app.loadAsync()
|
||||
Component({
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
isLogin: {
|
||||
type: Boolean
|
||||
},
|
||||
propData: {
|
||||
type: Number
|
||||
},
|
||||
cityInfo: {
|
||||
type: Object,
|
||||
value: {
|
||||
city: "未定位",
|
||||
city_code: ""
|
||||
}
|
||||
},
|
||||
system: {
|
||||
type: Object,
|
||||
value: {
|
||||
titleHeight: "",
|
||||
statusHeight: ""
|
||||
}
|
||||
},
|
||||
pageTitle: {
|
||||
type: String,
|
||||
value: "伊莎洗衣"
|
||||
},
|
||||
isBack: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
isLocation: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
isContact: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
titleColor: {
|
||||
type: Object,
|
||||
value: {
|
||||
bColor: "#ffffff",
|
||||
tColor: "#333333"
|
||||
}
|
||||
},
|
||||
backColor: {
|
||||
type: String,
|
||||
value: null
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
isCount: 0
|
||||
},
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
goBack: function (e) {
|
||||
var pages = getCurrentPages();
|
||||
var prevPage = pages[pages.length - 2]
|
||||
if (!!prevPage) {
|
||||
wx.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
} else {
|
||||
wx.reLaunch({
|
||||
url: '/pages/auth/auth'
|
||||
})
|
||||
}
|
||||
},
|
||||
changePhone: function () {
|
||||
var that = this;
|
||||
var isCount = that.data.isCount;
|
||||
that.setData({
|
||||
isCount: isCount == 0 ? 1 : 0
|
||||
})
|
||||
this.triggerEvent('changeInput', {
|
||||
isCount: isCount == 0 ? 1 : 0
|
||||
})
|
||||
},
|
||||
storeJump: async function (e) {
|
||||
let getSetting = await model.getauth.getSetting() //获取已经授权的信息
|
||||
let url = e.currentTarget.dataset.url
|
||||
if (!getSetting.authSetting['scope.userLocation']) {
|
||||
// 用户取消授权的处理
|
||||
wx.showModal({
|
||||
title: '你拒绝了地理位置授权',
|
||||
content: '请点击确定,到权限表设置',
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
wx.openSetting()
|
||||
}
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
wx.navigateTo({
|
||||
url: url
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
4
衣莎项目/源码/YiShaXiYi/component/navbar/navbar.json
Normal file
4
衣莎项目/源码/YiShaXiYi/component/navbar/navbar.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
18
衣莎项目/源码/YiShaXiYi/component/navbar/navbar.wxml
Normal file
18
衣莎项目/源码/YiShaXiYi/component/navbar/navbar.wxml
Normal file
@@ -0,0 +1,18 @@
|
||||
<!-- component/navber/navber.wxml -->
|
||||
<!-- components/header/header.wxml -->
|
||||
<view style="padding-top:{{system.statusHeight+'px'}};background: {{titleColor.bColor}};color: {{titleColor.tColor}};" class='customTitleBox'>
|
||||
<view class='customBot' style="height:{{system.titleHeight+'px'}}">
|
||||
<view wx:if="{{isLocation}}" data-url='{{cityInfo.location}}' class="cityBox" bind:tap="storeJump">
|
||||
<image class='arrowBottom' src='/static/img/icon/dw.png'></image>
|
||||
{{cityInfo.city}}
|
||||
<!-- <image class='arrowBottom1' src='/static/img/icon/inverted-icon.png'></image> -->
|
||||
</view>
|
||||
<view data-propdata="{{propData}}" data-islogin="{{isLogin}}" style="width:{{system.titleHeight+'px'}}" wx:if="{{isBack}}" bindtap='goBack' class='backBtn'>
|
||||
<image wx:if="{{backColor == null}}" class='backIcon' src='/static/img/icon/asdwgyjtyj.png'></image>
|
||||
<image wx:else class='backIcon' src='/static/img/icon/left-fff.png'></image>
|
||||
</view>
|
||||
<view bindtap='changePhone' wx:if="{{isContact}}" class='addChange'>添加账户联系人</view>
|
||||
<view class='customTitle'>{{pageTitle}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="height:{{system.statusHeight+system.titleHeight+'px'}}"></view>
|
||||
77
衣莎项目/源码/YiShaXiYi/component/navbar/navbar.wxss
Normal file
77
衣莎项目/源码/YiShaXiYi/component/navbar/navbar.wxss
Normal file
@@ -0,0 +1,77 @@
|
||||
/* component/navber/navber.wxss */
|
||||
/* 顶部要固定定位 标题要居中 自定义按钮和标题要和右边微信原生的胶囊上下对齐 */
|
||||
.customTitleBox {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
z-index: 1001;
|
||||
}
|
||||
|
||||
.customTitle {
|
||||
font-size: 36rpx;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 750rpx;
|
||||
text-align: center;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.customBot {
|
||||
display: flex;
|
||||
display: -webkit-flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.arrowBottom {
|
||||
width: 28rpx;
|
||||
/* width: 32rpx; */
|
||||
height: 32rpx;
|
||||
margin: 0 10rpx;
|
||||
}
|
||||
|
||||
.arrowBottom1 {
|
||||
width: 26rpx;
|
||||
height: 16rpx;
|
||||
margin: 0 10rpx;
|
||||
}
|
||||
|
||||
.cityBox {
|
||||
font-size: 32rpx;
|
||||
display: flex;
|
||||
display: -webkit-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
margin-left: 30rpx;
|
||||
position: relative;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.backBtn {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
display: -webkit-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-left: -10rpx;
|
||||
position: relative;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.backIcon {
|
||||
width: 44rpx;
|
||||
height: 44rpx;
|
||||
}
|
||||
|
||||
.addChange {
|
||||
font-size: 26rpx;
|
||||
height: 44rpx;
|
||||
}
|
||||
|
||||
.addChange {
|
||||
font-size: 26rpx;
|
||||
color: #fff;
|
||||
}
|
||||
Reference in New Issue
Block a user