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