index.vue 2.1 KB

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