myActivityDetail.vue 8.8 KB

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