introduction.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <template>
  2. <view>
  3. <block v-if="detail.urlsType == 0">
  4. <view class="bg-img flex align-center" :style="[{backgroundImage:'url('+ detail.urls +')'}]" style="height: 450upx;"></view>
  5. </block>
  6. <block v-else>
  7. <view class="bg-img flex align-center" :style="[{backgroundImage:'url('+ detail.cover +')'}]" style="height: 450upx;"></view>
  8. </block>
  9. <view class="container" style="margin: -60upx 20upx 20upx 20upx;">
  10. <view class="text-center">
  11. <view class="cu-avatar avatar round" :style="[{backgroundImage:'url('+ detail.loginWebVO.avatar +')'}]"></view>
  12. <view class="padding-tb-xs" style="font-size: 38upx;font-family: PingFang SC;font-weight: 800;color: #222222;">{{detail.personName}}</view>
  13. <view class="flex justify-center align-center">
  14. <view class="padding-right-sm" style="font-size: 30upx;font-family: PingFang SC;font-weight: 800;color: #222222;">{{+detail.hotValue}}</view>
  15. <!-- <view class="tag">
  16. <image src="/static/crown.png" style="width: 22upx;height: 19upx;margin-right: 10upx;"></image>
  17. <view class="text-sm text-white">热力榜第1</view>
  18. </view> -->
  19. </view>
  20. </view>
  21. <view style="padding: 0 60upx;">
  22. <view>{{detail.introduce}}</view>
  23. </view>
  24. <view class="flex justify-around padding">
  25. <button class="theme-bg-color text-white round cu-btn" style="width: 200upx;height: 70upx;" @click="wxShare">转发好友</button>
  26. <button class="theme-bg-color text-white round cu-btn" style="width: 200upx;height: 70upx;" @click="pyqShare">生成海报</button>
  27. </view>
  28. </view>
  29. <view style="width: 10upx;height: 10upx;" class="qrimg-i" v-if="qrCode">
  30. <tki-qrcode
  31. cid="qrcode"
  32. ref="qrcode"
  33. :val="val"
  34. :size="size"
  35. :onval="onval"
  36. :loadMake="loadMake"
  37. :usingComponents="true"
  38. @result="qrR" />
  39. </view>
  40. <view class="container margin-sm" v-if="!$u.test.isEmpty(boostList)">
  41. <block v-for="(item, index) in boostList" :key="index">
  42. <view class="flex align-center justify-between padding-lr-sm">
  43. <view class="flex align-center" style="width: 40%;">
  44. <view class="padding-sm">
  45. <u-avatar :src="item.avatar" size="82"></u-avatar>
  46. </view>
  47. <view class="name">{{item.nickName}}</view>
  48. </view>
  49. <view class="text-sm" style="color: #757575;">{{item.typeSub == 1 ? '打榜' : '打赏'}}</view>
  50. <view class="name padding-right flex justify-end" style="width: 180upx;">{{+item.totalHotValue}}热力值</view>
  51. </view>
  52. </block>
  53. </view>
  54. <view v-else>
  55. <u-empty margin-top="100" text="暂无数据" mode="list"></u-empty>
  56. </view>
  57. <view class="cu-modal" :class="wxShareShow ? 'show' : ''" style="z-index: 9999;">
  58. <view class="cu-dialog">
  59. <view style="height:150px;">
  60. <view style="color: #000000;font-size: 38upx;padding: 40upx;">1. 先点击右上角<text class="text-bold" style="font-size: 38upx;">"···"</text></view>
  61. <view style="color: #000000;font-size: 38upx;padding: 40upx;">2. 选择<text class="text-bold" style="font-size: 38upx;">"{{type}}"</text></view>
  62. </view>
  63. <view class="cu-bar text-green text-lg bg-white">
  64. <view class="action margin-0 flex-sub solid-left" @tap="wxShareShow = false">知道了</view>
  65. </view>
  66. </view>
  67. </view>
  68. <view style="height: 80rpx;" v-if="status">
  69. <u-divider bgColor="#f1f1f1;" height="80">到底了</u-divider>
  70. </view>
  71. <works-poster ref="myCard" :works="works"></works-poster>
  72. </view>
  73. </template>
  74. <script>
  75. import worksPoster from "@/components/works-poster/works-poster.vue";
  76. import { pathToBase64, base64ToPath } from '@/common/utils/index.js'
  77. export default {
  78. components: {worksPoster},
  79. data() {
  80. return {
  81. val: '', // 要生成的二维码值
  82. size: 200, // 二维码大小
  83. //unit: 'upx', // 单位
  84. //icon: '', // 二维码图标
  85. //iconsize: 40, // 二维码图标大小
  86. //lv: 3, // 二维码容错级别 , 一般不用设置,默认就行
  87. onval: false, // val值变化时自动重新生成二维码
  88. loadMake: true, // 组件加载完成后自动生成二维码
  89. src: '' ,// 二维码生成后的图片地址或base64
  90. qrCode: false,
  91. works: {
  92. image: 'https://yyzs.nanyue6688.com/obsfile/9bd6e4bb9e464794a23d7073de826662-图层 1.png',
  93. title: '',
  94. hotValue: '',
  95. rank: '',
  96. avatar: '',
  97. name: '',
  98. qrcode: 'https://yyzs.nanyue6688.com/obsfile/c531395a576b4b1aa7377cdbf62cb088-default.png',
  99. },
  100. productId: '',
  101. detail: {},
  102. boostList: [],
  103. current: 1,
  104. size: 30,
  105. status: false,
  106. wxShareShow: false,
  107. type: '',
  108. }
  109. },
  110. onLoad(options) {
  111. this.productId = options.id;
  112. this.getProductInfo();
  113. this.getHelpRecord();
  114. },
  115. onReachBottom() {
  116. if (this.boostList.length < this.current * this.size) {
  117. this.status = true;
  118. } else {
  119. this.current += 1;
  120. this.getHelpRecord();
  121. }
  122. },
  123. methods: {
  124. getHelpRecord() {
  125. this.$u.api.production.helpRecord({productId: this.productId, current: this.current, size: this.size}).then(res => {
  126. this.boostList = [...this.boostList,...res.records];
  127. })
  128. },
  129. getProductInfo() {
  130. this.$u.api.musicBoost.detail({id: this.productId}).then(res => {
  131. this.detail = res;
  132. this.getActivity(res.activityId);
  133. })
  134. },
  135. getActivity(id) {
  136. this.$u.api.activity.detail({id: id}).then(res => {
  137. let userId = uni.getStorageSync("userId");
  138. if (!this.$u.test.isEmpty(userId)) {
  139. let link = "https://yyzs.nanyue6688.com/vote-h5/index.html#/pages/activityList/activity/musicBoost?id=" + this.productId;
  140. if (link.indexOf("?") != -1) {
  141. link = link + "&agenterId=" + userId
  142. } else {
  143. link = link + "?agenterId=" + userId
  144. }
  145. let obj = {
  146. link,
  147. title: res.shareTitle,
  148. desc: res.shareDesc,
  149. imgUrl: res.shareImg
  150. }
  151. this.$shareConfig(obj, this);
  152. }
  153. })
  154. },
  155. wxShare() {
  156. this.wxShareShow = true;
  157. this.type = "发送给朋友";
  158. },
  159. pyqShare() {
  160. this.qrCode = true;
  161. uni.showLoading({
  162. title: '制作海报中...',
  163. mask: true
  164. })
  165. if (this.detail.urlsType == 1) {
  166. this.works.image = this.detail.cover;
  167. } else {
  168. this.works.image = this.detail.urls;
  169. }
  170. this.works.title = this.detail.title;
  171. this.works.hotValue = +this.detail.hotValue;
  172. this.works.rank = this.detail.rank;
  173. this.works.name = this.detail.personName;
  174. setTimeout(() => {
  175. this.ctx.draw(true,()=>{
  176. uni.hideLoading()
  177. this.$refs.myCard.showCanvas();
  178. })
  179. },800)
  180. },
  181. qrR(res) {
  182. base64ToPath(res).then(res => {
  183. this.works.qrcode = res;
  184. });
  185. },
  186. }
  187. }
  188. </script>
  189. <style>
  190. .container {
  191. background-color: #ffffff;
  192. border-radius: 30upx;
  193. box-shadow: 10upx 10upx 60upx #d0d0d0;
  194. }
  195. .avatar {
  196. width: 145upx;
  197. height: 145upx;
  198. margin-top: -60upx;
  199. }
  200. .tag {
  201. padding: 0 10upx;
  202. display: flex;
  203. align-items: center;
  204. justify-content: center;
  205. background: linear-gradient(90deg, #7355F4 0%, #573BE5 100%);
  206. margin-top: 8upx;
  207. border-radius: 30upx;
  208. }
  209. .name {
  210. font-size: 26upx;
  211. font-family: PingFang SC;
  212. font-weight: bold;
  213. color: #111111;
  214. }
  215. </style>