orderConfirm.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <view>
  3. <view class="container flex align-center justify-between" @click="navTap">
  4. <view class="flex padding align-center">
  5. <image src="/static/address.png" style="width: 65upx;height: 65upx;"></image>
  6. <view class="padding-left text-sm" v-if="!$u.test.isEmpty(address)">
  7. <view style="font-size: 28upx;font-family: PingFang SC;font-weight: 800;color: #000000;">{{address.consignee}} {{address.phone}}</view>
  8. <view class="text-gray">{{address.area}} {{address.detail}}</view>
  9. </view>
  10. <view class="padding-left" style="font-size: 28upx;font-family: PingFang SC;font-weight: 800;color: #000000;" v-else>请选择收货地址</view>
  11. </view>
  12. <view class="padding">
  13. <u-icon name="arrow-right" color="#d4d4d4"></u-icon>
  14. </view>
  15. </view>
  16. <block v-for="(item, index) in giftList" :key="index">
  17. <view class="card">
  18. <view class="padding">
  19. <view class="flex margin-top-xs">
  20. <image :src="item.goodsPic" style="width: 220upx;height: 220upx;"></image>
  21. <view class="padding-left-sm">
  22. <view class="name text-cut" style="width: 350upx;">{{item.goodsName}}</view>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="flex justify-end padding" style="margin-top: -120upx;">
  27. <view class="count">x{{item.count}}</view>
  28. </view>
  29. </view>
  30. </block>
  31. <view style="height: 120upx;"></view>
  32. <view class="notice text-sm">
  33. 提示:该礼包运费需要用户自行承担
  34. </view>
  35. <view class="footer-fixed flex justify-between align-center padding-sm bg-white">
  36. <view></view>
  37. <button class="cu-btn round text-white theme-bg-color" style="width: 180upx;height: 80upx;" @click="dialog">领取</button>
  38. </view>
  39. <u-popup v-model="dialogShow" mode="center" width="500" height="480" border-radius="30">
  40. <view class="bg-img text-center" style="background-image: url('https://upload-file-data.obs.cn-south-1.myhuaweicloud.com/e914f556be414767aca011a30961560a-dialogBgImg.png');height: 600rpx;">
  41. <view style="height: 80upx;"></view>
  42. <view style="font-size: 50upx;font-family: PingFang SC;font-weight: 600;color: #ffffff;">恭喜你</view>
  43. <view class="text-bold text-black" style="padding: 80upx 0;">领取成功!请等待卖家发货</view>
  44. <view class="padding">
  45. <u-button class="custom-style" shape="circle" @click="onConfirm">确定</u-button>
  46. </view>
  47. </view>
  48. </u-popup>
  49. </view>
  50. </template>
  51. <script>
  52. export default {
  53. data() {
  54. return {
  55. userId:'',
  56. dialogShow: false,
  57. writeAddress: false,
  58. //我的地址
  59. address:{},
  60. count: 0,
  61. giftList: [],
  62. }
  63. },
  64. onLoad(options) {
  65. this.giftList=JSON.parse(options.goods)
  66. this.userId=this.giftList[0].userId
  67. this.getAddress()
  68. },
  69. onShow() {
  70. this.getAddress()
  71. },
  72. methods: {
  73. getAddress(){
  74. this.$u.api.user.userAddress({userId:this.userId}).then(res=>{
  75. this.address=res.records[0]
  76. })
  77. },
  78. dialog() {
  79. this.giftList.forEach(item=>{
  80. item.addressId=this.address.id
  81. })
  82. this.$u.api.goods.obtain(this.giftList).then(res=>{
  83. this.dialogShow=true
  84. })
  85. },
  86. onConfirm() {
  87. this.dialogShow = false;
  88. uni.navigateBack({
  89. delta:1
  90. })
  91. },
  92. navTap() {
  93. uni.navigateTo({
  94. url: "/pages/activityList/mine/order/address?userId="+this.userId
  95. })
  96. }
  97. }
  98. }
  99. </script>
  100. <style lang="scss" scoped>
  101. .card {
  102. margin: 20upx;
  103. border-radius: 16upx;
  104. background-color: #FFFFFF;
  105. .title {
  106. font-size: 28upx;
  107. font-family: PingFang SC;
  108. font-weight: 800;
  109. color: #222222;
  110. }
  111. .name {
  112. font-size: 26upx;
  113. font-family: PingFang SC;
  114. font-weight: 800;
  115. color: #222222;
  116. }
  117. .specification {
  118. padding-top: 30upx;
  119. font-size: 24upx;
  120. font-family: PingFang SC;
  121. font-weight: bold;
  122. color: #959595;
  123. }
  124. .count {
  125. width: 60upx;
  126. height: 60upx;
  127. border: #d9d9d9 1upx solid;
  128. border-radius: 16upx;
  129. display: flex;
  130. align-items: center;
  131. justify-content: center;
  132. }
  133. }
  134. .container {
  135. background-color: #ffffff;
  136. border-radius: 16upx;
  137. margin: 20upx;
  138. }
  139. .notice {
  140. position: fixed;
  141. width: 100%;
  142. z-index: 10000;
  143. bottom: 120upx;
  144. left: 0;
  145. line-height: 80upx;
  146. text-align: center;
  147. background-color: #fdedee;
  148. color: #ff0000;
  149. }
  150. .custom-style {
  151. background-color: #5b3ee7;
  152. width: 250upx;
  153. color: #ffffff;
  154. }
  155. </style>