医废工具端小程序源码
This commit is contained in:
@@ -0,0 +1,137 @@
|
||||
<template>
|
||||
<view>
|
||||
<scroll-view scroll-y class="page">
|
||||
<cu-custom bgColor="bg-cyan"><block slot="content">首页</block></cu-custom>
|
||||
<view class="photoView">
|
||||
<view class="photoImage">
|
||||
<open-data type="userAvatarUrl"></open-data>
|
||||
</view>
|
||||
</view>
|
||||
<view style="padding-top:20%;">
|
||||
<view class='text-center margin-bottom text-lg text-grey'>请扫描科室、设备或人员二维码进行配置</view>
|
||||
</view>
|
||||
<view class="padding flex flex-direction" style="padding-top: 40%;">
|
||||
<button class="cu-btn bg-cyan margin-tb-sm lg" @click="buttonClick">扫码配置</button>
|
||||
<button class="cu-btn bg-red margin-tb-sm lg" @click="buttonClick1">注销账号</button>
|
||||
</view>
|
||||
<view class="cu-tabbar-height"></view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
mounted(){
|
||||
if(getApp().globalData.openid == '' || getApp().globalData.openid == 'undefined'){
|
||||
uni.navigateTo({
|
||||
url: '/pages/plugin/register'
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
buttonClick() {
|
||||
let that = this;
|
||||
uni.scanCode({
|
||||
success: function (res) {
|
||||
let code = res.result;
|
||||
uni.request({
|
||||
url: 'https://lekapi.opmonitor.com/?c=app_api&a=getToolQrcodeType',
|
||||
data: {code: code},
|
||||
header: {
|
||||
'Content-type': 'application/json'
|
||||
},
|
||||
success: function(res){
|
||||
if(res.data.data.type === "error"){
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '不存在的医废二维码',
|
||||
success: function(res){
|
||||
if(res.confirm) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/index/index"
|
||||
})
|
||||
}else if (res.cancal){
|
||||
uni.navigateTo({
|
||||
url: "/pages/index/index"
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}else if(res.data.data.type === "device"){
|
||||
uni.navigateTo({
|
||||
url: "/pages/component/postByDevice?qrcode="+res.data.data.qrcode
|
||||
})
|
||||
}else if(res.data.data.type === "department"){
|
||||
uni.navigateTo({
|
||||
url: "/pages/component/postByDepartment?qrcode="+res.data.data.qrcode
|
||||
})
|
||||
}else if(res.data.data.type === "user"){
|
||||
uni.navigateTo({
|
||||
url: "/pages/component/postByUser?qrcode="+res.data.data.qrcode
|
||||
})
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
console.info('小程序域名不正确,请检查域名的正确性')
|
||||
}
|
||||
})
|
||||
},
|
||||
fail: () => {
|
||||
console.info('调用照相功能失败!!!')
|
||||
}
|
||||
})
|
||||
},
|
||||
buttonClick1() {
|
||||
let openid = getApp().globalData.openid;
|
||||
let that = this;
|
||||
uni.request({
|
||||
url: "https://lekapi.opmonitor.com/?c=app_api&a=getToolCancel",
|
||||
data: {openid: openid},
|
||||
header: {
|
||||
'Content-type': 'application/json'
|
||||
},
|
||||
success: function(res){
|
||||
if(res.data.data === 'success'){
|
||||
getApp().globalData = []
|
||||
uni.navigateTo({
|
||||
url: "/pages/plugin/check"
|
||||
})
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
console.info('小程序域名不正确,请检查域名的正确性')
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.page {
|
||||
width: 100vw;
|
||||
height: 100Vh;
|
||||
}
|
||||
|
||||
.photoView {
|
||||
padding-top: 150rpx;
|
||||
position: relative;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
.photoImage {
|
||||
overflow:hidden;
|
||||
display: block;
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
margin: 20rpx;
|
||||
border-radius: 50%;
|
||||
border: 2px solid #fff;
|
||||
box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user