Преглед изворни кода

提交代码~

release/210823_需求对对碰
王饶冀 пре 4 година
родитељ
комит
0df6345a45
4 измењених фајлова са 40 додато и 7 уклоњено
  1. 1
    0
      app.js
  2. 13
    2
      pages/index/index.js
  3. 1
    1
      pages/index/index.wxml
  4. 25
    4
      pages/login/login.js

+ 1
- 0
app.js Прегледај датотеку

sessionKey: "", sessionKey: "",
suiteCode: "", suiteCode: "",
customerId: null, customerId: null,
customer:null,
}, },
// 跳转登录页 // 跳转登录页
goLogin(e) { goLogin(e) {

+ 13
- 2
pages/index/index.js Прегледај датотеку

this.getListData(); this.getListData();
} }
}, },
goLogin() {
app.goLogin();
setAttention() {
if(!app.globalData.customerId){
app.goLogin();
return
}
let customerid = app.globalData.customerId;
wx.navigateTo({
url:"/pages/myModule/components/myAttention/myAttention",
success: function (res) {
// 通过eventChannel向被打开页面传送数据
res.eventChannel.emit('customerid', { customerid })
}
})
}, },
}) })

+ 1
- 1
pages/index/index.wxml Прегледај датотеку

全方位需求 全方位需求
<text class="sub-title">交流平台</text> <text class="sub-title">交流平台</text>
</view> </view>
<button type="default" plain class="set-attention" id="shouquan" bindtap="goLogin">
<button type="default" plain class="set-attention" id="shouquan" bindtap="setAttention">
设置关注类型喜好 >> 设置关注类型喜好 >>
</button> </button>
<image class="header-img" src="/images/home/header-icon.png" /> <image class="header-img" src="/images/home/header-icon.png" />

+ 25
- 4
pages/login/login.js Прегледај датотеку

province, province,
city city
}).then(res => { }).then(res => {
console.log(res,'保存用户信息返回的Res')
console.log(res, '保存用户信息返回的Res')
this.getUserSession() this.getUserSession()
}).catch(error => { }).catch(error => {
console.log(error, 'error appletLogin') console.log(error, 'error appletLogin')
// 获取用户信息弹框 // 获取用户信息弹框
onCheckboxChange() { onCheckboxChange() {
if (!this.data.hasUserInfo) { if (!this.data.hasUserInfo) {
if(!this.data.userInfo){
if (!this.data.userInfo) {
this.getUserProfile() this.getUserProfile()
}else{
} else {
this.setData({ this.setData({
hasUserInfo: true hasUserInfo: true
}) })
let that = this let that = this
$request.post('/script/getSession.action', {}).then(res => { $request.post('/script/getSession.action', {}).then(res => {
wx.hideLoading() wx.hideLoading()
console.log(res, '返回的res')
app.globalData.customerId = res.data.customer.customerId; app.globalData.customerId = res.data.customer.customerId;
wx.navigateBack()
app.globalData.customer = res.data.customer;
let pages = getCurrentPages();
let Page = pages[pages.length - 1];//当前页
let prevPage = pages[pages.length - 2]; //上一个页面
let info = prevPage.data //取上页data里的数据也可以修改
console.log(prevPage,'prevPage');
console.log(info,'info');
// 如果是上一页是我的页面
if(prevPage.route == "pages/myModule/index"){
}else{
wx.navigateBack()
}
// let tempListData = info.listData;
// tempListData.forEach(el => {
// if (el.businessCommunicationDemandId == businessCommunicationDemandId) {
// el.info = Page.data.detailValue
// }
// })
// prevPage.setData({ listData: tempListData })//设置数据
// wx.navigateBack()
}).catch(error => { }).catch(error => {
console.log(error, "获取error") console.log(error, "获取error")
}) })

Loading…
Откажи
Сачувај