123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- <template>
- <view class="container">
- <u-navbar leftIconColor="#fff" titleStyle="color:#fff;fontSize:36rpx;" :autoBack="true" bgColor="#2C6FF3"
- :placeholder="true" title="会员信息"></u-navbar>
- <view class="content">
- <view class="xy-card info-box">
- <view class="flex justify-start">
- <view class="flex justify-start">
- <view class="name">会员id:</view>
- <view>{{info.memberId}}</view>
- </view>
- <view style="margin-left: 24rpx;">
- <xbutton size="mini" @tap="copy(info.memberId)">复制</xbutton>
- </view>
- </view>
- <view class="flex justify-start">
- <view class="name">昵称:</view>
- <view>{{info.member.wechatNickname||info.member.alipayNickname||'/'}}</view>
- </view>
- <view class="flex justify-start phone">
- <view class="flex justify-start">
- <view class="name">手机:</view>
- <view>{{info.member.tel}}</view>
- </view>
- <view style="margin-left: 24rpx;">
- <xbutton size="mini" @click="block" v-if="info.isBlacklist">解除黑名单</xbutton>
- <xbutton size="mini" @click="block" v-else>拉黑</xbutton>
- </view>
- </view>
- </view>
- </view>
- <xpopup :show="show" @close="close" @confirm="submit" :showBtn="true" title="黑名单">
- <!-- 拉黑 -->
- <view class="pop-content restart">
- 是否确定拉黑该用户?
- </view>
- </xpopup>
- </view>
- </template>
- <script>
- import {
- userInfo,
- setBlacklist,
- removeBlackList
- } from '@/api/order/order.js'
- export default {
- data() {
- return {
- id: null,
- info: {},
- show: false,
- }
- },
- onLoad(o) {
- this.id = o.id;
- this.getInfo()
- },
- methods: {
- getInfo() {
- userInfo({
- memberId: this.id
- }).then(res => {
- this.info = res.data
- })
- },
- copy(text) {
- uni.setClipboardData({
- data: text,
- success: (data) => {
- uni.showToast({
- title: '复制成功'
- })
- },
- fail: function(err) {
- },
- complete: function(res) {
- }
- })
- },
- block() {
- // this.show = true
- if(this.info.isBlacklist){ //已拉黑,解除
- removeBlackList({
- memberId: this.id
- }).then(res => {
- this.getInfo()
- this.close()
- this.$modal.showToast('解除成功~')
- }).catch(err => {
- this.close()
- })
- }else{ //拉黑
- setBlacklist({
- memberId: this.id
- }).then(res => {
- this.getInfo()
- this.close()
- this.$modal.showToast('拉黑成功~')
- }).catch(err => {
- this.close()
- })
- }
- },
- // 关闭弹框
- close(e) {
- this.show = false
- },
- // 弹框确定
- submit() {
- if(this.info.isBlacklist){ //已拉黑,解除
- removeBlackList({
- memberId: this.id
- }).then(res => {
- this.$modal.msg('解除成功~')
- this.getInfo()
- this.close()
- }).catch(err => {
- this.close()
- })
- }else{ //拉黑
- setBlacklist({
- memberId: this.id
- }).then(res => {
- this.$modal.msg('拉黑成功~')
- this.getInfo()
- this.close()
- }).catch(err => {
- this.close()
- })
- }
- },
- }
- }
- </script>
- <style lang="scss">
- .container {
- .content {
- padding: 0 24rpx;
- overflow: hidden;
- .info-box {
- margin-top: 24rpx;
- >view {
- line-height: 60rpx;
- }
- .name {
- width: 120rpx;
- font-size: 28rpx;
- font-weight: bold;
- color: #333;
- }
- }
- .phone {
- text {
- display: inline-block;
- background-color: #5b5b5b;
- color: #fff;
- font-size: 22rpx;
- padding: 0 12rpx;
- border-radius: 6rpx;
- margin-left: 12rpx;
- line-height: 36rpx;
- }
- }
- }
- .pop-content {
- padding: 24rpx;
- }
- }
- </style>
|