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

203 lines
4.4 KiB

3 months ago
2 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
  1. <template>
  2. <view class="box w-100 h100">
  3. <view class="header-info">
  4. <view class="base flex-rowl">
  5. <up-image width="120rpx" height="120rpx" :src="state.baseInfo.upgrade_image" shape="circle"></up-image>
  6. <view class="flex-colt">
  7. <view class="size-32 mb16">
  8. {{state.baseInfo.info.userName}}
  9. </view>
  10. <view class="title size-22 color-fff">
  11. {{state.baseInfo.partner_level}}
  12. </view>
  13. <view class="color-a55 size-24 mt16" v-html="state.baseInfo.level_details">
  14. </view>
  15. </view>
  16. </view>
  17. <view class="tips flex-between">
  18. <view class="flex-between tips-item">
  19. <view class="flex-colc item">
  20. <view class="size-30 color-a55 fw700">
  21. 推广攻略
  22. </view>
  23. <view class="size-22 color-a55 mt20">
  24. 快速定位宠友群体
  25. </view>
  26. </view>
  27. <image :src="configList.icon_popularize_strategy.paramValueImage" mode=""></image>
  28. </view>
  29. <view class="flex-between tips-item">
  30. <view class="flex-colc item">
  31. <view class="size-30 color-a55 fw700">
  32. 推广教程
  33. </view>
  34. <view class="size-22 color-a55 mt20">
  35. 快速定位宠友群体
  36. </view>
  37. </view>
  38. <image :src="configList.icon_popularize_tutorial.paramValueImage" mode=""></image>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="cards bg-fff">
  43. <YCard :data="state.code" @emitCopy="copyCode" />
  44. <YCard :data="cardData1" @emitShare="shareHandle" @savePoster="savePoster" />
  45. <YCard :data="cardData2" @emitCopy="copyCode" />
  46. </view>
  47. </view>
  48. </template>
  49. <script setup>
  50. import {
  51. binBaseInfo,
  52. bindCode
  53. } from "@/api/home.js"
  54. import {
  55. onMounted,
  56. reactive,
  57. ref,
  58. computed,
  59. } from "vue"
  60. import { useStore } from 'vuex'
  61. import YCard from "../components/y-card.vue"
  62. const shareRef = ref('share')
  63. const store = useStore()
  64. const configList = computed(() => {
  65. return store.getters.configList
  66. })
  67. const cardData = {
  68. methodNum: "方法一",
  69. title: "邀请码邀请",
  70. des: "用户输入邀请码,直接完成绑定。",
  71. inputBg: "#FDD6CE",
  72. titleColour: "#BC796C",
  73. copy: true,
  74. bgUrl: '/static/images/levelImage/bg1.png',
  75. code: 'jsk6623'
  76. }
  77. const cardData1 = {
  78. methodNum: "方法二",
  79. title: "分享海报邀请码",
  80. des: "扫码进去猫妈狗爸完成绑定",
  81. titleColour: "#5D81A4",
  82. copy: false,
  83. bgUrl: '/static/images/levelImage/bg2.png'
  84. }
  85. const cardData2 = {
  86. methodNum: "方法三",
  87. title: "分享链接邀请码",
  88. des: "复制链接给好友,进入直接绑定。",
  89. inputBg: "#FDD69A",
  90. titleColour: "#B36F3C",
  91. copy: true,
  92. bgUrl: '/static/images/levelImage/bg3.png',
  93. code: 'https://fanyi.baidu.com/mtpe-individual/multimodal?query=%E6%94%BB%E7%95%A5%0A&lang=zh2en&ext_channel=Aldtype'
  94. }
  95. const state = reactive({
  96. info: {},
  97. baseInfo: {},
  98. code: {},
  99. posterUrl: ""
  100. })
  101. onMounted(() => {
  102. const info = uni.getStorageSync("baseInfo")
  103. if (info) {
  104. const baseInfo = JSON.parse(info)
  105. state.info = baseInfo
  106. }
  107. getBaseInfo()
  108. })
  109. // 获取基本信息
  110. const getBaseInfo = () => {
  111. binBaseInfo(state.info.userId).then(res => {
  112. state.baseInfo = res.data
  113. })
  114. bindCode(state.info.userId).then(res => {
  115. state.code = {
  116. ...cardData,
  117. code: res.data.code
  118. }
  119. state.posterUrl = res.data.url
  120. })
  121. }
  122. // 保存海报
  123. const savePoster = () => {
  124. uni.navigateTo({
  125. url: "/otherPages/binding/share/index?url=" + state.posterUrl
  126. })
  127. }
  128. const copyCode = (v) => {
  129. console.log(v, "ppp");
  130. }
  131. const shareHandle = () => {
  132. console.log("分享海报");
  133. }
  134. </script>
  135. <style scoped lang="scss">
  136. .box {
  137. background: linear-gradient(180deg, #ffbf60, #f3b962 50%, #ffe6bf);
  138. .header-info {
  139. padding: 23rpx 36rpx;
  140. .base {
  141. image {
  142. width: 139rpx;
  143. height: 139rpx;
  144. background-color: red;
  145. border-radius: 50%;
  146. margin-right: 20rpx;
  147. }
  148. }
  149. .title {
  150. border: 4rpx solid #fff;
  151. border-radius: 30rpx;
  152. padding: 0 10rpx;
  153. background-color: #FFA848;
  154. }
  155. .tips {
  156. margin-top: 45rpx;
  157. .tips-item {
  158. width: 309rpx;
  159. background-color: #FFF4E6;
  160. border-radius: 16rpx;
  161. padding: 12rpx 0;
  162. .item {
  163. width: 176rpx;
  164. padding-left: 17rpx;
  165. }
  166. }
  167. image {
  168. width: 72rpx;
  169. height: 78rpx;
  170. margin: 0 30rpx 0 0;
  171. // background-color: red;
  172. }
  173. }
  174. }
  175. .cards {
  176. border-radius: 16rpx;
  177. width: 750rpx;
  178. padding: 26rpx 33rpx;
  179. height: 100vh;
  180. }
  181. }
  182. </style>