index.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <view class="page">
  3. <uni-nav-bar :fixed="true" background-color="#FFE05C" :border="false" :statusBar="true" title="首页" />
  4. <manager :height="height" v-if="userInfo.isManager === 1"></manager>
  5. <attach :height="height" v-if="userInfo.isManager === 0 && userInfo.roleTag == '0'"></attach>
  6. <view v-if="userInfo.isManager === 0 && userInfo.roleTag == '1'">
  7. <text>合作伙伴</text>
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. import manager from "./manager/manager";
  13. import attach from "./attach/attach"
  14. export default {
  15. components:{
  16. manager,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 - 45 + 'px'
  30. },
  31. onShow(){
  32. this.userInfo = uni.getStorageSync('spreadUserInfo')
  33. },
  34. methods: {
  35. // 微信支付
  36. wechatPay(){
  37. const that = this;
  38. // 用户信息
  39. this.$api.service.wechatPay({
  40. orderNo:'CZ20240223125943175'
  41. }).then((res)=>{
  42. var param = res.data.data;
  43. uni.requestPayment({
  44. appId: param.appid,
  45. timeStamp: param.timestamp+"",
  46. nonceStr: param.noncestr,
  47. package: "prepay_id="+param.prepayid,
  48. signType: "RSA",
  49. paySign: param.sign,
  50. success: res => {
  51. uni.showToast({
  52. title: '支付成功!'
  53. });
  54. // 刷新用户信息
  55. that.getUserInfo()
  56. },
  57. fail: res => {
  58. uni.showModal({
  59. content: '支付失败',
  60. showCancel: false
  61. });
  62. }
  63. });
  64. })
  65. },
  66. }
  67. }
  68. </script>
  69. <style scoped lang="scss">
  70. @import './index.rpx.css';
  71. </style>