diff --git a/src/pages/index.wpy b/src/pages/index.wpy index ce7c9f46b0d0f45d61513f02a76173ec4a0bf6c8..69831cc397948469112701c17aec27b4dcdd77b1 100644 --- a/src/pages/index.wpy +++ b/src/pages/index.wpy @@ -63,6 +63,15 @@ box-sizing: border-box; display: flex;flex-direction: row;align-items: center } +.van-tabs__line { + z-index: 1; + left: 0; + bottom: 15px; + height: 3px; + position: absolute; + border-radius: 3px; + background-color: #409EFF !important; +} @@ -81,7 +90,10 @@
- + + + +
@@ -123,15 +135,26 @@ wepy.page({ data: { orderList: [], userInfo: {}, - platformOptions: [] + platformOptions: [], + activeTab: 0, + activeTitle: '', + platform: '' }, computed: {}, methods: { item_click(item){ - let data = JSON.stringify(item) - wx.navigateTo({ - url: '/pages/approvePreview?data=' + encodeURIComponent(data) - }) + let data = JSON.parse(JSON.stringify(item)) + data.activeTitle = this.activeTitle + if (this.activeTitle === '试剂耗材') { + wx.navigateTo({ + url: '/pages/approvePreview?data=' + encodeURIComponent(JSON.stringify(data)) + }) + } else if (this.activeTitle === '实验动物') { + wx.navigateTo({ + url: '/pages/sydwApprovePreview?data=' + encodeURIComponent(JSON.stringify(data)) + }) + } + // wx.setStorageSync("order", item); // wx.navigateTo({ @@ -233,6 +256,64 @@ wepy.page({ }) } }); + }, + getSydwList() { + wx.getStorage({ + key: 'user_info', + success: (res) => { + this.userInfo = JSON.parse(res.data); + wx.showLoading({ + title: '加载中' + }); + const requestURL = wx.getStorageSync('requestURL') + wx.request({ + url: `${requestURL}/approveOpera/listUnApproveAnm`, + method: 'post', + header: { + 'Content-Type': 'application/json', + 'token': this.userInfo.token + }, + data: { + searchText: '', + roleNum: this.userInfo.roleNum + }, + success: (res) => { + if (res.data.success) { + this.orderList = res.data.data + } else if(res.statusCode === 401) { + wx.showModal({ + title: '提示', + content: '重新扫码登录', + showCancel: false, + success: () => { + } + }) + } else { + this.orderList = [] + } + wx.hideLoading() + } + }); + }, + fail: function() { + wx.showModal({ + title: '提示', + content: '重新扫码登录', + showCancel: false, + success: () => { + } + }) + } + }); + }, + onChange(event) { + this.activeTitle = event.$wx.detail.title + this.orderList = [] + if (event.$wx.detail.title === '试剂耗材') { + this.getList() + } else if (event.$wx.detail.title === '实验动物') { + this.getSydwList() + } } }, onShow() { @@ -325,6 +406,7 @@ wepy.page({ let username = arrPara[1] let plat = arrPara[3] let requestURL = this.platformOptions.find(v => v.platformNum === plat).platformUrl + this.platform = plat.replace('_test', '') wx.setStorage({ key: 'requestURL', data: requestURL @@ -355,7 +437,8 @@ wepy.page({ 角色编号:res.data.data.umsUserRoleQueryVo[0].roleNum, 课题组名称:res.data.data.umsUserRoleQueryVo[0].groupName, 课题组编号:res.data.data.umsUserRoleQueryVo[0].groupCode, - 默认页:'index' + 默认页:'index', + platform: plat.replace('_test', '') }; wx.setStorage({ key: 'user_info', @@ -390,6 +473,7 @@ wepy.page({ key: 'user_info', success: (res) => { this.userInfo = JSON.parse(res.data); + this.platform = this.userInfo.platform this.getList() }, fail: function() { @@ -471,7 +555,9 @@ header: '~@/components/header', 'van-button': 'module:@vant/weapp/lib/button', "van-action-sheet": "module:@vant/weapp/lib/action-sheet/index", "van-tabbar": "module:@vant/weapp/lib/tabbar/index", -"van-tabbar-item": "module:@vant/weapp/lib/tabbar-item/index" +"van-tabbar-item": "module:@vant/weapp/lib/tabbar-item/index", +"van-tabs": "module:@vant/weapp/lib/tabs/index", +"van-tab": "module:@vant/weapp/lib/tab/index" } } diff --git a/src/pages/sydwApprovePreview.wpy b/src/pages/sydwApprovePreview.wpy new file mode 100644 index 0000000000000000000000000000000000000000..4c6d96e9e817a4e746a71ee46f08d574d2c7d1c6 --- /dev/null +++ b/src/pages/sydwApprovePreview.wpy @@ -0,0 +1,474 @@ + + + + + + + + + + + + + + + + +{ +navigationBarTextStyle: "white", +navigationBarBackgroundColor: "#45C9C3", +navigationBarTitleText: '小树懒捎带', +usingComponents: { +"van-card": "module:@vant/weapp/lib/card/index", +"van-icon": "module:@vant/weapp/lib/icon/index", +"van-overlay": "module:@vant/weapp/lib/overlay/index", +"van-cell": "module:@vant/weapp/lib/cell/index", +"van-cell-group": "module:@vant/weapp/lib/cell-group/index", +"van-search": "module:@vant/weapp/lib/search/index", +"van-image": "module:@vant/weapp/lib/image/index", +"van-dialog": "module:@vant/weapp/lib/dialog/index", +header: '~@/components/header', +"van-picker": "module:@vant/weapp/lib/picker/index", +"van-popup": "module:@vant/weapp/lib/popup/index", +'van-button': 'module:@vant/weapp/lib/button', +"van-action-sheet": "module:@vant/weapp/lib/action-sheet/index", +"van-tabbar": "module:@vant/weapp/lib/tabbar/index", +"van-tabbar-item": "module:@vant/weapp/lib/tabbar-item/index" +} +} +