Commit 868ca039 by 胡悦

设置置顶通知

1 parent 9a47f6af

2.41 MB | W: | H:

2.42 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -40,11 +40,18 @@
</scroll-view>
</view>
</view>
<uni-transition :show="noticeTips" mode="slide-top">
<view class="notice-tips blue" >
<view class="sprite-icon icon-notice-success"></view>
<view>{{ topList.includes(Number(moduleType)) ? '置顶' : '取消置顶' }}成功</view>
</view>
</uni-transition>
</view>
</template>
<script>
const PAGE_SIZE = 10
const PAGE_NUM = 1
let timer = null
import dayjs from 'dayjs'
import { moduleTypeEnum, moduleContentEnum } from './components/contant'
import ServiceList from './components/ServiceList.vue';
......@@ -68,7 +75,8 @@ export default {
pageSize: 10,
scrollTop: 0,
isLoading: false,
userInfo: {}
userInfo: {},
noticeTips: false
}
},
computed: {
......@@ -336,7 +344,8 @@ export default {
// 置顶,取消置顶
handleStickTop() {
console.log('置顶')
const {phone, shopMerchantId, sceneType} = this.userInfo
clearTimeout(timer)
const { phone, shopMerchantId, sceneType } = this.userInfo
const _topInfo = uni.$storage.get('noticeTopInfo') || {}
const key = `${phone}-${shopMerchantId}-${sceneType}`
let _topList = _topInfo[key] || []
......@@ -347,6 +356,10 @@ export default {
}
_topInfo[key] = _topList
this.topList = _topList
this.noticeTips = true
timer = setTimeout(() => {
this.noticeTips = false
}, 3000)
uni.$storage.set('noticeTopInfo', _topInfo)
}
}
......@@ -489,4 +502,24 @@ export default {
padding: toRpx(30) 0;
font-size: toRpx(24);
}
.notice-tips {
position: fixed;
top: toRpx(160);
left: 50%;
transform: translateX(-50%);
display: flex;
align-items: center;
justify-content: center;
color: #4673ff;
font-size: toRpx(28);
padding: toRpx(16) toRpx(24);
border-radius: toRpx(8);
z-index: 1;
&.blue {
background: #4673ff1a;
}
.icon-notice-success {
margin-right: toRpx(16);
}
}
</style>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!