appPopup.vue 7.2 KB

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