index.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template>
  2. <view class="content">
  3. <image class="logo" :src="detailObj.picture"></image>
  4. <view class="detail-title">
  5. <text style="margin-left: 5%;">{{detailObj.desc}}</text>
  6. <text class="price-style">¥{{detailObj.money}}</text>
  7. </view>
  8. <view class="share-box">
  9. <view>分销商分享给好友,好友购买产品成功后即可获</view>
  10. <view>得分享奖励</view>
  11. <view>单笔最高可赚¥200.00</view>
  12. <view>快去分享吧</view>
  13. <button type="default" open-type="share">分享</button>
  14. </view>
  15. <view class="share-box" style="height: 200upx;margin-top: 2%;" @longpress="copyCode">
  16. <view>长按复制框内整段文字,打开 [手淘] 即可购买</view>
  17. <view>¥kSfsDfrtrEjt¥</view>
  18. <button type="default" @click="copyCode">一键复制</button>
  19. </view>
  20. <view class="product-title">产品详情</view>
  21. <view>
  22. <u-parse :content="detailObj.content"></u-parse>
  23. </view>
  24. <!-- <image class="logo-footer" src="/static/detail-bg2.png"></image> -->
  25. </view>
  26. </template>
  27. <script>
  28. var md5 = require("../../../common/md5.js");
  29. import uParse from '@/components/gaoyia-parse/parse.vue'
  30. export default {
  31. components: {
  32. uParse,
  33. },
  34. data() {
  35. return {
  36. title: 'Hello',
  37. detailObj:{},
  38. }
  39. },
  40. onLoad(option) {
  41. this.getDetailInfo(option.detailId)
  42. },
  43. onShareAppMessage() {
  44. return {
  45. title: '分销小助手',
  46. path:'/pages/index/index?inviteId=' + getApp().globalData.user_id
  47. }
  48. },
  49. methods: {
  50. getDetailInfo(dId){
  51. let that = this;
  52. uni.request({
  53. url: getApp().globalData.shareUrl, //需要设置为全局
  54. method: 'POST',
  55. header: {
  56. 'content-type': 'application/x-www-form-urlencoded'
  57. },
  58. data: {
  59. method: 'getProductsInfo',
  60. timestamp: getApp().globalData.globalTimestamp, //Date.now()
  61. id: dId,
  62. sign: md5('getProductsInfo' + getApp().globalData.globalTimestamp)
  63. },
  64. success: res => {
  65. if (res.data.code === 200) {
  66. that.detailObj = res.data.msg
  67. console.log(res.data.msg)
  68. }
  69. }
  70. });
  71. },
  72. copyCode(){
  73. uni.setClipboardData({
  74. data:'xxx',
  75. success() {
  76. uni.showToast({
  77. icon:'none',
  78. title:'复制成功'
  79. })
  80. }
  81. })
  82. }
  83. }
  84. }
  85. </script>
  86. <style>
  87. .content {
  88. display: flex;
  89. flex-direction: column;
  90. align-items: center;
  91. justify-content: center;
  92. }
  93. .logo {
  94. height: 200px;
  95. width: 100%;
  96. }
  97. .logo-footer {
  98. height: 500px;
  99. width: 100%;
  100. }
  101. .detail-title {
  102. padding: 10px;
  103. margin-bottom: 2%;
  104. width: 100%;
  105. height: 150rpx;
  106. display: flex;
  107. flex-direction: column;
  108. justify-content: space-around;
  109. /* align-items: center; */
  110. background: #fff;
  111. font-size: 30rpx;
  112. }
  113. .price-style {
  114. /* margin-right: 75%; */
  115. margin-left: 4.5%;
  116. color: red;
  117. }
  118. .share-box {
  119. display: flex;
  120. flex-direction: column;
  121. justify-content: center;
  122. align-items: center;
  123. width: 80%;
  124. height: 300upx;
  125. border: 1px dashed red;
  126. background: #fff;
  127. font-size: 28rpx;
  128. padding: 5px;
  129. }
  130. .share-box button {
  131. width: 300rpx;
  132. height: 70rpx;
  133. line-height: 70rpx;
  134. margin-top: 2%;
  135. background-color: #27BCEF;
  136. color: #fff;
  137. }
  138. .title {
  139. font-size: 36upx;
  140. color: #8f8f94;
  141. }
  142. .product-title {
  143. margin-top: 2%;
  144. margin-bottom: 2%;
  145. font-size: 32rpx;
  146. }
  147. </style>