Commit 382d0c54 by liuquan

no message

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