myActivityDetail.vue 9.3 KB

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