appPopup.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. <template>
  2. <!-- 礼品弹窗 -->
  3. <uni-popup ref="appPopup" type="center" :is-mask-click="false">
  4. <view class="appPopup-mask">
  5. <image class="tipimg" src="https://cos.his.cdwjyyh.com/fs/20250909/d5736027b6ac4255bfa2415cf400969c.png"></image>
  6. <image class="close_icon" src="https://cos.his.cdwjyyh.com/fs/20250909/c8a5a9f34e5a4bd786f9fd2a380508dd.png" mode="aspectFill" @click="closePop"></image>
  7. <view class="appPopup-box">
  8. <view class="appPopup-title">恭喜你,<text style="color: #FF5C03;">回答正确</text></view>
  9. <view>百种好礼等你兑换</view>
  10. <view class="goodslist">
  11. <view class="goodsitem" v-for="(item,index) in products" :key="index" @click="handleItem(item,index)">
  12. <image class="bg" src="https://cos.his.cdwjyyh.com/fs/20250909/13630e9a4a054fa487e5c50b7d5ab1d2.png" mode="widthFix"></image>
  13. <image class="img" :src="item.imageUrl" mode="aspectFill"></image>
  14. <view class="goodsitem-name ellipsis">{{item.productName}}</view>
  15. <view class="goodsitem-integral">
  16. <text class="goodsitem-integral-num">{{item.requiredPoints}}</text>
  17. <text>芳华币</text>
  18. </view>
  19. <view class="goodsitem-price">原价{{item.otPrice&&item.otPrice.toFixed(2)}}元</view>
  20. </view>
  21. </view>
  22. <view class="changebtn" @click="getInfo">换一批</view>
  23. <view class="progress">
  24. <text>奖品兑换进度</text><text class="num">{{goodsInfo.exchangeProgress || 0}}%</text>
  25. <progress style="margin-top: 30rpx;" active-color="#FAA97F" backgroundColor="#F5F7FA" border-radius="12" :percent="goodsInfo.exchangeProgress" stroke-width="12"></progress>
  26. </view>
  27. <view class="my-integral">我的芳华币:<text>{{goodsInfo.currentPoints || 0}}</text> </view>
  28. <view class="x-bc" style="padding: 0 24rpx;">
  29. <view class="appPopup-btn" style="margin-right: 12px;" @click="navTo('/pages_user/user/storeOrder?status=0')">查看芳华币订单</view>
  30. <view class="appPopup-btn" @click="navTo('/pages/shopping/productList?cateId=320&pid=321&isCourse=1')">去兑换</view>
  31. </view>
  32. <!-- <view class="appPopup-tips">放弃芳华币,领取红包></view> -->
  33. </view>
  34. </view>
  35. </uni-popup>
  36. </template>
  37. <script>
  38. import { getCourseIntegralGoods } from "@/api/course.js"
  39. export default {
  40. data() {
  41. return {
  42. goodsInfo: {},
  43. products: []
  44. }
  45. },
  46. methods: {
  47. openPop() {
  48. this.$refs.appPopup.open("center")
  49. this.getInfo()
  50. },
  51. closePop() {
  52. this.$refs.appPopup.close()
  53. },
  54. navTo(url) {
  55. uni.navigateTo({
  56. url: url
  57. })
  58. // this.postMessage({
  59. // isFullscreen: false,
  60. // login: 1,
  61. // productId: '',
  62. // pagesUrl:'/pages/user/integral/integralGoodsList'
  63. // })
  64. },
  65. //app礼品列表
  66. getInfo() {
  67. uni.showLoading({
  68. title: '加载中'
  69. })
  70. getCourseIntegralGoods().then(res=>{
  71. uni.hideLoading()
  72. if(res.code == 200) {
  73. this.goodsInfo = res.data
  74. this.products = res.data && res.data.products? res.data.products:[]
  75. } else {
  76. uni.showToast({
  77. title: res.msg,
  78. icon: 'none'
  79. })
  80. }
  81. }).catch(()=>{
  82. uni.hideLoading()
  83. })
  84. },
  85. postMessage(data) {
  86. this.uniReady(() => {
  87. uni.webView.postMessage({
  88. data: data
  89. });
  90. })
  91. },
  92. uniReady(callback) {
  93. if (uni.webView) {
  94. callback()
  95. } else {
  96. document.addEventListener('UniAppJSBridgeReady', callback, { once: true })
  97. }
  98. },
  99. handleItem(item,index) {
  100. uni.navigateTo({
  101. url: '/pages/shopping/productList?cateId=320&pid=321&isCourse=1'
  102. })
  103. // this.postMessage({
  104. // isFullscreen: false,
  105. // login: 1,
  106. // productId: item.productId,
  107. // pagesUrl:''
  108. // })
  109. }
  110. }
  111. }
  112. </script>
  113. <style scoped lang="scss">
  114. @mixin u-flex($flexD, $alignI, $justifyC) {
  115. display: flex;
  116. flex-direction: $flexD;
  117. align-items: $alignI;
  118. justify-content: $justifyC;
  119. }
  120. .num {
  121. margin-left: 12rpx;
  122. font-family: DINPro, DINPro;
  123. font-size: 40rpx;
  124. }
  125. .appPopup-mask {
  126. margin-top: -88rpx;
  127. width: 670rpx;
  128. @include u-flex(column, center, center);
  129. .tipimg {
  130. height: 206rpx;
  131. width: 206rpx;
  132. z-index: 99;
  133. }
  134. .close_icon {
  135. height: 48rpx;
  136. width: 48rpx;
  137. position: absolute;
  138. top: 34rpx;
  139. right: 20rpx;
  140. }
  141. .appPopup-box {
  142. width: 670rpx;
  143. padding-bottom: 32rpx;
  144. background: linear-gradient( 180deg, #FFEBBD 0%, #FFFFFF 9%, #FFFFFF 100%);
  145. border-radius: 32rpx 32rpx 32rpx 32rpx;
  146. overflow: hidden;
  147. margin-top: -103rpx;
  148. padding-top: 103rpx;
  149. box-sizing: border-box;
  150. font-family: PingFang SC;
  151. font-weight: 400;
  152. font-size: 28rpx;
  153. color: #757575;
  154. text-align: center;
  155. }
  156. .appPopup-title {
  157. margin-bottom: 10rpx;
  158. font-family: PingFang SC;
  159. font-weight: 600;
  160. font-size: 40rpx;
  161. color: #222222;
  162. }
  163. }
  164. .goodslist {
  165. margin-top: 58rpx;
  166. padding: 24rpx 10rpx;
  167. @include u-flex(row, center, space-evenly);
  168. }
  169. .bg {
  170. width: 100%;
  171. height: 100%;
  172. position: absolute;
  173. bottom: 0;
  174. left: 0;
  175. z-index: -1;
  176. }
  177. .goodsitem {
  178. flex: 1;
  179. max-width: 200rpx;
  180. min-height: 124rpx;
  181. border-radius: 10rpx;
  182. @include u-flex(column, center, flex-start);
  183. font-family: PingFang SC;
  184. font-weight: 400;
  185. font-size: 22rpx;
  186. color: #999999;
  187. position: relative;
  188. z-index: 2;
  189. .img {
  190. width: 153rpx;
  191. height: 126rpx;
  192. margin-top: -44rpx;
  193. border-radius: 10rpx;
  194. }
  195. &-name {
  196. width: 100%;
  197. padding: 8rpx 14rpx;
  198. text-align: center;
  199. font-family: PingFang SC;
  200. font-weight: 500;
  201. font-size: 24rpx;
  202. color: #222222;
  203. box-sizing: border-box;
  204. }
  205. &-integral {
  206. min-width: 80%;
  207. padding-bottom: 16rpx;
  208. box-sizing: border-box;
  209. font-family: PingFang SC;
  210. font-weight: 400;
  211. font-size: 22rpx;
  212. color: #FF5C03;
  213. border-bottom: 2px #999999 dotted;
  214. &-num {
  215. font-family: DINPro, DINPro;
  216. font-weight: 500;
  217. font-size: 36rpx;
  218. }
  219. }
  220. &-price {
  221. padding: 10rpx 0;
  222. }
  223. }
  224. .appPopup-btn {
  225. width: 560rpx;
  226. height: 84rpx;
  227. margin: 0 auto;
  228. background: #FF5C03;
  229. border-radius: 42rpx 42rpx 42rpx 42rpx;
  230. @include u-flex(row, center, center);
  231. font-family: PingFang SC;
  232. font-weight: 500;
  233. font-size: 32rpx;
  234. color: #FFFFFF;
  235. }
  236. .changebtn {
  237. width: 152rpx;
  238. height: 64rpx;
  239. margin: 0 auto;
  240. border-radius: 32rpx 32rpx 32rpx 32rpx;
  241. border: 1rpx solid #FF5C03;
  242. @include u-flex(row, center, center);
  243. font-family: PingFang SC;
  244. font-weight: 400;
  245. font-size: 24rpx;
  246. color: #FF5C03;
  247. }
  248. .progress {
  249. padding: 0 90rpx;
  250. margin-top: 40rpx;
  251. font-family: PingFang SC;
  252. font-weight: 500;
  253. font-size: 32rpx;
  254. color: #222222;
  255. }
  256. ::v-deep {
  257. .uni-progress-bar, .uni-progress-inner-bar {
  258. border-radius: 6px;
  259. }
  260. }
  261. .my-integral {
  262. margin: 32rpx 0;
  263. font-family: PingFang SC;
  264. font-weight: 400;
  265. font-size: 28rpx;
  266. color: #222222;
  267. text {
  268. color: #FF5C03;
  269. }
  270. }
  271. .appPopup-tips {
  272. margin-top: 32rpx;
  273. }
  274. </style>