index.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <view class="page" :style="{height:height}">
  3. <!-- #ifdef H5-->
  4. <uni-nav-bar v-if="!$isWxBrowser()" :fixed="true" background-color="#FFE05C" :border="false" :statusBar="false"
  5. title="首页" />
  6. <!-- #endif -->
  7. <manager v-if="isManager == '1'" :height="height"></manager>
  8. <attach v-else-if="isManager == '0' && (roleTag == '0' || roleTag == '2')"></attach>
  9. <view :style="{height:height}" v-else-if="isManager == '0' && roleTag == '1'" class="flex-col justify-center">
  10. <view class="flex-row justify-center">
  11. <text>合作伙伴相关功能正在建设中...</text>
  12. </view>
  13. </view>
  14. <!-- <manager></manager>-->
  15. <!-- <attach></attach>-->
  16. </view>
  17. </template>
  18. <script>
  19. import manager from "./manager/manager";
  20. import attach from "./attach/attach";
  21. export default {
  22. components: {
  23. manager,
  24. attach
  25. },
  26. data() {
  27. return {
  28. isManager: '',
  29. roleTag: '',
  30. height: '',
  31. ruleList: [],
  32. roleList: [],
  33. roleBindRuleParam: {},
  34. userInfo: {},
  35. }
  36. },
  37. onLoad() {
  38. let sysInfo = uni.getSystemInfoSync()
  39. this.height = sysInfo.windowHeight + 'px'
  40. },
  41. onShow() {
  42. this.userInfo = uni.getStorageSync('spreadUserInfo')
  43. console.log('时间戳', new Date().getTime())
  44. this.userInfo = uni.getStorageSync('spreadUserInfo')
  45. this.isManager = this.userInfo.isManager
  46. this.roleTag = this.userInfo.roleTag
  47. console.log(this.isManager,'类型',this.roleTag )
  48. },
  49. methods: {
  50. // 微信支付
  51. wechatPay() {
  52. const that = this;
  53. // 用户信息
  54. this.$api.service.wechatPay({
  55. orderNo: 'CZ20240223125943175'
  56. }).then((res) => {
  57. var param = res.data.data;
  58. uni.requestPayment({
  59. appId: param.appid,
  60. timeStamp: param.timestamp + "",
  61. nonceStr: param.noncestr,
  62. package: "prepay_id=" + param.prepayid,
  63. signType: "RSA",
  64. paySign: param.sign,
  65. success: res => {
  66. uni.showToast({
  67. title: '支付成功!'
  68. });
  69. // 刷新用户信息
  70. that.getUserInfo()
  71. },
  72. fail: res => {
  73. uni.showModal({
  74. content: '支付失败',
  75. showCancel: false
  76. });
  77. }
  78. });
  79. })
  80. },
  81. }
  82. }
  83. </script>
  84. <style scoped lang="scss">
  85. @import './index.rpx.css';
  86. </style>