| | |
| | | <uni-swipe-action-item :right-options="rightOptions" @click="handleDel(index, card)"> |
| | | <view @click="selectCard(index)" class="card-item"> |
| | | <view :class="{active: card.is_default==1}" class="card-preview"> |
| | | <image style="width: 650rpx;border-radius: 12rpx;" :src="card.mp" mode="widthFix"></image> |
| | | <image v-show="card.is_default==1" src="@/static/icon/mrmp.png" class="mrmp"></image> |
| | | <image style="width: 650rpx;border-radius: 12rpx;" :src="card.mp" |
| | | mode="widthFix"></image> |
| | | <image v-show="card.is_default==1" src="@/static/icon/mrmp.png" class="mrmp"> |
| | | </image> |
| | | </view> |
| | | </view> |
| | | </uni-swipe-action-item> |
| | |
| | | |
| | | <script> |
| | | import Popup from '@/components/uni-popup.vue'; |
| | | import uniSwipeAction from '@/uni_modules/uni-swipe-action/components/uni-swipe-action/uni-swipe-action.vue'; |
| | | import uniSwipeActionItem from '@/uni_modules/uni-swipe-action/components/uni-swipe-action-item/uni-swipe-action-item.vue'; |
| | | import uniSwipeAction from '@/uni_modules/uni-swipe-action/components/uni-swipe-action/uni-swipe-action.vue'; |
| | | import uniSwipeActionItem from '@/uni_modules/uni-swipe-action/components/uni-swipe-action-item/uni-swipe-action-item.vue'; |
| | | export default { |
| | | components: { |
| | | Popup, |
| | |
| | | }, |
| | | onLoad() { |
| | | this.screenWidth = uni.getSystemInfoSync().windowWidth * 2 - 70; |
| | | |
| | | }, |
| | | onShow() { |
| | | this.getbusinessList(); |
| | | this.getVisitorList(); |
| | | }, |
| | |
| | | }, function(res) { |
| | | _this.businessList = res.data.data; |
| | | if (_this.businessList.length > 0) { |
| | | for(let i in _this.businessList){ |
| | | if(_this.businessList[i].is_default==1){ |
| | | _this.current=i; |
| | | for (let i in _this.businessList) { |
| | | if (_this.businessList[i].is_default == 1) { |
| | | _this.current = i; |
| | | } |
| | | } |
| | | _this.getbusiness(_this.businessList[_this.current].user_id) |
| | |
| | | this.gotoPage( |
| | | `/pages/plus/business/add?business_card_id=${this.businessList[this.current].business_card_id}` |
| | | ); |
| | | }else{ |
| | | } else { |
| | | this.gotoPage( |
| | | `/pages/plus/business/add` |
| | | ); |
| | |
| | | }, |
| | | shareCard() { |
| | | // 分享名片逻辑 |
| | | |
| | | |
| | | }, |
| | | viewAllVisitors() { |
| | | // 查看全部访客 |
| | | this.gotoPage('/pages/plus/business/visitors'); |
| | | }, |
| | | |
| | | |
| | | // 跳转到聊天记录页面 |
| | | gotoChatList() { |
| | | uni.navigateTo({ |
| | |
| | | this.showToast('默认名片不能删除'); |
| | | return; |
| | | } |
| | | |
| | | |
| | | uni.showModal({ |
| | | title: '提示', |
| | | content: '确定要删除这个名片吗?', |
| | |
| | | // 删除成功,更新列表 |
| | | this.businessList.splice(index, 1); |
| | | this.showToast('删除成功'); |
| | | |
| | | |
| | | // 如果删除的是当前选中的名片,切换到第一个名片 |
| | | if (index === this.current) { |
| | | if (this.businessList.length > 0) { |
| | | this.current = 0; |
| | | this.getStatistics(this.businessList[this.current].business_card_id); |
| | | this.getStatistics(this.businessList[this.current] |
| | | .business_card_id); |
| | | } |
| | | } else if (index < this.current) { |
| | | // 如果删除的是当前选中名片之前的,current减1 |