appPopup.vue 6.9 KB

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