<!--packageB/privacy/privacy.wxml-->
<view style="padding: 40rpx;">
<view class="pingb">屏蔽公司</view>
<view class="okij">添加屏蔽公司后,你和这些公司的BOSS都不会被相互推荐,你的查看行为也不会告知对方</view>
<view bindtap="bttn" class="pkpiouyg">
<image class="emsssff" src="../../images/search.png"></image>
<view>搜索公司全称、简称、邮箱后缀</view>
</view>
</view>
<view>
<view wx:for="{{ExchangeInfo}}">
<view bindtap="xuanz" data-id="{{item.id}}" class="Exlist">
<view class="fangfang">
<image wx:if="{{item.tur}}" style="width: 100%; height: 100%;" src="../../images/duih.png"></image>
</view>
<view>{{item.title}}</view>
</view>
</view>
<view bindtap="quedingbtn" class="queding">确定</view>
</view>
<view class="upload" hidden="{{HiddenFlag}}">
<image src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.zcool.cn%2Fcommunity%2F0190105c273b92a8012029ac7b58e4.gif&refer=http%3A%2F%2Fimg.zcool.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1641445384&t=33af4ca2f4094c846cc5b4460750222c" class="loadding"></image>
</view>
<view class="zanwu" wx:if="{{StorePoints}}">已经到底了</view>
/* packageB/privacy/privacy.wxss */
.pingb{
width: 128rpx;
height: 44rpx;
font-size: 32rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 700;
color: #333333;
line-height: 44rpx;
margin: 30rpx 0;
}
.okij{
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
}
.pkpiouyg{
height: 60rpx;
background: #FFFFFF;
border-radius: 50rpx;
border: 2rpx solid #DEDEDE;
line-height: 60rpx;
padding-left: 40rpx;
margin: 40rpx 0;
color: #999;
display: flex;
justify-content: flex-start;align-items: center;
}
.emsssff{
width: 40rpx;
height: 40rpx;
margin-right: 20rpx;
}
.Exlist{
display: flex;
justify-content: flex-start;align-items: center;
}
.fangfang{
width: 30rpx;
height: 30rpx;
border: solid 2rpx #e7e8e9;
border-radius: 10rpx;
background: #e7e8e9;
margin-right: 20rpx;
}
.queding{
width: 100%;
height: 60rpx;
line-height: 60rpx;
text-align: center;
color: #FFF;
background-color: #7CAAFF;
border-radius: 50rpx;
}
/*
* @Author: wdl
* @Date: 2017-11-08 15:06:42
* @Last Modified by: wdl
* @Last Modified time: 2017-12-14 16:36:57
*/
var app = getApp()
Page({
data: {
shoopingtext: "",
StorePoints: false,
HiddenFlag: true,
ppage: 0,
ExchangeInfo: [],
pingb: []
},
xuanz(e) {
// console.log(e.currentTarget.dataset.id);
var that = this
// console.log(that.data.ExchangeInfo);
var array = that.data.ExchangeInfo
for (let i = 0; i < array.length; i++) {
if (array[i].id == e.currentTarget.dataset.id) {
if (array[i].tur == false) {
array[i].tur = true
that.data.pingb.push(e.currentTarget.dataset.id)
that.setData({
pingb:that.data.pingb
})
console.log(that.data.pingb);
} else {
array[i].tur = false
if (that.data.pingb.includes(e.currentTarget.dataset.id)) {
var num= that.data.pingb.indexOf(e.currentTarget.dataset.id)
that.data.pingb.splice(num,1)
console.log("2222", that.data.pingb);
}
}
}
}
that.setData({
ExchangeInfo:array
})
console.log(that.data.pingb);
},
quedingbtn(e){
var that=this
console.log(that.data.pingb);
wx.request({
url: app.globalData.baseUrl + "/My/ShieldingJiechu",
data: {
arrystr:that.data.pingb,
userid: app.globalData.userid
},
method: 'post',
success: function (res) {
console.log("介乎成了",res);
that.onLoad()
that.setData({
shoppinglist:false,
})
wx.showToast({
title: '解除成功',
icon: 'success',
duration: 2000
})
},
fail:function(res){
wx.showToast({
title: '错误',
icon: 'success',
duration: 2000
})
}
});
},
citywide: function () {
var that = this;
console.log(that.data.ppage);
wx.request({
url: app.globalData.baseUrl + "/My/WorkerShielding",
data: {
userid: app.globalData.userid,
},
method: 'post',
success: function (res) {
console.log("tre", res.data.data.ShieldingCompany);
var plis = res.data.data.ShieldingCompany
for (let i = 0; i < plis.length; i++) {
plis[i].tur = false
}
that.setData({
ExchangeInfo: plis
})
},
});
},
onLoad: function () {
this.citywide()
},
onPullDownRefresh() {
wx.showToast({
title: '刷新成功',
icon: 'success',
duration: 2000
})
wx.stopPullDownRefresh()
},
onReachBottom() {
this.loadMore();
},
loadMore() {
var that = this;
// var list=that.data.ExchangeInfo;
var sdd = this.data.ppage + 1
that.setData({
HiddenFlag: false,
ppage: sdd
});
that.citywide()
//实际中应换为request
// for(var i=1;i<5; i++){
// ExchangeInfo.push({
// ExchangeName:i+"兑换5¥代金券",
// ExchangeDate:"2017-12-08 10:05:36",
// PayPoints:"-100",
// })
// }
// console.log(that.data.ExchangeInfo+"1243543645safasf");
setTimeout(function () {
that.setData({
// ExchangeInfo: list,
HiddenFlag: true
})
}, 2000)
},
bttn(e) {
wx.navigateTo({
url: '/packageB/privacypb/privacypb',
})
},
})
|