猫妈狗爸伴宠师小程序前端代码
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.

168 lines
5.1 KiB

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