feat(我的页面): 添加扫码功能和积分余额显示
- 在页面顶部添加扫码按钮及处理逻辑 - 新增积分余额显示在菜单项右侧 - 扩展菜单数据包含积分余额、核销记录和联系客服 - 修改图标样式和尺寸 - 更新路由配置添加来源参数
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
background-size: 100% 100%;
|
background-size: 100% 100%;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
|
display: inline-block;
|
||||||
}
|
}
|
||||||
.custom-icon-filtersearch{
|
.custom-icon-filtersearch{
|
||||||
width: 32rpx;
|
width: 32rpx;
|
||||||
@@ -15,7 +16,7 @@
|
|||||||
background-image: url('https://img.liche.cn/lichebao/icon-logout.png');
|
background-image: url('https://img.liche.cn/lichebao/icon-logout.png');
|
||||||
}
|
}
|
||||||
.custom-icon-scancode{
|
.custom-icon-scancode{
|
||||||
width: 32rpx;
|
width: 24rpx;
|
||||||
height: 32rpx;
|
height: 24rpx;
|
||||||
background-image: url('https://img.liche.cn/lichebao/icon-scancode.png');
|
background-image: url('https://img.liche.cn/lichebao/icon-scancode.png');
|
||||||
}
|
}
|
||||||
+32
-2
@@ -62,9 +62,26 @@ Page({
|
|||||||
// }
|
// }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
// 20250624
|
||||||
|
let mock_data = [{
|
||||||
|
icon:'https://img.liche.cn/lichebao/menu-1.png',
|
||||||
|
title:'积分余额',
|
||||||
|
tip:'7999',
|
||||||
|
url:'/pages/customer/score/index'
|
||||||
|
},{
|
||||||
|
icon:'https://img.liche.cn/lichebao/menu-2.png',
|
||||||
|
title:'核销记录',
|
||||||
|
url:'/pages/customer/score/exchange'
|
||||||
|
},{
|
||||||
|
icon:'https://img.liche.cn/lichebao/menu-3.png',
|
||||||
|
title:'联系客服',
|
||||||
|
type:1,
|
||||||
|
url:'13455556666'
|
||||||
|
}]
|
||||||
|
let menu_list = mock_data.concat(list)
|
||||||
|
|
||||||
this.setData({
|
this.setData({
|
||||||
list: list,
|
list: menu_list,
|
||||||
})
|
})
|
||||||
|
|
||||||
this.getUserInfo()
|
this.getUserInfo()
|
||||||
@@ -134,7 +151,12 @@ Page({
|
|||||||
|
|
||||||
//推送链接-敬请期待
|
//推送链接-敬请期待
|
||||||
pushLinkMsg(e) {
|
pushLinkMsg(e) {
|
||||||
if (e.currentTarget.dataset.url) {
|
// 20250624
|
||||||
|
if(e.currentTarget.dataset.type == 1){
|
||||||
|
wx.makePhoneCall({
|
||||||
|
phoneNumber: e.currentTarget.dataset.url,
|
||||||
|
})
|
||||||
|
}else if (e.currentTarget.dataset.url) {
|
||||||
_.$router.openUrlScheme(e.currentTarget.dataset.url)
|
_.$router.openUrlScheme(e.currentTarget.dataset.url)
|
||||||
} else {
|
} else {
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
@@ -175,4 +197,12 @@ Page({
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
//20250624 扫码
|
||||||
|
bindScanCode(){
|
||||||
|
wx.scanCode({
|
||||||
|
success(res) {
|
||||||
|
console.log(res)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
@@ -14,7 +14,11 @@
|
|||||||
<view class="mt10 font-22 color-666">{{userInfo.biz_name}}</view>
|
<view class="mt10 font-22 color-666">{{userInfo.biz_name}}</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="absolute right-0 box-middle pb40" >
|
<view class="absolute right-0 box-middle p240" >
|
||||||
|
<!-- 20250624 -->
|
||||||
|
<view class="bg-f6 mb25 pt10 pb10 pl20 pr15 font-22 color-666 ulib-rl750 fn-flex fn-flex-middle" bindtap="bindScanCode" wx:if="{{userInfo.group_name_arr.length>0}}">
|
||||||
|
<i class="custom-icon custom-icon-scancode mr10"></i><text>扫码</text>
|
||||||
|
</view>
|
||||||
<view class="bg-f6 mb25 pt10 pb10 pl20 pr15 font-22 color-666 ulib-rl750" bindtap="switchingRoles" wx:if="{{userInfo.group_name_arr.length>0}}">
|
<view class="bg-f6 mb25 pt10 pb10 pl20 pr15 font-22 color-666 ulib-rl750" bindtap="switchingRoles" wx:if="{{userInfo.group_name_arr.length>0}}">
|
||||||
<i class="iconfont icon-cheliangfenpei mr10"></i>切换角色
|
<i class="iconfont icon-cheliangfenpei mr10"></i>切换角色
|
||||||
</view>
|
</view>
|
||||||
@@ -29,16 +33,18 @@
|
|||||||
<view class="pl40 pr40">
|
<view class="pl40 pr40">
|
||||||
<block wx:for="{{list}}" wx:key="index">
|
<block wx:for="{{list}}" wx:key="index">
|
||||||
<block wx:if="{{item.title == '账户设置'}}">
|
<block wx:if="{{item.title == '账户设置'}}">
|
||||||
<view class="relative pt30 pb30 pl60 font-32" bindtap="pushLinkMsg" data-url="{{item.url}}?source={{source}}">
|
<view class="relative pt30 pb30 pl60 font-32" bindtap="pushLinkMsg" data-type="{{item.type}}" data-url="{{item.url}}?source={{source}}">
|
||||||
<image class='absolute left-0 box-middle img-50x50' mode="aspectFill" src='{{item.icon}}' lazy-load="{{true}}"></image>
|
<image class='absolute left-0 box-middle img-50x50' mode="aspectFill" src='{{item.icon}}' lazy-load="{{true}}"></image>
|
||||||
<text>{{item.title}}</text>
|
<text>{{item.title}}</text>
|
||||||
|
<text wx:if="{{item.tip}}" class="absolute right-0 mr40 box-middle color-ff0000">{{item.tip}}</text>
|
||||||
<i class="absolute right-0 box-middle iconfont icon-gengduo"></i>
|
<i class="absolute right-0 box-middle iconfont icon-gengduo"></i>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
<block wx:else>
|
<block wx:else>
|
||||||
<view class="relative pt30 pb30 pl60 font-32" bindtap="pushLinkMsg" data-url="{{item.url}}">
|
<view class="relative pt30 pb30 pl60 font-32" bindtap="pushLinkMsg" data-type="{{item.type}}" data-url="{{item.url}}">
|
||||||
<image class='absolute left-0 box-middle img-50x50' mode="aspectFill" src='{{item.icon}}' lazy-load="{{true}}"></image>
|
<image class='absolute left-0 box-middle img-50x50' mode="aspectFill" src='{{item.icon}}' lazy-load="{{true}}"></image>
|
||||||
<text>{{item.title}}</text>
|
<text>{{item.title}}</text>
|
||||||
|
<text wx:if="{{item.tip}}" class="absolute right-0 mr40 box-middle color-ff0000">{{item.tip}}</text>
|
||||||
<i class="absolute right-0 box-middle iconfont icon-gengduo"></i>
|
<i class="absolute right-0 box-middle iconfont icon-gengduo"></i>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
|
|||||||
@@ -6,9 +6,23 @@
|
|||||||
{
|
{
|
||||||
"name": "pages/customer/index",
|
"name": "pages/customer/index",
|
||||||
"pathName": "pages/customer/score/exchange",
|
"pathName": "pages/customer/score/exchange",
|
||||||
"query": "",
|
"query": "source=shop",
|
||||||
"scene": null,
|
"scene": null,
|
||||||
"launchMode": "default"
|
"launchMode": "default"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "pages/mine/index",
|
||||||
|
"pathName": "pages/mine/index",
|
||||||
|
"query": "source=shop",
|
||||||
|
"launchMode": "default",
|
||||||
|
"scene": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "pages/mine/index",
|
||||||
|
"pathName": "pages/mine/index",
|
||||||
|
"query": "",
|
||||||
|
"launchMode": "default",
|
||||||
|
"scene": null
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user