myActivityDetail.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <template>
  2. <view class="flex-col page">
  3. <view class="flex-col content">
  4. <view class="out1">
  5. <view class="flex-col top">
  6. <view class="flex-row title">
  7. <text>{{ activity.title }}</text>
  8. </view>
  9. <view class="flex-row price">
  10. <text>¥{{ activity.payAmount }}</text>
  11. </view>
  12. <view class="flex-row justify-start">
  13. <view class="activityKey ">
  14. <text>活动时间:</text>
  15. </view>
  16. <view>
  17. <text v-if="activity.valid == 2">{{ activity.validBeginTime.substring(0, 10) }} 至
  18. {{ activity.validEndTime.substring(0, 10) }}
  19. </text>
  20. <text v-else>长期有效</text>
  21. </view>
  22. </view>
  23. <view class="flex-row justify-start">
  24. <view class="activityKey">
  25. <text>活动门店:</text>
  26. </view>
  27. <view class="activityValue">
  28. <text>{{ activity.useStoreDesc }}</text>
  29. </view>
  30. </view>
  31. <view class="flex-row">
  32. <view class="activityKey">
  33. <text>活动描述:</text>
  34. </view>
  35. <view class="activityValue">
  36. <text>{{ activity.description }}</text>
  37. </view>
  38. </view>
  39. </view>
  40. <view v-if="activity.canShare" class="flex-col top">
  41. <button open-type="share" type="primary" plain="true" size="mini" class="pic_r3">
  42. <text class="tit">分享活动</text>
  43. <uni-icons color="#18bc37" type="redo-filled" size="14"></uni-icons>
  44. </button>
  45. </view>
  46. </view>
  47. <view class="out2" v-if="activity.couponList">
  48. <view class="flex-col ticket">
  49. <view class="flex-row justify-center title">
  50. <text>赠送优惠券</text>
  51. </view>
  52. <view class="flex-row ticketList" v-for="(i,index) in activity.couponList">
  53. <view class="h-text flex-col justify-center ">
  54. <text class="money" v-if="i.discountsType == 2">{{ i.discount }}折</text>
  55. <text class="money" v-else>{{ i.discountsPrice }}</text>
  56. <text class="desc">满{{ i.reachPrice }}可用</text>
  57. </view>
  58. <view class="h-center-content flex-col justify-around">
  59. <view class="h-value">
  60. <text>{{ i.name }}</text>
  61. </view>
  62. <!-- <view class="ticketMsg">-->
  63. <!-- 使用平台:-->
  64. <!-- <text>全平台</text>-->
  65. <!-- </view>-->
  66. <view class="ticketMsg">
  67. 可用次数/总次数:{{ i.degree }}/{{ i.totalDegree }}
  68. </view>
  69. <view class="ticketMsg">
  70. 服务项目:{{ i.useServiceDesc }}
  71. </view>
  72. <view class="ticketMsg">
  73. <text v-if="i.validType == 1">领取后{{ i.effectiveDays }}天内有效</text>
  74. <view v-else>
  75. <view>使用期限:{{ i.startTime.substring(0, 10) }} 至 {{ i.endTime.substring(0, 10) }}</view>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. <view class="out2" v-if="activity.equityList">
  83. <view class="flex-col ticket">
  84. <view class="flex-row justify-center title">
  85. <text>赠送权益卡</text>
  86. </view>
  87. <view class="flex-row ticketList" v-for="(i,index) in activity.equityList">
  88. <view class="h-text flex-col justify-center ">
  89. <text class="money">{{ i.faceValue }}</text>
  90. <text class="desc">权益价</text>
  91. </view>
  92. <view class="h-center-content flex-col justify-around">
  93. <view class="h-value">
  94. <text>{{ i.title }}</text>
  95. </view>
  96. <view class="ticketMsg">
  97. 适用门店:{{ i.useStoreDesc || '' }}
  98. </view>
  99. <view class="ticketMsg">
  100. 领取后{{ i.effectiveDays }}天内有效
  101. </view>
  102. </view>
  103. </view>
  104. </view>
  105. </view>
  106. <view class="out2" v-if="activity.rechargeList">
  107. <view class="flex-col ticket">
  108. <view class="flex-row justify-center title">
  109. <text>赠送储值卡</text>
  110. </view>
  111. <view class="flex-row ticketList" v-for="(i,index) in activity.rechargeList">
  112. <view class="h-text flex-col justify-center ">
  113. <text class="money">{{ i.reachPrice }}</text>
  114. <text class="desc">储值额度</text>
  115. </view>
  116. <view class="h-center-content flex-col justify-around">
  117. <view class="h-value">
  118. <text>{{ i.name }}</text>
  119. </view>
  120. </view>
  121. </view>
  122. </view>
  123. </view>
  124. </view>
  125. </view>
  126. </template>
  127. <script>
  128. export default {
  129. components: {},
  130. data() {
  131. return {
  132. userInfo: {},
  133. activityOrderId: '',
  134. activity: {},
  135. facePhotoUrl: '',
  136. }
  137. },
  138. computed: {
  139. isShareAgain() {
  140. return false;
  141. }
  142. },
  143. onLoad(e) {
  144. this.userInfo = uni.getStorageSync('userInfo')
  145. this.activityOrderId = e.activityOrderId
  146. this.myActivityDetail()
  147. },
  148. onShareAppMessage(e) {
  149. //禁止二次转发--
  150. uni.showShareMenu({
  151. withShareTicket: this.isShareAgain
  152. });
  153. wx.updateShareMenu({
  154. isPrivateMessage: this.isShareAgain,
  155. withShareTicket: this.isShareAgain,
  156. success(res) {
  157. console.log('updateShareMenu: ', res);
  158. },
  159. fail() {
  160. }
  161. }); //禁止二次转发--end
  162. console.log(this.activity)
  163. let shareobj = {
  164. title: this.activity.shareContext, //分享的标题
  165. path: '/orderPages/activityDetail/activityDetail?activityId=' + this.activity.activityId + '&inviteUserId=' + this.userInfo.id + '&inviteOrderId=' + this.activity.orderId, //好友点击分享之后跳转的页面
  166. //imageUrl: "https://****.com/banner.jpg", //分享的图片 支持PNG及JPG。显示图片长宽比是 5:4。
  167. imageUrl: this.facePhotoUrl, //内容图片
  168. }
  169. return shareobj //一定要返回对象
  170. },
  171. methods: {
  172. // 获取图片
  173. getImgUrlByBannerOssId(items) {
  174. this.$api.getImgUrlByOssId({ossId: items}).then(res => {
  175. this.facePhotoUrl = res.data.data[0].url.replace(/^http:/, "https:")
  176. })
  177. },
  178. myActivityDetail() {
  179. this.$api.myActivityDetail({
  180. activityOrderId: this.activityOrderId,
  181. }).then(res => {
  182. console.log(res)
  183. this.activity = res.data.data
  184. this.$set(this.activity)
  185. this.getImgUrlByBannerOssId(res.data.data.sharePicture)
  186. })
  187. },
  188. }
  189. }
  190. </script>
  191. <style lang="scss" scoped>
  192. @import '/common/css/common.css';
  193. @import './index.rpx.scss';
  194. </style>