二维码生成页面中心icon没了的bug
一次大型分包更新生产了 合作企业路由 /packageQr/pages/partnership/partnership 员工管理路由 /packageStaff/pages/staff/List/List 油站二维码路由 /packageQr/pages/qrsite/QrCode_xy 加油订单路由改成 /packageOrders/pages/orderList/orderList
This commit is contained in:
@@ -1,217 +0,0 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="content text-left padding">
|
||||
<view class="strong padding-bottom-xs color-333 ">
|
||||
{{oilSite.oilSiteName}}
|
||||
</view>
|
||||
<view class="font-12 color-999">
|
||||
<text class=" text-cut">{{oilSite.address}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-left padding-right">
|
||||
<view class="padding-bottom-sm">
|
||||
油号选择:
|
||||
</view>
|
||||
<view class="grid col-5 justify-start">
|
||||
<view class="padding-xs" v-for="(item,index) in oilList" :key="index">
|
||||
<button class="cu-btn" @tap="oilNameSel(item)" :class="[selected.oilName===item.oilName?'bg-main-oil':'line-gray']">{{item.oilName}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-top-xs padding-left padding-right">
|
||||
<text class="strong padding-right font-16">
|
||||
{{selected.oilName}}
|
||||
</text>
|
||||
<text class="padding-right">星油价格:<text class="oil-main-color text-bold">¥{{selected.xkPrice?selected.xkPrice:selected.lvPrice|numberFilter}}/L</text></text>
|
||||
<text class="s-rich">市场价:¥{{selected.standardPrice|numberFilter}}/L</text>
|
||||
</view>
|
||||
<view class="padding-left padding-right">
|
||||
<view class="padding-bottom-sm">
|
||||
油枪选择:
|
||||
</view>
|
||||
<view class="grid col-5 justify-start">
|
||||
|
||||
<view class="padding-xs" v-for="(item,index) in ColorList" :key="index">
|
||||
<button @tap="gunIdSel(index)" class="cu-btn" :class="[gunId===index?'bg-main-oil':'line-gray']">{{index+1}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="solid-top margin-top-sm shadow-warp">
|
||||
<view class="cu-form-group">
|
||||
<view class="title">加油升数</view>
|
||||
<input type="digit" v-model="vol" @input="calcMoney" placeholder="请输入加油升数" name="input" />
|
||||
<text>约¥{{money.total|numberFilter}}</text>
|
||||
</view>
|
||||
<view class="my-cell">
|
||||
<text class="font-12">星卡优惠金额</text><text class="fr">-¥{{money.discount|numberFilter}}</text>
|
||||
</view>
|
||||
<view class="my-cell">
|
||||
<text class="font-12">实际支付金额</text><text class="oil-main-color fr">¥{{money.realPay|numberFilter}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<button class="margin round bg-main-oil" @tap="onConfirm">确定</button>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
oilList: {
|
||||
type: Array,
|
||||
default () {}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
active: 0,
|
||||
vol: '',
|
||||
oliNameList: [1, 2, 9, 10],
|
||||
ColorList: [1, 2, 9, 10],
|
||||
gunId: 0,
|
||||
oilSite: uni.getStorageSync('oilSite'),
|
||||
selected: {
|
||||
xkPrice: '',
|
||||
standardPrice: ''
|
||||
},
|
||||
money: {
|
||||
total: '',
|
||||
discount: '',
|
||||
realPay: ''
|
||||
},
|
||||
price: 1
|
||||
}
|
||||
},
|
||||
created() {
|
||||
console.log(this.oilList)
|
||||
this.initForm()
|
||||
},
|
||||
watch: {
|
||||
oilList: {
|
||||
handler(newVal, oldVal) {
|
||||
console.log('深度监听', newVal, oldVal)
|
||||
this.oilList = newVal
|
||||
this.initForm()
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
selected: {
|
||||
handler(newVal, oldVal) {
|
||||
console.log('深度监听2323', newVal, oldVal)
|
||||
this.selected = newVal
|
||||
if (newVal) {
|
||||
this.calcMoney()
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
gunIdSel(index) {
|
||||
this.gunId = index
|
||||
},
|
||||
oilNameSel(item) {
|
||||
this.selected = item
|
||||
|
||||
},
|
||||
initForm() {
|
||||
if (this.oilList) {
|
||||
this.selected = this.oilList[0]
|
||||
}
|
||||
},
|
||||
onConfirm() {
|
||||
const data5 = {
|
||||
...this.selected,
|
||||
vol: this.vol,
|
||||
oilPrice: this.selected.xkPrice ? this.selected.xkPrice : this.selected.lvPrice,
|
||||
gunId: this.gunId + 1,
|
||||
realPay: this.money.realPay
|
||||
}
|
||||
console.log('被选中的', data5)
|
||||
this.$emit('confirmVol', data5)
|
||||
},
|
||||
calcMoney(e) {
|
||||
// var vol;
|
||||
// vol = e.detail.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3');
|
||||
// this.vol = vol
|
||||
|
||||
this.price = this.selected.xkPrice ? this.selected.xkPrice : this.selected.lvPrice
|
||||
this.money.total = this.vol * this.selected.standardPrice
|
||||
this.money.discount = this.money.total - this.vol * (this.selected.standardPrice - this.price)
|
||||
this.money.realPay = (this.money.total - this.money.discount).toFixed(2)
|
||||
console.log('总金额', '折扣', '实际支付')
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
numberFilter(value) {
|
||||
value = value - 1 + 1
|
||||
if (value) {
|
||||
return value.toFixed(2)
|
||||
} else {
|
||||
return '0.00'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page-content {
|
||||
background-color: #F1F2F7;
|
||||
min-height: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.navigation {
|
||||
position: absolute;
|
||||
right: 16px;
|
||||
top: 10px;
|
||||
}
|
||||
|
||||
.icon-self {
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
}
|
||||
|
||||
.oil-price {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.oil-price radio {
|
||||
position: absolute;
|
||||
left: 0rem;
|
||||
top: 10px;
|
||||
}
|
||||
|
||||
.qr-icon {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
.pay-desc {
|
||||
line-height: 2rem;
|
||||
}
|
||||
|
||||
.bottom-pay {
|
||||
min-height: 100rpx;
|
||||
width: 750upx;
|
||||
}
|
||||
|
||||
.pay-bar {
|
||||
width: 750upx;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.money-container {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.money-position {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
display: block;
|
||||
border-radius: 0 0 0 100upx;
|
||||
}
|
||||
</style>
|
||||
@@ -1,110 +0,0 @@
|
||||
<template>
|
||||
<view class="margin padding bg-gragul-oil radius company-card">
|
||||
<view class="padding-top padding-bottom-lg flex">
|
||||
<view class="basis-xl">
|
||||
<text class="text-white">{{company.companyName}}</text>
|
||||
<view class="padding-top-xs">
|
||||
<text class="text-white" @tap="makeCall(company.leaderPhone)">负责人:{{company.leaderName}} ({{company.leaderPhone|phoneFilter}})</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="basis-xs">
|
||||
<!-- bg-qy -->
|
||||
<view class="bg-qy">
|
||||
<image style="width: 100%;" :src="mainURL+'bg-qy.png'" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="dashed-top padding-top">
|
||||
<view class="flex">
|
||||
<view class="flex-sub text-center" v-show="company.openJoinCompany" @tap="joinqr">
|
||||
<button class="cu-btn round bg-white text-red text-sm">
|
||||
<text class="text-lg">
|
||||
<text class="cuIcon-qr_code padding-right-xs"></text>
|
||||
</text>
|
||||
出示二维码
|
||||
</button>
|
||||
</view>
|
||||
<view class="flex-sub text-center" v-show="company.openDirectOil" @tap="oiling">
|
||||
<button class="cu-btn round bg-white text-red text-sm">
|
||||
<text class="text-lg">
|
||||
<text class="cuIcon-addressbook padding-right-xs"></text>
|
||||
</text>
|
||||
<!-- <text class="cuIcon-crown padding-right-xs"></text> -->
|
||||
直接加油
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props:{
|
||||
company:{
|
||||
type:Object,
|
||||
default(){}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
mainURL: this.global.mainURL,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
oiling() {
|
||||
uni.navigateTo({
|
||||
url: `/pages/partnership/partner-group/partner-group?id=${this.company.companyId}`
|
||||
})
|
||||
},
|
||||
joinqr() {
|
||||
uni.navigateTo({
|
||||
url: `/pages/partnership/join-qr/join-qr?id=${this.company.companyId}&name=${this.company.companyName}`
|
||||
})
|
||||
},
|
||||
makeCall(number){
|
||||
uni.makePhoneCall({
|
||||
phoneNumber:number
|
||||
})
|
||||
}
|
||||
},
|
||||
filters:{
|
||||
phoneFilter(value){
|
||||
if(value){
|
||||
return value.substring(0, 3) + ' ' + ' **** ' + ' ' + value.substring(7, 11)
|
||||
}else{
|
||||
return '暂无手机号'
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.bg-gragul-oil {
|
||||
background: linear-gradient(-51deg, rgba(255, 0, 0, 0.81), rgba(255, 19, 19, 0.81));
|
||||
}
|
||||
|
||||
.dashed-top::after {
|
||||
border-color: #fff !important;
|
||||
}
|
||||
|
||||
.company-card {
|
||||
position: relative;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.bg-qy {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
width: 120upx;
|
||||
height: 120upx;
|
||||
top: 15rpx;
|
||||
right: 2.5rem;
|
||||
}
|
||||
|
||||
.cu-btn {
|
||||
border-radius: 100upx 100upx 100upx 0;
|
||||
}
|
||||
</style>
|
||||
@@ -1,67 +0,0 @@
|
||||
<template>
|
||||
<view class="solid-bottom content" @tap="virtualScan(driver.driverId)">
|
||||
<view class="text-xl">
|
||||
<text class="cuIcon-deliver text-red padding-sm padding-bottom-0">
|
||||
</text>
|
||||
<text class="text-df text-black padding-top-sm">
|
||||
{{driver.plateNumber?driver.plateNumber:'暂无车牌号'}}
|
||||
</text>
|
||||
</view>
|
||||
<view class="padding-left padding-bottom margin-left">
|
||||
<view class="bg-white padding-left-xs">
|
||||
<text class="padding-right-lg text-df">{{driver.userName}} ({{driver.driverId}})</text>{{driver.phone|phoneFilter}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import partnerApi from '@/api/partner.js'
|
||||
export default {
|
||||
props: {
|
||||
driver: {
|
||||
type: Object,
|
||||
default () {}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
mainURL: this.global.mainURL,
|
||||
loginUser: uni.getStorageSync('loginUser'),
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
virtualScan(id) {
|
||||
partnerApi.getQrCode(id).then(res=>{
|
||||
if(res.code==20000){
|
||||
uni.setStorageSync('qrCode', res.data)
|
||||
uni.navigateTo({
|
||||
url:`/pages/stationDetail/stationDetail`
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
phoneFilter(value) {
|
||||
if (value) {
|
||||
return value.substring(0, 3) + ' ' + ' **** ' + ' ' + value.substring(7, 11)
|
||||
} else {
|
||||
return '暂无手机号'
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.cu-tag {
|
||||
border-radius: 100upx 0 0 100upx;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 30rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -26,7 +26,6 @@
|
||||
}
|
||||
},
|
||||
created() {
|
||||
console.log('之心')
|
||||
this.calcPrice()
|
||||
},
|
||||
filters: {
|
||||
|
||||
@@ -1,262 +0,0 @@
|
||||
// 可供选择的订单
|
||||
// 开票列表
|
||||
<template>
|
||||
<view class="cu-item radius shadow margin-bottom ">
|
||||
<!-- <image class="pay-status" :src="baseURL+'static/img/oil-unfinished.png'" alt /> -->
|
||||
<view class="cu-avatar text-sl" v-if="item.sourceType==='3'" :style="'background-image:url('+baseURL+'static/img/order-wjy.png)'"></view>
|
||||
<view class="cu-avatar text-sl" v-if="item.sourceType==='4'||item.sourceType==='6'" :style="'background-image:url('+baseURL+'static/img/order-xy.png)'"></view>
|
||||
<view class="cu-avatar text-sl" v-if="item.sourceType==='5'" :style="'background-image:url('+baseURL+'static/img/order-lv.png)'"></view>
|
||||
<view class="content">
|
||||
<view class=" solid-bottom padding-bottom-sm">
|
||||
<view class="flex-treble" @tap="copyId(item.orderID)">
|
||||
{{item.orderID}}<text class="flex-sub padding-left-sm text-right cuIcon-copy text-lg text-red">
|
||||
</text>
|
||||
|
||||
|
||||
</view>
|
||||
<view class="flex-sub text-right cuIcon-right" @tap="toDetails(item.orderID)">
|
||||
</view>
|
||||
</view>
|
||||
<view class=" text-content text-df">
|
||||
{{item.oilSiteName}}
|
||||
</view>
|
||||
<view class="text-sm padding-top-sm" @tap="toDetails(item.orderID)">
|
||||
<view class="flex">
|
||||
<view class="details">
|
||||
<view class="top1 text-left">
|
||||
<image class="icon icon-desc " :src="baseURL+'static/img/oil-lf.png'" alt />
|
||||
<text class="padding-left-xs padding-right-xs" v-if="item.vol"> {{item.vol|numberFilter}}升</text>
|
||||
<text>
|
||||
{{item.oilName}}
|
||||
</text>
|
||||
|
||||
</view>
|
||||
<view class="bottom text-left">
|
||||
<image class="icon icon-desc " :src="baseURL+'static/img/oil-time.png'" alt />
|
||||
|
||||
<text class="padding-left-xs">
|
||||
{{item.createDatetime.substring(0, 10)}}
|
||||
|
||||
</text>
|
||||
</view>
|
||||
<view class="bottom text-left">
|
||||
<image class="icon icon-desc " :src="baseURL+'static/img/mini-car.png'" alt />
|
||||
|
||||
<text class="padding-left-xs">
|
||||
加油车牌: {{item.carNo}}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-top-sm flex justify-between" @tap="toDetails(item.orderID)">
|
||||
<view class="text-gray text-df">
|
||||
{{item.createDatetime.substring(0,19)}}</view>
|
||||
<view>
|
||||
<text class="color-000 text-lg total-money">¥{{item.realamount|numberFilter}}</text>
|
||||
<view class="round pay-state light bg-olive bg-transparent text-center state-0" v-if="item.istate==0">
|
||||
<text class="inner-istate round">{{item.istate|formatStr}}</text>
|
||||
<view class="inner-border">
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="round pay-state light bg-orange bg-transparent text-center state-1" v-if="item.istate==1">
|
||||
<text class="inner-istate round">{{item.istate|formatStr}}</text>
|
||||
<view class="inner-border">
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="round pay-state light bg-oilve bg-transparent text-center state--1" v-if="item.istate==-1">
|
||||
<text class="inner-istate round">{{item.istate|formatStr}}</text>
|
||||
<view class="inner-border">
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="round pay-state light bg-gray bg-transparent text-center state--2" v-if="item.istate==-2">
|
||||
<text class="inner-istate round">{{item.istate|formatStr}}</text>
|
||||
<view class="inner-border">
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<!-- <text v-show="item.orderType!='9'&&item.orderType!='0'" class="text-sm text-orange">(分单)</text> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <xkempty v-else></xkempty> -->
|
||||
<!-- <Empty /> -->
|
||||
<!-- 评价的弹出层 -->
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'oilOrders',
|
||||
|
||||
props: {
|
||||
item: {
|
||||
type: Object,
|
||||
default () {}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
baseURL: this.global.baseURL
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
copyId(id) {
|
||||
uni.setClipboardData({
|
||||
data: id,
|
||||
success: () => {
|
||||
uni.showToast({
|
||||
title: '订单号已复制',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
toDetails(id) {
|
||||
uni.setStorageSync('orderId', id)
|
||||
console.log('id', id)
|
||||
uni.navigateTo({
|
||||
url: '/pages/orderList/OrderDetail/OrderDetail'
|
||||
})
|
||||
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
toT(value) {
|
||||
if (value) {
|
||||
return value / 1000
|
||||
}
|
||||
},
|
||||
dateFormat(value) {
|
||||
if (value) {
|
||||
return value.substring(5, 16)
|
||||
}
|
||||
},
|
||||
numberFilter(value) {
|
||||
value = value - 1 + 1
|
||||
return value.toFixed(2)
|
||||
},
|
||||
formatStr(value) {
|
||||
switch (parseInt(value)) {
|
||||
case 1:
|
||||
return '已支付'
|
||||
case -1:
|
||||
return '支付失败'
|
||||
case -2:
|
||||
return '退款'
|
||||
case 0:
|
||||
return '待支付'
|
||||
default:
|
||||
return '待支付'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.cu-avatar {
|
||||
background-color: rgba(255, 255, 255, 0);
|
||||
}
|
||||
|
||||
.icon-car {
|
||||
height: 41px;
|
||||
background-size: contain;
|
||||
float: left;
|
||||
margin-top: -8px;
|
||||
margin-left: -6px;
|
||||
}
|
||||
|
||||
.car-position {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.bottom {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.icon-desc {
|
||||
display: inline-block;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
position: relative;
|
||||
top: 1px;
|
||||
line-height: 25px;
|
||||
}
|
||||
|
||||
|
||||
.details {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
|
||||
.cu-item {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.pay-status {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
right: 100upx;
|
||||
top: 50rpx;
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
}
|
||||
|
||||
.pay-state {
|
||||
position: absolute;
|
||||
right: 2rem;
|
||||
bottom: 1rem;
|
||||
width: 172upx;
|
||||
height: 172upx;
|
||||
line-height: 172upx;
|
||||
transform: rotate(-30deg);
|
||||
|
||||
}
|
||||
|
||||
.inner-border {
|
||||
position: absolute;
|
||||
width: 142upx;
|
||||
height: 142upx;
|
||||
left: 14upx;
|
||||
border-radius: 800upx;
|
||||
top: 14upx;
|
||||
}
|
||||
|
||||
.state-0 {
|
||||
border: 1px solid #8dc63f;
|
||||
}
|
||||
|
||||
.state-1 {
|
||||
border: 1px solid #f37b1d;
|
||||
}
|
||||
|
||||
.state--1 {
|
||||
border: 1px solid #f37b1d;
|
||||
}
|
||||
|
||||
.state--2 {
|
||||
border: 1px solid #666;
|
||||
}
|
||||
|
||||
.state-0 .inner-border {
|
||||
border: 1px dashed #8dc63f;
|
||||
}
|
||||
|
||||
.state-1 .inner-border {
|
||||
border: 1px dashed #f37b1d;
|
||||
}
|
||||
|
||||
.state--1 .inner-border {
|
||||
border: 1px dashed #f37b1d;
|
||||
}
|
||||
|
||||
.state--2 .inner-border {
|
||||
border: 1px dashed #666;
|
||||
}
|
||||
</style>
|
||||
@@ -1,73 +0,0 @@
|
||||
<template>
|
||||
<view class="cu-item">
|
||||
<view class="cu-avatar round lg" :style="'background-image: url('+mainURL+'default-avator.png)'">
|
||||
<!-- {{staff.cUserName.substring(-1)}} -->
|
||||
</view>
|
||||
<!-- <view class="cu-avatar round lg" >
|
||||
{{staff.cUserName.slice(0,1)}}
|
||||
</view> -->
|
||||
<view class="content">
|
||||
<view class="text-black">{{staff.cUserName}}
|
||||
<text v-show="loginUser.id===staff.cUserId" class="padding-left-sm text-orange text-sm">
|
||||
(当前登录账号)
|
||||
</text>
|
||||
</view>
|
||||
<view class="text-gray flex" @tap="callStaff(staff.phone)">
|
||||
<view class="text-cut text-df">
|
||||
<text class="cuIcon-phone oil-main-color margin-right-xs"></text>
|
||||
<text>{{staff.phone}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="action solid-left" v-show="!staff.cType">
|
||||
<button class="cu-btn padding-left-xs padding-right-xs bg-white" @tap="toEdit(staff.cUserId)">编辑</button>
|
||||
</view>
|
||||
<view class="action" v-show="staff.cType==1">
|
||||
<view class="cu-tag text-white round my-tag" style="background-color:#FE0505;">超级管理员</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
staff: {
|
||||
type: Object,
|
||||
default () {}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
mainURL: this.global.mainURL,
|
||||
loginUser: uni.getStorageSync('loginUser'),
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
callStaff(phone) {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: phone
|
||||
})
|
||||
},
|
||||
toEdit(Uid) {
|
||||
uni.setStorageSync('tempUid', {
|
||||
id: Uid,
|
||||
type: 'edit'
|
||||
})
|
||||
uni.navigateTo({
|
||||
url: '/pages/staff/editStaff/editStaff'
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.cu-tag {
|
||||
border-radius: 100upx 0 0 100upx;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 30rpx;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,210 +0,0 @@
|
||||
<template xlang="wxml" minapp="mpvue">
|
||||
<view class="tki-qrcode">
|
||||
<!-- #ifndef MP-ALIPAY -->
|
||||
<canvas class="tki-qrcode-canvas" :canvas-id="cid" :style="{width:cpSize+'px',height:cpSize+'px'}" />
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-ALIPAY -->
|
||||
<canvas :id="cid" :width="cpSize" :height="cpSize" class="tki-qrcode-canvas" />
|
||||
<!-- #endif -->
|
||||
<image v-show="show" :src="result" :style="{width:cpSize+'px',height:cpSize+'px'}" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import QRCode from "./qrcode.js"
|
||||
let qrcode
|
||||
export default {
|
||||
name: "tki-qrcode",
|
||||
props: {
|
||||
cid: {
|
||||
type: String,
|
||||
default: 'tki-qrcode-canvas'
|
||||
},
|
||||
size: {
|
||||
type: Number,
|
||||
default: 200
|
||||
},
|
||||
unit: {
|
||||
type: String,
|
||||
default: 'upx'
|
||||
},
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
val: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
background: {
|
||||
type: String,
|
||||
default: '#ffffff'
|
||||
},
|
||||
foreground: {
|
||||
type: String,
|
||||
default: '#000000'
|
||||
},
|
||||
pdground: {
|
||||
type: String,
|
||||
default: '#000000'
|
||||
},
|
||||
icon: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
iconSize: {
|
||||
type: Number,
|
||||
default: 40
|
||||
},
|
||||
lv: {
|
||||
type: Number,
|
||||
default: 3
|
||||
},
|
||||
onval: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
loadMake: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
usingComponents: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
showLoading: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
loadingText: {
|
||||
type: String,
|
||||
default: '二维码生成中'
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
result: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
_makeCode() {
|
||||
let that = this
|
||||
if (!this._empty(this.val)) {
|
||||
qrcode = new QRCode({
|
||||
context: that, // 上下文环境
|
||||
canvasId:that.cid, // canvas-id
|
||||
usingComponents: that.usingComponents, // 是否是自定义组件
|
||||
showLoading: that.showLoading, // 是否显示loading
|
||||
loadingText: that.loadingText, // loading文字
|
||||
text: that.val, // 生成内容
|
||||
size: that.cpSize, // 二维码大小
|
||||
background: that.background, // 背景色
|
||||
foreground: that.foreground, // 前景色
|
||||
pdground: that.pdground, // 定位角点颜色
|
||||
correctLevel: that.lv, // 容错级别
|
||||
image: that.icon, // 二维码图标
|
||||
imageSize: that.iconSize,// 二维码图标大小
|
||||
cbResult: function (res) { // 生成二维码的回调
|
||||
that._result(res)
|
||||
},
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '二维码内容不能为空',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
},
|
||||
_clearCode() {
|
||||
this._result('')
|
||||
qrcode.clear()
|
||||
},
|
||||
_saveCode() {
|
||||
let that = this;
|
||||
if (this.result != "") {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: that.result,
|
||||
success: function () {
|
||||
uni.showToast({
|
||||
title: '二维码保存成功',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
_result(res) {
|
||||
this.result = res;
|
||||
this.$emit('result', res)
|
||||
},
|
||||
_empty(v) {
|
||||
let tp = typeof v,
|
||||
rt = false;
|
||||
if (tp == "number" && String(v) == "") {
|
||||
rt = true
|
||||
} else if (tp == "undefined") {
|
||||
rt = true
|
||||
} else if (tp == "object") {
|
||||
if (JSON.stringify(v) == "{}" || JSON.stringify(v) == "[]" || v == null) rt = true
|
||||
} else if (tp == "string") {
|
||||
if (v == "" || v == "undefined" || v == "null" || v == "{}" || v == "[]") rt = true
|
||||
} else if (tp == "function") {
|
||||
rt = false
|
||||
}
|
||||
return rt
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
size: function (n, o) {
|
||||
if (n != o && !this._empty(n)) {
|
||||
this.cSize = n
|
||||
if (!this._empty(this.val)) {
|
||||
setTimeout(() => {
|
||||
this._makeCode()
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
},
|
||||
val: function (n, o) {
|
||||
if (this.onval) {
|
||||
if (n != o && !this._empty(n)) {
|
||||
setTimeout(() => {
|
||||
this._makeCode()
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
cpSize() {
|
||||
if(this.unit == "upx"){
|
||||
return uni.upx2px(this.size)
|
||||
}else{
|
||||
return this.size
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
if (this.loadMake) {
|
||||
if (!this._empty(this.val)) {
|
||||
setTimeout(() => {
|
||||
this._makeCode()
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.tki-qrcode {
|
||||
position: relative;
|
||||
}
|
||||
.tki-qrcode-canvas {
|
||||
position: fixed;
|
||||
top: -99999upx;
|
||||
left: -99999upx;
|
||||
z-index: -99999;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user