integralConfirm.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. <template>
  2. <view class="box">
  3. <view class="topTis">
  4. <view class="tanhao">!</view>
  5. <view class="topTisTxt">提交申请后请到店兑换</view>
  6. </view>
  7. <view class="cont">
  8. <view class="contTitle">商品明细</view>
  9. <view class="goodsCont">
  10. <img :src="jfgoodsDetail.imgList[0].img" alt="" class="goodsImg" v-if="jfgoodsDetail.imgList.length>0">
  11. <image src="../../static/timg/noimg.png" class="goodsImg" v-else></image>
  12. <view class="goodsRight">
  13. <view class="goodsName">{{jfgoodsDetail.name}}</view>
  14. <view class="goodsNumbox">
  15. <view class="Price" v-if="jfgoodsDetail.salePrice">¥<span>{{jfgoodsDetail.salePrice}}</span> </view>
  16. <view class="goodsNum">x{{goodsnum}}</view>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="shopCont">
  22. <view class="shopLeft">服务门店</view>
  23. <view class="shopName">{{shopName}}</view>
  24. </view>
  25. <view class="buybtnBox">
  26. <view class="ktyong"><view>合计 <span class="ktyong1">{{goodsnum*jfgoodsDetail.integral}}</span><span class="ktyong2">积分</span> </view>
  27. <view class="kyNum">可用积分:{{avaIntegral}}</view>
  28. </view>
  29. <view class="bottomBtn" :style="{background:'#'+themeColor}" @click="goBuy">提交订单</view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. export default {
  35. data() {
  36. return {
  37. shopId:'',
  38. shopName:'',
  39. avaIntegral:'',
  40. goodsnum:'',
  41. jfgoodsDetail:'',
  42. themeColor:'',
  43. }
  44. },
  45. onLoad(opt) {
  46. this.jfgoodsDetail=uni.getStorageSync("jfgoodsDetail");
  47. this.shopName=opt.shopName;
  48. this.shopId=opt.shopID;
  49. this.avaIntegral=opt.avaIntegral;
  50. this.goodsnum=opt.goodsnum;
  51. this.themeColor = uni.getStorageSync("themeColor");
  52. },
  53. methods: {
  54. goDetail(){
  55. uni.navigateTo({
  56. url:'integralgoodsDetail'
  57. })
  58. },
  59. goBuy(){
  60. uni.showLoading({
  61. title: '加载中'
  62. })
  63. this.$http('openIntegralMall/exchangeApply', {
  64. shopId:this.shopId,
  65. goodsID:this.jfgoodsDetail.id,
  66. qty:this.goodsnum
  67. },'POST').then(res => {
  68. uni.hideLoading();
  69. if(res.code==0){
  70. this.orderData=res.data
  71. // uni.showToast({
  72. // title: '兑换成功',
  73. // icon: 'none',
  74. // duration: 3000
  75. // });
  76. var that = this
  77. uni.showModal({
  78. title: '提示',
  79. content: '提交成功',
  80. cancelText:'回到首页',
  81. confirmText:'查看订单',
  82. success: function (res2) {
  83. if (res2.confirm) {
  84. uni.redirectTo({
  85. url:'recordDetail?id='+res.data
  86. })
  87. } else if (res2.cancel) {
  88. uni.switchTab({
  89. url:'../index/index'
  90. })
  91. }
  92. }
  93. });
  94. }else{
  95. uni.showToast({
  96. title: res.msg,
  97. icon: 'none',
  98. duration: 3000
  99. });
  100. }
  101. })
  102. }
  103. }
  104. }
  105. </script>
  106. <style scoped>
  107. .box{
  108. background: #F4F5F7;
  109. min-height: 100vh;
  110. }
  111. .tanhao{
  112. width: 30rpx;
  113. height: 30rpx;
  114. background: #F19D01;
  115. border-radius: 50%;
  116. text-align: center;
  117. line-height: 30rpx;
  118. color: #ffffff;
  119. font-size: 30rpx;
  120. }
  121. .topTis{
  122. padding: 20rpx 21rpx;
  123. background: #FDF5E5;
  124. display: flex;
  125. }
  126. .topTisTxt{
  127. color: #F19D01;font-size: 26rpx;line-height: 30rpx;padding-left: 10rpx;
  128. }
  129. .cont{
  130. width: 702rpx;
  131. background: #FFFFFF;
  132. border-radius: 10rpx;
  133. margin-left: 24rpx;
  134. margin-top: 20rpx;
  135. }
  136. .contTitle{
  137. font-size: 30rpx;
  138. font-family: PingFangSC-Medium, PingFang SC;
  139. font-weight: 500;
  140. color: #3C3C3C;
  141. line-height: 42rpx;
  142. padding: 26rpx 20rpx;
  143. border-bottom: 1px solid #EEEEEE;
  144. }
  145. .goodsImg{
  146. width: 120rpx;
  147. height: 120rpx;
  148. }
  149. .goodsCont{
  150. display: flex;
  151. padding: 30rpx 20rpx;
  152. }
  153. .goodsRight{
  154. width: 522rpx;
  155. padding-left: 20rpx;
  156. display: flex;
  157. flex-direction: column;
  158. justify-content: space-between;
  159. }
  160. .goodsName{
  161. color: #3C3C3C;font-size: 26rpx;
  162. }
  163. .goodsNumbox{
  164. display: flex;
  165. justify-content: space-between;
  166. }
  167. .Price{
  168. color: #3C3C3C;font-size: 22rpx;
  169. }
  170. .Price span{
  171. font-weight: 500;
  172. color: #3C3C3C;
  173. font-size: 32rpx;
  174. }
  175. .goodsNum{
  176. color: #999999;font-size: 24rpx;padding-top: 5rpx;
  177. }
  178. .buybtnBox{
  179. width: 750rpx;
  180. height: 120rpx;
  181. background: #FFFFFF;
  182. box-shadow: 0px -2px 10px 0px rgba(153,153,153,0.2000);
  183. display: flex;
  184. justify-content: space-between;
  185. position: fixed;
  186. left: 0;
  187. bottom: 0;
  188. padding-bottom: env(safe-area-inset-bottom);
  189. }
  190. .ktyong{
  191. font-weight: 500;
  192. color: #666666;
  193. font-size: 24rpx;
  194. padding-left: 30rpx;
  195. padding-top: 18rpx;
  196. } .ktyong1{
  197. color: #FF0000;
  198. font-size: 32rpx;
  199. }
  200. .ktyong2{
  201. color: #FF0000;
  202. font-size: 24rpx;
  203. }
  204. .kyNum{
  205. color: #999999;
  206. font-size: 24rpx;
  207. }
  208. .bottomBtn{
  209. width: 204rpx;
  210. height: 74rpx;
  211. background: #D53533;
  212. border-radius: 37rpx;
  213. line-height: 74rpx;
  214. text-align: center;
  215. color: #FFFFFF;
  216. font-size: 30rpx;
  217. margin-top: 23rpx;
  218. margin-left: 70rpx;
  219. margin-right: 30rpx;
  220. }
  221. .shopCont{
  222. background: #FEFFFE;
  223. border-radius: 10rpx;
  224. width: 702rpx;
  225. padding: 30rpx 0;
  226. margin-top: 20rpx;
  227. margin-left: 24rpx;
  228. display: flex;
  229. justify-content: space-between;
  230. }
  231. .shopLeft{
  232. color: #666666;
  233. font-size: 28rpx;
  234. padding-left: 20rpx;
  235. }
  236. .shopName{
  237. color: #333333;font-size: 28rpx;
  238. padding-right: 20rpx;
  239. }
  240. </style>