feat: “我的”页面添加按钮点击事件
This commit is contained in:
parent
da14783edc
commit
aa4e18e267
|
|
@ -1,4 +1,6 @@
|
|||
// components/payroll-manage/index.js
|
||||
import Dialog from 'tdesign-miniprogram/dialog/index';
|
||||
|
||||
Component({
|
||||
/**
|
||||
* 组件的属性列表
|
||||
|
|
@ -18,16 +20,39 @@ Component({
|
|||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
list: [
|
||||
{ value: 'label_1', label: '首页', icon: 'home' },
|
||||
{ value: 'label_2', label: '应用', icon: 'app' }
|
||||
]
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
showDialog(e) {
|
||||
const {value} = e.target.dataset;
|
||||
let content;
|
||||
if (value == "oa-shenpi" || value == "zhanghuyue") {
|
||||
content = "您当前没有操作权限"
|
||||
}else if(value == "baoxian" || value == "baoxianzhanghu") {
|
||||
content = "未开通保险账号,请联系您的客户经理"
|
||||
} else {
|
||||
content = "功能升级中, 敬请期待"
|
||||
}
|
||||
const dialogConfig = {
|
||||
context: this,
|
||||
title: '提示',
|
||||
content: content,
|
||||
closeBtn: true,
|
||||
cancelBtn: null,
|
||||
closeOnOverlayClick: true,
|
||||
confirmBtn:'确定'
|
||||
};
|
||||
|
||||
Dialog.confirm(dialogConfig)
|
||||
.then(() => {
|
||||
console.log('点击确定');
|
||||
})
|
||||
.catch(() => {
|
||||
console.log('点击取消');
|
||||
});
|
||||
},
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"iconfont": "/iconfont/iconfont"
|
||||
"iconfont": "/iconfont/iconfont",
|
||||
"t-dialog": "tdesign-miniprogram/dialog/dialog"
|
||||
}
|
||||
}
|
||||
|
|
@ -4,9 +4,10 @@
|
|||
<view class="icon" >
|
||||
<view wx:for="{{icons}}" wx:key="index" >
|
||||
<view class="card-icon" style="background-color: {{item.color}}" >
|
||||
<iconfont name="{{item.value}}" size="48" color="white" />
|
||||
<iconfont name="{{item.value}}" size="48" color="white" bindtap="showDialog" data-value="{{item.value}}"/>
|
||||
</view>
|
||||
<view class="card-name">{{item.name}}</view>
|
||||
</view>
|
||||
<t-dialog id="t-dialog" />
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ Page({
|
|||
iconsList1: [{
|
||||
value: 'oa-shenpi',
|
||||
color: 'orange',
|
||||
name: 'OA审批'
|
||||
name: 'OA审批',
|
||||
}, {
|
||||
value: 'zhifushezhi',
|
||||
color: 'deepskyblue',
|
||||
|
|
@ -46,6 +46,7 @@ Page({
|
|||
}]
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<!--pages/my/my.wxml-->
|
||||
<view class="my">
|
||||
<view class="my" style="padding-bottom: 25%;">
|
||||
<view class="userinfo">
|
||||
<view class="userinfo-avatar" bindtap="bindViewTap">
|
||||
<open-data type="userAvatarUrl"></open-data>
|
||||
|
|
@ -15,4 +15,3 @@
|
|||
<t-cell title="回到首页" hover arrow leftIcon="home" bordered="{{false}}" />
|
||||
<t-cell title="关于我们" hover arrow leftIcon="error-circle" bordered="{{false}}" />
|
||||
</view>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
/* pages/my/my.wxss */
|
||||
|
||||
.my {
|
||||
width: 100%
|
||||
}
|
||||
.userinfo {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
flex-direction: row;
|
||||
background-color: white;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue