v2.31.0 NFC卡解锁
This commit is contained in:
parent
a0e16e5b0e
commit
357e274a8f
|
|
@ -3,335 +3,135 @@
|
|||
<u-navbar :title="tit" :border-bottom="false" :background="bgc" title-color='#000' back-icon-color="#000"
|
||||
title-size='36' height='50'></u-navbar>
|
||||
<view class="box">
|
||||
<view class="title">
|
||||
基本信息
|
||||
</view>
|
||||
<view class="title">基本信息</view>
|
||||
<view class="list">
|
||||
<view class="list_val">
|
||||
<view class="" style="padding-top:12rpx">备注名</view> <input type="text" v-model="beizhu"
|
||||
placeholder="请输入备注名" />
|
||||
<view class="" style="padding-top:12rpx">备注名</view>
|
||||
<input type="text" v-model="beizhu" placeholder="请输入备注名" />
|
||||
</view>
|
||||
<view class="list_val" style="position: relative;">
|
||||
<view class="" style="padding-top:12rpx;width: 176rpx;">身份类型</view> <input @click="show = true"
|
||||
type="text" disabled="false" v-model="sheng" :placeholder="sheng" />
|
||||
<u-icon name="arrow-down" style="position: absolute;top: 30%;right: 14rpx;"
|
||||
color="#808080"></u-icon>
|
||||
<view class="" style="padding-top:12rpx;width: 176rpx;">身份类型</view>
|
||||
<input @click="show = true" type="text" disabled="false" v-model="sheng" :placeholder="sheng" />
|
||||
<u-icon name="arrow-down" style="position: absolute;top: 30%;right: 14rpx;" color="#808080"></u-icon>
|
||||
<u-select v-model="show" :list="arr" @confirm="confirm"></u-select>
|
||||
</view>
|
||||
<view class="list_val">
|
||||
<view class="" style="padding-top:12rpx">手机号码</view> <input type="text" v-model="tel"
|
||||
placeholder="请输入手机号码" />
|
||||
<view class="" style="padding-top:12rpx">手机号码</view>
|
||||
<input type="text" v-model="tel" placeholder="请输入手机号码" />
|
||||
</view>
|
||||
<view class="list_val">
|
||||
<view class="" style="padding-top:12rpx">分成比例</view> <input type="text" v-model="bili"
|
||||
placeholder="请输入分成比例%" />
|
||||
<view class="" style="padding-top:12rpx">分成比例</view>
|
||||
<input type="text" v-model="bili" placeholder="请输入分成比例%" />
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="title">
|
||||
合作伙伴权限
|
||||
|
||||
<!-- 权限区域 -->
|
||||
<view class="section-header">
|
||||
<view class="title">合作伙伴权限</view>
|
||||
<view class="global-actions" v-if="permissionGroups.length > 0">
|
||||
<text class="action-btn" @click="handleSelectAllGlobal">全选</text>
|
||||
<text class="action-divider">|</text>
|
||||
<text class="action-btn" @click="handleDeselectAllGlobal">取消全选</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="swlist">
|
||||
<view class="swlist_val" v-for="(item,index) in list" :key="index">
|
||||
<view class="lt">
|
||||
<view class="one">
|
||||
{{item.name}}
|
||||
</view>
|
||||
<view class="two">
|
||||
{{item.tit}}
|
||||
</view>
|
||||
|
||||
<view v-if="permissionsLoading" class="loading-tip">
|
||||
<u-loading mode="circle" size="36"></u-loading>
|
||||
<text style="margin-left: 12rpx; color: #999; font-size: 26rpx;">加载中...</text>
|
||||
</view>
|
||||
|
||||
<view v-for="(group, gi) in permissionGroups" :key="gi" class="permission-group">
|
||||
<view class="group-header">
|
||||
<text class="group-name">{{ group.group }}</text>
|
||||
<view class="group-actions">
|
||||
<text class="action-btn" @click="handleSelectAllGroup(gi)">全选</text>
|
||||
<text class="action-divider">|</text>
|
||||
<text class="action-btn" @click="handleDeselectAllGroup(gi)">取消</text>
|
||||
</view>
|
||||
<view class="rt" v-if="item.name == '查看运营区'">
|
||||
<u-switch v-model="item.checked" :disabled="true" active-color="#2b2929" size="36"
|
||||
inactive-color="#eee"></u-switch>
|
||||
</view>
|
||||
<view class="rt" v-else>
|
||||
<u-switch v-model="item.checked" active-color="#4C97E7" size="36"
|
||||
inactive-color="#eee"></u-switch>
|
||||
</view>
|
||||
<view class="swlist">
|
||||
<view class="swlist_val" v-for="(item, ii) in group.items" :key="ii">
|
||||
<view class="lt">
|
||||
<view class="one">{{ item.name }}</view>
|
||||
<view class="two">{{ item.description }}</view>
|
||||
</view>
|
||||
<view class="rt">
|
||||
<u-switch
|
||||
v-model="item.checked"
|
||||
:disabled="item.isDefault"
|
||||
:active-color="item.isDefault ? '#2b2929' : '#4C97E7'"
|
||||
size="36"
|
||||
inactive-color="#eee"
|
||||
></u-switch>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="baocun" @click="btncj">
|
||||
{{tit}}
|
||||
</view>
|
||||
|
||||
<view class="baocun" @click="btncj">{{ tit }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
bgc: {
|
||||
backgroundColor: "#fff"
|
||||
},
|
||||
level: '',
|
||||
bgc: { backgroundColor: "#fff" },
|
||||
tel: '',
|
||||
sheng: '请选择身份类型',
|
||||
arr: [{
|
||||
label: '加盟商',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
label: '合伙人',
|
||||
value: 2
|
||||
}
|
||||
arr: [
|
||||
{ label: '加盟商', value: 1 },
|
||||
{ label: '合伙人', value: 2 }
|
||||
],
|
||||
tit: '创建加盟伙伴',
|
||||
userId: '',
|
||||
bili: '',
|
||||
beizhu: '',
|
||||
jiamtype: '',
|
||||
areaId: '',
|
||||
jiamid: '',
|
||||
// 权限映射配置
|
||||
permissionConfig: {
|
||||
'查看运营区': 'area:view',
|
||||
'操作运营区': 'area:edit',
|
||||
'查看运营区推广': 'areaPromotion:view',
|
||||
'操作运营区推广': 'areaPromotion:edit',
|
||||
'查看停车区': 'areaSub:view',
|
||||
'操作停车区': 'areaSub:edit',
|
||||
'查看故障': 'fault:view',
|
||||
'故障审核': 'fault:edit',
|
||||
'查看订单': 'order:view',
|
||||
'操作订单': 'order:edit',
|
||||
'查看车辆': 'device:view',
|
||||
'操作车辆': 'device:edit',
|
||||
// '查看订单金额':'order:view:amount',
|
||||
'查看广告': 'ad:view',
|
||||
'操作广告': 'ad:edit',
|
||||
'查看套餐': 'suit:view',
|
||||
'操作套餐': 'suit:edit',
|
||||
'查看车型': 'model:view',
|
||||
'操作车型': 'model:edit',
|
||||
'查看客服': 'customerService:view',
|
||||
'操作客服': 'customerService:edit',
|
||||
'查看卡券': 'vip:view',
|
||||
'操作卡券': 'vip:edit',
|
||||
'查看卡券订单': 'vipOrder:view',
|
||||
'操作卡券订单': 'vipOrder:edit',
|
||||
'查看用户卡券': 'vipUser:view',
|
||||
'操作用户卡券': 'vipUser:edit',
|
||||
'查看投诉': 'complaint:view',
|
||||
'操作投诉': 'complaint:edit',
|
||||
'查看协议': 'agreement:view',
|
||||
'操作协议': 'agreement:edit',
|
||||
'查看换电工单': 'powerWork:view',
|
||||
'操作换电工单': 'powerWork:edit',
|
||||
'查看调度日志': 'dispatchLog:view',
|
||||
},
|
||||
list: [{
|
||||
name: '查看运营区',
|
||||
tit: '是否允许',
|
||||
checked: true,
|
||||
txt: 1
|
||||
},
|
||||
{
|
||||
name: '操作运营区',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 2
|
||||
},
|
||||
{
|
||||
name: '查看运营区推广',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 3
|
||||
},
|
||||
{
|
||||
name: '操作运营区推广',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 4
|
||||
},
|
||||
{
|
||||
name: '查看停车区',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 5
|
||||
},
|
||||
{
|
||||
name: '操作停车区',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 6
|
||||
},
|
||||
{
|
||||
name: '查看故障',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 7
|
||||
},
|
||||
{
|
||||
name: '故障审核',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 8
|
||||
},
|
||||
{
|
||||
name: '查看订单',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 9
|
||||
},
|
||||
{
|
||||
name: '操作订单',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 10
|
||||
},
|
||||
{
|
||||
name: '查看车辆',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 11
|
||||
},
|
||||
{
|
||||
name: '操作车辆',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 12
|
||||
},
|
||||
{
|
||||
name: '查看广告',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 13
|
||||
},
|
||||
{
|
||||
name: '操作广告',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 14
|
||||
},
|
||||
{
|
||||
name: '查看套餐',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 15
|
||||
},
|
||||
{
|
||||
name: '操作套餐',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 16
|
||||
},
|
||||
{
|
||||
name: '查看车型',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 17
|
||||
},
|
||||
{
|
||||
name: '操作车型',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 18
|
||||
},
|
||||
{
|
||||
name: '查看客服',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 19
|
||||
},
|
||||
{
|
||||
name: '操作客服',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 20
|
||||
},
|
||||
{
|
||||
name: '查看卡券',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 21
|
||||
},
|
||||
{
|
||||
name: '操作卡券',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 22
|
||||
},
|
||||
{
|
||||
name: '查看卡券订单',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 23
|
||||
},
|
||||
{
|
||||
name: '操作卡券订单',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 24
|
||||
},
|
||||
{
|
||||
name: '查看用户卡券',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 25
|
||||
},
|
||||
{
|
||||
name: '操作用户卡券',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 26
|
||||
},
|
||||
{
|
||||
name: '查看投诉',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 27
|
||||
},
|
||||
{
|
||||
name: '操作投诉',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 28
|
||||
},
|
||||
{
|
||||
name: '查看协议',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 29
|
||||
},
|
||||
{
|
||||
name: '操作协议',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 30
|
||||
}, {
|
||||
name: '查看换电工单',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 31
|
||||
},{
|
||||
name: '操作换电工单',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 32
|
||||
},{
|
||||
name: '查看调度日志',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 33
|
||||
},
|
||||
],
|
||||
permissionsLoading: false,
|
||||
permissionGroups: [],
|
||||
// 编辑时临时保存待回填的权限列表
|
||||
pendingPermissions: null
|
||||
}
|
||||
},
|
||||
|
||||
onLoad(option) {
|
||||
this.areaId = uni.getStorageSync('adminAreaid')
|
||||
|
||||
if (option.item) {
|
||||
this.tit = '编辑加盟伙伴'
|
||||
const obj = JSON.parse(option.item)
|
||||
this.initFormData(obj)
|
||||
}
|
||||
this.loadPermissions().then(() => {
|
||||
if (option.item) {
|
||||
this.tit = '编辑加盟伙伴'
|
||||
const obj = JSON.parse(option.item)
|
||||
this.initFormData(obj)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化表单数据
|
||||
/** 从接口加载权限分组 */
|
||||
loadPermissions() {
|
||||
this.permissionsLoading = true
|
||||
return this.$u.get('/bst/areaJoin/permissions').then(res => {
|
||||
if (res.code === 200 && res.data) {
|
||||
// 为每个权限项添加 checked 状态
|
||||
this.permissionGroups = res.data.map(group => ({
|
||||
...group,
|
||||
items: group.items.map(item => ({
|
||||
...item,
|
||||
checked: !!item.isDefault
|
||||
}))
|
||||
}))
|
||||
}
|
||||
}).catch(() => {
|
||||
uni.showToast({ title: '权限列表加载失败', icon: 'none' })
|
||||
}).finally(() => {
|
||||
this.permissionsLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
/** 初始化表单数据 */
|
||||
initFormData(obj) {
|
||||
this.tel = obj.userPhone
|
||||
this.areaId = obj.areaId
|
||||
|
|
@ -339,75 +139,68 @@
|
|||
this.jiamid = obj.id
|
||||
this.beizhu = obj.remark
|
||||
this.jiamtype = obj.type
|
||||
|
||||
// 设置权限选中状态
|
||||
this.setPermissionStatus(obj.permissions)
|
||||
|
||||
// 设置身份类型显示
|
||||
this.sheng = obj.type === 1 ? '加盟商' : '合伙人'
|
||||
this.setPermissionStatus(obj.permissions || [])
|
||||
},
|
||||
|
||||
// 设置权限选中状态
|
||||
/** 根据权限 code 数组回填开关状态 */
|
||||
setPermissionStatus(permissions) {
|
||||
const permissionMap = {
|
||||
'area:view': 0,
|
||||
'area:edit': 1,
|
||||
'areaPromotion:view': 2,
|
||||
'areaPromotion:edit': 3,
|
||||
'areaSub:view': 4,
|
||||
'areaSub:edit': 5,
|
||||
'fault:view': 6,
|
||||
'fault:edit': 7,
|
||||
'order:view': 8,
|
||||
'order:edit': 9,
|
||||
'device:view': 10,
|
||||
'device:edit': 11,
|
||||
'ad:view': 12,
|
||||
'ad:edit': 13,
|
||||
'suit:view': 14,
|
||||
'suit:edit': 15,
|
||||
'model:view': 16,
|
||||
'model:edit': 17,
|
||||
'customerService:view': 18,
|
||||
'customerService:edit': 19,
|
||||
'vip:view': 20,
|
||||
'vip:edit': 21,
|
||||
'vipOrder:view': 22,
|
||||
'vipOrder:edit': 23,
|
||||
'vipUser:view': 24,
|
||||
'vipUser:edit': 25,
|
||||
'complaint:view': 26,
|
||||
'complaint:edit': 27,
|
||||
'agreement:view': 28,
|
||||
'agreement:edit': 29,
|
||||
'powerWork:view': 30,
|
||||
'powerWork:edit': 31,
|
||||
'dispatchLog:view': 32
|
||||
}
|
||||
|
||||
permissions.forEach(permission => {
|
||||
const index = permissionMap[permission]
|
||||
if (index !== undefined) {
|
||||
this.list[index].checked = true
|
||||
}
|
||||
const permSet = new Set(permissions)
|
||||
this.permissionGroups.forEach(group => {
|
||||
group.items.forEach(item => {
|
||||
if (!item.isDefault) {
|
||||
item.checked = permSet.has(item.code)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
// 身份选择确认
|
||||
/** 全部全选 */
|
||||
handleSelectAllGlobal() {
|
||||
this.permissionGroups.forEach(group => {
|
||||
group.items.forEach(item => { item.checked = true })
|
||||
})
|
||||
},
|
||||
|
||||
/** 全部取消(保留默认权限) */
|
||||
handleDeselectAllGlobal() {
|
||||
this.permissionGroups.forEach(group => {
|
||||
group.items.forEach(item => {
|
||||
if (!item.isDefault) item.checked = false
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
/** 分组全选 */
|
||||
handleSelectAllGroup(gi) {
|
||||
this.permissionGroups[gi].items.forEach(item => { item.checked = true })
|
||||
},
|
||||
|
||||
/** 分组取消(保留该组默认权限) */
|
||||
handleDeselectAllGroup(gi) {
|
||||
this.permissionGroups[gi].items.forEach(item => {
|
||||
if (!item.isDefault) item.checked = false
|
||||
})
|
||||
},
|
||||
|
||||
/** 身份选择确认 */
|
||||
confirm(e) {
|
||||
this.sheng = e[0].label
|
||||
this.jiamtype = e[0].value
|
||||
},
|
||||
|
||||
// 收集选中的权限
|
||||
/** 收集选中的权限 code */
|
||||
collectPermissions() {
|
||||
return this.list
|
||||
.filter(item => item.checked)
|
||||
.map(item => this.permissionConfig[item.name])
|
||||
.filter(Boolean) // 过滤掉undefined
|
||||
const codes = []
|
||||
this.permissionGroups.forEach(group => {
|
||||
group.items.forEach(item => {
|
||||
if (item.checked) codes.push(item.code)
|
||||
})
|
||||
})
|
||||
return codes
|
||||
},
|
||||
|
||||
// 构建请求数据
|
||||
/** 构建请求数据 */
|
||||
buildRequestData() {
|
||||
return {
|
||||
id: this.jiamid,
|
||||
|
|
@ -420,43 +213,27 @@
|
|||
}
|
||||
},
|
||||
|
||||
// 处理API响应
|
||||
/** 处理 API 响应 */
|
||||
handleApiResponse(res, successMessage) {
|
||||
if (res.code === 200) {
|
||||
uni.showToast({
|
||||
title: successMessage,
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 2000)
|
||||
uni.showToast({ title: successMessage, icon: 'success', duration: 2000 })
|
||||
setTimeout(() => { uni.navigateBack() }, 2000)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
uni.showToast({ title: res.msg, icon: 'none', duration: 2000 })
|
||||
}
|
||||
},
|
||||
|
||||
// 点击创建/编辑
|
||||
/** 点击创建/编辑 */
|
||||
async btncj() {
|
||||
const data = this.buildRequestData()
|
||||
const isEdit = this.tit === '编辑加盟伙伴'
|
||||
const apiMethod = isEdit ? 'put' : 'post'
|
||||
const apiUrl = '/bst/areaJoin'
|
||||
const successMessage = isEdit ? '编辑成功' : '创建成功'
|
||||
|
||||
try {
|
||||
const res = await this.$u[apiMethod](apiUrl, data)
|
||||
const res = await this.$u[apiMethod]('/bst/areaJoin', data)
|
||||
this.handleApiResponse(res, successMessage)
|
||||
} catch (error) {
|
||||
uni.showToast({
|
||||
title: '请求失败,请重试',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
uni.showToast({ title: '请求失败,请重试', icon: 'none', duration: 2000 })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -469,47 +246,111 @@
|
|||
padding-bottom: 22rpx;
|
||||
}
|
||||
|
||||
.swlist {
|
||||
margin-top: 34rpx;
|
||||
.section-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
margin-top: 40rpx;
|
||||
|
||||
.swlist_val {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 324rpx;
|
||||
height: 144rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||
padding-top: 28rpx;
|
||||
padding-left: 38rpx;
|
||||
box-sizing: border-box;
|
||||
margin-top: 18rpx;
|
||||
.title {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.lt {
|
||||
.one {
|
||||
font-size: 28rpx;
|
||||
.global-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.action-btn {
|
||||
font-size: 26rpx;
|
||||
color: #4C97E7;
|
||||
padding: 0 10rpx;
|
||||
}
|
||||
|
||||
.action-divider {
|
||||
font-size: 24rpx;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.loading-tip {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 40rpx 0;
|
||||
}
|
||||
|
||||
.permission-group {
|
||||
margin-top: 24rpx;
|
||||
background: #fff;
|
||||
border-radius: 24rpx;
|
||||
padding: 24rpx 28rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
.group-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.group-name {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: #3D3D3D;
|
||||
}
|
||||
|
||||
.two {
|
||||
font-size: 24rpx;
|
||||
color: #808080;
|
||||
margin-top: 12rpx;
|
||||
.group-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.rt {
|
||||
margin-top: 24rpx;
|
||||
padding-right: 12rpx;
|
||||
.swlist {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.swlist_val {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 48%;
|
||||
min-height: 120rpx;
|
||||
background: #F4F5F7;
|
||||
border-radius: 16rpx;
|
||||
padding: 20rpx 20rpx 20rpx 24rpx;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.lt {
|
||||
flex: 1;
|
||||
padding-right: 12rpx;
|
||||
|
||||
.one {
|
||||
font-size: 26rpx;
|
||||
color: #3D3D3D;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.two {
|
||||
font-size: 22rpx;
|
||||
color: #808080;
|
||||
margin-top: 8rpx;
|
||||
line-height: 1.4;
|
||||
}
|
||||
}
|
||||
|
||||
.rt {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 32rpx;
|
||||
color: #3D3D3D;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.page {
|
||||
|
|
@ -520,7 +361,6 @@
|
|||
height: 100%;
|
||||
overflow-y: scroll;
|
||||
background: #F4F5F7;
|
||||
border-radius: 0rpx 0rpx 0rpx 0rpx;
|
||||
padding: 32rpx 36rpx;
|
||||
box-sizing: border-box;
|
||||
padding-bottom: 100rpx;
|
||||
|
|
@ -530,8 +370,8 @@
|
|||
height: 90rpx;
|
||||
margin: auto;
|
||||
background: linear-gradient(270deg, #4C97E7 0%, #4C97E7 100%);
|
||||
border-radius: 54rpx 54rpx 54rpx 54rpx;
|
||||
margin-top: 110rpx;
|
||||
border-radius: 54rpx;
|
||||
margin-top: 80rpx;
|
||||
margin-bottom: 78rpx;
|
||||
font-weight: 500;
|
||||
font-size: 40rpx;
|
||||
|
|
@ -540,58 +380,14 @@
|
|||
line-height: 90rpx;
|
||||
}
|
||||
|
||||
.swlist {
|
||||
margin-top: 34rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.swlist_val {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 324rpx;
|
||||
height: 144rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||
padding-top: 28rpx;
|
||||
padding-left: 38rpx;
|
||||
box-sizing: border-box;
|
||||
margin-top: 18rpx;
|
||||
}
|
||||
|
||||
.lt {
|
||||
.one {
|
||||
font-size: 28rpx;
|
||||
color: #3D3D3D;
|
||||
}
|
||||
|
||||
.two {
|
||||
font-size: 24rpx;
|
||||
color: #808080;
|
||||
margin-top: 12rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.rt {
|
||||
margin-top: 24rpx;
|
||||
padding-right: 12rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 32rpx;
|
||||
color: #3D3D3D;
|
||||
}
|
||||
|
||||
.list {
|
||||
width: 680rpx;
|
||||
max-height: 578rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||
border-radius: 24rpx;
|
||||
padding: 46rpx 36rpx;
|
||||
box-sizing: border-box;
|
||||
margin-top: 34rpx;
|
||||
margin-bottom: 47rpx;
|
||||
margin-bottom: 0rpx;
|
||||
|
||||
.list_val {
|
||||
display: flex;
|
||||
|
|
@ -604,7 +400,7 @@
|
|||
width: 430rpx;
|
||||
height: 70rpx;
|
||||
background: #F0F0F0;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
border-radius: 12rpx;
|
||||
padding-left: 32rpx;
|
||||
box-sizing: border-box;
|
||||
font-size: 28rpx;
|
||||
|
|
@ -614,4 +410,4 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -128,14 +128,14 @@
|
|||
|
||||
<script>
|
||||
var xBlufi = require("@/components/blufi/xBlufi.js")
|
||||
import VehicleCard from './components/VehicleCard.vue'
|
||||
import PackageSelector from './components/PackageSelector.vue'
|
||||
import CheckVideoUploader from './components/CheckVideoUploader.vue'
|
||||
import PaymentSelector from './components/PaymentSelector.vue'
|
||||
import FeeDetailPanel from './components/FeeDetailPanel.vue'
|
||||
import NoticeModal from './components/NoticeModal.vue'
|
||||
import ServicePanel from './components/ServicePanel.vue'
|
||||
import GuideVideoModal from './components/GuideVideoModal.vue'
|
||||
import FeeDetailPanel from './components/FeeDetailPanel.vue'
|
||||
import GuideVideoModal from './components/GuideVideoModal.vue'
|
||||
import NoticeModal from './components/NoticeModal.vue'
|
||||
import PackageSelector from './components/PackageSelector.vue'
|
||||
import PaymentSelector from './components/PaymentSelector.vue'
|
||||
import ServicePanel from './components/ServicePanel.vue'
|
||||
import VehicleCard from './components/VehicleCard.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
|
@ -153,10 +153,8 @@
|
|||
iconobj: this.$store.state.iconobj,
|
||||
bgc: { backgroundColor: "#4C97E7" },
|
||||
fanganindex: 0,
|
||||
zutime: 1,
|
||||
checked: true,
|
||||
mxflag: true,
|
||||
macid: '',
|
||||
modelId: '',
|
||||
taocanlist: [],
|
||||
chesn: '',
|
||||
|
|
@ -169,20 +167,15 @@
|
|||
sn: '',
|
||||
logoflag: false,
|
||||
ver_dataflag: 1,
|
||||
deviceId: '',
|
||||
name: '',
|
||||
zhezhaoflag: true,
|
||||
actiobj: {},
|
||||
paymentList: [],
|
||||
selectedPayment: "",
|
||||
selectedSubPayment: "",
|
||||
mac: '',
|
||||
deviceid: '',
|
||||
devicename: '',
|
||||
devicesarr: [],
|
||||
findDeviceTimer: null,
|
||||
lat: '',
|
||||
lon: '',
|
||||
show: false,
|
||||
huiyuanlist: [],
|
||||
huiyuanobj: {},
|
||||
|
|
@ -216,187 +209,80 @@
|
|||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.duoirder) {
|
||||
this.duoirder = option.duoirder
|
||||
}
|
||||
if (option.duoirder) this.duoirder = option.duoirder
|
||||
this.$u.get(`/app/app/detail?id=${this.$store.state.appid}`).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.$store.state.app = res.data
|
||||
if (res.data.startArticleEnabled == true) {
|
||||
if (uni.getStorageSync('xieyi')) {
|
||||
// already agreed
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/agreement?startArticleId=' + res.data.startArticleId + '&type=1' + '&q=' + option.q
|
||||
})
|
||||
}
|
||||
if (res.data.startArticleEnabled && !uni.getStorageSync('xieyi')) {
|
||||
uni.navigateTo({ url: '/pages/agreement?startArticleId=' + res.data.startArticleId + '&type=1&q=' + option.q })
|
||||
}
|
||||
}
|
||||
})
|
||||
xBlufi.initXBlufi(1)
|
||||
xBlufi.notifyStartDiscoverBle({ 'isStart': true })
|
||||
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent)
|
||||
uni.getLocation({
|
||||
type: 'gcj02',
|
||||
success: function(lb) {},
|
||||
fail: function(error) {}
|
||||
})
|
||||
if (option.modelId) {
|
||||
uni.showLoading({ title: '加载中...', mask: true })
|
||||
setTimeout(() => {
|
||||
this.$u.get("/app/order/mineProcessing").then(res => {
|
||||
if (res.code == 200) {
|
||||
if (res.data && this.duoirder != 1) {
|
||||
uni.switchTab({ url: '/pages/index/index' })
|
||||
this.zhezhaoflag = false
|
||||
uni.hideLoading()
|
||||
} else {
|
||||
this.zhezhaoflag = false
|
||||
uni.hideLoading()
|
||||
this.modelId = option.modelId
|
||||
this.chesn = option.sn
|
||||
this.sn = option.sn
|
||||
this.taocanId = option.t || ''
|
||||
this.getzaixian()
|
||||
this.getQiniuToken()
|
||||
this.gettaocan()
|
||||
this.getcheliang()
|
||||
}
|
||||
} else if (res.code == 401) {
|
||||
this.modelId = option.modelId
|
||||
this.chesn = option.sn
|
||||
this.zhezhaoflag = false
|
||||
uni.hideLoading()
|
||||
this.getlogo(() => {
|
||||
this.sn = option.sn
|
||||
this.taocanId = option.t || ''
|
||||
this.getzaixian()
|
||||
this.getQiniuToken()
|
||||
this.gettaocan()
|
||||
this.getcheliang()
|
||||
})
|
||||
}
|
||||
})
|
||||
}, 1000)
|
||||
} else {
|
||||
uni.showLoading({ title: '加载中...', mask: true })
|
||||
setTimeout(() => {
|
||||
this.$u.get("/app/order/mineProcessing").then((res) => {
|
||||
if (res.code == 200) {
|
||||
if (res.data && this.duoirder != 1) {
|
||||
uni.switchTab({ url: '/pages/index/index' })
|
||||
this.zhezhaoflag = false
|
||||
uni.hideLoading()
|
||||
} else {
|
||||
this.zhezhaoflag = false
|
||||
uni.hideLoading()
|
||||
function getQueryParam(url, paramName) {
|
||||
let regex = new RegExp(`[?&]${paramName}=([^&]*)`)
|
||||
let results = regex.exec(url)
|
||||
return results ? decodeURIComponent(results[1].replace(/\+/g, ' ')) : null
|
||||
}
|
||||
let sceneValue = option.q
|
||||
let decodedValue = decodeURIComponent(sceneValue)
|
||||
this.sn = getQueryParam(decodedValue, 's') || getQueryParam(decodedValue, 'sn')
|
||||
this.taocanId = option.t || getQueryParam(decodedValue, 't') || ''
|
||||
this.$u.get(`/app/device/availableDetail?sn=${this.sn}`).then((res) => {
|
||||
if (res.code == 200) {
|
||||
if (res.data) {
|
||||
this.bikeobj = res.data
|
||||
this.modelId = res.data.modelId
|
||||
this.areaNeedCheckVideo = res.data.areaNeedCheckVideo
|
||||
this.mac = res.data.mac
|
||||
this.getzaixian()
|
||||
this.gettaocan()
|
||||
this.getcheliang()
|
||||
this.getQiniuToken()
|
||||
this.getAreaDetail()
|
||||
}
|
||||
} else {
|
||||
uni.showModal({ title: '提示', content: res.msg, showCancel: false, confirmText: '知道了' })
|
||||
}
|
||||
})
|
||||
}
|
||||
} else if (res.code == 401) {
|
||||
this.zhezhaoflag = false
|
||||
uni.hideLoading()
|
||||
this.getlogo(() => {
|
||||
function getQueryParam(url, paramName) {
|
||||
let regex = new RegExp(`[?&]${paramName}=([^&]*)`)
|
||||
let results = regex.exec(url)
|
||||
return results ? decodeURIComponent(results[1].replace(/\+/g, ' ')) : null
|
||||
}
|
||||
let sceneValue = option.q
|
||||
let decodedValue = decodeURIComponent(sceneValue)
|
||||
this.sn = getQueryParam(decodedValue, 's') || getQueryParam(decodedValue, 'sn')
|
||||
this.taocanId = option.t || getQueryParam(decodedValue, 't') || ''
|
||||
this.$u.get(`/app/device/availableDetail?sn=${this.sn}`).then((res) => {
|
||||
if (res.code == 200) {
|
||||
if (res.data) {
|
||||
this.bikeobj = res.data
|
||||
this.modelId = res.data.modelId
|
||||
this.areaNeedCheckVideo = res.data.areaNeedCheckVideo
|
||||
this.mac = res.data.mac
|
||||
this.getzaixian()
|
||||
this.gettaocan()
|
||||
this.getcheliang()
|
||||
this.getQiniuToken()
|
||||
this.getAreaDetail()
|
||||
}
|
||||
} else {
|
||||
uni.showModal({ title: '提示', content: res.msg, showCancel: false, confirmText: '知道了' })
|
||||
}
|
||||
})
|
||||
})
|
||||
} else {
|
||||
this.zhezhaoflag = false
|
||||
uni.hideLoading()
|
||||
function getQueryParam(url, paramName) {
|
||||
let regex = new RegExp(`[?&]${paramName}=([^&]*)`)
|
||||
let results = regex.exec(url)
|
||||
return results ? decodeURIComponent(results[1].replace(/\+/g, ' ')) : null
|
||||
}
|
||||
let sceneValue = option.q
|
||||
let decodedValue = decodeURIComponent(sceneValue)
|
||||
this.sn = getQueryParam(decodedValue, 's') || getQueryParam(decodedValue, 'sn')
|
||||
this.taocanId = option.t || getQueryParam(decodedValue, 't') || ''
|
||||
this.$u.get(`/app/device/availableDetail?sn=${this.sn}`).then((res) => {
|
||||
if (res.code == 200) {
|
||||
if (res.data) {
|
||||
this.bikeobj = res.data
|
||||
this.mac = res.data.mac
|
||||
this.areaNeedCheckVideo = res.data.areaNeedCheckVideo
|
||||
this.modelId = res.data.modelId
|
||||
this.getzaixian()
|
||||
this.getcheliang()
|
||||
this.getQiniuToken()
|
||||
this.gettaocan()
|
||||
this.getAreaDetail()
|
||||
}
|
||||
} else {
|
||||
uni.showModal({ title: '提示', content: res.msg, showCancel: false, confirmText: '知道了' })
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}, 1000)
|
||||
}
|
||||
uni.getLocation({ type: 'gcj02', success() {}, fail() {} })
|
||||
uni.showLoading({ title: '加载中...', mask: true })
|
||||
setTimeout(() => {
|
||||
this.getgg()
|
||||
this.gethuiyuan()
|
||||
}, 1500)
|
||||
this.$u.get("/app/order/mineProcessing").then(res => {
|
||||
if (res.code == 200 && res.data && this.duoirder != 1) {
|
||||
uni.switchTab({ url: '/pages/index/index' })
|
||||
this.zhezhaoflag = false
|
||||
uni.hideLoading()
|
||||
return
|
||||
}
|
||||
this.zhezhaoflag = false
|
||||
uni.hideLoading()
|
||||
const doInit = () => option.modelId ? this._initWithModelId(option) : this._initFromQuery(option)
|
||||
res.code == 401 ? this.getlogo(doInit) : doInit()
|
||||
})
|
||||
}, 1000)
|
||||
},
|
||||
onShow() {
|
||||
if (this.bikeobj && this.bikeobj.areaId) {
|
||||
this.getAreaDetail()
|
||||
}
|
||||
},
|
||||
onHide() {},
|
||||
onUnload() {
|
||||
// findDeviceTimer 在 getzaixian/蓝牙搜索中用到
|
||||
if (this.findDeviceTimer) clearTimeout(this.findDeviceTimer)
|
||||
},
|
||||
methods: {
|
||||
// ── onLoad 初始化辅助 ────────────────────────
|
||||
_getQueryParam(url, paramName) {
|
||||
const result = new RegExp(`[?&]${paramName}=([^&]*)`).exec(url)
|
||||
return result ? decodeURIComponent(result[1].replace(/\+/g, ' ')) : null
|
||||
},
|
||||
_initWithModelId(option) {
|
||||
this.modelId = option.modelId
|
||||
this.chesn = option.sn
|
||||
this.sn = option.sn
|
||||
this.taocanId = option.t || ''
|
||||
this.getzaixian()
|
||||
this.getQiniuToken()
|
||||
this.gettaocan()
|
||||
this.getcheliang()
|
||||
},
|
||||
_initFromQuery(option) {
|
||||
const decoded = decodeURIComponent(option.q || '')
|
||||
this.sn = this._getQueryParam(decoded, 's') || this._getQueryParam(decoded, 'sn')
|
||||
this.taocanId = option.t || this._getQueryParam(decoded, 't') || ''
|
||||
this.$u.get(`/app/device/availableDetail?sn=${this.sn}`).then(res => {
|
||||
if (res.code == 200 && res.data) {
|
||||
this.bikeobj = res.data
|
||||
this.modelId = res.data.modelId
|
||||
this.areaNeedCheckVideo = res.data.areaNeedCheckVideo
|
||||
this.mac = res.data.mac
|
||||
this.getzaixian()
|
||||
this.getQiniuToken()
|
||||
this.gettaocan()
|
||||
this.getcheliang()
|
||||
this.getAreaDetail()
|
||||
} else {
|
||||
uni.showModal({ title: '提示', content: res.msg, showCancel: false, confirmText: '知道了' })
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// ── 套餐选择 ──────────────────────────────────
|
||||
onPackageSelect(index, item) {
|
||||
this.actiobj = item
|
||||
|
|
@ -572,11 +458,7 @@
|
|||
uni.showToast({ title: '请不要频繁点击', icon: 'none', duration: 2000 })
|
||||
}
|
||||
},
|
||||
tobuy(item) {
|
||||
this.show = true
|
||||
this.huiyuanobj = item
|
||||
},
|
||||
gethuiyuan() {
|
||||
gethuiyuan() {
|
||||
if (!this.bikeobj || !this.bikeobj.areaId) return
|
||||
this.$u.get(`/app/vip/listByArea?areaId=${this.bikeobj.areaId}`).then(res => {
|
||||
if (res.code == 200) this.huiyuanlist = res.data || []
|
||||
|
|
@ -622,16 +504,17 @@
|
|||
}
|
||||
},
|
||||
|
||||
// ── 公告 ─────────────────────────────────────
|
||||
getgg() {
|
||||
this.$u.get(`/app/agreement/latest?areaId=${this.bikeobj.areaId}&agreementType=0`).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.ggobj = res.data || null
|
||||
} else {
|
||||
this.ggobj = null
|
||||
}
|
||||
})
|
||||
},
|
||||
// ── 公告 ─────────────────────────────────────
|
||||
getgg() {
|
||||
if (!this.bikeobj || !this.bikeobj.areaId) return
|
||||
this.$u.get(`/app/agreement/latest?areaId=${this.bikeobj.areaId}&agreementType=0`).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.ggobj = res.data || null
|
||||
} else {
|
||||
this.ggobj = null
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// ── 协议 ─────────────────────────────────────
|
||||
btnxy(num) {
|
||||
|
|
@ -957,66 +840,48 @@
|
|||
})
|
||||
},
|
||||
|
||||
// ── 手机号快捷登录 ───────────────────────────
|
||||
getPhoneNumber(e) {
|
||||
const wxLoginAsync = () => new Promise((resolve, reject) => {
|
||||
wx.login({
|
||||
success(res) {
|
||||
if (res.code) resolve({ jscode: res.code, mobileCode: e.detail.code })
|
||||
else reject(res.errMsg)
|
||||
},
|
||||
fail(err) { reject(err) }
|
||||
})
|
||||
// ── 手机号快捷登录 ───────────────────────────
|
||||
getPhoneNumber(e) {
|
||||
const wxLoginAsync = () => new Promise((resolve, reject) => {
|
||||
wx.login({
|
||||
success(res) {
|
||||
if (res.code) resolve({ jscode: res.code, mobileCode: e.detail.code })
|
||||
else reject(res.errMsg)
|
||||
},
|
||||
fail(err) { reject(err) }
|
||||
})
|
||||
wxLoginAsync().then(async (data) => {
|
||||
let datas = { mobileCode: data.mobileCode, loginCode: data.jscode, appId: this.$store.state.appid }
|
||||
this.$u.post("/wxLogin", datas).then((res) => {
|
||||
if (res.code == 200) {
|
||||
wx.setStorageSync('token', res.token)
|
||||
this.$u.get(`/app/device/availableDetail?sn=${this.sn == '' ? this.chesn : this.sn}`).then((res) => {
|
||||
if (res.code == 200 && res.data) {
|
||||
this.bikeobj = res.data
|
||||
this.mac = res.data.mac
|
||||
this.areaNeedCheckVideo = res.data.areaNeedCheckVideo
|
||||
this.modelId = res.data.modelId
|
||||
this.getcheliang()
|
||||
} else {
|
||||
uni.showModal({ title: '提示', content: res.msg, showCancel: false, confirmText: '知道了' })
|
||||
}
|
||||
})
|
||||
this.logoflag = false
|
||||
} else {
|
||||
uni.showToast({ title: res.msg, icon: 'none', duration: 2000 })
|
||||
}
|
||||
})
|
||||
})
|
||||
wxLoginAsync().then(async (data) => {
|
||||
const datas = { mobileCode: data.mobileCode, loginCode: data.jscode, appId: this.$store.state.appid }
|
||||
this.$u.post("/wxLogin", datas).then(res => {
|
||||
if (res.code == 200) {
|
||||
wx.setStorageSync('token', res.token)
|
||||
this.logoflag = false
|
||||
this.getcheliang()
|
||||
} else {
|
||||
uni.showToast({ title: res.msg, icon: 'none', duration: 2000 })
|
||||
}
|
||||
})
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
// ── 获取车辆信息 ─────────────────────────────
|
||||
getcheliang() {
|
||||
if (this.chesn == '') {
|
||||
this.$u.get(`/app/device/availableDetail?sn=${this.sn}`).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.bikeobj = res.data
|
||||
this.areaNeedCheckVideo = res.data.areaNeedCheckVideo
|
||||
this.mac = res.data.mac
|
||||
this.$u.put(`/app/user/bindArea?areaId=${res.data.areaId}`).then(resp => {})
|
||||
this.gettaocan()
|
||||
this.getAreaDetail()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$u.get(`/app/device/availableDetail?sn=${this.chesn}`).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.areaNeedCheckVideo = res.data.areaNeedCheckVideo
|
||||
this.mac = res.data.mac
|
||||
this.bikeobj = res.data
|
||||
this.gettaocan()
|
||||
this.getAreaDetail()
|
||||
}
|
||||
})
|
||||
// ── 获取车辆信息 ─────────────────────────────
|
||||
getcheliang() {
|
||||
const sn = this.chesn || this.sn
|
||||
this.$u.get(`/app/device/availableDetail?sn=${sn}`).then(res => {
|
||||
if (res.code == 200 && res.data) {
|
||||
this.bikeobj = res.data
|
||||
this.modelId = res.data.modelId
|
||||
this.areaNeedCheckVideo = res.data.areaNeedCheckVideo
|
||||
this.mac = res.data.mac
|
||||
if (!this.chesn) this.$u.put(`/app/user/bindArea?areaId=${res.data.areaId}`).then(() => {})
|
||||
this.gettaocan()
|
||||
this.getAreaDetail()
|
||||
this.getgg()
|
||||
this.gethuiyuan()
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
// ── 获取套餐 ─────────────────────────────────
|
||||
gettaocan() {
|
||||
|
|
|
|||
|
|
@ -3,416 +3,182 @@
|
|||
<u-navbar :title="tit" :border-bottom="false" :background="bgc" title-color='#000' back-icon-color="#000"
|
||||
title-size='36' height='50'></u-navbar>
|
||||
<view class="box">
|
||||
<view class="title">
|
||||
基本信息
|
||||
</view>
|
||||
<view class="title">基本信息</view>
|
||||
<view class="list">
|
||||
<view class="list_val">
|
||||
<view class="" style="padding-top:12rpx">备注名</view> <input type="text" v-model="beizhu"
|
||||
placeholder="请输入备注名" />
|
||||
<view class="" style="padding-top:12rpx">备注名</view>
|
||||
<input type="text" v-model="beizhu" placeholder="请输入备注名" />
|
||||
</view>
|
||||
<view class="list_val" style="position: relative;">
|
||||
<view class="" style="padding-top:12rpx;width: 176rpx;">身份类型</view> <input type="text" disabled="false" v-model="sheng" :placeholder="sheng" />
|
||||
<!-- <u-select v-model="show" :list="arr" @confirm="confirm"></u-select> -->
|
||||
<view class="" style="padding-top:12rpx;width: 176rpx;">身份类型</view>
|
||||
<input type="text" disabled="false" v-model="sheng" :placeholder="sheng" />
|
||||
</view>
|
||||
<view class="list_val">
|
||||
<view class="" style="padding-top:12rpx">手机号码</view> <input type="text" v-model="tel"
|
||||
placeholder="请输入手机号码" />
|
||||
<view class="" style="padding-top:12rpx">手机号码</view>
|
||||
<input type="text" v-model="tel" placeholder="请输入手机号码" />
|
||||
</view>
|
||||
<!-- <view class="list_val">
|
||||
<view class="" style="padding-top:12rpx">分成比例</view> <input type="text" v-model="bili"
|
||||
placeholder="请输入分成比例%" />
|
||||
</view> -->
|
||||
|
||||
</view>
|
||||
<view class="title">
|
||||
权限
|
||||
|
||||
<!-- 权限区域 -->
|
||||
<view class="section-header">
|
||||
<view class="title">权限</view>
|
||||
<view class="global-actions" v-if="permissionGroups.length > 0">
|
||||
<text class="action-btn" @click="handleSelectAllGlobal">全选</text>
|
||||
<text class="action-divider">|</text>
|
||||
<text class="action-btn" @click="handleDeselectAllGlobal">取消全选</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="swlist">
|
||||
<view class="swlist_val" v-for="(item,index) in list" :key="index">
|
||||
<view class="lt">
|
||||
<view class="one">
|
||||
{{item.name}}
|
||||
</view>
|
||||
<view class="two">
|
||||
{{item.tit}}
|
||||
</view>
|
||||
|
||||
<view v-if="permissionsLoading" class="loading-tip">
|
||||
<u-loading mode="circle" size="36"></u-loading>
|
||||
<text style="margin-left: 12rpx; color: #999; font-size: 26rpx;">加载中...</text>
|
||||
</view>
|
||||
|
||||
<view v-for="(group, gi) in permissionGroups" :key="gi" class="permission-group">
|
||||
<view class="group-header">
|
||||
<text class="group-name">{{ group.group }}</text>
|
||||
<view class="group-actions">
|
||||
<text class="action-btn" @click="handleSelectAllGroup(gi)">全选</text>
|
||||
<text class="action-divider">|</text>
|
||||
<text class="action-btn" @click="handleDeselectAllGroup(gi)">取消</text>
|
||||
</view>
|
||||
<view class="rt" v-if="item.name == '查看运营区'">
|
||||
<u-switch v-model="item.checked" :disabled="true" active-color="#2b2929" size="36"
|
||||
inactive-color="#eee"></u-switch>
|
||||
</view>
|
||||
<view class="rt" v-else>
|
||||
<u-switch v-model="item.checked" active-color="#4C97E7" size="36"
|
||||
inactive-color="#eee"></u-switch>
|
||||
</view>
|
||||
<view class="swlist">
|
||||
<view class="swlist_val" v-for="(item, ii) in group.items" :key="ii">
|
||||
<view class="lt">
|
||||
<view class="one">{{ item.name }}</view>
|
||||
<view class="two">{{ item.description }}</view>
|
||||
</view>
|
||||
<view class="rt">
|
||||
<u-switch
|
||||
v-model="item.checked"
|
||||
:disabled="item.isDefault"
|
||||
:active-color="item.isDefault ? '#2b2929' : '#4C97E7'"
|
||||
size="36"
|
||||
inactive-color="#eee"
|
||||
></u-switch>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="baocun" @click="btncj">
|
||||
{{tit}}
|
||||
</view>
|
||||
<view class="baocun" @click="btncj">{{ tit }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
bgc: {
|
||||
backgroundColor: "#fff"
|
||||
},
|
||||
level: '',
|
||||
bgc: { backgroundColor: "#fff" },
|
||||
tel: '',
|
||||
sheng: '运维',
|
||||
arr: [{
|
||||
label: '加盟商',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
label: '合伙人',
|
||||
value: 2
|
||||
}
|
||||
],
|
||||
tit: '创建运维人员',
|
||||
userId: '',
|
||||
bili: '',
|
||||
beizhu: '',
|
||||
jiamtype: '',
|
||||
jiamtype: 3,
|
||||
areaId: '',
|
||||
jiamid: '',
|
||||
// 权限映射配置
|
||||
permissionConfig: {
|
||||
'查看运营区': 'area:view',
|
||||
'操作运营区': 'area:edit',
|
||||
'查看运营区推广': 'areaPromotion:view',
|
||||
'操作运营区推广': 'areaPromotion:edit',
|
||||
'查看停车区': 'areaSub:view',
|
||||
'操作停车区': 'areaSub:edit',
|
||||
'查看故障': 'fault:view',
|
||||
'故障审核': 'fault:edit',
|
||||
'查看订单': 'order:view',
|
||||
'操作订单': 'order:edit',
|
||||
'查看车辆': 'device:view',
|
||||
'操作车辆': 'device:edit',
|
||||
// '查看订单金额': 'order:view:amount',
|
||||
'查看广告': 'ad:view',
|
||||
'操作广告': 'ad:edit',
|
||||
'查看套餐': 'suit:view',
|
||||
'操作套餐': 'suit:edit',
|
||||
'查看车型': 'model:view',
|
||||
'操作车型': 'model:edit',
|
||||
'查看客服': 'customerService:view',
|
||||
'操作客服': 'customerService:edit',
|
||||
'查看卡券': 'vip:view',
|
||||
'操作卡券': 'vip:edit',
|
||||
'查看卡券订单': 'vipOrder:view',
|
||||
'操作卡券订单': 'vipOrder:edit',
|
||||
'查看用户卡券': 'vipUser:view',
|
||||
'操作用户卡券': 'vipUser:edit',
|
||||
'查看投诉': 'complaint:view',
|
||||
'操作投诉': 'complaint:edit',
|
||||
'查看协议': 'agreement:view',
|
||||
'操作协议': 'agreement:edit',
|
||||
'查看换电工单': 'powerWork:view',
|
||||
'操作换电工单': 'powerWork:edit',
|
||||
'查看调度日志': 'dispatchLog:view',
|
||||
},
|
||||
list: [{
|
||||
name: '查看运营区',
|
||||
tit: '是否允许',
|
||||
checked: true,
|
||||
txt: 1
|
||||
},
|
||||
{
|
||||
name: '操作运营区',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 2
|
||||
},
|
||||
{
|
||||
name: '查看运营区推广',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 3
|
||||
},
|
||||
{
|
||||
name: '操作运营区推广',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 4
|
||||
},
|
||||
{
|
||||
name: '查看停车区',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 5
|
||||
},
|
||||
{
|
||||
name: '操作停车区',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 6
|
||||
},
|
||||
{
|
||||
name: '查看故障',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 7
|
||||
},
|
||||
{
|
||||
name: '故障审核',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 8
|
||||
},
|
||||
{
|
||||
name: '查看订单',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 9
|
||||
},
|
||||
{
|
||||
name: '操作订单',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 10
|
||||
},
|
||||
{
|
||||
name: '查看车辆',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 11
|
||||
},
|
||||
{
|
||||
name: '操作车辆',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 12
|
||||
},
|
||||
{
|
||||
name: '查看广告',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 13
|
||||
},
|
||||
{
|
||||
name: '操作广告',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 14
|
||||
},
|
||||
{
|
||||
name: '查看套餐',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 15
|
||||
},
|
||||
{
|
||||
name: '操作套餐',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 16
|
||||
},
|
||||
{
|
||||
name: '查看车型',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 17
|
||||
},
|
||||
{
|
||||
name: '操作车型',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 18
|
||||
},
|
||||
// {
|
||||
// name: '查看订单金额',
|
||||
// tit: '是否允许',
|
||||
// checked: false,
|
||||
// txt: 17
|
||||
// },
|
||||
{
|
||||
name: '查看客服',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 19
|
||||
},
|
||||
{
|
||||
name: '操作客服',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 20
|
||||
},
|
||||
{
|
||||
name: '查看卡券',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 21
|
||||
},
|
||||
{
|
||||
name: '操作卡券',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 22
|
||||
},
|
||||
{
|
||||
name: '查看卡券订单',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 23
|
||||
},
|
||||
{
|
||||
name: '操作卡券订单',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 24
|
||||
},
|
||||
{
|
||||
name: '查看用户卡券',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 25
|
||||
},
|
||||
{
|
||||
name: '操作用户卡券',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 26
|
||||
},
|
||||
{
|
||||
name: '查看投诉',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 27
|
||||
},
|
||||
{
|
||||
name: '操作投诉',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 28
|
||||
},
|
||||
{
|
||||
name: '查看协议',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 29
|
||||
},
|
||||
{
|
||||
name: '操作协议',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 30
|
||||
}, {
|
||||
name: '查看换电工单',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 31
|
||||
},{
|
||||
name: '操作换电工单',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 32
|
||||
},{
|
||||
name: '查看调度日志',
|
||||
tit: '是否允许',
|
||||
checked: false,
|
||||
txt: 33
|
||||
},
|
||||
|
||||
],
|
||||
permissionsLoading: false,
|
||||
permissionGroups: []
|
||||
}
|
||||
},
|
||||
|
||||
onLoad(option) {
|
||||
this.areaId = uni.getStorageSync('adminAreaid')
|
||||
|
||||
if (option.item) {
|
||||
this.tit = '编辑运维人员'
|
||||
const obj = JSON.parse(option.item)
|
||||
this.initFormData(obj)
|
||||
}
|
||||
this.loadPermissions().then(() => {
|
||||
if (option.item) {
|
||||
this.tit = '编辑运维人员'
|
||||
const obj = JSON.parse(option.item)
|
||||
this.initFormData(obj)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化表单数据
|
||||
initFormData(obj) {
|
||||
this.tel = obj.userPhone
|
||||
this.areaId = obj.areaId
|
||||
this.bili = obj.point
|
||||
this.jiamid = obj.id
|
||||
this.beizhu = obj.remark
|
||||
this.jiamtype = obj.type
|
||||
|
||||
// 设置权限选中状态
|
||||
this.setPermissionStatus(obj.permissions)
|
||||
|
||||
// 设置身份类型显示
|
||||
},
|
||||
|
||||
// 设置权限选中状态
|
||||
setPermissionStatus(permissions) {
|
||||
const permissionMap = {
|
||||
'area:view': 0,
|
||||
'area:edit': 1,
|
||||
'areaPromotion:view': 2,
|
||||
'areaPromotion:edit': 3,
|
||||
'areaSub:view': 4,
|
||||
'areaSub:edit': 5,
|
||||
'fault:view': 6,
|
||||
'fault:edit': 7,
|
||||
'order:view': 8,
|
||||
'order:edit': 9,
|
||||
'device:view': 10,
|
||||
'device:edit': 11,
|
||||
'ad:view': 12,
|
||||
'ad:edit': 13,
|
||||
'suit:view': 14,
|
||||
'suit:edit': 15,
|
||||
'model:view': 16,
|
||||
'model:edit': 17,
|
||||
// 'order:view:amount': 16,
|
||||
'customerService:view': 18,
|
||||
'customerService:edit': 19,
|
||||
'vip:view': 20,
|
||||
'vip:edit': 21,
|
||||
'vipOrder:view': 22,
|
||||
'vipOrder:edit': 23,
|
||||
'vipUser:view': 24,
|
||||
'vipUser:edit': 25,
|
||||
'complaint:view': 26,
|
||||
'complaint:edit': 27,
|
||||
'agreement:view': 28,
|
||||
'agreement:edit': 29,
|
||||
'powerWork:view': 30,
|
||||
'powerWork:edit': 31,
|
||||
'dispatchLog:view': 32
|
||||
}
|
||||
|
||||
permissions.forEach(permission => {
|
||||
const index = permissionMap[permission]
|
||||
if (index !== undefined) {
|
||||
this.list[index].checked = true
|
||||
/** 从接口加载权限分组 */
|
||||
loadPermissions() {
|
||||
this.permissionsLoading = true
|
||||
return this.$u.get('/bst/areaJoin/permissions').then(res => {
|
||||
if (res.code === 200 && res.data) {
|
||||
this.permissionGroups = res.data.map(group => ({
|
||||
...group,
|
||||
items: group.items.map(item => ({
|
||||
...item,
|
||||
checked: !!item.isDefault
|
||||
}))
|
||||
}))
|
||||
}
|
||||
}).catch(() => {
|
||||
uni.showToast({ title: '权限列表加载失败', icon: 'none' })
|
||||
}).finally(() => {
|
||||
this.permissionsLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
// 身份选择确认
|
||||
confirm(e) {
|
||||
this.sheng = e[0].label
|
||||
this.jiamtype = e[0].value
|
||||
/** 初始化表单数据 */
|
||||
initFormData(obj) {
|
||||
this.tel = obj.userPhone
|
||||
this.areaId = obj.areaId
|
||||
this.jiamid = obj.id
|
||||
this.beizhu = obj.remark
|
||||
this.jiamtype = obj.type
|
||||
this.setPermissionStatus(obj.permissions || [])
|
||||
},
|
||||
|
||||
// 收集选中的权限
|
||||
/** 根据权限 code 数组回填开关状态 */
|
||||
setPermissionStatus(permissions) {
|
||||
const permSet = new Set(permissions)
|
||||
this.permissionGroups.forEach(group => {
|
||||
group.items.forEach(item => {
|
||||
if (!item.isDefault) {
|
||||
item.checked = permSet.has(item.code)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
/** 全部全选 */
|
||||
handleSelectAllGlobal() {
|
||||
this.permissionGroups.forEach(group => {
|
||||
group.items.forEach(item => { item.checked = true })
|
||||
})
|
||||
},
|
||||
|
||||
/** 全部取消(保留默认权限) */
|
||||
handleDeselectAllGlobal() {
|
||||
this.permissionGroups.forEach(group => {
|
||||
group.items.forEach(item => {
|
||||
if (!item.isDefault) item.checked = false
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
/** 分组全选 */
|
||||
handleSelectAllGroup(gi) {
|
||||
this.permissionGroups[gi].items.forEach(item => { item.checked = true })
|
||||
},
|
||||
|
||||
/** 分组取消(保留该组默认权限) */
|
||||
handleDeselectAllGroup(gi) {
|
||||
this.permissionGroups[gi].items.forEach(item => {
|
||||
if (!item.isDefault) item.checked = false
|
||||
})
|
||||
},
|
||||
|
||||
/** 收集选中的权限 code */
|
||||
collectPermissions() {
|
||||
return this.list
|
||||
.filter(item => item.checked)
|
||||
.map(item => this.permissionConfig[item.name])
|
||||
.filter(Boolean) // 过滤掉undefined
|
||||
const codes = []
|
||||
this.permissionGroups.forEach(group => {
|
||||
group.items.forEach(item => {
|
||||
if (item.checked) codes.push(item.code)
|
||||
})
|
||||
})
|
||||
return codes
|
||||
},
|
||||
|
||||
// 构建请求数据
|
||||
/** 构建请求数据 */
|
||||
buildRequestData() {
|
||||
return {
|
||||
id: this.jiamid,
|
||||
|
|
@ -425,43 +191,27 @@
|
|||
}
|
||||
},
|
||||
|
||||
// 处理API响应
|
||||
/** 处理 API 响应 */
|
||||
handleApiResponse(res, successMessage) {
|
||||
if (res.code === 200) {
|
||||
uni.showToast({
|
||||
title: successMessage,
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 2000)
|
||||
uni.showToast({ title: successMessage, icon: 'success', duration: 2000 })
|
||||
setTimeout(() => { uni.navigateBack() }, 2000)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
uni.showToast({ title: res.msg, icon: 'none', duration: 2000 })
|
||||
}
|
||||
},
|
||||
|
||||
// 点击创建/编辑
|
||||
/** 点击创建/编辑 */
|
||||
async btncj() {
|
||||
const data = this.buildRequestData()
|
||||
const isEdit = this.tit === '编辑运维人员'
|
||||
const apiMethod = isEdit ? 'put' : 'post'
|
||||
const apiUrl = '/bst/areaJoin'
|
||||
const successMessage = isEdit ? '编辑成功' : '创建成功'
|
||||
|
||||
try {
|
||||
const res = await this.$u[apiMethod](apiUrl, data)
|
||||
const res = await this.$u[apiMethod]('/bst/areaJoin', data)
|
||||
this.handleApiResponse(res, successMessage)
|
||||
} catch (error) {
|
||||
uni.showToast({
|
||||
title: '请求失败,请重试',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
uni.showToast({ title: '请求失败,请重试', icon: 'none', duration: 2000 })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -474,47 +224,111 @@
|
|||
padding-bottom: 22rpx;
|
||||
}
|
||||
|
||||
.swlist {
|
||||
margin-top: 34rpx;
|
||||
.section-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
margin-top: 40rpx;
|
||||
|
||||
.swlist_val {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 324rpx;
|
||||
height: 144rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||
padding-top: 28rpx;
|
||||
padding-left: 38rpx;
|
||||
box-sizing: border-box;
|
||||
margin-top: 18rpx;
|
||||
.title {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.lt {
|
||||
.one {
|
||||
font-size: 28rpx;
|
||||
.global-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.action-btn {
|
||||
font-size: 26rpx;
|
||||
color: #4C97E7;
|
||||
padding: 0 10rpx;
|
||||
}
|
||||
|
||||
.action-divider {
|
||||
font-size: 24rpx;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.loading-tip {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 40rpx 0;
|
||||
}
|
||||
|
||||
.permission-group {
|
||||
margin-top: 24rpx;
|
||||
background: #fff;
|
||||
border-radius: 24rpx;
|
||||
padding: 24rpx 28rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
.group-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.group-name {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: #3D3D3D;
|
||||
}
|
||||
|
||||
.two {
|
||||
font-size: 24rpx;
|
||||
color: #808080;
|
||||
margin-top: 12rpx;
|
||||
.group-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.rt {
|
||||
margin-top: 24rpx;
|
||||
padding-right: 12rpx;
|
||||
.swlist {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.swlist_val {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 48%;
|
||||
min-height: 120rpx;
|
||||
background: #F4F5F7;
|
||||
border-radius: 16rpx;
|
||||
padding: 20rpx 20rpx 20rpx 24rpx;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.lt {
|
||||
flex: 1;
|
||||
padding-right: 12rpx;
|
||||
|
||||
.one {
|
||||
font-size: 26rpx;
|
||||
color: #3D3D3D;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.two {
|
||||
font-size: 22rpx;
|
||||
color: #808080;
|
||||
margin-top: 8rpx;
|
||||
line-height: 1.4;
|
||||
}
|
||||
}
|
||||
|
||||
.rt {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 32rpx;
|
||||
color: #3D3D3D;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.page {
|
||||
|
|
@ -525,7 +339,6 @@
|
|||
height: 100%;
|
||||
overflow-y: scroll;
|
||||
background: #F4F5F7;
|
||||
border-radius: 0rpx 0rpx 0rpx 0rpx;
|
||||
padding: 32rpx 36rpx;
|
||||
box-sizing: border-box;
|
||||
padding-bottom: 100rpx;
|
||||
|
|
@ -535,8 +348,8 @@
|
|||
height: 90rpx;
|
||||
margin: auto;
|
||||
background: linear-gradient(270deg, #4C97E7 0%, #4C97E7 100%);
|
||||
border-radius: 54rpx 54rpx 54rpx 54rpx;
|
||||
margin-top: 110rpx;
|
||||
border-radius: 54rpx;
|
||||
margin-top: 80rpx;
|
||||
margin-bottom: 78rpx;
|
||||
font-weight: 500;
|
||||
font-size: 40rpx;
|
||||
|
|
@ -545,58 +358,13 @@
|
|||
line-height: 90rpx;
|
||||
}
|
||||
|
||||
.swlist {
|
||||
margin-top: 34rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.swlist_val {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 324rpx;
|
||||
height: 144rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||
padding-top: 28rpx;
|
||||
padding-left: 38rpx;
|
||||
box-sizing: border-box;
|
||||
margin-top: 18rpx;
|
||||
}
|
||||
|
||||
.lt {
|
||||
.one {
|
||||
font-size: 28rpx;
|
||||
color: #3D3D3D;
|
||||
}
|
||||
|
||||
.two {
|
||||
font-size: 24rpx;
|
||||
color: #808080;
|
||||
margin-top: 12rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.rt {
|
||||
margin-top: 24rpx;
|
||||
padding-right: 12rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 32rpx;
|
||||
color: #3D3D3D;
|
||||
}
|
||||
|
||||
.list {
|
||||
width: 680rpx;
|
||||
max-height: 578rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||
border-radius: 24rpx;
|
||||
padding: 46rpx 36rpx;
|
||||
box-sizing: border-box;
|
||||
margin-top: 34rpx;
|
||||
margin-bottom: 47rpx;
|
||||
|
||||
.list_val {
|
||||
display: flex;
|
||||
|
|
@ -609,7 +377,7 @@
|
|||
width: 430rpx;
|
||||
height: 70rpx;
|
||||
background: #F0F0F0;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
border-radius: 12rpx;
|
||||
padding-left: 32rpx;
|
||||
box-sizing: border-box;
|
||||
font-size: 28rpx;
|
||||
|
|
@ -619,4 +387,4 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
<view class="card" v-for="(item,index) in allList" :key="index" @click="toOrderDetail(item.deviceSn,item.id,item)">
|
||||
<view class="line"></view>
|
||||
<view class="top_info">
|
||||
<view class="top_info_left" style="display: flex; align-items: center; flex-wrap: wrap;">
|
||||
<view class="top_info_left" style="display: flex; align-items: center; ">
|
||||
<text v-if="item.timeout == false">{{item.no}}</text>
|
||||
<text v-else style="color: red;">{{item.no}}</text>
|
||||
<text style="color: red;" v-if="item.timeout == true"> ·超时</text>
|
||||
|
|
@ -135,9 +135,9 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import TabBar from '@/page_shanghu/components/tab-bar/tab-bar.vue';
|
||||
import { ChannelApiType } from '@/common/enums/channel';
|
||||
import ZhimaNoDepositBadge from '@/components/zhima-no-deposit-badge/zhima-no-deposit-badge.vue';
|
||||
import ZhimaNoDepositBadge from '@/components/zhima-no-deposit-badge/zhima-no-deposit-badge.vue';
|
||||
import TabBar from '@/page_shanghu/components/tab-bar/tab-bar.vue';
|
||||
|
||||
let timerId;
|
||||
let timerId1;
|
||||
|
|
@ -602,11 +602,9 @@
|
|||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
.top_info_left {
|
||||
width: 70%;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
flex: 1;
|
||||
font-size: 26rpx;
|
||||
color: #3D3D3D;
|
||||
font-weight: 600;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<view>
|
||||
<u-mask :show="show" @click="handleClose" :z-index="100" />
|
||||
<u-mask :show="show" :z-index="100" />
|
||||
<view class="nfc-add-dialog" v-if="show">
|
||||
<!-- 标题 -->
|
||||
<view class="dialog-title">添加NFC卡</view>
|
||||
|
|
@ -172,12 +172,12 @@
|
|||
|
||||
// NFC卡片发现回调
|
||||
onNfcDiscovered(res) {
|
||||
const uid = this.arrayBufferToHex(res.id)
|
||||
const uid = this.arrayBufferToHex(res.id).toUpperCase().padStart(16, '0')
|
||||
console.log('[NFC] 原始响应:', res)
|
||||
console.log('[NFC] 卡片UID (hex):', uid.toUpperCase())
|
||||
console.log('[NFC] 卡片UID (hex):', uid)
|
||||
console.log('[NFC] 技术类型 techs:', res.techs)
|
||||
console.log('[NFC] NDEF messages:', res.messages)
|
||||
this.form.nfcNo = uid.toUpperCase()
|
||||
this.form.nfcNo = uid
|
||||
this.nfcReadSuccess = true
|
||||
this.stopNfcRead()
|
||||
uni.showToast({ title: '读取成功', icon: 'success', duration: 1500 })
|
||||
|
|
@ -224,15 +224,15 @@
|
|||
}
|
||||
uni.showLoading({ title: '绑定中...', mask: true })
|
||||
const data = {
|
||||
id: this.deviceId,
|
||||
deviceId: this.deviceId,
|
||||
nfcNo: this.form.nfcNo.trim(),
|
||||
type: this.form.type,
|
||||
remark: this.form.remark.trim() || undefined
|
||||
}
|
||||
this.$u.put('/bst/device/iot/bindNfc', data).then(res => {
|
||||
this.$u.post('/bst/deviceNfc', data).then(res => {
|
||||
uni.hideLoading()
|
||||
if (res.code === 200) {
|
||||
uni.showToast({ title: '绑定成功', icon: 'success' })
|
||||
uni.showToast({ title: '新增成功', icon: 'success' })
|
||||
this.$emit('success')
|
||||
this.handleClose()
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -140,12 +140,7 @@
|
|||
},
|
||||
deleteNfc(item) {
|
||||
uni.showLoading({ title: '删除中...', mask: true })
|
||||
const data = {
|
||||
id: this.deviceId,
|
||||
nfcNo: item.nfcNo,
|
||||
type: item.type
|
||||
}
|
||||
this.$u.put('/bst/device/iot/unbindNfc', data).then(res => {
|
||||
this.$u.delete('/bst/deviceNfc?id=' + item.id).then(res => {
|
||||
uni.hideLoading()
|
||||
if (res.code === 200) {
|
||||
uni.showToast({ title: '删除成功', icon: 'success' })
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@
|
|||
<view class="info-card overview-card" style="z-index: 1;">
|
||||
<view class="card-header">
|
||||
<view class="order-no-box" style="display: flex; align-items: center;">
|
||||
<text class="label">订单编号:</text>
|
||||
<text class="value">{{orderxqobj.no}}</text>
|
||||
<zhima-no-deposit-badge v-if="orderxqobj.payChannelApiType === ChannelApiType.ZHIMA_DEPOSIT_ONLY.value" style="margin-left: 12rpx;" />
|
||||
</view>
|
||||
|
|
@ -630,7 +629,7 @@
|
|||
const app = getApp()
|
||||
var xBlufi = require("@/components/blufi/xBlufi.js")
|
||||
import { ChannelApiType } from '@/common/enums/channel'
|
||||
import ZhimaNoDepositBadge from '@/components/zhima-no-deposit-badge/zhima-no-deposit-badge.vue'
|
||||
import ZhimaNoDepositBadge from '@/components/zhima-no-deposit-badge/zhima-no-deposit-badge.vue'
|
||||
|
||||
let _this = null
|
||||
export default {
|
||||
|
|
@ -2975,7 +2974,7 @@
|
|||
margin-bottom: 30rpx;
|
||||
|
||||
.order-no-box {
|
||||
font-size: 28rpx;
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
|
||||
.value {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user