猫妈狗爸伴宠师小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

165 lines
4.9 KiB

1 month ago
1 month ago
1 month ago
  1. <template>
  2. <view class="bind-user">
  3. <view class="bind-user-header">
  4. <view class="flex mb28">
  5. <up-image width="139rpx" height="139rpx" :src="userInfo?.userImage" shape="circle"></up-image>
  6. <view class="header-name">
  7. <view class="font32 mb20" :style="{color:'#000'}">{{ userInfo?.userName}}</view>
  8. <view class="label1" v-if="userInfo.userHhRole == 1">
  9. 初级伴宠师
  10. </view>
  11. <view class="label1" v-if="userInfo.userHhRole == 2">
  12. 中级伴宠师
  13. </view>
  14. <view class="label1"v-if="userInfo.userHhRole == 3">
  15. 高级伴宠师
  16. </view>
  17. <view class="flex font24">
  18. <view :style="{color:'#A55822'}">当前分成比例
  19. <text :style="{color:'#C12525'}">{{baseInfo.partner_new_num}}</text>
  20. </view>
  21. <view :style="{color:'#A55822'}">晋级后分成比例
  22. <text :style="{color:'#C12525'}">{{baseInfo.partner_upgrade_num}}</text>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="flex flex-evenly mt60">
  28. <view class="header-card card-left box-size"
  29. @click="configPopupRef.open('pet_attention_details')">
  30. <view class="flex-between flex">
  31. <view class="mr20">
  32. <view class="mb20 ml20" :style="{color:'#A55822',fontWeight:'bold',fontSize:'30rpx'}">推广攻略
  33. </view>
  34. <view :style="{color:'#A55822',fontSize:'22rpx'}">快速定位宠友群体</view>
  35. </view>
  36. <up-image :show-loading="true" src="https://cdn.catmdogd.com/Work/image/work/icon1.png"
  37. width="71rpx" height="85rpx"></up-image>
  38. </view>
  39. </view>
  40. <view class="header-card card-right box-size"
  41. @click="configPopupRef.open('pet_attention_details')">
  42. <view class="flex flex-between">
  43. <view class="mr20">
  44. <view class="mb20 ml20" :style="{color:'#A55822',fontWeight:'bold',fontSize:'30rpx'}">推广教程
  45. </view>
  46. <view :style="{color:'#A55822',fontSize:'22rpx'}">推广问题一目了然</view>
  47. </view>
  48. <up-image :show-loading="true" src="https://cdn.catmdogd.com/Work/image/work/icon2.png"
  49. width="71rpx" height="85rpx"></up-image>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. <!--
  55. :style="{'background-image' : `url(${configList.background_popularize_one.paramValueImage})`}" -->
  56. <view class="bind-main">
  57. <view class="bind-main-one mb10"
  58. :style="{'background-image' : `url('${configList.background_popularize_one.paramValueImage}')`}">
  59. <view class="mb20 font32">邀请码邀请</view>
  60. <view class="mb20">用户输入邀请码直接完成绑定</view>
  61. <up-input disabled v-model="dataF.code">
  62. <template #suffix>
  63. <up-button @click="copyMessage(dataF.code)" text="复制" type="success" size="small" shape="circle"></up-button>
  64. </template>
  65. </up-input>
  66. </view>
  67. <view class="bind-main-two mb10"
  68. :style="{'background-image' : `url('${configList.background_popularize_two.paramValueImage}')`}">
  69. <view class="mb20 font32">分享海报邀请</view>
  70. <view class="mb20">扫码进入猫妈狗爸完成绑定</view>
  71. <up-button @click="toSharing" text="保存海报" type="primary" shape="circle" plain style="background: transparent;"></up-button>
  72. </view>
  73. <view class="bind-main-three"
  74. :style="{'background-image' : `url('${configList.background_popularize_three.paramValueImage}')`}">
  75. <view class="mb20 font32">分享链接邀请</view>
  76. <view class="mb20">复制链接给好友进入直接绑定</view>
  77. <up-input disabled v-model="dataF.code">
  78. <template #suffix>
  79. <up-button @click="copyMessage(dataF.code)" text="复制" type="success" size="small" shape="circle"></up-button>
  80. </template>
  81. </up-input>
  82. </view>
  83. </view>
  84. <configPopup ref="configPopupRef" />
  85. </view>
  86. </template>
  87. <script setup>
  88. import {
  89. computed,
  90. ref,
  91. onMounted,
  92. } from "vue";
  93. import {
  94. useStore
  95. } from "vuex"
  96. import {
  97. binBaseInfo,
  98. bindCode,
  99. } from "@/api/home.js"
  100. import configPopup from '@/components/configPopup.vue'
  101. const store = useStore();
  102. const dataF = ref({})
  103. const baseInfo = ref({})
  104. const configPopupRef = ref(null)
  105. const configList = computed(() => {
  106. return store.getters.configList
  107. })
  108. const userInfo = computed(() => {
  109. return store.getters.userInfo
  110. })
  111. //复制
  112. const copyMessage = (value) => {
  113. uni.setClipboardData({
  114. data: value,
  115. success: function(res) {
  116. uni.getClipboardData({
  117. success: function(res) {
  118. uni.showToast({
  119. icon: 'none',
  120. title: "复制成功",
  121. });
  122. },
  123. });
  124. },
  125. });
  126. }
  127. const getBaseInfo = () => {
  128. binBaseInfo(baseInfo.value.userId).then(res => {
  129. baseInfo.value = res.data
  130. })
  131. bindCode(baseInfo.value.userId).then(res => {
  132. dataF.value = res.data
  133. })
  134. }
  135. function toSharing(){
  136. uni.navigateTo({
  137. url: `/otherPages/workbenchManage/bindUser/sharing`
  138. })
  139. }
  140. onMounted(() => {
  141. baseInfo.value = JSON.parse(uni.getStorageSync("baseInfo"))
  142. getBaseInfo()
  143. })
  144. </script>
  145. <style scoped lang="scss">
  146. @import "index";
  147. </style>