Commit 07a8a29b by liuquan

合并分支 'test' 到 'XDJK-master'

feature.logistics.v3.2.3.20210421.liuquan

查看合并请求 !14
parents 5e46960a 473c760e
...@@ -54,10 +54,10 @@ App({ ...@@ -54,10 +54,10 @@ App({
this.globalData.headerHeight = headHeight this.globalData.headerHeight = headHeight
this.globalData.statusBarHeight = statusBarHeight this.globalData.statusBarHeight = statusBarHeight
}, },
onShow:function(){ onShow: function () {
console.log("onShow") console.log("onShow")
}, },
onHide:function(){ onHide: function () {
console.log("onHide") console.log("onHide")
}, },
...@@ -94,52 +94,28 @@ App({ ...@@ -94,52 +94,28 @@ App({
}) })
}, },
//登录方法 //登录方法
getUserInfo: function (cb) { getUserInfo: function (info, cb) {
var that = this; var that = this;
//登录 //登录
wx.login({ wx.login({
success: function (msg) { success: function (msg) {
wx.getUserInfo({ if (msg.code) {
success: function (res) { service.getOpenId(msg.code).then((res) => {
if (msg.code) { wx.setStorageSync('user', res); //存储openid
var data = {}; info.openid=res.openid;
data.code = msg.code; info.unionid=res.unionid;
data.encryptedData = res.encryptedData; info.type=1;
data.iv = res.iv; return service.addUserInfo(info)
data.type = 1; }).then((res) => {
service.addUserInfo(data).then((res) => { that.globalData.unionid = res.unionid;
console.log('%c添加成功', "color:#04BE02", res); typeof cb == "function" && cb(res)
that.globalData.unionid = res.unionId; console.log('%c添加成功', "color:#04BE02", res);
that.getUserData(res.openId) }).catch(function (imError) {
if (Util.isEmpty(res.unionId)) return service.breakPromise(); typeof cb == "function" && cb(that.globalData.unionid)
else return service.getUserSig(res.unionId) console.log('"%c登录失败', "color:#ff0000", imError); // 登录失败
}).then((res) => { console.warn('login error:', imError); // 登录失败的相关信息
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);
}
}).catch(function (imError) {
typeof cb == "function" && cb(that.globalData.unionid)
console.log('"%c登录失败', "color:#ff0000", imError); // 登录失败
console.warn('login error:', imError); // 登录失败的相关信息
});
}
},
fail: function (e) {
var data = {
code: msg.code,
type: 0
};
service.addUserInfo(data).then((res) => {
typeof cb == "function" && cb(res)
})
}
})
}, },
fail: function (err) { fail: function (err) {
typeof cb == "function" && cb(err) typeof cb == "function" && cb(err)
...@@ -147,46 +123,4 @@ App({ ...@@ -147,46 +123,4 @@ App({
} }
}) })
}, },
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 @@ ...@@ -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" "sitemapLocation": "sitemap.json"
} }
\ No newline at end of file
...@@ -27,8 +27,23 @@ Component({ ...@@ -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({ ...@@ -47,12 +62,12 @@ Component({
}, },
getInfo: function (e) { getInfo: function (e) {
let that = this; let that = this;
if (e.detail.userInfo) { if (e) {
wx.showLoading({ wx.showLoading({
title: '正在登录', title: '正在登录',
mask:true, mask:true,
}) })
app.getUserInfo(function (cb) { app.getUserInfo(e,function (cb) {
if (!Util.isEmpty(cb)) { if (!Util.isEmpty(cb)) {
wx.showToast({ wx.showToast({
title: '登录成功', title: '登录成功',
...@@ -63,6 +78,24 @@ Component({ ...@@ -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() { _refreshEvent() {
this.triggerEvent('refreshEvent') this.triggerEvent('refreshEvent')
......
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
<!-- <image class='login-close' catchtap="hideLogin" src="/images/icon@2x.png"></image> --> <!-- <image class='login-close' catchtap="hideLogin" src="/images/icon@2x.png"></image> -->
<view class="login-title">{{loginTitle}}</view> <view class="login-title">{{loginTitle}}</view>
<view class="login-text">{{loginMsg}}</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 catchtap="_refreshEvent"></view>
</view> </view>
</view> </view>
\ No newline at end of file
...@@ -18,12 +18,8 @@ Page({ ...@@ -18,12 +18,8 @@ Page({
ishow: true, ishow: true,
paySuccess: false, paySuccess: false,
errshow: false, errshow: false,
items: [ items: [{
{ name: '',
name: '不需要',
value: '0'
},{
name: '需要',
value: '1' value: '1'
}, },
], ],
...@@ -250,9 +246,9 @@ Page({ ...@@ -250,9 +246,9 @@ Page({
* 是否需要开具纸质发票 * 是否需要开具纸质发票
* @param {*} e * @param {*} e
*/ */
radioChange: function (e) { checkboxChange: function (e) {
this.setData({ this.setData({
isInvoice: e.detail.value, isInvoice: e.detail.value[0]==1?1:0,
}) })
}, },
/** /**
...@@ -397,8 +393,20 @@ Page({ ...@@ -397,8 +393,20 @@ Page({
money: that.data.list.money, money: that.data.list.money,
hstr: hstr.toString(), hstr: hstr.toString(),
isgd: 1, isgd: 1,
isInvoice:that.data.isInvoice,
// rise_need: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) => { Service.prescriptionPay(data).then((res) => {
console.log('res1', res); console.log('res1', res);
switch (res.code) { switch (res.code) {
......
...@@ -109,14 +109,22 @@ ...@@ -109,14 +109,22 @@
<text class="fonw-400" style="font-size: 28rpx;">{{list.freight}}</text> <text class="fonw-400" style="font-size: 28rpx;">{{list.freight}}</text>
</view> </view>
</view> </view>
<!-- <view class="order-num"> <view class="order-num">
<text>纸质发票</text> <text>开具发票</text>
<radio-group class="radio-group" bindchange="radioChange"> <!-- <radio-group class="radio-group" bindchange="radioChange">
<label class="radio" wx:for="{{items}}" wx:key="key"> <label class="radio" wx:for="{{items}}" wx:key="key">
<radio value="{{item.value}}" checked="{{item.value==0?true : false}}" color='#1384ff' />{{item.name}} <radio value="{{item.value}}" checked="{{item.value==0?true : false}}" color='#1384ff' />{{item.name}}
</label> </label>
</radio-group> </radio-group> -->
</view> --> <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 class="tys" bindtap="agree">
<view wx:if='{{!agree}}' class="unselected"> <view wx:if='{{!agree}}' class="unselected">
</view> </view>
...@@ -126,7 +134,7 @@ ...@@ -126,7 +134,7 @@
<text class="tys-text">我已阅读并接受</text> <text class="tys-text">我已阅读并接受</text>
<text class="zqtys" catchtap="goConsent">《知情同意书》</text> <text class="zqtys" catchtap="goConsent">《知情同意书》</text>
</view> </view>
<view class="tsy">根据药品实际仓储位置,您的订单可能分开发货</view> <view class="tsy">根据您的收货地址,若顺丰无法送达,则采用邮政发货。</view>
<view class="tsy">遇到任何问题请拨打客服电话:<text bindtap='dial' data-tel='4001199218' style="color:#2684ff;">4001199218</text> <view class="tsy">遇到任何问题请拨打客服电话:<text bindtap='dial' data-tel='4001199218' style="color:#2684ff;">4001199218</text>
</view> </view>
<view class="user-logo"> <view class="user-logo">
......
...@@ -7,17 +7,17 @@ page { ...@@ -7,17 +7,17 @@ page {
background: rgb(242, 242, 242) background: rgb(242, 242, 242)
} }
checkbox { /* checkbox {
padding-top: 90rpx; padding-top: 90rpx;
transform: scale(.8); transform: scale(.8);
} } */
radio { checkbox {
transform: scale(.7); transform: scale(.7);
color: #1384ff; color: #1384ff;
} }
.radio { .checkbox {
font-size: 28rpx; font-size: 28rpx;
} }
...@@ -41,8 +41,7 @@ checkbox .wx-checkbox-input.wx-checkbox-input-checked::before { ...@@ -41,8 +41,7 @@ checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
color: #fff; color: #fff;
} }
.radio-group { .checkbox-group {
width: 43%;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
......
...@@ -319,12 +319,5 @@ Page({ ...@@ -319,12 +319,5 @@ Page({
onReachBottom: function() { onReachBottom: function() {
}, },
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
},
}) })
...@@ -223,6 +223,7 @@ Page({ ...@@ -223,6 +223,7 @@ Page({
item.groupName = item.groupProfile.name; item.groupName = item.groupProfile.name;
return item; return item;
}); });
console.log("serviceList",JSON.stringify(serviceList));
that.setData({ that.setData({
serviceList: serviceList, serviceList: serviceList,
showview: true, showview: true,
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"enablePullDownRefresh": true, "enablePullDownRefresh": true,
"usingComponents": { "usingComponents": {
"modal": "/components/modal/modal", "modal": "/components/modal/modal",
"login": "/components/login/login", "login": "/components/login/login"
"answer":"/components/answer/answer" ,"answer":"/components/answer/answer"
} }
} }
\ No newline at end of file
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
<block> <block>
<view class='user-box' wx:if='{{isShow}}'> <view class='user-box' wx:if='{{isShow}}'>
<view class='user-info'> <view class='user-info'>
<view class='user-name' wx:if='{{nickname!=""}}'>{{nickname}}</view> <view class='user-name' wx:if='{{nickname!=""&&nickname!="微信用户"}}' bindtap='getUserInfo'>{{nickname}}</view>
<button class='user-name' wx:if='{{nickname==0}}' bindtap='getUserInfo'>点击登录</button> <button class='user-name' wx:if='{{nickname==0||nickname=="微信用户"}}' bindtap='getUserInfo'>点击获取</button>
<image src='{{headimgurl}}' class='header-img' binderror="binderrorimg"></image> <image src='{{headimgurl}}' class='header-img' binderror="binderrorimg"></image>
</view> </view>
<view class="server"> <view class="server">
......
...@@ -63,6 +63,7 @@ page { ...@@ -63,6 +63,7 @@ page {
.user-name { .user-name {
width: 440rpx; width: 440rpx;
text-align: left;
height: 52rpx; height: 52rpx;
font-size: 50rpx; font-size: 50rpx;
color: #333; color: #333;
...@@ -86,7 +87,7 @@ page { ...@@ -86,7 +87,7 @@ page {
top: 50rpx; top: 50rpx;
left: 30rpx; left: 30rpx;
z-index: 1; z-index: 1;
border: 1rpx solid #dfdede; /* border: 1rpx solid #dfdede; */
} }
.item { .item {
width: 650rpx; width: 650rpx;
......
...@@ -47,7 +47,7 @@ const url = { ...@@ -47,7 +47,7 @@ const url = {
getUserSig :HOST + 'wechatIm.php?s=/Im/wechat_get_sign', //获取usersig以及userID getUserSig :HOST + 'wechatIm.php?s=/Im/wechat_get_sign', //获取usersig以及userID
getOpenId :HOST + 'applet.php?s=Applet/getopenid', ///获取openid getOpenId :HOST + 'applet.php?s=Applet/getopenid', ///获取openid
getUserData :HOST + 'wechatIteration.php?s=/Home/index', ///获取用户数据 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 seeOpenId :HOST + "wechatIteration.php?s=/Inquisition/get_openid",//查询openid
getRoomUserSig :HOST + "wechatIteration.php?s=/Inquisition/get_room",//获取room的userSig getRoomUserSig :HOST + "wechatIteration.php?s=/Inquisition/get_room",//获取room的userSig
/**IM用户关系 */ /**IM用户关系 */
......
...@@ -12,6 +12,7 @@ function wxPromise(method,url,data){ ...@@ -12,6 +12,7 @@ function wxPromise(method,url,data){
data:data, data:data,
header:{'content-type': 'application/x-www-form-urlencoded'}, header:{'content-type': 'application/x-www-form-urlencoded'},
success:function(res){ success:function(res){
// console.log("res",res)
// setTimeout(function () { // setTimeout(function () {
// wx.hideLoading(); // wx.hideLoading();
// }, 100); // }, 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