Browse Source

个人中心相关

devlop
mo-bai 4 years ago
parent
commit
404cd7df48
12 changed files with 569 additions and 27 deletions
  1. 34
      apis/applyApi.js
  2. 4
      apis/orderApi.js
  3. 10
      enums/index.js
  4. 16
      pages.json
  5. 263
      pages/apply-detail/index.vue
  6. 170
      pages/apply-manage/index.vue
  7. 2
      pages/contract-manage/index.vue
  8. 8
      pages/login/index.vue
  9. 76
      pages/mine/index.vue
  10. BIN
      static/imgs/digital-workshops/验厂管理.sketch
  11. 0
      static/imgs/mine/apply-manage-icon.png
  12. 13
      utils/handlePushMsg.js

34
apis/applyApi.js

@ -0,0 +1,34 @@
import http from '@/utils/http/index.js'
/**
* 获取远程验厂列表
*/
export function getApplyingList(data = {}) {
return http.get({
url: '/base-paper-trading/get/factory-inspection/list',
data
})
}
/**
* 获取远程验厂详情
*/
export function getApplyingInfo(data = {}) {
return http.get({
url: `/base-paper-trading/get/factory-inspection/${data.id}`,
data
})
}
/**
* 处理远程验厂申请
* @param {object} data
* @property {number} handleResult
* @property {number} id
*/
export function handleApplying(data = {}) {
return http.post({
url: `/base-paper-trading/handle/for-factory-inspection`,
data
})
}

4
apis/orderApi.js

