Commit eb5afe26 authored by Facius's avatar Facius

feat: 使用帮助;印章选择

parent 34f93bda
Pipeline #6404 canceled with stages
......@@ -218,7 +218,7 @@ export async function getSealList() {
export async function madeSeal(data) {
return request({
url: `/rest/user/madeSeal`,
url: `/rest/user/madeSeal/V2`,
method: 'POST',
data,
noLoading: true
......
......@@ -12,4 +12,44 @@ export async function updateShopInfo(data) {
method: 'POST',
data
})
}
export async function getSealList(data) {
return request({
url: `/rest/user/seal`,
method: 'GET',
data
})
}
export async function sealDelete(data) {
return request({
url: `/rest/user/seal/${data.id}`,
method: 'DELETE',
data
})
}
export async function saveSeal(data) {
return request({
url: `/rest/user/saveSeal`,
method: 'POST',
data
})
}
export async function getSealType() {
return request({
url: `/rest/user/sealType`,
method: 'GET',
})
}
export async function madePersonSeal(data) {
return request({
url: `/rest/user/madeSeal/person`,
method: 'POST',
data
})
}
\ No newline at end of file
<template>
<view :style="{ '--border-color': borderColor }" :class="['cell-seal', {selected: info.selected}]" :hover-class="isEdit ? '' : 'u-hover-class'">
<view class="content-view" @click="$u.throttle(handleCickCell, 500)">
<view class="left-view">
<view class="image-view">
<image :src="info.sealImg" mode="heightFix"/>
</view>
<view class="info-view">
<view class="name-view" v-if="!isElectron">{{ info.name }}</view>
<view class="sign-view" v-if="info.isDefault">默认</view>
</view>
</view>
<view class="right-view" v-if="isEdit">
<view class="edit-view" @click.stop="$u.throttle(handleClickButton, 500)" hover-class="u-hover-class">
<image :src="editImage" class="edit-image"></image>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
customStyle: {
type: String,
default: ''
},
info: {
type: Object,
default () {
return {
type:{}
}
},
},
type: {
type: String,
default: 'normal'
}
},
data () {
return {}
},
computed: {
baseUrl () {
return process.uniEnv.qn_base_url
},
editImage () {
return this.baseUrl + 'bianjifuwufenlei@3x.png'
},
isEdit() {
return this.type == 'edit'
},
borderColor() {
return this.isEdit ? 'transparent' : '#DDDDDD'
},
isElectron() {
return this.info.type.code == 'ELECTRON'
}
},
created () { },
methods: {
handleClickButton () {
this.$emit('action', this.info)
},
handleCickCell () {
if (this.isEdit) {
this.$emit('action', this.info)
} else {
this.$emit('select', this.info.id)
}
}
},
}
</script>
<style scoped lang="scss">
.cell-seal {
padding: 20rpx 24rpx;
min-height: 160rpx;
border-radius: 16rpx;
background-color: #ffffff;
border: 2rpx solid var(--border-color);
&.selected {
border: 2rpx solid #02A074;
}
.content-view {
display: flex;
align-items: center;
justify-content: space-between;
.left-view {
display: flex;
align-items: center;
font-size: 28rpx;
font-weight: bold;
color: #333333;
.image-view {
min-width: 120rpx;
height: 120rpx;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
flex-shrink: 0;
margin-right: 24rpx;
}
.info-view {
display: flex;
align-items: flex-start;
.sign-view {
color: #02A074;
width: 48rpx;
height: 28rpx;
line-height: 28rpx;
text-align: center;
border-radius: 8rpx;
border: 2rpx solid #02A074;
flex-shrink: 0;
font-size: 16rpx;
margin-top: 8rpx;
}
.name-view {
margin-right: 18rpx;
flex: 1;
}
}
}
.right-view {
display: flex;
align-items: center;
justify-content: flex-end;
flex-shrink: 0;
margin-left: 24rpx;
.edit-view {
width: 80rpx;
height: 72rpx;
display: flex;
justify-content: center;
align-items: center;
.edit-image {
width: 32rpx;
height: 32rpx;
}
}
}
}
}</style>
......@@ -388,10 +388,27 @@
"enablePullDownRefresh": false
}
},
{
"path": "shop-setting/seal-list",
"style": {
"navigationBarTitleText": "印章列表",
"navigationStyle": "custom",
"enablePullDownRefresh": false,
"disableScroll": true
}
},
{
"path": "shop-setting/seal",
"style": {
"navigationBarTitleText": "印章",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "help/index",
"style": {
"navigationBarTitleText": "使用帮助",
"enablePullDownRefresh": false
}
},
......
<template>
<u-popup v-model="show" safe-area-inset-bottom border-radius="24" mode="bottom" :closeable="true" @close="handleClose"
:mask-close-able="true">
<view class="pop-seal">
<view class="title-view">{{ title }}</view>
<view class="content-view">
<view v-for="(item, index) in sealList" :key="index" class="item-view">
<CellSeal :info="item" @select="handleClick" />
</view>
</view>
</view>
</u-popup>
</template>
<script>
import CellSeal from '@/components/cell-seal/index';
export default {
props: {
title: {
type: String,
default: ''
},
visible: {
type: Boolean,
default: false,
},
list: {
type: Array,
default () {
return []
}
}
},
components: {
CellSeal,
},
data () {
return {
show: false,
sealList: []
}
},
computed: {
},
watch: {
visible (val) {
this.show = val
this.sealList = this.list
},
},
methods: {
handleClick (id) {
for (var item of this.sealList) {
item.selected = id == item.id
if (item.selected) {
this.$emit('select', item)
}
}
this.changeVisibleValue(false)
},
changeVisibleValue (val) {
this.show = val
this.$emit('update:visible', val)
},
handleClose () {
this.changeVisibleValue(false)
},
},
}
</script>
<style lang="scss" scoped>
.pop-seal {
padding: 32rpx;
max-height: 80vh;
.title-view {
color: #333333;
font-size: 32rpx;
font-weight: bold;
position: fixed;
top: 0;
left: 0;
right: 0;
width: 100%;
background-color: #ffffff;
height: 90rpx;
line-height: 90rpx;
padding-left: 32rpx;
}
.content-view {
padding: 64rpx 0;
.item-view {
margin: 24rpx 0;
}
}
}
</style>
<template>
<view class="seal-select">
<view class="seal-title">选择印章种类</view>
<view class="content-view">
<view v-for="(item, index) in sealList" :key="index" :class="['label-view', { selected: item.selected }]"
hover-class="u-hover-class" @click="handleClick(item)">
<view>{{ item.label }}</view>
</view>
</view>
<view class="select-view">
<block v-if="selectedItem.selectText">
<view class="left-view">{{ selectedItem.selectText }}</view>
<view class="right-view" @click="$u.throttle(handleSelect, 500)" hover-class="u-hover-class">
<view class="image-view">
<image v-if="selectedItem.url" :src="selectedItem.url" mode="heightFix" />
</view>
<u-icon name="arrow-right" color="#CCCCCC" size="28"></u-icon>
</view>
</block>
</view>
<PopSeal :title="selectedItem.selectText" :list="selectedItem.list" :visible.sync="visible" @select="handleSelectItem"/>
</view>
</template>
<script>
import PopSeal from './pop-seal';
export default {
components: {
PopSeal,
},
props: {
sealList: {
type: Array,
default () {
return []
}
},
},
components: {
},
data () {
return {
visible: false,
}
},
computed: {
selectedItem () {
for (var item of this.sealList) {
if (item.selected) {
return item
}
}
return {}
}
},
methods: {
handleSelectItem(item) {
this.selectedItem.url = item.sealImg
this.$emit('select', item.sealImg)
},
handleClick (item) {
this.$emit('change', {...item})
},
handleSelect () {
if (this.current == 3) {
return
}
this.visible = true
},
},
}
</script>
<style lang="scss" scoped>
.seal-select {
background-color: #ffffff;
// border-radius: 16rpx;
overflow: hidden;
// padding: 24rpx;
.seal-title {
font-size: 28rpx;
color: #333333;
font-weight: bold;
}
.content-view {
display: flex;
justify-content: space-between;
align-items: center;
.label-view {
display: flex;
justify-content: center;
align-items: center;
height: 80rpx;
padding: 0 24rpx;
min-width: 202rpx;
background-color: #F6F7FA;
color: #8D8D8D;
font-weight: bold;
font-size: 28rpx;
border-radius: 8rpx;
margin: 24rpx 0;
&.selected {
background-color: #02A074;
color: #FFFFFF;
}
}
}
.select-view {
height: 120rpx;
margin: 16rpx 0;
font-weight: bold;
font-size: 28rpx;
display: flex;
justify-content: space-between;
align-items: center;
.left-view {
color: #333333;
font-weight: bold;
font-size: 28rpx;
}
.right-view {
flex: 1;
display: flex;
justify-content: flex-end;
align-items: center;
.image-view {
height: 120rpx;
margin-right: 24rpx;
}
}
}
}
</style>
\ No newline at end of file
......@@ -163,7 +163,8 @@
</view>
</view>
<view class="part-view">
<view class="label-view">选择印章种类</view>
<SealSelect :sealList="sealList" @change="sealTypeChange" @select="handleSelectSeal"/>
<!-- <view class="label-view">选择印章种类</view>
<view class="seal-type-view">
<view class="seal-type-view-item" :class="{ active: item.value == form.extend.sealType }" v-for="(item, index) in sealList" :key="index" @click="sealTypeChange(item)">
<view class="seal-type-view-item-icon" :style="{width:item.width,height:item.height}" v-if="item.url">
......@@ -172,7 +173,7 @@
<text>{{ item.label }}</text>
</view>
</view>
</view> -->
</view>
</view>
<submit-button
......@@ -216,16 +217,18 @@ import ReceiptPreview from './components/receipt-preview.vue';
import ParticularsView from './components/particulars-view.vue';
import ParticularsCreate from './components/particulars-create.vue';
import ParticularsRecord from './components/particulars-record.vue';
import SealSelect from './components/seal-select.vue';
import UnitPopup from '@/components/unit-popup/unit-popup.vue';
import CheckboxGroups from '@/components/checkbox-groups/checkbox-groups.vue';
import {getSealType,getSealList} from "@/api/mine/shop.js"
import { getSetting, random_string } from '@/utils/common.js';
import { checkOpenPermission, checkOpenService } from '@/utils/app-plus-auth.js';
import { repairDetail, editeRepair, createOrUpdateService,getSealList } from '@/api/maintain/index.js';
import { repairDetail, editeRepair, createOrUpdateService } from '@/api/maintain/index.js';
import { formatCount } from '@/utils/common.js';
import { billBaseUrl } from '@/utils/config.js';
import { mapGetters } from 'vuex';
import { sealOptions } from '@/utils/options/maintain-bill/index.js';
import { sealOptions,sealInfos } from '@/utils/options/maintain-bill/index.js';
export default {
components: {
NavbarRight,
......@@ -239,7 +242,8 @@ export default {
ParticularsRecord,
SubmitButton,
UnitPopup,
CheckboxGroups
CheckboxGroups,
SealSelect
},
data() {
return {
......@@ -301,7 +305,7 @@ export default {
}
],
chooseMemberImage: billBaseUrl + 'tiaozhuantongxunlu@3x.png',
sealList: sealOptions, // 印章列表
sealList: [], // 印章列表
checkboxCustomStyle: {
width: '200rpx',
height: '128rpx'
......@@ -462,9 +466,10 @@ export default {
this.form.type = options.type;
}
this.freshing = false;
this.getSealList() // 获取印章列表
if (this.billId || this.copyId) {
this.repairDetail(this.billId || this.copyId);
} else {
this.getSealType(true)
}
uni.$on('maintain-bill-detail', res => {
this.repairDetail(this.billId);
......@@ -624,60 +629,108 @@ export default {
});
},
handleChangeShowSign() {},
async getSealList() {
try {
let res = await getSealList()
console.log(res)
res.data.map(item => {
this.sealList.map(seal=>{
if (item.value === seal.value) {
seal.url=item.url
}
})
})
} catch (e) {
console.log(e)
//TODO handle the exception
}
},
sealTypeChange(e) {
this.form.extend.sealType = e.value;
this.form.extend.sealUrl = e.url;
if (e.value === '2' && !e.url) {
if (e.value === '2' && !e.url) {
this.showSealPopup = true
return
}
},
async resetSeal() {
let sealType = this.form.extend.sealType
if (sealType !== '2') {
return;
for (var item of this.sealList) {
item.selected = item.value == e.value
}
await this.getSealList();
this.sealList.map(item => {
if (item.value === sealType) {
if (item.url) {
this.form.extend.sealUrl = item.url;
} else {
this.form.extend.sealType = '1';
this.form.extend.sealType = e.value;
this.form.extend.sealUrl = e.url;
},
getSealType(isNew=false) {
getSealType()
.then(res => {
var array = []
for (var seal of sealInfos) {
for (var item of res.data) {
if (item.code == seal.code) {
seal = {
...item,
...seal,
list: null
}
break
}
}
if (!isNew) {
if ( seal.value == this.form.extend.sealType) {
seal.selected = true
seal.url = this.form.extend.sealUrl
} else {
seal.selected = false
}
}
array.push(seal)
}
}
this.sealList = array
for (var item of res.data) {
this.getSealList(item.code)
}
})
.catch(err => {
console.log(err);
});
},
getSealList (sealType) {
if (!sealType) {
return
}
getSealList({
sealType: sealType,
})
this.jumpToSeal=false
.then(res => {
let data = res.data || [];
if (data.length <= 0) return
for (var item of this.sealList) {
if (item.code == sealType) {
if (!item.url) {
for (var seal of data) {
if (seal.isDefault) {
item.url = seal.sealImg
break
}
}
if (!item.sealUrl) {
item.url = data[0].sealImg
}
}
for (var seal of data) {
seal.selected = item.url == seal.sealImg
}
item.list = data
break
}
}
})
.catch(err => {
console.log(err);
});
},
handleSelectSeal(url) {
this.form.extend.sealUrl = url
},
handleConfirmSeal() {
uni.$once('receipt-set-seal', async res => {
this.resetSeal()
uni.$once('receipt-set-seal', res => {
for (var item of this.sealList) {
item.selected = item.value == '2'
}
this.form.extend.sealType = '2';
this.getSealList('OFFICIAL')
});
this.jumpToSeal=true
this.$u.route({
url: 'pages/mine/shop-setting/seal',
type: 'navigateTo',
params: {
type: 'OFFICIAL'
}
});
},
handleCancelSeal() {
let e = this.sealList[0]
this.form.extend.sealType = e.value;
this.form.extend.sealUrl = e.url;
},
repairDetail(id) {
if (!id) return;
......@@ -689,6 +742,9 @@ export default {
if (res.data) {
this.setForm(res.data);
}
if (this.sealList.length <= 0) {
this.getSealType()
}
this.loading = false;
})
.catch(res => {
......@@ -881,7 +937,7 @@ export default {
},
handleChangeShowSeal(event) {
this.form.showSeal = event;
}
},
}
};
</script>
......@@ -969,35 +1025,35 @@ export default {
}
}
}
.seal-type-view {
padding: 24rpx 0;
display: flex;
flex-wrap: wrap;
&-item {
width: 200rpx;
height: 168rpx;
background: #f6f7fa;
border-radius: 8upx;
font-size: 28upx;
color: #8d8d8d;
margin-right: 24upx;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
&:last-child {
margin-right: 0;
}
&-icon{
margin-bottom: 12rpx;
}
}
.active {
background-color: $default-color;
color: #ffffff;
}
}
// .seal-type-view {
// padding: 24rpx 0;
// display: flex;
// flex-wrap: wrap;
// &-item {
// width: 200rpx;
// height: 168rpx;
// background: #f6f7fa;
// border-radius: 8upx;
// font-size: 28upx;
// color: #8d8d8d;
// margin-right: 24upx;
// text-align: center;
// display: flex;
// flex-direction: column;
// align-items: center;
// justify-content: center;
// &:last-child {
// margin-right: 0;
// }
// &-icon{
// margin-bottom: 12rpx;
// }
// }
// .active {
// background-color: $default-color;
// color: #ffffff;
// }
// }
.part-view {
padding: 16rpx 24rpx 0rpx 24rpx;
......
......@@ -128,7 +128,8 @@
</view>
</view>
<view class="part-view">
<view class="label-view">选择印章种类</view>
<SealSelect :sealList="sealList" @change="sealTypeChange" @select="handleSelectSeal"/>
<!-- <view class="label-view">选择印章种类</view>
<view class="seal-type-view">
<view class="seal-type-view-item" :class="{ active: item.value == form.extend.sealType }" v-for="(item, index) in sealList" :key="index" @click="sealTypeChange(item)">
<view class="seal-type-view-item-icon" :style="{width:item.width,height:item.height}" v-if="item.url">
......@@ -137,7 +138,7 @@
<text>{{ item.label }}</text>
</view>
</view>
</view> -->
</view>
</view>
<!-- #ifdef APP-PLUS -->
......@@ -162,11 +163,13 @@
import NavbarRight from '@/components/navbar-right';
import CheckboxGroups from '@/components/checkbox-groups/checkbox-groups.vue';
import PopInput from '@/components/pop-input-view';
import { sealOptions } from '@/utils/options/maintain-bill/index.js';
import { sealInfos } from '@/utils/options/maintain-bill/index.js';
import SealSelect from './components/seal-select.vue';
import {getSealType,getSealList} from "@/api/mine/shop.js"
import {
repairDetail,
editeRepair,
getSealList,
getProjectMembersKnow
} from '@/api/maintain/index.js';
import {
......@@ -179,7 +182,8 @@
DateRangePicker,
SubmitButton,
PopInput,
CheckboxGroups
CheckboxGroups,
SealSelect
},
data() {
return {
......@@ -206,7 +210,7 @@
customerSignSwitch: false
}
},
sealList: sealOptions, // 印章列表
sealList: [], // 印章列表
checkboxCustomStyle: {
width: '200rpx',
height: '128rpx'
......@@ -260,17 +264,14 @@
if (options && options.billId) {
this.billId = options.billId;
}
this.getSealList() // 获取印章列表
if (this.billId || this.copyId) {
this.repairDetail(this.billId || this.copyId);
} else {
this.getSealType(true)
}
// uni.$on('maintain-bill-detail', res => {
// this.repairDetail();
// });
},
onUnload() {
// uni.$off('maintain-bill-detail');
},
methods: {
chooseMember() {
......@@ -288,51 +289,108 @@
this.showMember = false;
},
handleChangeShowSign() {},
async getSealList() {
try {
let res = await getSealList()
console.log(res)
res.data.map(item => {
this.sealList.map(seal=>{
if (item.value === seal.value) {
seal.url=item.url
}
})
})
} catch (e) {
console.log(e)
//TODO handle the exception
}
},
sealTypeChange(e) {
this.form.extend.sealType = e.value;
this.form.extend.sealUrl = e.url;
if (e.value === '2' && !e.url) {
if (e.value === '2' && !e.url) {
this.showSealPopup = true
return
}
for (var item of this.sealList) {
item.selected = item.value == e.value
}
this.form.extend.sealType = e.value;
this.form.extend.sealUrl = e.url;
},
handleConfirmSeal() {
uni.$once('receipt-set-seal', async res => {
await this.getSealList();
this.sealList.map(item => {
if (item.value === '2') {
if (item.url) {
this.form.extend.sealUrl = item.url;
} else {
this.form.extend.sealType = '1';
getSealType(isNew=false) {
getSealType()
.then(res => {
var array = []
for (var seal of sealInfos) {
for (var item of res.data) {
if (item.code == seal.code) {
seal = {
...item,
...seal,
list: null
}
break
}
}
if (!isNew) {
if ( seal.value == this.form.extend.sealType) {
seal.selected = true
seal.url = this.form.extend.sealUrl
} else {
seal.selected = false
}
}
array.push(seal)
}
this.sealList = array
for (var item of res.data) {
this.getSealList(item.code)
}
})
.catch(err => {
console.log(err);
});
},
getSealList (sealType) {
if (!sealType) {
return
}
getSealList({
sealType: sealType,
})
.then(res => {
let data = res.data || [];
if (data.length <= 0) return
for (var item of this.sealList) {
if (item.code == sealType) {
if (!item.url) {
for (var seal of data) {
if (seal.isDefault) {
item.url = seal.sealImg
break
}
}
if (!item.sealUrl) {
item.url = data[0].sealImg
}
}
for (var seal of data) {
seal.selected = item.url == seal.sealImg
}
item.list = data
break
}
}
})
.catch(err => {
console.log(err);
});
},
handleSelectSeal(url) {
this.form.extend.sealUrl = url
},
handleConfirmSeal() {
uni.$once('receipt-set-seal', res => {
for (var item of this.sealList) {
item.selected = item.value == '2'
}
this.form.extend.sealType = '2';
this.getSealList('OFFICIAL')
});
this.$u.route({
url: 'pages/mine/shop-setting/seal',
type: 'navigateTo',
params: {
type: 'OFFICIAL'
}
});
},
handleCancelSeal() {
let e = this.sealList[0]
this.form.extend.sealType = e.value;
this.form.extend.sealUrl = e.url;
},
repairDetail(id) {
this.loading = true;
......@@ -343,6 +401,9 @@
if (res.data) {
this.setForm(res.data);
}
if (this.sealList.length <= 0) {
this.getSealType()
}
this.loading = false;
})
.catch(res => {
......@@ -512,35 +573,35 @@
display: flex;
}
}
.seal-type-view {
padding: 24rpx 0;
display: flex;
flex-wrap: wrap;
&-item {
width: 200rpx;
height: 168rpx;
background: #f6f7fa;
border-radius: 8upx;
font-size: 28upx;
color: #8d8d8d;
margin-right: 24upx;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
&:last-child {
margin-right: 0;
}
&-icon{
margin-bottom: 12rpx;
}
}
.active {
background-color: $default-color;
color: #ffffff;
}
}
// .seal-type-view {
// padding: 24rpx 0;
// display: flex;
// flex-wrap: wrap;
// &-item {
// width: 200rpx;
// height: 168rpx;
// background: #f6f7fa;
// border-radius: 8upx;
// font-size: 28upx;
// color: #8d8d8d;
// margin-right: 24upx;
// text-align: center;
// display: flex;
// flex-direction: column;
// align-items: center;
// justify-content: center;
// &:last-child {
// margin-right: 0;
// }
// &-icon{
// margin-bottom: 12rpx;
// }
// }
// .active {
// background-color: $default-color;
// color: #ffffff;
// }
// }
.part-view {
padding: 0rpx 24rpx;
background-color: #ffffff;
......
<template>
<view class="update-log-item" :class="{active:checked}" @click="toDetail">
<view class="head">
<view class="head-title ellipsis">{{detail.title}}</view>
<!-- <view class="head-time">{{detail.createTime}}</view> -->
</view>
<view class="content ellipsis-2">
<!-- <text>{{detail.content}}</text> -->
<rich-text :nodes="detail.content"></rich-text>
</view>
</view>
</template>
<script>
export default {
props:{
detail:{
type:Object,
default:()=>{}
},
checked:{
type:Boolean,
default:false
}
},
data() {
return {};
},
methods:{
toDetail(){
this.$emit("click",this.detail)
}
}
};
</script>
<style lang="scss" scoped>
.update-log-item {
padding: 24rpx;
background-color: #ffffff;
margin-bottom: 24rpx;
border-radius: 16rpx;
// color: #8d8d8d;
.head {
padding: 8rpx 0 24rpx 0;
border-bottom: 2px solid #f6f7fa;
.head-title {
line-height: 28rpx;
font-size: 28rpx;
font-weight: bold;
}
.head-time {
margin-top: 16rpx;
color: #8d8d8d;
line-height: 24rpx;
font-size: 24rpx;
}
}
.content {
margin-top: 24rpx;
line-height: 32rpx;
font-size: 24rpx;
min-height: 32rpx;
max-height: 64rpx;
overflow: hidden;
}
}
.active{
color: #333333;
}
</style>
<template>
<view class="update-log">
<view class="content-view">
<scroll-view
scroll-y
style="height: 100%;width: 100%;"
@scrolltolower="reachBottom"
scroll-anchoring
refresher-enabled="true"
:refresher-triggered="triggered"
:refresher-threshold="100"
refresher-background="#F6F7FA"
@refresherrefresh="onRefresh"
@refresherrestore="onRestore"
enable-back-to-top
>
<view class="scroll-view">
<NoData v-if="noData" :text="noDataText" customStyle="margin-top: 0rpx;" :imageName="noDataImage" />
<view v-else>
<view class="bill-list"><help-item v-for="(item, index) in list" :key="index" :detail="item" @click="toDetail"></help-item></view>
</view>
<view class="loading-view" v-if="!loaded"><u-loading mode="flower"></u-loading></view>
</view>
</scroll-view>
</view>
</view>
</template>
<script>
import NoData from '@/components/no-data';
import HelpItem from './components/help-item.vue';
import { getList } from '@/api/mine/help.js';
export default {
components: {
NoData,
HelpItem
},
data() {
return {
list: [],
loaded: false,
noDataText: '当前暂无内容',
noDataImage: 'bill/wuzhangdanneirong@3x.png',
};
},
computed: {
noData() {
return (this.list || []).length == 0 && this.loaded;
}
},
mounted() {
this.reloadList();
},
methods: {
reloadList() {
this.getList();
},
async getList() {
try {
let res = await getList();
this.list = res.data;
} catch (e) {
//TODO handle the exception
console.log('error', e);
}
this.loaded = true;
},
onRefresh() {
if (this.freshing) return;
this.freshing = true;
this.reloadList();
},
onRestore() {
this.triggered = 'restore'; // 需要重置
},
toDetail(item){
this.$u.route({
url:"/pages/mine/help/help-detail",
params:{
id:item.id
}
})
}
}
};
</script>
<style lang="scss" scoped>
.update-log {
padding: 32rpx 24rpx;
width: 100%;
height: 100%;
.content-view {
width: 100%;
height: 100%;
overflow: hidden;
.scroll-view {
width: 100%;
height: 100%;
}
.loading-view {
width: 100%;
background-color: transparent;
display: flex;
align-items: center;
justify-content: center;
top: 50%;
left: 0;
position: fixed;
}
}
}
</style>
<template>
<view class="seal-list">
<NavbarRight :title="title" />
<view class="seal-tips">
<view class="seal-tips-icon">
<u-icon name="info-circle" color="#02A074" size="28"></u-icon>
</view>
<view class="seal-tips-content">操作提示:可进行编辑或删除操作</view>
</view>
<view class="content-view">
<scroll-view scroll-y style="height: 100%; width: 100%" @scrolltolower="reachBottom" scroll-anchoring
refresher-enabled="true" :refresher-triggered="triggered" :refresher-threshold="100"
refresher-background="#F6F7FA" @refresherrefresh="onRefresh" @refresherrestore="onRestore" enable-back-to-top>
<view class="list-view" v-if="projects && projects.length > 0">
<view v-for="(item, index) in projects" :key="index" class="item-view">
<CellSeal :info="item" @action="handleClickButton" type="edit"/>
</view>
<view class="load-more-view" v-show="(current == 1 && !loading) || current > 1">
<u-loadmore :status="loadStatus" bgColor="#F6F7FA"></u-loadmore>
</view>
</view>
<NoData v-else-if="!loading" customStyle="margin-top:100rpx" />
</scroll-view>
</view>
<view class="bottom-view">
<u-button type="success" :custom-style="customCreate" @click="handleClickCreate">
<u-icon name="plus" color="#FFFFFF" size="40"></u-icon>
<view class="create-view">{{ buttonText }}</view>
</u-button>
</view>
<view class="loading-view" v-if="loading && !freshing">
<u-loading mode="flower"></u-loading>
</view>
<u-toast ref="uToast" />
</view>
</template>
<script>
import NavbarRight from '@/components/navbar-right';
import CellSeal from '@/components/cell-seal/index';
import NoData from '@/components/no-data';
import { getSealList } from '@/api/mine/shop.js';
export default {
components: {
NavbarRight,
CellSeal,
NoData,
},
data () {
return {
type: 'normal',
projects: [],
loading: true,
loadStatus: 'loading',
triggered: true,
freshing: false,
current: 1,
size: 100,
sealType: ''
};
},
computed: {
customCreate () {
return {
color: 'transparent',
'background-color': '#02a074',
height: '104rpx',
'border-radius': '16rpx',
width: '686rpx'
};
},
isElectron() {
return this.sealType == 'ELECTRON'
},
title() {
return this.isElectron ? '电子水印' : '我的公章'
},
buttonText() {
return this.isElectron ? '添加电子水印' : '添加公章'
}
},
onLoad (options) {
uni.$on('seal-changed', res => {
this.reloadList();
});
if (options && options.type) {
this.sealType = options.type
}
this.freshing = false;
this.reloadList();
},
onUnload () {
if (this.isNormal) {
uni.$off('seal-changed');
}
},
methods: {
reloadList () {
this.current = 1;
this.loadStatus = 'loading';
this.getSealList();
},
getSealList () {
if (this.current == 1) {
this.loading = true;
}
getSealList({
current: this.current,
sealType: this.sealType,
size: this.size,
})
.then(res => {
let data = res.data;
this.projects = data
this.loadStatus = 'nomore'
this.$nextTick(() => {
if (this.freshing) {
this.triggered = false;
this.freshing = false;
}
});
this.loading = false;
})
.catch(err => {
this.loading = false;
console.log(err);
});
},
deleteProject () {
deleteProject({
id: this.currentPopInfo.projectId
})
.then(res => {
let data = res.data;
if (data) {
this.$refs.uToast.show({
title: '删除成功',
type: 'success',
duration: 1500,
callback: () => {
this.reloadList()
}
});
}
})
.catch(err => {
this.loading = false;
console.log(err);
});
},
recoveryProject () {
recoveryProject({
id: this.currentPopInfo.projectId
})
.then(res => {
let data = res.data;
if (data) {
this.$refs.uToast.show({
title: '恢复成功',
type: 'success',
duration: 1500,
callback: () => {
uni.$emit('projects-changed')
this.reloadList()
}
});
}
})
.catch(err => {
this.loading = false;
console.log(err);
});
},
updateProject (params) {
updateProject(params)
.then(res => {
let data = res.data;
if (data) {
this.$refs.uToast.show({
title: '创建成功',
type: 'success',
duration: 1500,
callback: () => {
this.reloadList()
}
});
}
})
.catch(err => {
this.loading = false;
console.log(err);
});
},
onRefresh () {
if (this.freshing) return;
this.freshing = true;
this.reloadList();
},
onRestore () {
this.triggered = 'restore'; // 需要重置
},
// 滚动底部
reachBottom (e) {
if (this.loadStatus != 'loadmore') return;
this.current += 1;
this.loadStatus == 'loading';
this.getSealList();
},
handleClickButton (seal) {
this.$u.route({
url: 'pages/mine/shop-setting/seal',
type: 'navigateTo',
params: {
seal: JSON.stringify(seal),
type: this.sealType,
noDelete: this.isElectron && this.projects.length <= 1 ? 'YES' : 'NO'
}
});
},
handleClickCreate () {
this.$u.route({
url: 'pages/mine/shop-setting/seal',
type: 'navigateTo',
params: {
type: this.sealType,
}
});
},
}
};
</script>
<style scoped lang="scss">
.seal-list {
display: flex;
flex-direction: column;
height: 100vh;
background-color: #f6f7fa;
.seal-tips {
height: 60rpx;
display: flex;
align-items: center;
padding: 0 24rpx;
flex-shrink: 0;
margin-bottom: 24rpx;
.seal-tips-icon {
display: flex;
align-items: center;
justify-content: center;
}
.seal-tips-content {
font-size: 24rpx;
color: #333333;
margin-left: 16rpx;
}
}
.content-view {
height: 100%;
overflow: auto;
padding: 0rpx 24rpx;
.list-view {
.item-view {
margin-bottom: 24rpx;
}
}
.load-more-view {
padding-bottom: 44rpx;
}
}
.bottom-view {
margin: 16rpx 24rpx 36rpx 24rpx;
display: flex;
align-items: center;
justify-content: center;
.icon-view {}
.create-view {
color: #ffffff;
height: 104rpx;
line-height: 104rpx;
font-weight: bold;
font-size: 32rpx;
margin-left: 8rpx;
}
}
.loading-view {
width: 100%;
background-color: transparent;
display: flex;
align-items: center;
justify-content: center;
top: 50%;
left: 0;
position: fixed;
}
}
</style>
This diff is collapsed.
......@@ -8,13 +8,9 @@
</view>
</view>
<view class="padding">
<view class="switch">
<view class="label">我的印章</view>
<view class="seal-view" @click="setSeal">
<view class="seal-image" v-if="stopInfo.customSeal">
<image :src="stopInfo.customSeal" ></image>
</view>
<view v-else>上传印章</view>
<view class="switch" v-for="(item,index) in sealTypes" :key="index" hover-class="u-hover-class" @click="setSeal(item.code)">
<view class="label">{{ item.desc }}</view>
<view class="seal-view">
<u-icon name="arrow-right"></u-icon>
</view>
</view>
......@@ -24,7 +20,7 @@
<script>
import settingCard from './components/setting-card.vue';
import {getShopInfo,updateShopInfo} from "@/api/mine/shop.js"
import {getShopInfo,updateShopInfo,getSealType} from "@/api/mine/shop.js"
export default {
components: {
settingCard
......@@ -38,11 +34,13 @@ export default {
intoBookRecord:false,
customSeal:"", // 印章URL
},
switchLoading: false
switchLoading: false,
sealTypes: []
};
},
onLoad() {
this.getShop()
this.getSealType()
},
methods: {
async getShop(){
......@@ -73,13 +71,22 @@ export default {
}
this.switchLoading = false;
},
setSeal(){
uni.$once('receipt-set-shop-seal', res => {
this.getShop()
});
getSealType() {
getSealType()
.then(res => {
this.sealTypes = res.data
})
.catch(err => {
console.log(err);
});
},
setSeal(type){
this.$u.route({
url: 'pages/mine/shop-setting/seal',
url: 'pages/mine/shop-setting/seal-list',
type: 'navigateTo',
params: {
type: type
}
});
}
}
......@@ -98,7 +105,7 @@ export default {
border-radius: 16upx;
padding: 24upx;
width: 100%;
// height: 104upx;
min-height: 104upx;
background: #ffffff;
display: flex;
align-items: center;
......
......@@ -291,3 +291,29 @@ export const sealOptions = [{
},
]
export const sealInfos = [
{
label: "电子水印",
selectText: '选择电子水印',
url: '',
selected: true,
value: '1',
code: 'ELECTRON',
},
{
label: "公章",
selectText: '选择公章',
url: '',
selected: false,
value: '2',
code: 'OFFICIAL'
},
{
label: "不使用",
url: '',
selected: false,
value: '3',
code: ''
}
]
......@@ -43,6 +43,11 @@ export const packageOptions = [
title: '我的奖金',
path: "/pages/bonus/index"
},
{
id: 6,
title: '使用帮助',
path: "/pages/mine/help/index"
},
{
id: 0,
title: '数据导出/导入',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment