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

172 lines
5.4 KiB

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