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>({
wx.ajax = licia.curry(request)({ gUrl: this.globalData.url }); 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({ wx.login({
success: (res) => { success: (res) => {
wx.ajax({ wx.ajax({
@ -102,19 +115,12 @@ App<IAppOption>({
this.globalData.isLogin = res.isLogin; this.globalData.isLogin = res.isLogin;
this.globalData.isNewReg = res.isNewReg; this.globalData.isNewReg = res.isNewReg;
this.globalData.loginType = res.loginType; 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) { updateLoginInfo(callback?: (any) => void) {
wx.ajax({ wx.ajax({

54
src/components/pickerArea/index.ts

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

4
src/components/pickerArea/index.wxml

@ -9,11 +9,11 @@
<view class="area"> <view class="area">
<view class="item" bind:tap="handleProvince"> <view class="item" bind:tap="handleProvince">
<view class="content">{{ProvinceName || '请选择省份'}}</view> <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>
<view class="item" bind:tap="handleCity"> <view class="item" bind:tap="handleCity">
<view class="content">{{CityName || '请选择城市'}}</view> <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>
<view class="btn" bind:tap="handleShare">确定</view> <view class="btn" bind:tap="handleShare">确定</view>
</view> </view>

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

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

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

@ -231,7 +231,7 @@
</view> </view>
</view> </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="header" wx:if="{{card.name}}">
<view class="title">{{card.name}}</view> <view class="title">{{card.name}}</view>
<view <view

1
typings/index.d.ts vendored

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

Loading…
Cancel
Save