Commit 382d0c54 by liuquan

no message

parent bdb5b227
......@@ -615,7 +615,7 @@ Page({
let itemSettings = !Util.isEmpty(res.subscriptionsSetting) ? res.subscriptionsSetting.itemSettings : "";
console.log('itemSettings', res, itemSettings)
if (itemSettings) {
if (itemSettings['d33RkZvTz6O8Zjw8b8faoKIQGXA0cJJ2G24_kIWQjtY'] == 'accept' && itemSettings['FfvTlT9HNBt1zHNWKYUBs5dJ5n-bG7bcVpPcVZrH8jk'] == 'accept') {
if (itemSettings['d33RkZvTz6O8Zjw8b8faoKIQGXA0cJJ2G24_kIWQjtY'] == 'accept' ) {
that.setData({
remind: false
});
......@@ -645,9 +645,8 @@ Page({
that.setData({
remind: false
})
wx.requestSubscribeMessage({
tmplIds: ['d33RkZvTz6O8Zjw8b8faoKIQGXA0cJJ2G24_kIWQjtY', 'FfvTlT9HNBt1zHNWKYUBs5dJ5n-bG7bcVpPcVZrH8jk'],
tmplIds: ['d33RkZvTz6O8Zjw8b8faoKIQGXA0cJJ2G24_kIWQjtY'],
success(res) {
console.log('requestSubscribeMessage', res)
}
......@@ -659,22 +658,70 @@ Page({
})
},
tmplArr() {
let arr=[];
return new Promise((success,fail)=>{
wx.getSetting({
withSubscriptions: true,
success(res) {
let itemSettings = !Util.isEmpty(res.subscriptionsSetting) ? res.subscriptionsSetting.itemSettings : "";
console.log('itemSettings', res, itemSettings)
withSubscriptions: true
}).then(res => {
let itemSettings = !res.subscriptionsSetting.mainSwitch ? res.subscriptionsSetting.itemSettings : "";
console.log('itemSettings21331', res, itemSettings)
if (itemSettings) {
arr=itemSettings.map((item)=>{
console.log('1')
let list = ['d33RkZvTz6O8Zjw8b8faoKIQGXA0cJJ2G24_kIWQjtY', 'FfvTlT9HNBt1zHNWKYUBs5dJ5n-bG7bcVpPcVZrH8jk'];
arr = [];
arr = list.map((item) => {
if (itemSettings[item] = "reject") return item
})
}else{
arr= ['d33RkZvTz6O8Zjw8b8faoKIQGXA0cJJ2G24_kIWQjtY', 'FfvTlT9HNBt1zHNWKYUBs5dJ5n-bG7bcVpPcVZrH8jk'];
}
}
})
return arr;
success(arr)
}).catch(err => {
fail(arr)
})
})
// wx.getSetting({
// withSubscriptions: true
// }).then(res => {
// let itemSettings = !res.subscriptionsSetting.mainSwitch ? res.subscriptionsSetting.itemSettings : "";
// console.log('itemSettings21331', res, itemSettings)
// if (itemSettings) {
// console.log('1')
// let list = ['d33RkZvTz6O8Zjw8b8faoKIQGXA0cJJ2G24_kIWQjtY', 'FfvTlT9HNBt1zHNWKYUBs5dJ5n-bG7bcVpPcVZrH8jk'];
// arr = [];
// arr = list.map((item) => {
// if (itemSettings[item] = "reject") return item
// })
// }
// console.log('tmplArr1', arr)
// return arr;
// }).catch(err => {
// console.log('tmplArr2', arr)
// return arr;
// })
// wx.getSetting({
// withSubscriptions: true,
// success(res) {
// let itemSettings = !res.subscriptionsSetting.mainSwitch ? res.subscriptionsSetting.itemSettings : "";
// console.log('itemSettings21331', res, itemSettings)
// if (itemSettings) {
// console.log('1')
// let list = ['d33RkZvTz6O8Zjw8b8faoKIQGXA0cJJ2G24_kIWQjtY', 'FfvTlT9HNBt1zHNWKYUBs5dJ5n-bG7bcVpPcVZrH8jk'];
// arr = [];
// arr = list.map((item) => {
// if (itemSettings[item] = "reject") return item
// })
// }
// console.log('tmplArr1', arr)
// return arr;
// },
// fail() {
// console.log('tmplArr2', arr)
// return arr;
// }
// // complete(){
// // console.log('tmplArr3', arr)
// // return arr;
// // }
// })
},
/**
* 服务提前结束 0同意 1拒绝
......@@ -974,34 +1021,34 @@ Page({
});
}).then((imResponse) => {
console.log("%c第一次拉取消息列表", "color:#04BE02", imResponse)
let msgList = Util.deepClone(imResponse.data.messageList);
let messageList = that.messageListParser(msgList);
let length = Number(messageList.length - 1);
console.log("length", length)
if (length >= 0) {
that.data.lastShowTimeStamp = messageList[length].time;
console.log("messageList[length].payload.data", messageList[length].payload.data)
if (messageList[length].payload.data == "InitiateEndService") {
wx.showModal({
title: '提示',
content: '对方发起了一个结束当前服务的请求',
success(res) {
if (res.confirm) {
that.endInquiry(0);
that.userPayList(that.data.orderId ? that.data.orderId : '');
} else if (res.cancel) {
that.endInquiry(1);
that.userPayList(that.data.orderId ? that.data.orderId : '');
}
}
})
}
}
that.setData({
messageList: that.showTimestamp(messageList), // 消息列表。
nextReqMessageID: imResponse.data.nextReqMessageID, // 用于续拉,分页续拉时需传入该字段。
isCompleted: imResponse.data.isCompleted // 表示是否已经拉完所有消息。
})
// let msgList = Util.deepClone(imResponse.data.messageList);
// let messageList = that.messageListParser(msgList);
// let length = Number(messageList.length - 1);
// console.log("length", length)
// if (length >= 0) {
// that.data.lastShowTimeStamp = messageList[length].time;
// console.log("messageList[length].payload.data", messageList[length].payload.data)
// if (messageList[length].payload.data == "InitiateEndService") {
// wx.showModal({
// title: '提示',
// content: '对方发起了一个结束当前服务的请求',
// success(res) {
// if (res.confirm) {
// that.endInquiry(0);
// that.userPayList(that.data.orderId ? that.data.orderId : '');
// } else if (res.cancel) {
// that.endInquiry(1);
// that.userPayList(that.data.orderId ? that.data.orderId : '');
// }
// }
// })
// }
// }
// that.setData({
// messageList: that.showTimestamp(messageList), // 消息列表。
// nextReqMessageID: imResponse.data.nextReqMessageID, // 用于续拉,分页续拉时需传入该字段。
// isCompleted: imResponse.data.isCompleted // 表示是否已经拉完所有消息。
// })
//延时500ms避免scroll-view的防止抖动生效
setTimeout(() => {
that.scrollToBottom(); //使滑动条到最底部
......@@ -1494,6 +1541,7 @@ Page({
this.setData({
reportShow: true
})
console.log('message',message)
let msg = Util.deepClone(message);
that.unsentMessageInsert(msg);
Tim.createCustomMessage(message).then((imResponse) => {
......
......@@ -19,10 +19,13 @@ Page({
paySuccess: false,
errshow: false,
items: [{
name: '',
name: '',
value: '1'
}, ],
isInvoice: 0, //是否开具发票
}, {
name: '否',
value: '0'
}],
isInvoice: -1, //是否开具发票
isBtnAsh: true, //支付按钮置灰
},
/**
......@@ -251,9 +254,9 @@ Page({
* 是否需要开具纸质发票
* @param {*} e
*/
checkboxChange: function (e) {
radioChange: function (e) {
this.setData({
isInvoice: e.detail.value[0] == 1 ? 1 : 0,
isInvoice: e.detail.value,
})
},
/**
......@@ -348,6 +351,17 @@ Page({
})
return
}
if (that.data.isInvoice== -1) {
wx.showToast({
title: '请选择是否需要随货纸质发票',
icon: 'none',
duration:2000
})
that.setData({
isBtnAsh: true
})
return
}
if (that.data.ishow == true) {
if (that.data.item == null) {
wx.showToast({
......
......@@ -110,12 +110,12 @@
</view>
</view>
<view class="order-num">
<text>开具发票</text>
<checkbox-group class="checkbox-group" bindchange="checkboxChange">
<label class="checkbox" wx:for="{{items}}" wx:key="key">
<checkbox value="{{item.value}}" checked="{{item.value==0?true : false}}" color='#1384ff' />{{item.name}}
<text>是否需要随货纸质发票</text>
<radio-group class="radio-group" bindchange="radioChange">
<label class="radio" wx:for="{{items}}" wx:key="key">
<radio value="{{item.value}}" checked="{{item.value==isInvoice}}" color='#1384ff' />{{item.name}}
</label>
</checkbox-group>
</radio-group>
</view>
<view class="tys" bindtap="agree">
<view wx:if='{{!agree}}' class="unselected">
......
......@@ -7,10 +7,10 @@ page {
background: rgb(242, 242, 242)
}
/* checkbox {
padding-top: 90rpx;
radio {
transform: scale(.8);
} */
color: #1384ff;
}
checkbox {
transform: scale(.7);
......
......@@ -630,10 +630,10 @@ Page({
})
}
} else {
var {unionid} = wx.getStorageSync("data");
var allData = wx.getStorageSync("data");
if (that.data.id == '') {
var data = {
unionid:unionid,
unionid:allData.unionid,
name: that.data.name,
card: that.data.idCard,
idType: that.data.idType,
......
......@@ -19,18 +19,14 @@ Page({
paySuccess: false,
errshow: false,
items: [{
name: '不需要',
value: '0'
}, {
name: '需要',
name: '是',
value: '1'
}, ],
isInvoice: 0, //是否开具发票
isBtnAsh: true, //支付按钮置灰
items: [{
name: '',
value: '1'
}]
}, {
name: '否',
value: '0'
}],
isInvoice: -1, //是否开具发票
isBtnAsh: true //支付按钮置灰
},
/**
* 生命周期函数--监听页面加载
......@@ -232,9 +228,9 @@ Page({
* 是否需要开具纸质发票
* @param {*} e
*/
checkboxChange: function (e) {
radioChange: function (e) {
this.setData({
isInvoice: e.detail.value[0] == 1 ? 1 : 0,
isInvoice: e.detail.value,
})
},
/**
......@@ -311,6 +307,17 @@ Page({
})
return
}
if (that.data.isInvoice== -1) {
wx.showToast({
title: '请选择是否需要随货纸质发票',
icon: 'none',
duration:2000
})
that.setData({
isBtnAsh: true
})
return
}
if (that.data.ishow == true) {
if (that.data.item == null) {
wx.showToast({
......
......@@ -108,12 +108,12 @@
</view>
</view>
<view class="order-num">
<text>开具发票</text>
<checkbox-group class="checkbox-group" bindchange="checkboxChange">
<label class="checkbox" wx:for="{{items}}" wx:key="key">
<checkbox value="{{item.value}}" checked="{{item.value==0?true : false}}" color='#1384ff' />{{item.name}}
<text>是否需要随货纸质发票</text>
<radio-group class="radio-group" bindchange="radioChange">
<label class="radio" wx:for="{{items}}" wx:key="key">
<radio value="{{item.value}}" checked="{{item.value==isInvoice}}" color='#1384ff' />{{item.name}}
</label>
</checkbox-group>
</radio-group>
</view>
<view class="tys" bindtap="agree">
<view wx:if='{{!agree}}' class="unselected">
......
......@@ -12,6 +12,11 @@ page {
transform: scale(.8);
} */
radio {
transform: scale(.8);
color: #1384ff;
}
checkbox {
transform: scale(.7);
color: #1384ff;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment