introduction.vue 7.6 KB

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