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

170 lines
5.3 KiB

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