2023/5/23调试医院列表
This commit is contained in:
461
pages/my/my.js
461
pages/my/my.js
@@ -4,251 +4,244 @@ const app = getApp()
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
canIUseOpenData: wx.canIUse('open-data.type.userAvatarUrl') && wx.canIUse('open-data.type.userNickName'),
|
||||
phone: wx.getStorageSync('phone'),
|
||||
uidFlag:wx.getStorageSync('uidFlag'),
|
||||
status: '',
|
||||
code: '',
|
||||
height: ''
|
||||
},
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
canIUseOpenData: wx.canIUse('open-data.type.userAvatarUrl') && wx.canIUse('open-data.type.userNickName'),
|
||||
phone: wx.getStorageSync('phone'),
|
||||
uidFlag: wx.getStorageSync('uidFlag'),
|
||||
status: '',
|
||||
code: '',
|
||||
height: ''
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
var statusBarHeight = wx.getSystemInfoSync().statusBarHeight;
|
||||
app.console(statusBarHeight + "=================xxxxxxxxxxxxxxxxxxxxxxxx")
|
||||
this.setData({
|
||||
statusBarHeight: statusBarHeight,
|
||||
height: 46 + statusBarHeight,
|
||||
});
|
||||
app.console(this.data.height + "=================xxxxxxxxxxxxxxxxxxxxxxxx")
|
||||
//调试参数
|
||||
// wx.setStorageSync('phone', 18133922183);
|
||||
// wx.setStorageSync('uid', 'adfdffb45a364fc23162f1ebfe9dd66f');
|
||||
// wx.setStorageSync('token', '797d4q7XT8/PM9bU+T+CNpEpNfsWeVb5j+eXnrRXW0yq+wKXY9fBNSvb7qPiCRMlzZmwG3u1ods8R8Rh3gITxCkyiZGUtLZf');
|
||||
// wx.setStorageSync('uidFlag', true);
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
this.getLogin()
|
||||
console.log("code==" + this.data.code)
|
||||
// if (wx.getStorageSync('phone') != '') {
|
||||
// this.getUserBaseInfo()
|
||||
// }
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
var statusBarHeight = wx.getSystemInfoSync().statusBarHeight;
|
||||
app.console(statusBarHeight + "=================xxxxxxxxxxxxxxxxxxxxxxxx")
|
||||
this.setData({
|
||||
statusBarHeight: statusBarHeight,
|
||||
height: 46 + statusBarHeight,
|
||||
});
|
||||
app.console(this.data.height + "=================xxxxxxxxxxxxxxxxxxxxxxxx")
|
||||
//调试参数
|
||||
// wx.setStorageSync('phone', 18133922183);
|
||||
// wx.setStorageSync('uid', 'adfdffb45a364fc23162f1ebfe9dd66f');
|
||||
// wx.setStorageSync('token', '797d4q7XT8/PM9bU+T+CNpEpNfsWeVb5j+eXnrRXW0yq+wKXY9fBNSvb7qPiCRMlzZmwG3u1ods8R8Rh3gITxCkyiZGUtLZf');
|
||||
// wx.setStorageSync('uidFlag', true);
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
this.getLogin()
|
||||
console.log("code==" + this.data.code)
|
||||
// if (wx.getStorageSync('phone') != '') {
|
||||
// this.getUserBaseInfo()
|
||||
// }
|
||||
},
|
||||
|
||||
// 登录
|
||||
getLogin() {
|
||||
var that = this;
|
||||
wx.login({
|
||||
success: res => {
|
||||
console.log(res)
|
||||
app.globalData.code = res.code
|
||||
that.setData({
|
||||
code: res.code
|
||||
})
|
||||
}
|
||||
// 登录
|
||||
getLogin() {
|
||||
var that = this;
|
||||
wx.login({
|
||||
success: res => {
|
||||
console.log(res)
|
||||
app.globalData.code = res.code
|
||||
that.setData({
|
||||
code: res.code
|
||||
})
|
||||
},
|
||||
// 获取电话号码
|
||||
getPhoneNumber(e) {
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取电话号码
|
||||
getPhoneNumber(e) {
|
||||
|
||||
|
||||
console.log("encryptedData==" + e.detail.encryptedData)
|
||||
console.log("iv==" + e.detail.iv)
|
||||
console.log("wxcode==" + app.globalData.code)
|
||||
console.log("encryptedData==" + e.detail.encryptedData)
|
||||
console.log("iv==" + e.detail.iv)
|
||||
console.log("wxcode==" + app.globalData.code)
|
||||
|
||||
var _this = this;
|
||||
console.log(e)
|
||||
wx.request({
|
||||
url: app.globalData.url + '/weixinLogin',
|
||||
data: {
|
||||
encryptedData: e.detail.encryptedData,
|
||||
iv: e.detail.iv,
|
||||
wxcode: app.globalData.code
|
||||
},
|
||||
method: 'POST',
|
||||
header: {
|
||||
'content-type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
success(res) {
|
||||
if (res.data.code == 200) {
|
||||
app.globalData.phone = res.data.phone;
|
||||
wx.setStorageSync('phone', res.data.data.phoneNumber);
|
||||
wx.setStorageSync('uid', res.data.data.userId);
|
||||
wx.setStorageSync('token', res.data.data.token);
|
||||
wx.setStorageSync('uidFlag', true);
|
||||
_this.setData({
|
||||
uidFlag: true,
|
||||
phone: res.data.phone
|
||||
})
|
||||
app.globalData.uid = res.data.uid;
|
||||
wx.switchTab({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
// Token.token()
|
||||
_this.getToken()
|
||||
var _this = this;
|
||||
console.log(e)
|
||||
wx.request({
|
||||
url: app.globalData.url + '/weixinLogin',
|
||||
data: {
|
||||
encryptedData: e.detail.encryptedData,
|
||||
iv: e.detail.iv,
|
||||
wxcode: app.globalData.code
|
||||
},
|
||||
method: 'POST',
|
||||
header: {
|
||||
'content-type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
success(res) {
|
||||
if (res.data.code == 200) {
|
||||
app.globalData.phone = res.data.phone;
|
||||
wx.setStorageSync('phone', res.data.data.phoneNumber);
|
||||
wx.setStorageSync('uid', res.data.data.userId);
|
||||
wx.setStorageSync('token', res.data.data.token);
|
||||
wx.setStorageSync('uidFlag', true);
|
||||
_this.setData({
|
||||
uidFlag: true,
|
||||
phone: res.data.phone
|
||||
})
|
||||
app.globalData.uid = res.data.uid;
|
||||
wx.switchTab({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
// Token.token()
|
||||
_this.getToken()
|
||||
|
||||
_this.ceshi()
|
||||
_this.ceshi()
|
||||
|
||||
wx.showToast({
|
||||
title: res.data.msg,
|
||||
icon: 'none'
|
||||
});
|
||||
|
||||
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: res.data.msg,
|
||||
icon: 'none'
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
//上传测试数据
|
||||
ceshi() {
|
||||
|
||||
wx.request({
|
||||
url: app.buildUrltwo("/member/logintwo"),
|
||||
header: app.getRequestHeader(),
|
||||
method: "POST",
|
||||
data: {
|
||||
name: wx.getStorageSync('uid'),
|
||||
phone: wx.getStorageSync('phone'),
|
||||
storename: wx.getStorageSync('token')
|
||||
|
||||
},
|
||||
success: function (res) {
|
||||
var resp = res.data;
|
||||
if (resp.code != 200) {
|
||||
app.alert({
|
||||
"content": resp.msg
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 跳转
|
||||
wx.navigateBack({});
|
||||
}
|
||||
})
|
||||
},
|
||||
//获取token
|
||||
getUserBaseInfo: function () {
|
||||
var that = this;
|
||||
//假数据
|
||||
// if (this.data.resp.erro == 0) {
|
||||
// that.setData({
|
||||
// infor: this.data.resp.infor
|
||||
// });
|
||||
// }
|
||||
wx.request({
|
||||
url: app.globalData.url + '/getUserToken',
|
||||
header: app.getRequestHeader(),
|
||||
method: 'GET',
|
||||
data: {
|
||||
phonenumber: '18133922183'
|
||||
},
|
||||
success: function (res) {
|
||||
var resp = res.data;
|
||||
console.log(resp + "=================dddddddddddddddddddddddddddddddddddddddddddd")
|
||||
console.log(resp.erro + "=================dddddddddddddddddddddddddddddddddddddddddddd")
|
||||
if (resp.erro == 0) {
|
||||
|
||||
that.setData({
|
||||
infor: resp.infor
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
},
|
||||
shoucang() {
|
||||
wx.navigateTo({
|
||||
url: '/pages/myshoucang/myshoucang_index?' + "type=" + "1",
|
||||
})
|
||||
},
|
||||
pintuan() {
|
||||
wx.navigateTo({
|
||||
// url: '/pages/myshoucang/myshoucang_index?'+"type="+"2",
|
||||
url: '/pages/order/order',
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
kanjia() {
|
||||
// wx.navigateTo({
|
||||
// url: '/pages/myshoucang/myshoucang_index?'+"type="+"3",
|
||||
// })
|
||||
wx.showToast({
|
||||
title: '暂无开放',
|
||||
wx.showToast({
|
||||
title: res.data.msg,
|
||||
icon: 'none'
|
||||
});
|
||||
},
|
||||
qianbao() {
|
||||
wx.navigateTo({
|
||||
url: '/pages/wodeqianbao/qianbao'
|
||||
})
|
||||
},
|
||||
tuiguang() {
|
||||
});
|
||||
|
||||
|
||||
if (this.data.status == 1) {
|
||||
wx.navigateTo({
|
||||
url: '/pages/tuiguang/extensionInfor'
|
||||
})
|
||||
} else {
|
||||
wx.navigateTo({
|
||||
url: '/pages/tuiguang/tuiguang'
|
||||
})
|
||||
wx.showToast({
|
||||
title: res.data.msg,
|
||||
icon: 'none'
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
}
|
||||
})
|
||||
},
|
||||
//上传测试数据
|
||||
ceshi() {
|
||||
|
||||
wx.request({
|
||||
url: app.buildUrltwo("/member/logintwo"),
|
||||
header: app.getRequestHeader(),
|
||||
method: "POST",
|
||||
data: {
|
||||
name: wx.getStorageSync('uid'),
|
||||
phone: wx.getStorageSync('phone'),
|
||||
storename: wx.getStorageSync('token')
|
||||
|
||||
},
|
||||
success: function (res) {
|
||||
var resp = res.data;
|
||||
if (resp.code != 200) {
|
||||
app.alert({
|
||||
"content": resp.msg
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 跳转
|
||||
wx.navigateBack({});
|
||||
}
|
||||
})
|
||||
},
|
||||
//获取token
|
||||
getUserBaseInfo: function () {
|
||||
var that = this;
|
||||
//假数据
|
||||
// if (this.data.resp.erro == 0) {
|
||||
// that.setData({
|
||||
// infor: this.data.resp.infor
|
||||
// });
|
||||
// }
|
||||
wx.request({
|
||||
url: app.globalData.url + '/getUserToken',
|
||||
header: app.getRequestHeader(),
|
||||
method: 'GET',
|
||||
data: {
|
||||
phonenumber: '18133922183'
|
||||
},
|
||||
success: function (res) {
|
||||
var resp = res.data;
|
||||
console.log(resp + "=================dddddddddddddddddddddddddddddddddddddddddddd")
|
||||
console.log(resp.erro + "=================dddddddddddddddddddddddddddddddddddddddddddd")
|
||||
if (resp.erro == 0) {
|
||||
|
||||
that.setData({
|
||||
infor: resp.infor
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
},
|
||||
shoucang() {
|
||||
wx.navigateTo({
|
||||
url: '/pages/myshoucang/myshoucang_index?' + "type=" + "1",
|
||||
})
|
||||
},
|
||||
pintuan() {
|
||||
wx.navigateTo({
|
||||
// url: '/pages/myshoucang/myshoucang_index?'+"type="+"2",
|
||||
url: '/pages/order/order',
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
kanjia() {
|
||||
// wx.navigateTo({
|
||||
// url: '/pages/myshoucang/myshoucang_index?'+"type="+"3",
|
||||
// })
|
||||
wx.showToast({
|
||||
title: '暂无开放',
|
||||
icon: 'none'
|
||||
});
|
||||
},
|
||||
qianbao() {
|
||||
wx.navigateTo({
|
||||
url: '/pages/wodeqianbao/qianbao'
|
||||
})
|
||||
},
|
||||
guanyu() {
|
||||
wx.navigateTo({
|
||||
url: '/pages/guanyu/guanyu'
|
||||
})
|
||||
},
|
||||
|
||||
})
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"van-nav-bar":"/miniprogram/miniprogram_npm/@vant/weapp/nav-bar/index"
|
||||
"van-nav-bar":"/miniprogram/miniprogram_npm/@vant/weapp/nav-bar/index",
|
||||
"van-icon": "/miniprogram/miniprogram_npm/@vant/weapp/icon/index"
|
||||
},
|
||||
"navigationBarTitleText": "我的"
|
||||
}
|
||||
@@ -21,7 +21,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="substance" bindtap="shoucang">
|
||||
<!-- <view class="substance" bindtap="shoucang">
|
||||
<view style="display:flex">
|
||||
<image src="/pages/image/colleme.png" style="width:34rpx;height:34rpx;"></image>
|
||||
<view class="price">我的关注</view>
|
||||
@@ -29,7 +29,7 @@
|
||||
<view>
|
||||
<image src="/pages/image/right1.png" style="width:15rpx;height:28rpx"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- <view class="substance" bindtap="pintuan">
|
||||
<view style="display:flex">
|
||||
<image src="/pages/image/Collage.png" style="width:34rpx;height:34rpx;"></image>
|
||||
@@ -39,16 +39,17 @@
|
||||
<image src="/pages/image/right1.png" style="width:15rpx;height:28rpx"></image>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- <view class="substance" bindtap="tuiguang">
|
||||
|
||||
<view class="substance" bindtap="guanyu">
|
||||
<view style="display:flex">
|
||||
<image src="/pages/image/Bargain.png" style="width:34rpx;height:34rpx;"></image>
|
||||
<view class="price">我的推广</view>
|
||||
<van-icon style="width:34rpx;height:34rpx;" name="info-o" />
|
||||
|
||||
<view class="price">关于</view>
|
||||
</view>
|
||||
<view>
|
||||
<image src="/pages/image/right1.png" style="width:15rpx;height:28rpx"></image>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="content" wx:else>
|
||||
|
||||
Reference in New Issue
Block a user