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

214 lines
5.6 KiB

4 years ago
  1. <template>
  2. <view>
  3. <mescroll-body ref="mescrollRef" @down="downCallback" :down="downOpt">
  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. <text class="block margin-top-sm text-gray text-sm">网红辣椒棒 500g <text class="margin-left text-gray">x1</text></text>
  15. <view class="flex justify-between margin-top-sm">
  16. <view class="text-red text-price text-lg">
  17. <amount :value="Number(19.90 || 0)" :is-round-up="false" :precision="2" :duration="800" transition></amount>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </skeleton>
  23. </view>
  24. <self-line/>
  25. <!-- 表单 -->
  26. <view class="bg-white">
  27. <view class="cu-bar padding-lr solid-bottom flex justify-between align-center text-center">
  28. <text class="text-gray">可退金额</text>
  29. <view class="text-red text-price text-lg">
  30. <amount :value="Number(19.90 || 0)" :is-round-up="false" :precision="2" :duration="800" transition></amount>
  31. </view>
  32. </view>
  33. <view class="cu-bar padding-lr solid-bottom flex justify-between align-center text-center">
  34. <text class="text-gray">订单编号</text>
  35. <view>
  36. <text class="margin-right">67432428794847982374</text>
  37. <text class="text-orange text-sm" @tap="copy('67432428794847982374')">复制</text>
  38. </view>
  39. </view>
  40. <view class="cu-bar padding-lr solid-bottom">
  41. <text class="text-gray">退款说明</text>
  42. <input type="text" class="text-right text-df" placeholder="请输入反馈信息" />
  43. </view>
  44. </view>
  45. <self-line/>
  46. <view class="padding bg-white" style="border-radius: 6rpx 6rpx 0 0">
  47. <view class="cu-self menu">
  48. <view class="text-gray">请上传退款凭证</view>
  49. </view>
  50. </view>
  51. <view class="cu-form-group solid-bottom">
  52. <view class="grid col-4 grid-square flex-sub">
  53. <view class="solids" @tap="ChooseImage" v-if="hostImg == ''"><text class="cuIcon-cameraadd"></text></view>
  54. <view class="bg-img" v-else>
  55. <image :src="hostImg" @tap="showImg" mode="aspectFill"></image>
  56. <view class="cu-tag bg-red" @tap.stop="DelImg"><text class="cuIcon-close"></text></view>
  57. </view>
  58. </view>
  59. </view>
  60. <view class="padding-top-sm padding-lr-lg">
  61. <button class="cu-btn block bg-orange lg margin-top round" @tap="$routerGo('/pages/order/apply-details')">
  62. <text class="cuIcon-loading2 cuIconfont-spin margin-right-xs text-white" v-if="loading"></text>
  63. <text class="text-df text-white">确认申请</text>
  64. </button>
  65. </view>
  66. </mescroll-body>
  67. </view>
  68. </template>
  69. <script>
  70. import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
  71. export default {
  72. mixins: [MescrollMixin], // 使用mixin
  73. data() {
  74. return {
  75. skeletonLoading: true,
  76. loading: false,
  77. // 选择的本地图片路径
  78. hostImg: '',
  79. // 已上传服务器的图片名称
  80. serverImg:'',
  81. }
  82. },
  83. computed: {
  84. },
  85. onLoad(e) {
  86. setTimeout(()=>{
  87. this.skeletonLoading = false
  88. this.mescroll.endSuccess(); // 请求成功,隐藏加载状态
  89. },1000)
  90. },
  91. methods: {
  92. // 选择图片
  93. ChooseImage(e) {
  94. uni.chooseImage({
  95. count: 1,
  96. success: e => {
  97. this.hostImg = e.tempFilePaths[0];
  98. this.upload(this.hostImg)
  99. }
  100. });
  101. },
  102. // 上传图片到服务器
  103. upload(url){
  104. this.$http.upload({
  105. url: '/user/api/file/image',
  106. data: url,
  107. }).then(res=>{
  108. let imgurl = JSON.parse(res.data)
  109. this.serverImg=imgurl.data;
  110. })
  111. },
  112. // 预览图片
  113. showImg() {
  114. uni.previewImage({
  115. urls: [this.hostImg]
  116. });
  117. },
  118. // 删除图片
  119. DelImg() {
  120. uni.showModal({
  121. title: '提示',
  122. content: '即将取消上传这张图片,请确认?',
  123. success: e => {
  124. if (!e.confirm) return;
  125. this.hostImg = '';
  126. this.serverImg = '';
  127. }
  128. });
  129. },
  130. // 点击复制
  131. copy(text) {
  132. //app的复制方法
  133. // #ifdef APP-PLUS
  134. uni.setClipboardData({
  135. data: text
  136. });
  137. // #endif
  138. //html的复制方法
  139. // #ifdef H5
  140. this.$copyText(text)
  141. .then(res => {
  142. uni.showToast({
  143. title: '复制成功'
  144. });
  145. })
  146. .catch(err => {
  147. uni.showToast({
  148. icon: 'none',
  149. title: '复制失败,您的浏览器不支持'
  150. });
  151. });
  152. // #endif
  153. },
  154. //下拉刷新
  155. downCallback() {
  156. setTimeout(()=>{
  157. this.mescroll.endSuccess(); // 请求成功,隐藏加载状态
  158. this.mescroll.endErr(); // 请求失败,隐藏加载状态
  159. },1000)
  160. },
  161. }
  162. }
  163. </script>
  164. <style lang="scss" scoped>
  165. .address-box {
  166. // background-image: url(../../static/images/shop/envelope.png);
  167. background-repeat: repeat-x;
  168. background-position: left bottom;
  169. background-size: auto 8rpx;
  170. }
  171. .self-img-sm {
  172. width: 40rpx;
  173. height: 40rpx;
  174. }
  175. .bref-box {
  176. text-overflow: -o-ellipsis-lastline;
  177. overflow: hidden;
  178. text-overflow: ellipsis;
  179. display: -webkit-box;
  180. -webkit-line-clamp: 2;
  181. -webkit-box-orient: vertical;
  182. }
  183. .order-bottom {
  184. position: relative;
  185. .cuIcon-fold {
  186. position: absolute;
  187. right: 50rpx;
  188. top: -19rpx;
  189. color: rgba(0, 0, 0, 0.1)
  190. }
  191. }
  192. </style>