index.vue 1.6 KB

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