appPopup.vue 6.8 KB

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