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

173 lines
5.5 KiB

7 months ago
3 months ago
3 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
  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. <!-- background_popularize_three -->
  81. <view class="bind-main-three"
  82. :style="{'background-image' : `url('${configList.background_popularize_two.paramValueImage}')`}">
  83. <view class="mb20 font32">分享链接邀请</view>
  84. <view class="mb20">复制链接给好友进入直接绑定</view>
  85. <up-input disabled v-model="dataF.invitation_url">
  86. <template #suffix>
  87. <up-button @click="copyMessage(dataF.invitation_url)" text="复制" type="success" size="small" shape="circle"></up-button>
  88. </template>
  89. </up-input>
  90. </view>
  91. </view>
  92. <configPopup ref="configPopupRef" />
  93. </view>
  94. </template>
  95. <script setup>
  96. import {
  97. computed,
  98. ref,
  99. onMounted,
  100. } from "vue";
  101. import {
  102. useStore
  103. } from "vuex"
  104. import {
  105. binBaseInfo,
  106. bindCode,
  107. } from "@/api/home.js"
  108. import configPopup from '@/components/configPopup.vue'
  109. const store = useStore();
  110. const dataF = ref({})
  111. const baseInfo = ref({})
  112. const configPopupRef = ref(null)
  113. const configList = computed(() => {
  114. return store.getters.configList
  115. })
  116. const userInfo = computed(() => {
  117. return store.getters.userInfo
  118. })
  119. //复制
  120. const copyMessage = (value) => {
  121. uni.setClipboardData({
  122. data: value,
  123. success: function(res) {
  124. uni.getClipboardData({
  125. success: function(res) {
  126. uni.showToast({
  127. icon: 'none',
  128. title: "复制成功",
  129. });
  130. },
  131. });
  132. },
  133. });
  134. }
  135. const getBaseInfo = () => {
  136. binBaseInfo(baseInfo.value.userId).then(res => {
  137. baseInfo.value = res.data
  138. })
  139. bindCode(baseInfo.value.userId).then(res => {
  140. dataF.value = res.data
  141. })
  142. }
  143. function toSharing(){
  144. uni.navigateTo({
  145. url: `/otherPages/workbenchManage/bindUser/sharing`
  146. })
  147. }
  148. onMounted(() => {
  149. baseInfo.value = JSON.parse(uni.getStorageSync("baseInfo"))
  150. getBaseInfo()
  151. })
  152. </script>
  153. <style scoped lang="scss">
  154. @import "index";
  155. </style>