Browse Source

患者端迁移处理

dev
kola-web 4 weeks ago
parent
commit
cc40abe69d
  1. 26
      src/app.ts
  2. 54
      src/components/pickerArea/index.ts
  3. 4
      src/components/pickerArea/index.wxml
  4. 7
      src/patient/pages/cancellation/index.ts
  5. 2
      src/patient/pages/index/index.wxml
  6. 1
      typings/index.d.ts

26
src/app.ts

@ -89,6 +89,19 @@ App<IAppOption>({ @@ -89,6 +89,19 @@ App<IAppOption>({
wx.ajax = licia.curry(request)({ gUrl: this.globalData.url });
this.startLogin();
wx.setInnerAudioOption({
obeyMuteSwitch: false,
mixWithOther: false,
});
},
onShow(options) {
if (options.query.scene) {
this.globalData.scene = parseScene(options.query.scene);
}
},
startLogin(callback) {
wx.login({
success: (res) => {
wx.ajax({
@ -102,19 +115,12 @@ App<IAppOption>({ @@ -102,19 +115,12 @@ App<IAppOption>({
this.globalData.isLogin = res.isLogin;
this.globalData.isNewReg = res.isNewReg;
this.globalData.loginType = res.loginType;
if (callback) {
callback();
}
});
},
});
wx.setInnerAudioOption({
obeyMuteSwitch: false,
mixWithOther: false,
});
},
onShow(options) {
if (options.query.scene) {
this.globalData.scene = parseScene(options.query.scene);
}
},
updateLoginInfo(callback?: (any) => void) {
wx.ajax({

54
src/components/pickerArea/index.ts

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
const app = getApp<IAppOption>()
const app = getApp<IAppOption>();
Component({
properties: {
@ -25,7 +25,7 @@ Component({ @@ -25,7 +25,7 @@ Component({
},
observers: {
show(newVal: boolean) {
this.triggerEvent('show', newVal)
this.triggerEvent('show', newVal);
},
},
data: {
@ -224,8 +224,8 @@ Component({ @@ -224,8 +224,8 @@ Component({
scrollIntoView0: this.data.pid || '',
scrollIntoView1: this.data.cid || '',
})
this.getArea()
});
this.getArea();
},
getArea() {
wx.ajax({
@ -235,78 +235,78 @@ Component({ @@ -235,78 +235,78 @@ Component({
}).then((res) => {
this.setData({
area: res,
})
this.getRangeList()
})
});
this.getRangeList();
});
},
handleItem(e: any) {
const { code, name } = e.currentTarget.dataset
const { code, name } = e.currentTarget.dataset;
this.setData({
ProvinceId: code,
ProvinceName: name,
CityId: '',
CityName: '',
})
this.getRangeList()
});
this.getRangeList();
},
handleChangeCity(e: any) {
const { code, name } = e.currentTarget.dataset
const { code, name } = e.currentTarget.dataset;
this.setData({
CityId: code,
CityName: name,
})
});
},
handleShare() {
this.setData({
show: false,
})
});
this.triggerEvent('ok', {
ProvinceName: this.data.ProvinceName,
ProvinceId: this.data.ProvinceId,
CityName: this.data.CityName,
CityId: this.data.CityId,
})
});
},
handleSelect(e) {
const { id } = e.currentTarget.dataset
const { id } = e.currentTarget.dataset;
this.setData({
word: id,
scrollIntoView0: id,
})
});
},
getRangeList() {
const { area, ProvinceId } = this.data
if (!ProvinceId) return
const range = area.filter((item: any) => item.value == ProvinceId)[0].children
const { area, ProvinceId } = this.data;
if (!ProvinceId) return;
const range = area.filter((item: any) => item.value == ProvinceId)[0].children;
this.setData({
range,
active: 1,
scrollIntoView0: '',
scrollIntoView1: `id${this.data.CityId}`,
})
});
},
handleProvince() {
this.setData({
active: 0,
scrollIntoView0: this.data.word || `id${this.data.ProvinceId}`,
scrollIntoView1: '',
})
});
},
handleCity() {
const { ProvinceId } = this.data
const { ProvinceId } = this.data;
if (!ProvinceId) {
wx.showToast({
title: '请先选择省份',
icon: 'none',
})
return
});
return;
}
this.getRangeList()
this.getRangeList();
},
handleClose() {
this.setData({
show: false,
})
});
},
},
})
});

4
src/components/pickerArea/index.wxml

@ -9,11 +9,11 @@ @@ -9,11 +9,11 @@
<view class="area">
<view class="item" bind:tap="handleProvince">
<view class="content">{{ProvinceName || '请选择省份'}}</view>
<image class="icon" src="{{imageUrl}}icon6.png?t={{Timestamp}}"></image>
<image class="icon" src="{{imageUrl}}za-images/icon6.png?t={{Timestamp}}"></image>
</view>
<view class="item" bind:tap="handleCity">
<view class="content">{{CityName || '请选择城市'}}</view>
<image class="icon" src="{{imageUrl}}icon6.png?t={{Timestamp}}"></image>
<image class="icon" src="{{imageUrl}}za-images/icon6.png?t={{Timestamp}}"></image>
</view>
<view class="btn" bind:tap="handleShare">确定</view>
</view>

7
src/patient/pages/cancellation/index.ts

@ -33,9 +33,10 @@ Page({ @@ -33,9 +33,10 @@ Page({
app.globalData.backPage = '';
app.globalData.loginState = '';
app.globalData.userInfo = {};
app.startLogin();
wx.reLaunch({
url: '/pages/login/index',
app.startLogin(() => {
wx.reLaunch({
url: '/patient/pages/login/index',
});
});
});
}

2
src/patient/pages/index/index.wxml

@ -231,7 +231,7 @@ @@ -231,7 +231,7 @@
</view>
</view>
</view>
<view class="live" wx:if="{{card.code == 'activity1' && card.showStatus == 1 }}">
<view class="live" wx:if="{{card.code == 'activity1' && card.showStatus == 1 && liveDownList.length}}">
<view class="header" wx:if="{{card.name}}">
<view class="title">{{card.name}}</view>
<view

1
typings/index.d.ts vendored

@ -35,6 +35,7 @@ interface IAppOption { @@ -35,6 +35,7 @@ interface IAppOption {
};
userInfoReadyCallback?: WechatMiniprogram.GetUserInfoSuccessCallback;
waitLogin: (params?: { type?: pageType[] | 'any' }) => Promise<void>;
startLogin: (callback?: () => void) => void;
checkLoginType: (type: pageType[] | 'any') => boolean;
getMenuInfo: (arg0: WechatMiniprogram.Page.Instance<any, any>) => void;
getUserInfo: (type: 0 | 1 | 2) => Promise<never>;

Loading…
Cancel
Save