时空网前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

193 lines
5.5 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. <template>
  2. <view>
  3. <!-- <mescroll-body ref="mescrollRef" @down="downCallback" :down="downOpt" style="min-height: 645px;"> -->
  4. <!-- 商品信息 -->
  5. <self-line/>
  6. <view class="bg-white padding-tb-sm">
  7. <skeleton :loading="skeletonLoading" :row="2" :showAvatar="false" :showTitle="true">
  8. <view class="flex justify-between align-start padding-top-sm padding-lr">
  9. <image v-if="orderDetails.goods.cover" :src="orderDetails.goods.cover" mode="aspectFill" style="width: 150rpx; height: 150rpx;"></image>
  10. <view class="flex-sub padding-left-sm">
  11. <view class="bref-box margin-top-xs">
  12. {{orderDetails.goods.name}}
  13. </view>
  14. <view class="flex justify-between">
  15. <text class="block margin-top-sm text-gray text-sm">数量</text>
  16. <view class="flex align-center margin-top-sm">
  17. <text class="cuIcon-move" @tap="reduce"></text>
  18. <input type="number" v-model="num" class="text-center margin-lr-sm radius" style="width: 60rpx; height: 50rpx;background-color: #f7f7fb;" />
  19. <text class="cuIcon-add" @tap="add"></text>
  20. </view>
  21. </view>
  22. <view class="flex justify-between margin-top-sm">
  23. <view class="text-red text-price text-lg">
  24. <amount :value="Number(orderDetails.goods.specs[0].selling_price || 0)" :is-round-up="false" :precision="2" :duration="800" transition></amount>
  25. </view>
  26. <!-- <view>
  27. <button v-if="true" class="cu-btn line-orange round margin-left-sm text-sm">申请退款</button>
  28. <button v-else class="cu-btn line-gray bg-gray round margin-left-sm text-sm">退款中</button>
  29. </view> -->
  30. </view>
  31. </view>
  32. </view>
  33. </skeleton>
  34. </view>
  35. <self-line/>
  36. <skeleton :loading="skeletonLoading" :row="1" :showAvatar="false" :showTitle="true">
  37. <view class="bg-white">
  38. <view class="cu-bar padding-lr solid-bottom">
  39. <text class="text-gray">优惠</text>
  40. <text>暂无优惠</text>
  41. </view>
  42. </view>
  43. </skeleton>
  44. <self-line/>
  45. <!-- </mescroll-body> -->
  46. <skeleton :loading="skeletonLoading" :row="13" :showAvatar="false" :showTitle="true">
  47. <view class="btn-bottom">
  48. <view class="padding flex justify-around align-center" v-if="orderDetails.agreement.tips">
  49. <checkbox-group class="block" @change="CheckboxChange">
  50. <view class="margin-right">
  51. <checkbox @change="CheckboxChange" :class="checkbox[0].checked?'checked':''" :checked="checkbox[0].checked?true:false" value="A"></checkbox>
  52. </view>
  53. </checkbox-group>
  54. <view class="text-sm text-gray">{{orderDetails.agreement.tips}}</view>
  55. </view>
  56. <self-line/>
  57. <view class="padding-lr padding-tb-sm bg-white flex justify-between align-center solid-top shadow">
  58. <view class="flex align-center">
  59. <text class="">应付款</text>
  60. <view class="text-lg text-price text-red">
  61. <amount :value="Number(orderDetails.goods.specs[0].selling_price*num || 0)" :is-round-up="false" :precision="2" :duration="800" transition></amount>
  62. </view>
  63. </view>
  64. <button class="cu-btn block bg-orange round shadow" @tap="submit">
  65. <text class="cuIcon-loading2 cuIconfont-spin margin-right-xs text-white" v-if="loading"></text>
  66. <text class="text-df text-white">{{ loading ? '支付中...' : '下单付款' }}</text>
  67. </button>
  68. </view>
  69. </view>
  70. </skeleton>
  71. </view>
  72. </template>
  73. <script>
  74. import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
  75. export default {
  76. mixins: [MescrollMixin], // 使用mixin
  77. data() {
  78. return {
  79. num: 1,
  80. base64Img: '', //
  81. skeletonLoading: true,
  82. loading: false,
  83. checkbox: [{
  84. value: 'A',
  85. checked: true
  86. }],
  87. goods_id: 1,
  88. goods_specs_id: 1,
  89. orderDetails: {},
  90. ifchoose: true
  91. }
  92. },
  93. computed: {
  94. total(){
  95. return this.num * this.price
  96. }
  97. },
  98. onLoad(e) {
  99. this.goods_id = e.goods_id
  100. this.goods_specs_id = e.goods_specs_id
  101. },
  102. methods: {
  103. getConfirmOrder() {
  104. this.$http(this.API.API_COFIRMORDER_DETAILS, {goods_id: this.goods_id,goods_specs_id: this.goods_specs_id}).then(res => {
  105. if(res.code == 0) {
  106. this.orderDetails = res.data
  107. this.skeletonLoading = false
  108. this.mescroll.endSuccess(); // 请求成功,隐藏加载状态
  109. }
  110. }).catch(err => {
  111. // this.mescroll.endErr();
  112. });
  113. },
  114. reduce() {
  115. if (this.num === 1) return
  116. this.num--
  117. },
  118. add() {
  119. this.num++
  120. },
  121. CheckboxChange(e) {
  122. if(e.detail.value != '') {
  123. this.ifchoose = true
  124. }else {
  125. this.ifchoose = false
  126. }
  127. },
  128. // 点击复制
  129. copy(text) {
  130. uni.setClipboardData({
  131. data: text
  132. });
  133. },
  134. submit(){
  135. if(this.ifchoose == true) {
  136. this.$routerGo('/pages/order/pay-success')
  137. }else {
  138. this.$msg('请认真阅读并同意协议!')
  139. return
  140. }
  141. },
  142. //下拉刷新
  143. downCallback() {
  144. this.getConfirmOrder()
  145. },
  146. },
  147. created() {
  148. this.getConfirmOrder()
  149. }
  150. }
  151. </script>
  152. <style lang="scss" scoped>
  153. .address-box {
  154. // background-image: url(../../static/images/shop/envelope.png);
  155. background-repeat: repeat-x;
  156. background-position: left bottom;
  157. background-size: auto 8rpx;
  158. }
  159. .self-img-sm {
  160. width: 40rpx;
  161. height: 40rpx;
  162. }
  163. .bref-box {
  164. text-overflow: -o-ellipsis-lastline;
  165. overflow: hidden;
  166. text-overflow: ellipsis;
  167. display: -webkit-box;
  168. -webkit-line-clamp: 2;
  169. -webkit-box-orient: vertical;
  170. }
  171. .order-bottom {
  172. position: relative;
  173. .cuIcon-fold {
  174. position: absolute;
  175. right: 50rpx;
  176. top: -19rpx;
  177. color: rgba(0, 0, 0, 0.1)
  178. }
  179. }
  180. </style>