index.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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({ orderNo: 'CZ20240223125943175' }).then((res) => {
  55. var param = res.data.data;
  56. uni.requestPayment({
  57. appId: param.appid,
  58. timeStamp: param.timestamp + "",
  59. nonceStr: param.noncestr,
  60. package: "prepay_id=" + param.prepayid,
  61. signType: "RSA",
  62. paySign: param.sign,
  63. success: res => {
  64. uni.showToast({
  65. title: '支付成功!'
  66. });
  67. // 刷新用户信息
  68. that.getUserInfo()
  69. },
  70. fail: res => {
  71. uni.showModal({
  72. content: '支付失败',
  73. showCancel: false
  74. });
  75. }
  76. });
  77. })
  78. },
  79. }
  80. }
  81. </script>
  82. <style scoped lang="scss">
  83. @import './index.rpx.css';
  84. </style>