123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346 |
- <template>
- <view class="container product clearfix">
- <view class="remarks-content" :style="{ paddingBottom: isIphoneX ? '168rpx' : '0' }">
- <view :class="{ 'tui-order-list': scrollTop >= 0 }" class="clearfix">
- <!-- 空白页 -->
- <view class="empty-container" v-if="isEmpty">
- <image class="empty-container-image" :src="StaticUrl + '/icon/icon-remarks-empty@2x.png'"></image>
- <text class="error-text">暂无任何资料备注~</text>
- </view>
- <!-- 列表 -->
- <view class="tui-remarks-cell tui-mtop" v-for="(remark, index) in remarksList" :key="index" @click.stop="details(remark.remarksId)">
- <view class="tui-remarks-time">{{ remark.addTime }}</view>
- <view class="tui-remarks-content">{{ remark.remarks }}</view>
- <view class="tui-remarks-button">
- <view class="btn" @click.stop="handEditRemark(remark.remarksId)">修改</view>
- <view class="btn" @click.stop="deleteRemark(remark.remarksId)">删除</view>
- </view>
- </view>
- <!--加载loadding-->
- <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
- <tui-nomore :visible="!pullUpOn" :backgroundColor="'#ffffff'" :text="nomoreText"></tui-nomore>
- <!--加载loadding-->
- </view>
- </view>
- <!-- 取消收藏操作 -->
- <tui-bottom-popup :radius="false" :mask="false" :show="popupShow">
- <view class="tui-popup-box clearfix">
- <view class="tui-right-flex tui-popup-btn" :style="{ paddingBottom: isIphoneX ? '68rpx' : '0rpx' }">
- <view class="tui-flex-1">
- <view class="tui-button" @click="handleAllUnder">添加资料备注</view>
- </view>
- </view>
- </view>
- </tui-bottom-popup>
- <!-- 弹窗提示 -->
- <tui-modal
- :show="modal"
- @click="handleClick"
- @cancel="hideMobel"
- :content="contentModalText"
- :button="modalButton"
- color="#333"
- :size="32"
- shape="circle"
- :maskClosable="false"
- >
- </tui-modal>
- </view>
- </template>
- <script>
- import tuiLoadmore from '@/components/tui-components/loadmore/loadmore'
- import tuiNomore from '@/components/tui-components/nomore/nomore'
- import { mapState, mapMutations } from 'vuex'
- const defaultListQuery = {
- clubId: 0,
- pageNum: 1,
- pageSize: 10
- }
- export default {
- components: {
- tuiLoadmore,
- tuiNomore
- },
- data() {
- return {
- StaticUrl: this.$Static,
- isIphoneX: this.$store.state.isIphoneX,
- modalButton: [
- {
- text: '取消',
- type: 'gray',
- plain: true //是否空心
- },
- {
- text: '确认',
- customStyle: {
- color: '#fff',
- bgColor: 'linear-gradient(90deg, #F28F31 0%, #E15616 100%)'
- },
- plain: false
- }
- ],
- totalRecord: 0,
- popupShow: true,
- popupShow1: false,
- listQuery: Object.assign({}, defaultListQuery),
- remarksList: [],
- scrollTop: 0,
- isEmpty: false,
- loadding: false,
- pullUpOn: true,
- pullFlag: true,
- hasNextPage: false,
- navbarHeight: '',
- nomoreText: '上拉显示更多',
- contentModalText: '', //操作文字提示语句
- modal: false,
- handleRemarksId:0
- }
- },
- onLoad() {
-
- },
- filters: {
- NumFormat: function(value) {
- //处理金额
- if (!value) return '0.00'
- let number = Number(value).toFixed(2)
- return number
- }
- },
- computed: {
- ...mapState(['hasLogin', 'userInfo'])
- },
- methods: {
- ...mapMutations(['login', 'logout']),
- async initGetStotage() {
- const clubInfo = await this.$api.getComStorage('orderUserInfo')
- this.listQuery.clubId = clubInfo.clubID ? clubInfo.clubID : 0
- this.GetProductListInfo()
- },
- GetProductListInfo() {
- this.remarksList = []
- this.listQuery.pageNum = 1
- this.UserService.getUserClubRemarksList(this.listQuery)
- .then(response => {
- let data = response.data
- if (data.results && data.results.length > 0) {
- this.isEmpty = false
- this.hasNextPage = data.hasNextPage
- this.totalRecord = data.totalRecord
- this.remarksList = data.results
- this.pullFlag = false
- setTimeout(() => {
- this.pullFlag = true
- }, 500)
- if (this.hasNextPage) {
- this.pullUpOn = false
- this.nomoreText = '上拉显示更多'
- } else {
- if (this.remarksList.length < 8) {
- this.pullUpOn = true
- } else {
- this.pullUpOn = false
- this.loadding = false
- this.nomoreText = '已至底部'
- }
- }
- } else {
- this.isEmpty = true
- }
- this.isRequest = true
- })
- .catch(error => {
- this.$util.msg(error.msg, 2000)
- })
- },
- GetOnReachBottomData(index) {
- //上拉加载
- this.listQuery.pageNum += 1
- this.UserService.getUserClubRemarksList(this.listQuery)
- .then(response => {
- let data = response.data
- if (data.results && data.results.length > 0) {
- this.hasNextPage = data.hasNextPage
- this.remarksList = this.remarksList.concat(data.results)
- this.pullFlag = false // 防上拉暴滑
- setTimeout(() => {
- this.pullFlag = true
- }, 500)
- if (this.hasNextPage) {
- this.pullUpOn = false
- this.nomoreText = '上拉显示更多'
- } else {
- this.pullUpOn = false
- this.loadding = false
- this.nomoreText = '已至底部'
- }
- }
- })
- .catch(error => {
- this.$util.msg(error.msg, 2000)
- })
- },
- deleteRemark(remarksId) {
- this.handleRemarksId = remarksId
- this.modal = true
- this.contentModalText = '确定删除这条备注信息吗?'
- },
- handEditRemark(remarksId){
- //跳转修改资料备注
- this.$api.navigateTo(`/pages/seller/remarks/add?type=edit&remarksId=${remarksId}`)
- },
- handleAllUnder() {
- //跳转添加资料备注
- this.$api.navigateTo('/pages/seller/remarks/add')
- },
- handleClick(e) {
- //取消收藏
- if (e.index == 1) {
- this.handleDeleteUserLike()
- }
- this.modal = false
- },
- handleDeleteUserLike() {
- //操作删除资料备注
- this.UserService.getUserClubRemarksDelete({
- remarksId: this.handleRemarksId
- })
- .then(response => {
- this.$util.msg('删除成功', 2000, true, 'success')
- setTimeout(() => {
- this.GetProductListInfo()
- }, 2000)
- })
- .catch(error => {
- this.$util.msg(error.msg, 2000)
- })
- },
- hideMobel() {
- this.modal = false
- },
- details(remarksId) {
- this.$api.navigateTo(`/pages/seller/remarks/details?remarksId=${remarksId}`)
- }
- },
- onPageScroll(e) {
- //实时获取到滚动的值
- },
- onReachBottom() {
- if (this.hasNextPage) {
- this.loadding = true
- this.pullUpOn = true
- this.GetOnReachBottomData()
- }
- },
- onPullDownRefresh() {
- setTimeout(() => {
- this.listQuery.pageNum = 1
- uni.stopPullDownRefresh()
- }, 200)
- },
- onShow() {
- this.initGetStotage()
- }
- }
- </script>
- <style lang="scss">
- @import '@/uni.scss';
- page {
- background: #f7f7f7;
- }
- .empty-container {
- z-index: 99;
- }
- .remarks-content {
- width: 100%;
- height: auto;
- position: relative;
- padding: 0;
- box-sizing: border-box;
- padding: 24rpx;
- .empty-container-image {
- width: 260rpx;
- height: 260rpx;
- margin-top: -300rpx;
- }
- .tui-remarks-cell {
- width: 100%;
- height: 316rpx;
- border-radius: 16rpx;
- background: #ffffff;
- margin-bottom: 24rpx;
- box-sizing: border-box;
- padding: 25rpx 32rpx;
- .tui-remarks-time {
- width: 100%;
- height: 37rpx;
- line-height: 37rpx;
- text-align: left;
- font-size: $font-size-26;
- color: #666666;
- margin-bottom: 24rpx;
- }
- .tui-remarks-content {
- width: 100%;
- line-height: 44rpx;
- text-align: justify;
- font-size: $font-size-26;
- color: #333333;
- text-overflow: ellipsis;
- overflow: hidden;
- display: -webkit-box;
- -webkit-line-clamp: 3;
- line-clamp: 3;
- -webkit-box-orient: vertical;
- margin-bottom: 24rpx;
- }
- .tui-remarks-button {
- width: 100%;
- height: 48rpx;
- .btn {
- width: 104rpx;
- line-height: 48rpx;
- box-sizing: border-box;
- border: 1px solid #707070;
- text-align: center;
- border-radius: 30rpx;
- color: #666666;
- font-size: $font-size-24;
- float: right;
- margin-left: 24rpx;
- }
- }
- }
- }
- .tui-popup-box {
- position: relative;
- box-sizing: border-box;
- min-height: 100rpx;
- padding: 6rpx 24rpx;
- .tui-popup-content {
- padding-top: 30rpx;
- }
- }
- .tui-popup-btn {
- width: 100%;
- height: auto;
- float: left;
- box-sizing: border-box;
- margin-top: 30rpx;
- .tui-button {
- width: 600rpx;
- height: 88rpx;
- background: $btn-confirm;
- line-height: 88rpx;
- text-align: center;
- color: #ffffff;
- font-size: $font-size-28;
- border-radius: 44rpx;
- margin: 0 auto;
- }
- }
- </style>
|