index.vue 2.1 KB

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