提交 48b1c27e 作者: wk

图标替换

父级 6b3b1fc3
......@@ -97,6 +97,14 @@ const params = {
url: "/api/v2/org/o_job_v2/get_job_list_by_dept_id",
method: "get"
},
examine: {
url: "/api/v2/org/o_org_v2/examine_join_org",
method: "post"
},
getExamineList: {
url: "/api/v2/org/o_org_v2/get_join_org_list",
method: "get"
},
wxToLogin: {
url: "/ydt/api/v1/access/user_third/temp_login",
method: "post"
......
......@@ -6,9 +6,9 @@
</template>
<script>
import QRCode from "./qrcode.js"
let qrcode
export default {
import QRCode from "./qrcode.js"
let qrcode
export default {
name: "tki-qrcode",
props: {
cid: {
......@@ -87,7 +87,7 @@ export default {
if (!this._empty(this.val)) {
qrcode = new QRCode({
context: that, // 上下文环境
canvasId:that.cid, // canvas-id
canvasId: that.cid, // canvas-id
usingComponents: that.usingComponents, // 是否是自定义组件
showLoading: that.showLoading, // 是否显示loading
loadingText: that.loadingText, // loading文字
......@@ -98,8 +98,8 @@ export default {
pdground: that.pdground, // 定位角点颜色
correctLevel: that.lv, // 容错级别
image: that.icon, // 二维码图标
imageSize: that.iconSize,// 二维码图标大小
cbResult: function (res) { // 生成二维码的回调
imageSize: that.iconSize, // 二维码图标大小
cbResult: function(res) { // 生成二维码的回调
that._result(res)
},
});
......@@ -120,7 +120,7 @@ export default {
if (this.result != "") {
uni.saveImageToPhotosAlbum({
filePath: that.result,
success: function () {
success: function() {
uni.showToast({
title: '二维码保存成功',
icon: 'success',
......@@ -152,7 +152,7 @@ export default {
}
},
watch: {
size: function (n, o) {
size: function(n, o) {
if (n != o && !this._empty(n)) {
this.cSize = n
if (!this._empty(this.val)) {
......@@ -162,7 +162,7 @@ export default {
}
}
},
val: function (n, o) {
val: function(n, o) {
if (this.onval) {
if (n != o && !this._empty(n)) {
setTimeout(() => {
......@@ -174,14 +174,14 @@ export default {
},
computed: {
cpSize() {
if(this.unit == "upx"){
if (this.unit == "upx") {
return uni.upx2px(this.size)
}else{
} else {
return this.size
}
}
},
mounted: function () {
mounted: function() {
if (this.loadMake) {
if (!this._empty(this.val)) {
setTimeout(() => {
......@@ -190,16 +190,17 @@ export default {
}
}
},
}
}
</script>
<style>
.tki-qrcode {
.tki-qrcode {
position: relative;
}
.tki-qrcode-canvas {
}
.tki-qrcode-canvas {
position: fixed;
top: -99999upx;
left: -99999upx;
z-index: -99999;
}
}
</style>
......@@ -31,15 +31,15 @@
tabList: [{
id: 0,
path: "/pages/index/index",
icon: "/static/home-unsel.png",
selectIcon: "/static/home-sel.png",
icon: "/static/homepage-ic.png",
selectIcon: "/static/homepage-ic-sel.png",
text: "首页",
centerItem: false
}, {
id: 1,
path: "/pages/gallery/gallery",
icon: "/static/gallery.png",
selectIcon: "/static/gallery-sel.png",
icon: "/static/gzt-ic.png",
selectIcon: "/static/gzt-ic-sel.png",
text: "工作台",
centerItem: false
}, {
......@@ -49,15 +49,15 @@
}, {
id: 2,
path: "/pages/monitor/monitor",
icon: "/static/monitor.png",
selectIcon: "/static/monitor-sel.png",
icon: "/static/jkt-ic.png",
selectIcon: "/static/jkt-ic-sel.png",
text: "监控台",
centerItem: false
}, {
id: 3,
path: "/pages/mine/mine",
icon: "/static/mine.png",
selectIcon: "/static/mine-sel.png",
icon: "/static/user-ic.png",
selectIcon: "/static/user-ic-sel.png",
text: "我的",
centerItem: false
}],
......
......@@ -181,6 +181,14 @@
"navigationStyle": "custom"
}
}, {
"path": "pages/mine/myApproval/myApproval",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": true,
"navigationStyle": "custom"
}
}
],
"globalStyle": {
......
......@@ -25,6 +25,9 @@
</view>
</view>
</view>
<view class="popularity-content" :style="{'margin-top':statusBarHeight+116+'px'}">
</view>
<uni-tabbar currentPage="1"></uni-tabbar>
</view>
</template>
......@@ -146,5 +149,16 @@
}
}
.popularity-content {
width: 690rpx;
height: 40px;
border-radius: 40rpx;
background: #fff;
display: flex;
margin: 0 30rpx;
flex-direction: row;
align-items: center;
}
}
</style>
......@@ -67,6 +67,7 @@
onLoad: function(option) {
this.isAuth = option.auth_login === 1
this.unique_token = option.unique_token
this.wxLogin()
},
methods: {
register: function() {
......@@ -75,8 +76,72 @@
})
},
toBind: function() {
uni.redirectTo({
url: "/pages/login/wxLogin/wxLogin"
//判断是否绑定 如果绑定直接登录 没有绑定提示
this.checkBind()
// uni.redirectTo({
// url: "/pages/login/wxLogin/wxLogin"
// })
},
checkBind: function() {
Api.checkBind({
data: {
unique_token: this.unique_token
}
}).then((res) => {
let code = res.code
if (code == 0) { //已绑定直接登录
this.directLogin()
} else if (code == 33199) { //未绑定 去绑定
this.showMadel()
} else { //其他错误
uni.showToast({
title: res.data.msg,
icon: 'none'
})
}
})
},
showMadel: function() {
let _this = this
uni.showModal({
title: '提示',
content: '是否微信绑定已有账号',
showCancel: true,
confirmText: "去绑定",
cancelText: "微信登录",
confirmColor: '#3B73FE',
success: res => {
if (res.confirm) {
uni.navigateTo({
url: `/pages/login/bindLogin/bindLogin?unique_token=${_this.unique_token}`
})
} else {
_this.wxToLogin()
}
}
})
},
wxToLogin() {
Api.wxToLogin({
data: {
unique_token: this.unique_token
}
}).then((res) => {
let result = res.data
console.log("微信登录", result);
if (result.code == 0) {
uni.setStorageSync("short_token", result.data.short_token)
this.setToken(result.data.access_token)
uni.setStorageSync("user_info", result.data)
uni.setStorageSync("company_id", result.data.comp_id)
uni.showToast({
title: "授权登录成功",
icon: 'none'
})
uni.switchTab({
url: "/pages/index/index"
})
}
})
},
sendCode() {
......@@ -221,7 +286,34 @@
icon: 'none'
})
uni.switchTab({
url:"/pages/index/index"
url: "/pages/index/index"
})
} else {
uni.showToast({
title: result.msg,
icon: 'none'
})
}
})
},
directLogin: function() {
Api.bindLogin({
data: {
unique_token: this.unique_token
}
}).then((result) => {
console.log("登录用户信息:", result);
if (result.code == 0) {
uni.setStorageSync("short_token", result.data.short_token)
uni.setStorageSync("token", result.data.access_token)
uni.setStorageSync("user_info", result.data)
uni.setStorageSync("company_id", result.data.comp_id)
uni.showToast({
title: "授权登录成功",
icon: 'none'
})
uni.switchTab({
url: "/pages/index/index"
})
} else {
uni.showToast({
......@@ -316,7 +408,35 @@
})
}
},
wxLogin() {
let _this = this;
uni.showLoading({
title: '加载中...'
});
// 1.wx获取登录用户code
uni.login({
provider: 'weixin',
success: function(loginRes) {
let code = loginRes.code;
//2.将用户登录code传递到后台置换用户SessionKey、OpenId等信息
Api.exchangeToken({
data: {
"js_code": code,
"system_no": _this.$config.systemCode
},
header: {
"Content-Type": "application/json"
}
}).then((res) => {
let result = res.data
console.log(result);
_this.unique_token = result.unique_token
})
},
});
},
}
}
</script>
......
......@@ -22,7 +22,7 @@
<image src="../../static/right-arrow.png" class="image"></image>
</view>
<view class="line"></view>
<view class="item">
<view class="item" @click="linkTo('/pages/mine/myApproval/myApproval')">
<view class="name">我的审批</view>
<image src="../../static/right-arrow.png" class="image"></image>
</view>
......
<template>
<view>
<titleBar title="我的审批"></titleBar>
<view class="column-list-root">
<view v-for="(item,index) in mDatas" :key="index" class="column-list-item">
<text class="text-black-normal">{{item.user_name}}申请加入你的单位</text>
<text class="text-grey" style="margin-top: 10rpx;">{{item.create_time}}</text>
<view style="display: flex;flex-direction: row-reverse;margin-top: 32rpx;">
<view @click="reject(index)"
style="font-size: 24rpx;color: #FF0000;border: 1rpx solid #FF0000;padding: 8rpx 28rpx;border-radius: 8rpx;margin-left: 32rpx;">
驳回</view>
<view @click="pass(index)"
style="border: 1rpx solid #3B73FE;background-color: #3B73FE;font-size: 24rpx;color: #FFFFFF;padding: 8rpx 28rpx;border-radius: 8rpx;">
批准</view>
</view>
</view>
</view>
</view>
</template>
<script>
import Api from "../../../api/api.js"
export default {
data() {
return {
page: 1,
pageSize: 20,
totalPage: 1,
mDatas: []
}
},
onLoad: function() {
this.getApplyList()
},
onPullDownRefresh: function() {
this.page = 1
this.getApplyList()
},
onReachBottom: function() {
if (this.page < this.totalPage) {
this.page++
this.getApplyList()
}
},
methods: {
reject: function(index) {
this.showTip(index, 4)
},
pass: function(index) {
this.showTip(index, 3)
},
showTip: function(index, type) {
let _this = this
let apply = this.mDatas[index]
let content = type == 3 ? `确定同意${apply.user_name}加入你的单位` : `确定拒绝${apply.user_name}加入你的单位`
uni.showModal({
title: '提示',
content: content,
showCancel: true,
confirmText: "确定",
confirmColor: '#1890FF',
success: res => {
if (res.confirm) {
_this.deal(index, type)
}
}
})
},
deal: function(index, type) {
let apply = this.mDatas[index]
Api.examine({
data: {
examine: type,
comp_user_id: apply.comp_user_id
},
}).then((result) => {
if (result.code == 0) {
this.mDatas.splice(index, 1)
} else {
this.$toast.showToast(result.msg)
}
})
},
getApplyList: function() {
Api.getExamineList({
data: {
dept_type: 1,
is_page: 1,
page: this.page,
page_size: this.pageSize
},
}).then((result) => {
console.log("申请列表", result);
if (result.code == 0) {
this.totalPage = result.data.total_page
if (this.page == 1) {
this.mDatas = []
}
result.data.list.forEach((item) => {
this.mDatas.push(item)
})
} else {
this.$toast.showToast(result.msg)
}
})
}
}
}
</script>
<style>
.column-list-root {
background-color: #F5F5F5;
display: flex;
flex-direction: column;
}
.column-list-item {
background-color: #FFFFFF;
display: flex;
margin-bottom: 20rpx;
flex-direction: column;
padding: 32rpx;
}
</style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
Please register or to comment