activityDetail.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  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.salePrice}}</text>
  11. </view>
  12. <view class="flex-row" >
  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)}}</text>
  18. <text v-else>长期有效</text>
  19. </view>
  20. </view>
  21. <view class="flex-row">
  22. <view class="activityKey ">
  23. <text>活动门店:</text>
  24. </view>
  25. <view class="activityValue">
  26. <text>{{activity.useStoreDesc}}</text>
  27. </view>
  28. </view>
  29. <view class="flex-row">
  30. <view class="activityKey ">
  31. <text>活动描述:</text>
  32. </view>
  33. <view class="activityValue">
  34. <text>{{activity.description}}</text>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. <!-- <view class="out1">-->
  40. <!-- <view class="flex-col top1">-->
  41. <!-- <view class="flex-row justify-center title">-->
  42. <!-- <text>退款策略(模块标题)</text>-->
  43. <!-- </view>-->
  44. <!-- <view class="flex-row">-->
  45. <!-- <text>-->
  46. <!-- 活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述-->
  47. <!-- </text>-->
  48. <!-- </view>-->
  49. <!-- </view>-->
  50. <!-- </view>-->
  51. <view class="out2" v-if="activity.couponList">
  52. <view class="flex-col ticket">
  53. <view class="flex-row justify-center title">
  54. <text>赠送优惠券</text>
  55. </view>
  56. <view class="flex-row ticketList" v-for="(i,index) in activity.couponList">
  57. <view class="h-text flex-col justify-center ">
  58. <text class="money">{{i.discountsPrice}}</text>
  59. <text class="desc">满{{ i.reachPrice }}可用</text>
  60. </view>
  61. <view class="h-center-content flex-col justify-around">
  62. <view class="h-value">
  63. <text>{{ i.name }}</text>
  64. </view>
  65. <!-- <view class="ticketMsg">-->
  66. <!-- 使用平台:-->
  67. <!-- <text>全平台</text>-->
  68. <!-- </view>-->
  69. <view class="ticketMsg">
  70. 使用次数:{{ i.degree }}
  71. </view>
  72. <view class="ticketMsg">
  73. 领取后{{ i.effectiveDays }}天内有效
  74. </view>
  75. <!-- <view class="ticketMsg flex-row">-->
  76. <!-- <text @click.stop="showRemark(item)">使用规则</text>-->
  77. <!-- <u-icon v-if="item.id == showRemarkId" name="arrow-down-fill" color="" size="12"></u-icon>-->
  78. <!-- <u-icon v-else name="play-right-fill" color="" size="12"></u-icon>-->
  79. <!-- </view>-->
  80. </view>
  81. <view class="h-right-content flex-col justify-center ">
  82. <!-- <view class="btn">-->
  83. <!-- <text>立即领取</text>-->
  84. <!-- </view>-->
  85. </view>
  86. </view>
  87. </view>
  88. <!-- <view class="flex-row justify-between link">-->
  89. <!-- <text>跳转一</text>-->
  90. <!-- <u-icon name="arrow-right" color="" size="12"></u-icon>-->
  91. <!-- </view>-->
  92. <!-- <view class="flex-row justify-between link">-->
  93. <!-- <text>跳转一</text>-->
  94. <!-- <u-icon name="arrow-right" color="" size="12"></u-icon>-->
  95. <!-- </view>-->
  96. </view>
  97. <view class="out2" v-if="activity.equityList">
  98. <view class="flex-col ticket">
  99. <view class="flex-row justify-center title">
  100. <text>赠送权益卡</text>
  101. </view>
  102. <view class="flex-row ticketList" v-for="(i,index) in activity.equityList">
  103. <view class="h-text flex-col justify-center ">
  104. <text class="money">{{i.salePrice}}</text>
  105. <text class="desc">售价</text>
  106. </view>
  107. <view class="h-center-content flex-col justify-around">
  108. <view class="h-value">
  109. <text>{{ i.title }}</text>
  110. </view>
  111. <view class="ticketMsg">
  112. 适用门店:{{ i.useStoreDesc || '' }}
  113. </view>
  114. <view class="ticketMsg">
  115. 领取后{{ i.effectiveDays }}天内有效
  116. </view>
  117. </view>
  118. </view>
  119. </view>
  120. </view>
  121. <view class="out2" v-if="activity.rechargeList">
  122. <view class="flex-col ticket">
  123. <view class="flex-row justify-center title">
  124. <text>赠送储值卡</text>
  125. </view>
  126. <view class="flex-row ticketList" v-for="(i,index) in activity.rechargeList">
  127. <view class="h-text flex-col justify-center ">
  128. <text class="money">{{i.reachPrice}}</text>
  129. <text class="desc">储值额度</text>
  130. </view>
  131. <view class="h-center-content flex-col justify-around">
  132. <view class="h-value">
  133. <text>{{ i.name }}</text>
  134. </view>
  135. <view class="ticketMsg">
  136. 开始时间:{{ i.startTime.split(" ")[0] || '' }}
  137. </view>
  138. <view class="ticketMsg">
  139. 结束时间:{{ i.endTime.split(" ")[0] || '' }}
  140. </view>
  141. </view>
  142. </view>
  143. </view>
  144. </view>
  145. </view>
  146. <view class="flex-row justify-center inBtnView" >
  147. <view class="inBtn" @click="commitOrder" v-if="!isActivityCheck">立即参与</view>
  148. <view class="inBtn" v-else>已参与</view>
  149. </view>
  150. <myPay ref="myPay" :selectBlPay="userInfo.balance *1 >= activity.salePrice *1" :balance="userInfo.balance" :totalAmount="activity.salePrice" :lovePay="false" :blPay="false"
  151. :orderNo="subOrderNo" @payResult="payResult" @improperClose="improperClose"></myPay>
  152. </view>
  153. </template>
  154. <script>
  155. import myPay from '../../components/pay/pay';
  156. export default {
  157. components: {
  158. myPay
  159. },
  160. data() {
  161. return {
  162. userInfo:{},
  163. subOrderNo:'',
  164. id:'',
  165. activity:{},
  166. requestStatus:false,
  167. isActivityCheck:true, //是否参与过该活动
  168. }
  169. },
  170. onLoad(e) {
  171. this.userInfo = uni.getStorageSync('userInfo')
  172. this.id = e.id
  173. console.log('上一个页面传递过来的活动ID',this.id)
  174. this.activityDetail()
  175. this.activityCheck()
  176. },
  177. methods: {
  178. //支付结果回调
  179. payResult(e){
  180. console.log(e)
  181. if(e.payResult){
  182. uni.showToast({
  183. title: '支付成功!'
  184. });
  185. this.isActivityCheck = true
  186. }else {
  187. uni.showToast({
  188. title: '支付失败!',
  189. icon: 'error'
  190. });
  191. }
  192. },
  193. //支付弹窗关闭回调
  194. improperClose(){
  195. },
  196. //提交订单
  197. commitOrder() {
  198. if (this.subOrderNo){
  199. this.$refs.myPay.openPopup()
  200. }else {
  201. if (this.requestStatus) {
  202. return;
  203. }
  204. this.requestStatus = true
  205. uni.showLoading({
  206. title: '加载中'
  207. });
  208. this.$api.commonGeneralOrder({
  209. orderType: 7,
  210. activityId: this.activity.id,
  211. }).then(res => {
  212. console.log('++++++++++++++++++订单提交+++++++++++', res)
  213. uni.hideLoading();
  214. this.subOrderNo = res.data.data.orderNo
  215. this.$refs.myPay.openPopup()
  216. this.requestStatus = false
  217. }).catch(err => {
  218. this.requestStatus = false
  219. })
  220. }
  221. },
  222. activityDetail(){
  223. this.$api.activityDetail({
  224. id:this.id,
  225. }).then(res=>{
  226. console.log(res)
  227. this.activity = res.data.data
  228. this.$set(this.activity)
  229. })
  230. },
  231. activityCheck(){
  232. this.$api.activityCheck({activityId:this.id,}).then(res=>{
  233. console.log(res)
  234. this.isActivityCheck = res.data.data
  235. })
  236. }
  237. }
  238. }
  239. </script>
  240. <style lang="scss" scoped>
  241. @import '/common/css/common.css';
  242. @import './index.rpx.scss';
  243. </style>