Commit 96184d08 authored by Facius's avatar Facius

feat: 印章水印弹出列表新增添加;我的页面头像加设置提示;绑手机页面加占位符

parent 7c80285f
Pipeline #6705 canceled with stages
<template> <template>
<view class="user-header"> <view class="user-header">
<view class="user-profile" @click="toUserSetting"> <view class="user-profile" @click="toUserSetting">
<image :src="userInfo.avatar" mode="" v-if="userInfo.avatar"></image> <image class="head-image" :src="userInfo.avatar" mode="" v-if="userInfo.avatar"></image>
<image :src="avatar" v-else></image> <image class="head-image" :src="avatar" v-else></image>
<view class="set-tip" v-if="showSetTip"><view>设置</view></view>
</view> </view>
<view class="user-info" @click="toLogin"> <view class="user-info" @click="toLogin">
<view class="user-nickname"> <view class="user-nickname">
...@@ -59,6 +60,9 @@ export default { ...@@ -59,6 +60,9 @@ export default {
}, },
notVip() { notVip() {
return this.mineBaseUrl + 'bushihuiyuan@3x.png'; return this.mineBaseUrl + 'bushihuiyuan@3x.png';
},
showSetTip() {
return this.userInfo.id && (!this.userInfo.avatar || this.userInfo.avatar.indexOf('thirdwx') != -1 || this.userInfo.avatar.indexOf('/mine/') != -1)
} }
}, },
methods: { methods: {
...@@ -103,6 +107,23 @@ export default { ...@@ -103,6 +107,23 @@ export default {
border-radius: 50%; border-radius: 50%;
overflow: hidden; overflow: hidden;
border: 4upx solid #ffffff; border: 4upx solid #ffffff;
position: relative;
.head-image {
position: relative;
}
.set-tip {
position: absolute;
left: 0;
right: 0;
bottom: 0;
background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.4) 100%);
display: flex;
justify-content: center;
align-items: center;
color: #ffffff;
font-size: 24rpx;
height: 48rpx;
}
} }
.user-info { .user-info {
display: flex; display: flex;
......
...@@ -5,10 +5,10 @@ ...@@ -5,10 +5,10 @@
<view class="phone-view"> <view class="phone-view">
<view class="left-view">+86</view> <view class="left-view">+86</view>
<view class="middle-view"></view> <view class="middle-view"></view>
<view class="right-view"><input v-model="phone" type="number" width="100%" maxlength="20" clearable /></view> <view class="right-view"><input placeholder-style="color:#BDBDBD" placeholder="请输入手机号" v-model="phone" type="number" width="100%" maxlength="20" clearable /></view>
</view> </view>
<view class="code-view"> <view class="code-view">
<view class="left-view"><input v-model="code" type="number" maxlength="4" clearable /></view> <view class="left-view"><input placeholder-style="color:#BDBDBD" placeholder="请输入验证码" v-model="code" type="number" maxlength="4" clearable /></view>
<!-- <view :class="['right-view', { active: active }]" hover-class="u-hover-class" @click="$u.throttle(handleClick, 500)">{{ text }}</view> --> <!-- <view :class="['right-view', { active: active }]" hover-class="u-hover-class" @click="$u.throttle(handleClick, 500)">{{ text }}</view> -->
<view class="right-view"> <view class="right-view">
<u-toast ref="uToast"></u-toast> <u-toast ref="uToast"></u-toast>
...@@ -459,7 +459,7 @@ export default { ...@@ -459,7 +459,7 @@ export default {
font-weight: bold; font-weight: bold;
font-size: 28rpx; font-size: 28rpx;
color: #333333; color: #333333;
background-color: #fafafa; background-color: #f6f6f6;
border-radius: 16rpx; border-radius: 16rpx;
height: 104rpx; height: 104rpx;
padding: 0 32rpx; padding: 0 32rpx;
...@@ -492,7 +492,7 @@ export default { ...@@ -492,7 +492,7 @@ export default {
font-weight: bold; font-weight: bold;
font-size: 28rpx; font-size: 28rpx;
color: #333333; color: #333333;
background-color: #fafafa; background-color: #f6f6f6;
border-radius: 16rpx; border-radius: 16rpx;
height: 104rpx; height: 104rpx;
padding: 0 32rpx; padding: 0 32rpx;
......
<template> <template>
<u-popup v-model="show" safe-area-inset-bottom border-radius="24" mode="bottom" :closeable="true" @close="handleClose" <u-popup v-model="show" safe-area-inset-bottom border-radius="24" mode="bottom" :closeable="false" @close="handleClose"
:mask-close-able="true"> :mask-close-able="true">
<view class="pop-seal"> <view class="pop-seal">
<view class="title-view">{{ title }}</view> <view class="title-view">
<view class="left-view">{{ title }}</view>
<view class="right-view" @click="$u.throttle(handleAdd, 500)" hover-class="u-hover-class">
<u-icon name="plus" color="#02A074" size="30"></u-icon>
<view class="add-text">新增</view>
</view>
</view>
<view class="content-view"> <view class="content-view">
<view v-for="(item, index) in sealList" :key="index" class="item-view"> <view v-for="(item, index) in sealList" :key="index" class="item-view">
<CellSeal :info="item" @select="handleClick" /> <CellSeal :info="item" @select="handleClick" />
...@@ -50,6 +56,12 @@ export default { ...@@ -50,6 +56,12 @@ export default {
this.sealList = this.list this.sealList = this.list
} }
}, },
list: {
handler (val) {
this.sealList = val
},
deep: true
}
}, },
methods: { methods: {
handleClick (id) { handleClick (id) {
...@@ -61,6 +73,10 @@ export default { ...@@ -61,6 +73,10 @@ export default {
} }
this.changeVisibleValue(false) this.changeVisibleValue(false)
}, },
handleAdd() {
this.$emit('add')
// this.changeVisibleValue(false)
},
changeVisibleValue (val) { changeVisibleValue (val) {
this.show = val this.show = val
this.$emit('update:visible', val) this.$emit('update:visible', val)
...@@ -89,7 +105,22 @@ export default { ...@@ -89,7 +105,22 @@ export default {
background-color: #ffffff; background-color: #ffffff;
height: 90rpx; height: 90rpx;
line-height: 90rpx; line-height: 90rpx;
padding-left: 32rpx; padding: 0 32rpx;
display: flex;
justify-content: space-between;
align-items: center;
.left-view {
}
.right-view {
display: flex;
justify-content: flex-end;
align-items: center;
.add-text {
color: #02A074;
margin-left: 12rpx;
}
}
} }
.content-view { .content-view {
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</view> </view>
</block> </block>
</view> </view>
<PopSeal :title="selectedItem.selectText" :list="selectedItem.list" :visible.sync="visible" @select="handleSelectItem"/> <PopSeal :title="selectedItem.selectText" :list="selectedItem.list" :visible.sync="visible" @add="handleAdd" @select="handleSelectItem"/>
</view> </view>
</template> </template>
<script> <script>
...@@ -62,6 +62,15 @@ export default { ...@@ -62,6 +62,15 @@ export default {
handleSelect () { handleSelect () {
this.visible = true this.visible = true
}, },
handleAdd() {
this.$u.route({
url: 'pages/mine/shop-setting/seal',
type: 'navigateTo',
params: {
type: this.selectedItem.code,
}
});
}
}, },
} }
</script> </script>
......
...@@ -310,7 +310,7 @@ export default { ...@@ -310,7 +310,7 @@ export default {
width: '200rpx', width: '200rpx',
height: '128rpx' height: '128rpx'
}, },
jumpToSeal:false jumpToSeal:false,
}; };
}, },
computed: { computed: {
...@@ -450,7 +450,10 @@ export default { ...@@ -450,7 +450,10 @@ export default {
dayTime: dayTime, dayTime: dayTime,
hourTime: hourTime hourTime: hourTime
}; };
} },
isNew() {
return !(this.billId || this.copyId)
}
}, },
onLoad(options) { onLoad(options) {
// 测试数据 // 测试数据
...@@ -469,11 +472,14 @@ export default { ...@@ -469,11 +472,14 @@ export default {
if (this.billId || this.copyId) { if (this.billId || this.copyId) {
this.repairDetail(this.billId || this.copyId); this.repairDetail(this.billId || this.copyId);
} else { } else {
this.getSealType(true) this.getSealType()
} }
uni.$on('maintain-bill-detail', res => { uni.$on('maintain-bill-detail', res => {
this.repairDetail(this.billId); this.repairDetail(this.billId);
}); });
uni.$on('seal-changed', res => {
this.getSealList(res);
});
if (options && options.list) { if (options && options.list) {
let list = JSON.parse(decodeURIComponent(decodeURIComponent(decodeURIComponent(options.list)))); let list = JSON.parse(decodeURIComponent(decodeURIComponent(decodeURIComponent(options.list))));
console.log(list); console.log(list);
...@@ -490,6 +496,7 @@ export default { ...@@ -490,6 +496,7 @@ export default {
}, },
onUnload() { onUnload() {
uni.$off('maintain-bill-detail'); uni.$off('maintain-bill-detail');
uni.$off('seal-changed');
}, },
onShow() {}, onShow() {},
methods: { methods: {
...@@ -641,7 +648,7 @@ export default { ...@@ -641,7 +648,7 @@ export default {
this.form.extend.sealType = e.value; this.form.extend.sealType = e.value;
this.form.extend.sealUrl = e.url; this.form.extend.sealUrl = e.url;
}, },
getSealType(isNew=false) { getSealType() {
getSealType() getSealType()
.then(res => { .then(res => {
var array = [] var array = []
...@@ -656,7 +663,7 @@ export default { ...@@ -656,7 +663,7 @@ export default {
break break
} }
} }
if (!isNew) { if (!this.isNew) {
if ( seal.value == this.form.extend.sealType) { if ( seal.value == this.form.extend.sealType) {
seal.selected = true seal.selected = true
seal.url = this.form.extend.sealUrl seal.url = this.form.extend.sealUrl
...@@ -693,6 +700,17 @@ export default { ...@@ -693,6 +700,17 @@ export default {
if (seal.isDefault) { if (seal.isDefault) {
item.url = seal.sealImg item.url = seal.sealImg
item.sealId = seal.id item.sealId = seal.id
// 如果是新建且公章设了默认值,就选中公章选项
if (sealType == 'OFFICIAL' && this.isNew) {
for( var seal of this.sealList) {
if (seal.code == sealType) {
this.form.extend.sealType = seal.value
seal.selected = true
} else {
seal.selected = false
}
}
}
break break
} }
} }
...@@ -706,7 +724,7 @@ export default { ...@@ -706,7 +724,7 @@ export default {
seal.selected = item.sealId ? item.sealId == seal.id : item.url == seal.sealImg seal.selected = item.sealId ? item.sealId == seal.id : item.url == seal.sealImg
} }
item.list = data item.list = data
if (item.value == this.form.extend.sealType && !this.form.extend.sealUrl) { if (item.value == this.form.extend.sealType) {
this.form.extend.sealUrl = item.url this.form.extend.sealUrl = item.url
} }
break break
......
...@@ -254,6 +254,9 @@ ...@@ -254,6 +254,9 @@
canConfirm() { canConfirm() {
return this.form.customerName && this.form.extend.collectionReason && this.form.actualAmount return this.form.customerName && this.form.extend.collectionReason && this.form.actualAmount
}, },
isNew() {
return !(this.billId || this.copyId)
}
}, },
onLoad(options) { onLoad(options) {
// 测试数据 // 测试数据
...@@ -269,9 +272,13 @@ ...@@ -269,9 +272,13 @@
} else { } else {
this.getSealType(true) this.getSealType(true)
} }
uni.$on('seal-changed', res => {
this.getSealList(res);
});
}, },
onUnload() { onUnload() {
uni.$off('seal-changed');
}, },
methods: { methods: {
chooseMember() { chooseMember() {
...@@ -301,7 +308,7 @@ ...@@ -301,7 +308,7 @@
this.form.extend.sealType = e.value; this.form.extend.sealType = e.value;
this.form.extend.sealUrl = e.url; this.form.extend.sealUrl = e.url;
}, },
getSealType(isNew=false) { getSealType() {
getSealType() getSealType()
.then(res => { .then(res => {
var array = [] var array = []
...@@ -316,7 +323,7 @@ ...@@ -316,7 +323,7 @@
break break
} }
} }
if (!isNew) { if (!this.isNew) {
if ( seal.value == this.form.extend.sealType) { if ( seal.value == this.form.extend.sealType) {
seal.selected = true seal.selected = true
seal.url = this.form.extend.sealUrl seal.url = this.form.extend.sealUrl
...@@ -352,15 +359,28 @@ ...@@ -352,15 +359,28 @@
for (var seal of data) { for (var seal of data) {
if (seal.isDefault) { if (seal.isDefault) {
item.url = seal.sealImg item.url = seal.sealImg
item.sealId = seal.id
// 如果是新建且公章设了默认值,就选中公章选项
if (sealType == 'OFFICIAL' && this.isNew) {
for( var seal of this.sealList) {
if (seal.code == sealType) {
this.form.extend.sealType = seal.value
seal.selected = true
} else {
seal.selected = false
}
}
}
break break
} }
} }
if (!item.url) { if (!item.url) {
item.url = data[0].sealImg item.url = data[0].sealImg
item.sealId = data[0].id
} }
} }
for (var seal of data) { for (var seal of data) {
seal.selected = item.url == seal.sealImg seal.selected = item.sealId ? item.sealId == seal.id : item.url == seal.sealImg
} }
item.list = data item.list = data
if (item.value == this.form.extend.sealType && !this.form.extend.sealUrl) { if (item.value == this.form.extend.sealType && !this.form.extend.sealUrl) {
......
...@@ -318,7 +318,7 @@ ...@@ -318,7 +318,7 @@
}, },
goBack() { goBack() {
uni.$emit("receipt-set-seal") uni.$emit("receipt-set-seal")
uni.$emit('seal-changed') uni.$emit('seal-changed',this.sealType)
uni.navigateBack() uni.navigateBack()
}, },
handleClickConfirm() { handleClickConfirm() {
......
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