@ -144,7 +144,7 @@ export function getReciptCode(data) {
*/
export function getContractList(data) {
return http.get({
url: '/base-paper-trading/supplier/get/contract-list',
url: '/base-paper-trading/customer/get/contract-list',
data
})
}
@ -155,7 +155,7 @@ export function getContractList(data) {
*/
export function getCooperationList(data) {
return http.get({
url: '/base-paper-trading/supplier/get/contract-enterprise-list',
url: '/base-paper-trading/customer/get/contract-enterprise-list',
data
})
}

10
enums/index.js

@ -339,3 +339,13 @@ export const encryptType = {
MD5: 1,
SHA256: 2
}
/**
* 远程验厂申请状态 1:待处理 2:已同意 3:已拒绝 4:已过期
*/
export const applyingTypeEnum = {
WAITING: 1,
AGREE: 2,
REJECT: 3,
EXPIRED: 4
}

16
pages.json

@ -171,6 +171,22 @@
"navigationStyle": "custom"
}
},
{
"path": "pages/apply-detail/index",
"style": {
"navigationBarTitleText": "验厂详情",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pages/apply-manage/index",
"style": {
"navigationBarTitleText": "验厂申请",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pages/mine/index",
"style": {

263
pages/apply-detail/index.vue

@ -0,0 +1,263 @@
<template>
<view class="content">
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="申请详情"></uni-nav-bar>
<view class="flex-col group_4">
<view class="flex-col">
<view class="flex-col items-center text-wrapper" v-if="info.status == applyingTypeEnum.WAITING">
<text>通过后该用户可查看设备的视频信息生产信息</text>
</view>
<view v-else class="center-text-wrapper flex-col items-center view_1" :class="bgMap[info.status].bg">
<text>{{ bgMap[info.status].text }}</text>
</view>
<view class="flex-col section_1">
<view class="flex-row">
<text class="text_5">用户名</text>
<text class="text_6">{{ info.userName }}</text>
</view>
<view class="flex-row group_7">
<text class="text_7">手机号</text>
<text class="text_8">{{ info.mobile }}</text>
</view>
<view class="flex-row group_8">
<text class="text_9">企业名</text>
<text class="text_10">{{ info.enterpriseName }}</text>
</view>
<view class="flex-row group_9">
<text class="text_11">申请时间</text>
<text class="text_12">{{ info.createTime }}</text>
</view>
</view>
</view>
<view class="flex-row group_10" v-if="info.status == applyingTypeEnum.WAITING">
<view class="flex-col items-center text-wrapper_1" @click="handle(2)">
<text>拒绝</text>
</view>
<view class="flex-col items-center text-wrapper_2" @click="handle(1)">
<text>通过</text>
</view>
</view>
</view>
</view>
</template>
<script>
import { go2, back } from '@/utils/hook.js'
import { applyingTypeEnum } from '@/enums/index'
import { getApplyingInfo, handleApplying } from '@/apis/applyApi'
const bgMap = {
[applyingTypeEnum.WAITING]: {
bg: 'waiting-bg',
text: '待处理'
},
[applyingTypeEnum.AGREE]: {
bg: 'agree-bg',
text: '已同意'
},
[applyingTypeEnum.REJECT]: {
bg: 'reject-bg',
text: '已拒绝'
},
[applyingTypeEnum.EXPIRED]: {
bg: 'expired-bg',
text: '已过期'
}
}
export default {
data() {
return {
bgMap: Object.freeze(bgMap),
id: null,
info: {
status: applyingTypeEnum.WAITING
},
applyingTypeEnum: Object.freeze(applyingTypeEnum)
}
},
onLoad(options) {
if (options.id) {
this.id = options.id
getApplyingInfo({ id: this.id }).then((res) => {
if (res) {
this.info = res
}
})
} else {
uni.showToast({
title: '参数错误,即将跳转',
success: () => {
setTimeout(() => {
back()
}, 1500)
}
})
}
},
methods: {
go2,
back,
handle(handleResult) {
uni.showModal({
title: '提示',
content: '确定要操作吗?',
success: (res) => {
if (res.confirm) {
handleApplying({ id: this.id, handleResult }).then((res) => {
if (res) {
uni.showToast({
title: '操作成功',
success: () => {
setTimeout(() => {
back()
}, 1500)
}
})
}
})
}
}
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
width: 750rpx;
}
.group_4 {
position: relative;
flex: 1 1 auto;
overflow-y: auto;
.center-text-wrapper {
color: rgb(255, 255, 255);
font-size: 28rpx;
font-weight: 500;
line-height: 40rpx;
white-space: nowrap;
}
.view_1 {
padding: 5rpx 0;
border-radius: 0px 0px 0px 20rpx;
width: 120rpx;
position: absolute;
right: 0;
top: 0;
}
.group_10 {
margin-top: 140rpx;
padding: 0 32rpx;
.text-wrapper_1 {
padding: 21rpx 0;
flex: 1 1 332rpx;
color: rgb(238, 10, 36);
font-size: 30rpx;
font-weight: 500;
line-height: 42rpx;
white-space: nowrap;
background-color: rgb(255, 255, 255);
border-radius: 10rpx;
height: 88rpx;
border: solid 2rpx rgb(238, 10, 36);
}
.text-wrapper_2 {
margin-left: 22rpx;
padding: 23rpx 0;
flex: 1 1 332rpx;
color: rgb(255, 255, 255);
font-size: 30rpx;
font-weight: 500;
line-height: 42rpx;
white-space: nowrap;
background-color: rgb(0, 122, 255);
border-radius: 10rpx;
height: 88rpx;
}
}
.text-wrapper {
padding: 17rpx 0;
color: rgb(0, 122, 255);
font-size: 30rpx;
line-height: 42rpx;
white-space: nowrap;
background-color: rgb(229, 241, 255);
}
.section_1 {
padding: 16rpx 32rpx 31rpx;
background-color: rgb(255, 255, 255);
.group_7 {
margin-top: 15rpx;
.text_7 {
color: rgb(136, 136, 136);
font-size: 28rpx;
line-height: 40rpx;
white-space: nowrap;
}
.text_8 {
margin-left: 90rpx;
color: rgb(51, 51, 51);
font-size: 28rpx;
line-height: 40rpx;
white-space: nowrap;
}
}
.group_8 {
margin-top: 14rpx;
.text_9 {
color: rgb(136, 136, 136);
font-size: 28rpx;
line-height: 40rpx;
white-space: nowrap;
}
.text_10 {
margin-left: 90rpx;
color: rgb(51, 51, 51);
font-size: 28rpx;
line-height: 40rpx;
white-space: nowrap;
}
}
.group_9 {
margin-top: 14rpx;
.text_11 {
color: rgb(136, 136, 136);
font-size: 28rpx;
line-height: 40rpx;
white-space: nowrap;
}
.text_12 {
margin-left: 62rpx;
color: rgb(51, 51, 51);
font-size: 28rpx;
line-height: 40rpx;
white-space: nowrap;
}
}
.text_5 {
color: rgb(136, 136, 136);
font-size: 28rpx;
line-height: 40rpx;
white-space: nowrap;
}
.text_6 {
margin-left: 90rpx;
color: rgb(51, 51, 51);
font-size: 28rpx;
line-height: 40rpx;
white-space: nowrap;
}
}
}
.agree-bg {
background-color: rgba(19, 194, 194, 0.6);
}
.reject-bg {
background-color: rgba(255, 122, 69, 0.6);
}
.expired-bg {
background-color: rgb(217, 217, 217);
}
.waiting-bg {
background-color: rgba(89, 126, 247, 0.6);
}
</style>

170
pages/apply-manage/index.vue

@ -0,0 +1,170 @@
<template>
<view class="content">
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="验厂申请"></uni-nav-bar>
<scroll-list ref="list" :option="option" @load="upCallback" @refresh="downCallback">
<view class="list-item flex-col" v-for="item in list" :key="item.id" @click="go2('apply-detail', { id: item.id })">
<view class="top-group flex-col">
<text class="text_8">{{ item.userName }} 申请远程验厂</text>
<view class="center-text-wrapper flex-col items-center view_1" :class="bgMap[item.status].bg">
<text>{{ bgMap[item.status].text }}</text>
</view>
<text class="text_11">{{ item.createTime }}</text>
</view>
<text class="text_13">{{ item.enterpriseName }}</text>
</view>
</scroll-list>
</view>
</template>
<script>
import { go2, back } from '@/utils/hook.js'
import { applyingTypeEnum } from '@/enums/index'
import { getApplyingList } from '@/apis/applyApi'
const bgMap = {
[applyingTypeEnum.WAITING]: {
bg: 'waiting-bg',
text: '待处理'
},
[applyingTypeEnum.AGREE]: {
bg: 'agree-bg',
text: '已同意'
},
[applyingTypeEnum.REJECT]: {
bg: 'reject-bg',
text: '已拒绝'
},
[applyingTypeEnum.EXPIRED]: {
bg: 'expired-bg',
text: '已过期'
}
}
export default {
data() {
return {
bgMap: Object.freeze(bgMap),
option: {
size: 10,
auto: true,
emptyText: '暂无数据~',
background: '#F7F8FA',
disabled: false
},
pagination: {
pageNum: 0, //
pageSize: 10
},
list: []
}
},
methods: {
go2,
back,
getList() {
return new Promise((resolve, reject) => {
getApplyingList({ ...this.pagination })
.then((res) => {
// console.log('', res.records)
if (res) {
if (res.current == 1) {
this.list = res.records
} else {
this.list = this.list.concat(res.records)
}
resolve({ list: this.list, total: res.total })
} else {
reject()
}
})
.catch((err) => {
reject(err)
})
})
},
downCallback() {
this.pagination.pageNum = 1
this.getList()
.then(({ list, total }) => {
this.$refs.list.refreshSuccess({ list, total })
})
.catch(() => {
this.$refs.list.refreshFail()
})
},
upCallback() {
this.pagination.pageNum++
this.getList()
.then(({ list, total }) => {
this.$refs.list.loadSuccess({ list, total })
})
.catch(() => {
this.$refs.list.loadFail()
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
width: 750rpx;
}
.list-item {
margin-bottom: 20rpx;
padding-left: 32rpx;
padding-bottom: 24rpx;
background-color: rgb(255, 255, 255);
.top-group {
padding-top: 24rpx;
position: relative;
.text_8 {
color: rgb(0, 58, 140);
font-size: 32rpx;
font-weight: 500;
line-height: 45rpx;
white-space: nowrap;
}
.center-text-wrapper {
color: rgb(255, 255, 255);
font-size: 28rpx;
font-weight: 500;
line-height: 40rpx;
white-space: nowrap;
}
.view_1 {
padding: 5rpx 0;
border-radius: 0px 0px 0px 20rpx;
width: 120rpx;
position: absolute;
right: 0;
top: 0;
}
.agree-bg {
background-color: rgba(19, 194, 194, 0.6);
}
.reject-bg {
background-color: rgba(255, 122, 69, 0.6);
}
.expired-bg {
background-color: rgb(217, 217, 217);
}
.waiting-bg {
background-color: rgba(89, 126, 247, 0.6);
}
.text_11 {
margin-top: 5rpx;
color: rgb(136, 136, 136);
font-size: 24rpx;
line-height: 33rpx;
white-space: nowrap;
position: relative;
}
}
.text_13 {
margin-top: 15rpx;
color: rgb(85, 85, 85);
font-size: 28rpx;
line-height: 40rpx;
white-space: nowrap;
}
}
</style>

2
pages/contract-manage/index.vue

@ -32,7 +32,7 @@
<view :class="'icon ' + typeMap[item.type].class">
<text style="font-size: 28rpx; color: #ffffff">{{ typeMap[item.type].label }}</text>
</view>
<text class="title">{{ item.customerEnterpriseName }}</text>
<text class="title">{{ item.supplierEnterpriseName }}</text>
<view class="row flex-row-center-start" style="margin-top: 0rpx">
<text class="label">合同编号:</text>
<text class="value">{{ item.contractNo }}</text>

8
pages/login/index.vue

@ -154,10 +154,10 @@ export default {
if (res) {
//
// #ifdef APP-PLUS
// let cid = plus.push.getClientInfo().clientid
// let platform = uni.getSystemInfoSync().platform
// pushCustomerBind(cid, platform)
// // #endif
let cid = plus.push.getClientInfo().clientid
let platform = uni.getSystemInfoSync().platform
pushCustomerBind(cid, platform)
// #endif
if (!res.enterpriseList || res.enterpriseList.length === 0) {
go2('select-role')
} else {

76
pages/mine/index.vue

@ -39,8 +39,22 @@
<view class="header">
<text style="font-size: 30rpx; color: rgba(0, 0, 0, 0.85); font-weight: 600">我的设备</text>
</view>
<view class="flex-row justify-between equal-division_1">
<view class="flex-col items-center equal-division-item">
<text class="text_13">20</text>
<text class="text_14">设备总数()</text>
</view>
<view class="flex-col items-center equal-division-item">
<text class="text_13">14</text>
<text class="text_14">工作中()</text>
</view>
<view class="flex-col items-center equal-division-item">
<text class="text_13">6</text>
<text class="text_14">空闲()</text>
</view>
</view>
</view>
<view class="card-area" v-if="fsInfo.status !== -1" style="border-radius: 16rpx">
<!-- <view class="card-area" v-if="fsInfo.status !== -1" style="border-radius: 16rpx">
<image
class="poster"
v-if="fsInfo.status == fsAuditStatus.WAIT_APPLY || fsInfo.status == fsAuditStatus.REJECT"
@ -59,7 +73,7 @@
<uni-icons style="margin-left: 16rpx" type="right" size="10"></uni-icons>
</view>
</view>
</view>
</view> -->
<view class="card-area">
<view class="header">
<text style="font-size: 30rpx; color: rgba(0, 0, 0, 0.85); font-weight: 600">其他工具</text>
@ -77,8 +91,8 @@
<image class="icon" src="/static/imgs/mine/contract-icon.png"></image>
<text class="label">合同管理</text>
</view>
<view class="icon-item" @click="loginGo2('enquiry-list')">
<image class="icon" src="/static/imgs/mine/certification-icon.png"></image>
<view class="icon-item" @click="loginGo2('apply-manage')">
<image class="icon" src="/static/imgs/mine/apply-manage-icon.png"></image>
<text class="label">验厂申请</text>
</view>
<!-- <view class="icon-item" @click="loginGo2('address-manage')">
@ -89,6 +103,10 @@
<image class="icon" src="/static/imgs/mine/enterprise-icon.png"></image>
<text class="label">地址管理</text>
</view>
<view class="icon-item" @click="cancelAccount">
<image class="icon" src="/static/imgs/mine/enterprise-icon.png"></image>
<text class="label">账号注销</text>
</view>
</view>
</view>
</view>
@ -114,25 +132,23 @@ export default {
}
},
methods: {
makeVip() {
if (!this.hasLogin) {
go2('login')
return
}
if (this.hasCompany) {
let redirectUrl = encodeURIComponent(VIP_URL)
window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${QN_APPID}&redirect_uri=${redirectUrl}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect`
} else {
uni.showToast({
title: '请先完善企业信息',
icon: 'none'
})
}
},
loginGo2,
logout() {
exit()
},
cancelAccount() {
uni.showModal({
title: '提示',
content: '注销账号会删除账号下相关信息,请谨慎操作!',
confirmText: '确定注销',
cancelText: '取消',
success: (res) => {
if (res.confirm) {
this.logout()
}
}
})
},
//
certifyCompany() {
if (!this.hasCompany) {
@ -354,7 +370,27 @@ export default {
}
}
}
.equal-division_1 {
padding: 32rpx 32rpx 40rpx;
align-self: center;
.equal-division-item {
flex: 1 1 auto;
.text_13 {
color: rgb(0, 0, 0);
font-size: 36rpx;
font-weight: 500;
line-height: 50rpx;
white-space: nowrap;
}
.text_14 {
margin-top: 7rpx;
color: rgb(102, 102, 102);
font-size: 26rpx;
line-height: 37rpx;
white-space: nowrap;
}
}
}
.order-area {
padding: 40rpx 32rpx;
display: flex;

BIN
static/imgs/digital-workshops/验厂管理.sketch

static/imgs/mine/certification-icon.png → static/imgs/mine/apply-manage-icon.png

13
utils/handlePushMsg.js

@ -35,6 +35,10 @@ const messageTypes = {
83: {
title: '客户订单融资完成',
fn: handleOrderCompleted
},
90: {
title: '远程验厂申请',
fn: handleApplying
}
}
/**
@ -138,3 +142,12 @@ function handleOrderCompleted(params) {
let replyId = params.replyId || ''
loginGo2('order-detail', { orderId: replyId })
}
/**
* 验厂申请通知
* @param {object} params replyId
*/
function handleApplying(params) {
let applyId = params.applyId || ''
loginGo2('apply-detail', { id: applyId })
}
Loading…
Cancel
Save