时空网前端
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.

194 lines
5.4 KiB

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 src="@/static/tu.png" 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. 网红辣椒棒 魔鬼辣椒挑战全网第一辣 网红优惠季
  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(19.90*num || 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. <view class="bg-white">
  37. <view class="cu-bar padding-lr solid-bottom">
  38. <text class="text-gray">优惠</text>
  39. <text>暂无优惠</text>
  40. </view>
  41. </view>
  42. <self-line/>
  43. </mescroll-body>
  44. <view class="btn-bottom">
  45. <view class="padding flex justify-around align-center">
  46. <view class="margin-right">
  47. <checkbox :class="checkbox[0].checked?'checked':''" :checked="checkbox[0].checked?true:false" value="A"></checkbox>
  48. </view>
  49. <view class="text-sm text-gray">请认真阅读并同意时空网协议在小程序下单购买即表示您已默认同意时空网协议的所有条款</view>
  50. </view>
  51. <self-line/>
  52. <view class="padding-lr padding-tb-sm bg-white flex justify-between align-center solid-top shadow">
  53. <view class="flex align-center">
  54. <text class="">应付款</text>
  55. <view class="text-lg text-price text-red">
  56. <amount :value="Number(total || 0)" :is-round-up="false" :precision="2" :duration="800" transition></amount>
  57. </view>
  58. </view>
  59. <button class="cu-btn block bg-orange round shadow" @tap="submit">
  60. <text class="cuIcon-loading2 cuIconfont-spin margin-right-xs text-white" v-if="loading"></text>
  61. <text class="text-df text-white">{{ loading ? '支付中...' : '下单付款' }}</text>
  62. </button>
  63. </view>
  64. </view>
  65. </view>
  66. </template>
  67. <script>
  68. import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
  69. export default {
  70. mixins: [MescrollMixin], // 使用mixin
  71. data() {
  72. return {
  73. num: 1,
  74. area: '币种地址',
  75. base64Img: '', //
  76. skeletonLoading: true,
  77. payCur: 0, //支付方式下标
  78. loading: false,
  79. address: {},
  80. shopData: {},
  81. payPwd: '',
  82. price: '', //价格
  83. checkbox: [{
  84. value: 'A',
  85. checked: true
  86. }, {
  87. value: 'B',
  88. checked: true
  89. }, {
  90. value: 'C',
  91. checked: false
  92. }],
  93. }
  94. },
  95. computed: {
  96. disabled() {
  97. // 必须输入 邮箱和验证码 才能点击下一步
  98. // if (this.payPwd) return false
  99. return true
  100. },
  101. total(){
  102. return this.num * this.price
  103. }
  104. },
  105. onLoad(e) {
  106. setTimeout(()=>{
  107. this.skeletonLoading = false
  108. this.mescroll.endSuccess(); // 请求成功,隐藏加载状态
  109. },1000)
  110. },
  111. methods: {
  112. reduce() {
  113. if (this.num === 1) return
  114. this.num--
  115. },
  116. add() {
  117. this.num++
  118. },
  119. CheckboxChange(e) {
  120. var items = this.checkbox,
  121. values = e.detail.value;
  122. for (var i = 0, lenI = items.length; i < lenI; ++i) {
  123. items[i].checked = false;
  124. for (var j = 0, lenJ = values.length; j < lenJ; ++j) {
  125. if (items[i].value == values[j]) {
  126. items[i].checked = true;
  127. break
  128. }
  129. }
  130. }
  131. },
  132. //二维码回调
  133. qrR(data) {
  134. this.base64Img = data;
  135. },
  136. // 点击复制
  137. copy(text) {
  138. uni.setClipboardData({
  139. data: text
  140. });
  141. },
  142. submit(){
  143. this.$routerGo('/pages/order/pay-success')
  144. },
  145. //下拉刷新
  146. downCallback() {
  147. setTimeout(()=>{
  148. this.mescroll.endSuccess(); // 请求成功,隐藏加载状态
  149. this.mescroll.endErr(); // 请求失败,隐藏加载状态
  150. },1000)
  151. },
  152. }
  153. }
  154. </script>
  155. <style lang="scss" scoped>
  156. .address-box {
  157. // background-image: url(../../static/images/shop/envelope.png);
  158. background-repeat: repeat-x;
  159. background-position: left bottom;
  160. background-size: auto 8rpx;
  161. }
  162. .self-img-sm {
  163. width: 40rpx;
  164. height: 40rpx;
  165. }
  166. .bref-box {
  167. text-overflow: -o-ellipsis-lastline;
  168. overflow: hidden;
  169. text-overflow: ellipsis;
  170. display: -webkit-box;
  171. -webkit-line-clamp: 2;
  172. -webkit-box-orient: vertical;
  173. }
  174. .order-bottom {
  175. position: relative;
  176. .cuIcon-fold {
  177. position: absolute;
  178. right: 50rpx;
  179. top: -19rpx;
  180. color: rgba(0, 0, 0, 0.1)
  181. }
  182. }
  183. </style>