index.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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,attach
  16. },
  17. data() {
  18. return {
  19. height:'',
  20. ruleList:[],
  21. roleList:[],
  22. roleBindRuleParam:{},
  23. userInfo:{}
  24. }
  25. },
  26. onLoad() {
  27. let sysInfo = uni.getSystemInfoSync()
  28. this.height = sysInfo.windowHeight - 45 + 'px'
  29. },
  30. onShow(){
  31. this.userInfo = uni.getStorageSync('spreadUserInfo')
  32. },
  33. methods: {
  34. // 微信支付
  35. wechatPay(){
  36. const that = this;
  37. // 用户信息
  38. this.$api.service.wechatPay({
  39. orderNo:'CZ20240223125943175'
  40. }).then((res)=>{
  41. var param = res.data.data;
  42. uni.requestPayment({
  43. appId: param.appid,
  44. timeStamp: param.timestamp+"",
  45. nonceStr: param.noncestr,
  46. package: "prepay_id="+param.prepayid,
  47. signType: "RSA",
  48. paySign: param.sign,
  49. success: res => {
  50. uni.showToast({
  51. title: '支付成功!'
  52. });
  53. // 刷新用户信息
  54. that.getUserInfo()
  55. },
  56. fail: res => {
  57. uni.showModal({
  58. content: '支付失败',
  59. showCancel: false
  60. });
  61. }
  62. });
  63. })
  64. },
  65. }
  66. }
  67. </script>
  68. <style scoped lang="scss">
  69. @import './index.rpx.css';
  70. </style>