Commit 473c760e by liuquan

合并分支 'feature.login.v3.2.3.20210512.liuquan' 到 'test'

Feature.login.v3.2.3.20210512.liuquan

查看合并请求 !13
parents e46d9100 5c05b793
......@@ -54,10 +54,10 @@ App({
this.globalData.headerHeight = headHeight
this.globalData.statusBarHeight = statusBarHeight
},
onShow:function(){
onShow: function () {
console.log("onShow")
},
onHide:function(){
onHide: function () {
console.log("onHide")
},
......@@ -94,35 +94,22 @@ App({
})
},
//登录方法
getUserInfo: function (cb) {
getUserInfo: function (info, cb) {
var that = this;
//登录
wx.login({
success: function (msg) {
wx.getUserInfo({
success: function (res) {
if (msg.code) {
var data = {};
data.code = msg.code;
data.encryptedData = res.encryptedData;
data.iv = res.iv;
data.type = 1;
service.addUserInfo(data).then((res) => {
console.log('%c添加成功', "color:#04BE02", res);
that.globalData.unionid = res.unionId;
that.getUserData(res.openId)
if (Util.isEmpty(res.unionId)) return service.breakPromise();
else return service.getUserSig(res.unionId)
service.getOpenId(msg.code).then((res) => {
wx.setStorageSync('user', res); //存储openid
info.openid=res.openid;
info.unionid=res.unionid;
info.type=1;
return service.addUserInfo(info)
}).then((res) => {
return tim.login(res.data.userid, res.data.sign)
}).then(function (imResponse) {
that.globalData.isLogin = true;
typeof cb == "function" && cb(that.globalData.unionid)
console.log('%c登录成功', "color:#04BE02", imResponse.data.errorInfo);
if (imResponse.data.repeatLogin === true) {
// 标识账号已登录,本次登录操作为重复登录。v2.5.1 起支持
console.log('"%c本次登录操作为重复登录', "color:#ff0000", imResponse.data.errorInfo);
}
that.globalData.unionid = res.unionid;
typeof cb == "function" && cb(res)
console.log('%c添加成功', "color:#04BE02", res);
}).catch(function (imError) {
typeof cb == "function" && cb(that.globalData.unionid)
console.log('"%c登录失败', "color:#ff0000", imError); // 登录失败
......@@ -130,63 +117,10 @@ App({
});
}
},
fail: function (e) {
var data = {
code: msg.code,
type: 0
};
service.addUserInfo(data).then((res) => {
typeof cb == "function" && cb(res)
})
}
})
},
fail: function (err) {
typeof cb == "function" && cb(err)
console.log("login失败")
}
})
},
getaddFriend: function (add_unionid, type) {
var that = this;
// if (this.globalData.userInfo) {
// typeof cb == "function" && cb(this.globalData.userInfo)
// } else {
//调用登录接口
wx.login({
success: function (res1) {
wx.setStorageSync("code", res1)
wx.getUserInfo({
success: function (res) {
// that.globalData.userInfo = res.userInfo;
// that.globalData.refuse = 1;
// typeof cb == "function" && cb(that.globalData.userInfo)
wx.setStorageSync('userInfo', res.userInfo);
if (res1.code) {
var data = {};
data.add_unionid = add_unionid;
data.options_type = type;
data.code = res1.code;
data.encryptedData = res.encryptedData;
data.iv = res.iv;
service.appAddFriend(data).then(addres => {
if (addres.code == 1 || addres.code == 3) {
console.log('添加成功!')
if (type == 1) {}
} else {
wx.setStorageSync('addFriend', true);
console.log('添加失败!')
}
});
}
},
fail: function (e) {}
})
},
fail: function (err) {
console.log("添加失败err", err)
}
})
// }
},
})
\ No newline at end of file
......@@ -99,5 +99,11 @@
}
]
},
"usingComponents": {
"mp-toptips": "/miniprogram_npm/weui-miniprogram/toptips/toptips",
"answer":"/components/answer/answer",
"modal": "/components/modal/modal",
"login": "/components/login/login"
},
"sitemapLocation": "sitemap.json"
}
\ No newline at end of file
......@@ -27,8 +27,23 @@ Component({
/**
* 组件的初始数据
*/
data: {},
data: {
canIUseGetUserProfile: false,
canIUse: wx.canIUse('button.open-type.getUserInfo')
},
lifetimes: {
attached: function() {
// 在组件实例进入页面节点树时执行
if (wx.getUserProfile) {
this.setData({
canIUseGetUserProfile: true
})
}
},
detached: function() {
// 在组件实例被从页面节点树移除时执行
},
},
/**
* 组件的方法列表
*/
......@@ -47,12 +62,12 @@ Component({
},
getInfo: function (e) {
let that = this;
if (e.detail.userInfo) {
if (e) {
wx.showLoading({
title: '正在登录',
mask:true,
})
app.getUserInfo(function (cb) {
app.getUserInfo(e,function (cb) {
if (!Util.isEmpty(cb)) {
wx.showToast({
title: '登录成功',
......@@ -63,6 +78,24 @@ Component({
});
}
},
getUserProfile(e) {
let that = this;
// 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
// 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
wx.getUserProfile({
desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success: (res) => {
console.log("login",res)
that.getInfo(res.userInfo);
}
})
},
getUserInfo(e) {
// 不推荐使用getUserInfo获取用户信息,预计自2021年4月13日起,getUserInfo将不再弹出弹窗,并直接返回匿名的用户个人信息
console.log("login",e.detail)
this.getInfo(e.detail.userInfo);
},
//回调
_refreshEvent() {
this.triggerEvent('refreshEvent')
......
......@@ -5,7 +5,8 @@
<!-- <image class='login-close' catchtap="hideLogin" src="/images/icon@2x.png"></image> -->
<view class="login-title">{{loginTitle}}</view>
<view class="login-text">{{loginMsg}}</view>
<button class='login-btn' bindgetuserinfo="getInfo" open-type='getUserInfo'>{{loginBtn}}</button>
<button class='login-btn' wx:if="{{canIUseGetUserProfile}}" bindtap="getUserProfile"> {{loginBtn}} </button>
<button class='login-btn' wx:else open-type="getUserInfo" bindgetuserinfo="getUserInfo">{{loginBtn}}</button>
<view catchtap="_refreshEvent"></view>
</view>
</view>
\ No newline at end of file
......@@ -276,6 +276,7 @@ Page({
// | $$ | $$__/ $$| $$__/ $$| $$| $$| $$_____
// | $$ \$$ $$| $$ $$| $$| $$ \$$ \
// \$$ \$$$$$$ \$$$$$$$ \$$ \$$ \$$$$$$$
/**
* 判断授权
*/
......@@ -656,7 +657,6 @@ Page({
/**
* 服务提前结束 0同意 1拒绝
*/
endInquiry: function (e) {
var alldata = wx.getStorageSync('data')
let that = this;
......@@ -689,26 +689,28 @@ Page({
unitid: that.data.doctorunitid
}
Service.seeBuyStaus(data).then((res) => {
if (res.code == 1 && res.data.status == '1') {
if (res.code == 1) {
switch (Number(res.data.status)) {
case 0:
that.setData({
payFlag: true,
payFlag1: false,
payFlag1: true,
end_time: '待接诊',
sendBtns: true,
end_time: res.data.end_time_stamp,
status: false,
status: true,
serviceName: res.data.name
})
return;
} else if (res.code == 1 && res.data.status == "0") {
case 1:
that.setData({
payFlag1: true,
end_time: '待接诊',
payFlag: true,
payFlag1: false,
sendBtns: true,
status: true,
end_time: res.data.end_time_stamp,
status: false,
serviceName: res.data.name
})
return;
} else if (res.code == 1 && res.data.status == "2") {
case 2:
that.setData({
payFlag: false,
payFlag1: false,
......@@ -717,15 +719,22 @@ Page({
status: true,
serviceName: res.data.name
})
if( res.data.counsel=="20"){
that.getFreeChat(that.data.t_unionid, wx.getStorageSync('data').unionid);
} else {
}
return
default:
that.setData({
payFlag: false,
end_time: '',
serviceName: '未知',
})
if( res.data.counsel=="20"){
that.getFreeChat(that.data.t_unionid, wx.getStorageSync('data').unionid);
}
break;
}
}
}).catch(error => {
console.error("返回用户支付列表", error)
})
......@@ -1130,7 +1139,6 @@ Page({
message.payload.data = message.payload.data.type;
}
Arr.push(message);
that.setData({
unsentMessageList: that.data.unsentMessageList.concat(Arr),
msgContent: ''
......
......@@ -391,7 +391,7 @@
<text class='send-report' wx:if='{{payFlag}}' data-src="123" bindtap='openReport'>发送报告</text>
<text class='send-report' wx:if='{{!payFlag}}' data-src="123" style=" background:#e5e6e8;">发送报告</text>
<text class='send-img' wx:if='{{payFlag}}' bindtap='createImageMessage'>发送图片</text>
<text class='send-img' wx:if='{{!payFlag}}' style=" background:#e5e6e8;">发送图片</text>
<text class='send-img' wx:if='{{!payFlag}}' style="background:#e5e6e8;">发送图片</text>
<text class='send-img' wx:if='{{orderId!=""&&orderId!=0}}' bindtap='chatLog'>聊天记录</text>
<!-- <text class='send-img' wx:if="{{serviceEvaluation}}" bindtap="estimateShow" >服务评价</text> -->
</view>
......
......@@ -18,12 +18,8 @@ Page({
ishow: true,
paySuccess: false,
errshow: false,
items: [
{
name: '不需要',
value: '0'
},{
name: '需要',
items: [{
name: '',
value: '1'
},
],
......@@ -250,9 +246,9 @@ Page({
* 是否需要开具纸质发票
* @param {*} e
*/
radioChange: function (e) {
checkboxChange: function (e) {
this.setData({
isInvoice: e.detail.value,
isInvoice: e.detail.value[0]==1?1:0,
})
},
/**
......@@ -397,8 +393,20 @@ Page({
money: that.data.list.money,
hstr: hstr.toString(),
isgd: 1,
isInvoice:that.data.isInvoice,
// rise_need:that.data.isInvoice
}
// let data={
// payid:45241,
// patient_unionid:'oHhp80YxU8gE0ukqu1f7IIUsWlYI',
// modular: 1,
// lastid: 42177,
// address:26147,
// isywlx:1,
// money: 1182,
// hstr: hstr.toString(),
// isgd: 1,
// }
Service.prescriptionPay(data).then((res) => {
console.log('res1', res);
switch (res.code) {
......
......@@ -109,14 +109,22 @@
<text class="fonw-400" style="font-size: 28rpx;">{{list.freight}}</text>
</view>
</view>
<!-- <view class="order-num">
<text>纸质发票</text>
<radio-group class="radio-group" bindchange="radioChange">
<view class="order-num">
<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==0?true : false}}" color='#1384ff' />{{item.name}}
</label>
</radio-group>
</view> -->
</radio-group> -->
<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}}
</label>
</checkbox-group>
<!-- <label class="checkbox">
<checkbox value="{{item.value}}" checked="{{item.value==0?true : false}}" color='#1384ff'/>{{item.name}}
</label> -->
</view>
<view class="tys" bindtap="agree">
<view wx:if='{{!agree}}' class="unselected">
</view>
......@@ -126,7 +134,7 @@
<text class="tys-text">我已阅读并接受</text>
<text class="zqtys" catchtap="goConsent">《知情同意书》</text>
</view>
<view class="tsy">根据药品实际仓储位置,您的订单可能分开发货</view>
<view class="tsy">根据您的收货地址,若顺丰无法送达,则采用邮政发货。</view>
<view class="tsy">遇到任何问题请拨打客服电话:<text bindtap='dial' data-tel='4001199218' style="color:#2684ff;">4001199218</text>
</view>
<view class="user-logo">
......
......@@ -7,17 +7,17 @@ page {
background: rgb(242, 242, 242)
}
checkbox {
/* checkbox {
padding-top: 90rpx;
transform: scale(.8);
}
} */
radio {
checkbox {
transform: scale(.7);
color: #1384ff;
}
.radio {
.checkbox {
font-size: 28rpx;
}
......@@ -41,8 +41,7 @@ checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
color: #fff;
}
.radio-group {
width: 43%;
.checkbox-group {
display: flex;
flex-direction: row;
justify-content: space-between;
......
......@@ -15,7 +15,7 @@ Page({
time2: '',
time3: '',
img: '',
status: '',//物流状态
status: -1,//物流状态
sforderid:'',//物流单号
logistics: false,
mobileTail: '',
......@@ -31,6 +31,7 @@ Page({
ordernumber: options.ordernumber,
})
this.getLogisticsInfo(options.ordernumber);
// this.getLogisticsInfo("20210422589380")
},
/**
* 生命周期函数--监听页面显示
......@@ -84,10 +85,6 @@ Page({
status:res.data.status,
sforderid:res.data.sf_waybillno
})
} else {
that.setData({
status:0,
})
}
that.getWl()
// that.setData({
......
......@@ -6,13 +6,12 @@
<image src="{{img}}"></image>
</view>
<view class="marl">
<view class="dfh mt" wx:if="{{status==0}}">待发货</view>
<view class="dfh" wx:if="{{status==1}}">待收货</view>
<view class="dfh mt" wx:if="{{status==-1}}">待发货</view>
<view class="dfh" wx:if="{{status==0||status==1||status==6}}">待收货</view>
<view class="dfh" wx:if="{{status==2}}">已完成</view>
<view class="dfh" wx:if="{{status==3}}">已取消</view>
<view class="dfh" wx:if="{{status==4}}">已拒收</view>
<view class="dfh" wx:if="{{status==5}}">派件异常</view>
<view class="dfh" wx:if="{{status==6}}">运输中</view>
<view class="dh" wx:if="{{sforderid}}">
<text >顺丰速运</text>
:{{sforderid}}
......@@ -22,7 +21,7 @@
<!-- <text class="wuliuzx">物流咨询:</text>
<text class="wuliutel" bindtap="ddh">95338</text> -->
</view>
<view class="mt" wx:if="{{status==0}}">
<view class="mt" wx:if="{{!sforderid}}">
<text class="wuliuzx02">暂无运单信息</text>
</view>
</view>
......
......@@ -319,12 +319,5 @@ Page({
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
},
})
......@@ -77,6 +77,10 @@ Page({
}
}, 500);
},
onTabItemTap(item) {
// tab 点击时执行
console.log("item",item)
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
......@@ -219,6 +223,7 @@ Page({
item.groupName = item.groupProfile.name;
return item;
});
console.log("serviceList",JSON.stringify(serviceList));
that.setData({
serviceList: serviceList,
showview: true,
......
......@@ -68,6 +68,7 @@ Page({
}
},
onPullDownRefresh: function () {
console.log("onPullDownRefresh")
var that = this
that.getDoctorIndex();
that.resultNot(that.data.userInfo.openid)
......
......@@ -3,7 +3,7 @@
"enablePullDownRefresh": true,
"usingComponents": {
"modal": "/components/modal/modal",
"login": "/components/login/login",
"answer":"/components/answer/answer"
"login": "/components/login/login"
,"answer":"/components/answer/answer"
}
}
\ No newline at end of file
......@@ -3,8 +3,8 @@
<block>
<view class='user-box' wx:if='{{isShow}}'>
<view class='user-info'>
<view class='user-name' wx:if='{{nickname!=""}}'>{{nickname}}</view>
<button class='user-name' wx:if='{{nickname==0}}' bindtap='getUserInfo'>点击登录</button>
<view class='user-name' wx:if='{{nickname!=""&&nickname!="微信用户"}}' bindtap='getUserInfo'>{{nickname}}</view>
<button class='user-name' wx:if='{{nickname==0||nickname=="微信用户"}}' bindtap='getUserInfo'>点击获取</button>
<image src='{{headimgurl}}' class='header-img' binderror="binderrorimg"></image>
</view>
<view class="server">
......
......@@ -63,6 +63,7 @@ page {
.user-name {
width: 440rpx;
text-align: left;
height: 52rpx;
font-size: 50rpx;
color: #333;
......@@ -86,7 +87,7 @@ page {
top: 50rpx;
left: 30rpx;
z-index: 1;
border: 1rpx solid #dfdede;
/* border: 1rpx solid #dfdede; */
}
.item {
width: 650rpx;
......
......@@ -37,7 +37,7 @@
"minifyWXSS": true
},
"compileType": "miniprogram",
"libVersion": "2.12.2",
"libVersion": "2.13.0",
"appid": "wxd418ee346d79d382",
"projectname": "XDJK-master",
"scripts": {
......
......@@ -47,7 +47,7 @@ const url = {
getUserSig :HOST + 'wechatIm.php?s=/Im/wechat_get_sign', //获取usersig以及userID
getOpenId :HOST + 'applet.php?s=Applet/getopenid', ///获取openid
getUserData :HOST + 'wechatIteration.php?s=/Home/index', ///获取用户数据
addUserInfo :HOST + 'applet.php?s=/Applet/new_user_add', //添加用户
addUserInfo :HOST + 'applet.php?s=/Applet/setUserProfile', //添加用户
seeOpenId :HOST + "wechatIteration.php?s=/Inquisition/get_openid",//查询openid
getRoomUserSig :HOST + "wechatIteration.php?s=/Inquisition/get_room",//获取room的userSig
/**IM用户关系 */
......
......@@ -12,6 +12,7 @@ function wxPromise(method,url,data){
data:data,
header:{'content-type': 'application/x-www-form-urlencoded'},
success:function(res){
// console.log("res",res)
// setTimeout(function () {
// wx.hideLoading();
// }, 100);
......
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