From 155f2b80f2a9b6f900c73f6e4461e9cebb7cd028 Mon Sep 17 00:00:00 2001 From: whycq <10027870+whycq@user.noreply.gitee.com> Date: 星期二, 10 十月 2023 17:12:20 +0800 Subject: [PATCH] # --- pages/business/cstmr/cstmrDetails.vue | 65 +++++++++++++++++--------------- 1 files changed, 35 insertions(+), 30 deletions(-) diff --git a/pages/business/cstmr/cstmrDetails.vue b/pages/business/cstmr/cstmrDetails.vue index ce74f77..18c3a20 100644 --- a/pages/business/cstmr/cstmrDetails.vue +++ b/pages/business/cstmr/cstmrDetails.vue @@ -35,6 +35,9 @@ <view class="list-left">{{item.userName}}</view> <view class="list-right"><button size="mini" style="float: right;" type="warn" @click="removeFollowers(item.userId)">绉婚櫎</button></view> </view> + <view class="list-none" v-show="followers.length == 0"> + <text>鏆傛棤璺熻繘浜�</text> + </view> </view> </scroll-view> @@ -60,13 +63,12 @@ data() { return { id: 0, - baseUrl: '', cstmr: { id: '', - name: '娌冲寳鍚涢偊涔充笟鏈夐檺鍏徃', - tel: '15067665399', - addr: '娌冲寳鐪侀偗閮稿競鍚涢偊涔充笟鏈夐檺鍏徃', - cstman: '鏈辨槑蹇�' + name: '', + tel: '', + addr: '', + cstman: '' }, addFollower: { follower: '', @@ -79,14 +81,11 @@ }, onLoad(option) { this.id = option.id - this.baseUrl = uni.getStorageSync('baseUrl') this.init() this.autoLoad('follower','') setTimeout(()=>{ this.getFollowers() },500) - - }, methods: { init() { @@ -102,18 +101,15 @@ } }) }, - del(id) { + del(e) { let that = this - var ida ; - id = Number(id) - ida.push(id) - console.log(ida); + e = Number(e) uni.request({ - url: that.baseUrl + '/cstmr/delete/auth', + url: that.baseUrl + '/cstmr/delete/one/' + e, header: {'token' : uni.getStorageSync('token'), }, - data: ida, - method: 'POST', + method: 'GET', + success(res) { console.log(res); res = res.data @@ -138,13 +134,11 @@ // 纭閫夋嫨宸ヤ綔浜� confirm() { let that = this - var followerId = [], - cstmrId = []; - cstmrId.push(that.cstmrId) + var followerId var followerList = that.addFollower.followerList for (var i = 0;i < followerList.length; i++) { if (followerList[i].name == this.addFollower.follower) { - followerId.push(followerList[i].value) + followerId =followerList[i].value } } uni.request({ @@ -153,12 +147,12 @@ // 'content-type':'application/x-www-form-urlencoded', }, data: { - cstmrId: cstmrId, - followerIdList:followerId}, + cstmrId: that.cstmrId, + followerIds:followerId}, method: 'POST', success(result) { var res = result.data - console.log(res); + that.getFollowers() } }) this.addFollower.follower = '' @@ -175,7 +169,6 @@ method: 'POST', success(result) { var res = result.data - console.log(res); if (res.code === 200) { var element; if (type == 'follower') { @@ -204,10 +197,12 @@ }, removeFollowers(userId) { let that = this - console.log(that.cstmrId); uni.request({ url: that.baseUrl + '/cstmr/followers/remove/auth', - header:{'token':uni.getStorageSync('token')}, + header:{ + 'token':uni.getStorageSync('token'), + 'content-type': 'application/x-www-form-urlencoded' + }, data: { cstmrId:that.cstmrId, userId: userId @@ -215,7 +210,7 @@ method:'POST', success(res) { res = res.data - console.log(res); + that.getFollowers() } }) } @@ -227,7 +222,7 @@ .header { width: auto; min-height: 110rpx; - background-color: #f8f8f8; + background-color: #fff; padding: 30px 20px 10px 20px; } .cstmr-name { @@ -251,7 +246,7 @@ .container { margin-top: 10px; padding: 10rpx 20rpx 0 20rpx; - background-color: #f8f8f8; + background-color: #fff; display: grid; grid-template-columns: 1fr 3fr; } @@ -279,7 +274,7 @@ min-height: 100rpx; bottom: 0; margin-bottom: 0; - background-color: #f8f8f8; + background-color: #fff; border-top: 1px solid #efefef; display: flex; align-items: center; @@ -304,4 +299,14 @@ /* background-color: #222; */ padding-right: 30rpx; } + .list-none { + min-height: 60rpx; + margin-top: 20rpx; + text-align: center; + /* background-color: #303133; */ + color: #b1b3b8; + grid-column: 1 / 10; + display: grid; + position: relative; + } </style> \ No newline at end of file -- Gitblit v1.9.1