海南旅游项目 前端仓库
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.

244 lines
6.8 KiB

  1. <template>
  2. <view>
  3. <view class="lf-bg-white lf-p-t-30 lf-p-b-30 lf-p-l-32 lf-p-r-32">
  4. <view class="lf-row-between">
  5. <image src="../../static/logo.png" mode="aspectFill" style="width: 240rpx; height: 240rpx;border-radius: 20rpx;"></image>
  6. <view class="flex-sub padding-left-sm">
  7. <view class="bref-box lf-font-32 lf-color-333 lf-line-2" style="height: 88rpx;line-height: 44rpx;">
  8. 南澳站·潮玩旅游胜地 身处亚热带风情/玩转南澳
  9. </view>
  10. <view class="flex lf-m-t-25 align-center text-center">
  11. <text class="block lf-color-gray lf-font-24" style="line-height: 40rpx;">数量</text>
  12. <text class="lf-m-l-10 lf-color-gray lf-font-24">x 1</text>
  13. </view>
  14. <view class="flex align-center text-center lf-m-t-25">
  15. <lf-price :price="599.00" />
  16. <view class="lf-m-l-20 lf-line-through lf-color-gray">
  17. 599.00
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. <self-line/>
  24. <view class="bg-white">
  25. <view class="cu-bar padding-lr">
  26. <text class="lf-color-555 lf-font-28">可退金额</text>
  27. <text class="text-price lf-font-36 lf-color-price">549.00</text>
  28. </view>
  29. <view class="cu-bar padding-lr solid-bottom flex justify-between align-center text-center">
  30. <text class="lf-color-555 lf-font-28">订单编号</text>
  31. <view>
  32. <text class="margin-right lf-font-28 text-black1">2368492461046128742764</text>
  33. <!-- <text class="text-orange lf-font-28" @click="copy(2368492461046128742764)">复制</text> -->
  34. </view>
  35. </view>
  36. </view>
  37. <self-line/>
  38. <view class="bg-white lf-m-b-6">
  39. <view class="lf-p-t-30 lf-p-l-32 lf-p-b-36">
  40. <view class="lf-font-28 lf-color-black">退款说明</view>
  41. <input type="text" value="" placeholder="请输入退款说明" class="solid-bottom lf-m-t-30" />
  42. </view>
  43. </view>
  44. <view class="cu-form-group">
  45. <view class="grid col-4 grid-square flex-sub">
  46. <view style="width: 212rpx;height: 212rpx;border-radius: 10rpx;" class="bg-img" v-for="(item,index) in img_list" :key="index" @tap="showImg(index)" :data-url="img_list[index]">
  47. <image :src="img_list[index]" mode="aspectFill"></image>
  48. <view class="cu-tag bg-red" @tap.stop="DelImg(index)" :data-index="index">
  49. <text class='cuIcon-close'></text>
  50. </view>
  51. </view>
  52. <view style="width: 212rpx;height: 212rpx;border-radius: 10rpx;" class="solids" @tap="ChooseImage" v-if="img_list.length<3">
  53. <text class='cuIcon-cameraadd'></text>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="btn-bottom solid-top1" style="bottom: 60rpx;">
  58. <view class="padding-lr-lg">
  59. <button class="cu-btn block lf-bg-blue lg round" @tap="subimitApply()">
  60. <text class="text-df text-white">确认申请</text>
  61. </button>
  62. </view>
  63. </view>
  64. </view>
  65. </template>
  66. <script>
  67. export default {
  68. data() {
  69. return {
  70. hostImg: '',
  71. img_list: [], // 反馈问题图片
  72. }
  73. },
  74. methods: {
  75. checkImgInfo(tempFilePath, suc){
  76. uni.getImageInfo({
  77. src: tempFilePath,
  78. success (res) {
  79. let type = res.type;
  80. console.log('checkImgInfo...', type);
  81. if(type == 'png' || type == 'jpeg' || type == 'jpg'){
  82. suc && suc(true);
  83. } else {
  84. suc && suc(false);
  85. }
  86. },
  87. fail(err) {
  88. suc && suc(false);
  89. }
  90. })
  91. },
  92. // 选择图片
  93. ChooseImage(e) {
  94. let that = this;
  95. uni.chooseImage({
  96. count: 1,
  97. sizeType: ['original'], // 可以指定是原图original还是压缩图compressed ,默认二者都有
  98. sourceType: ['album', 'camera'], // album 从相册选图,camera 使用相机,默认二者都有
  99. success: res => {
  100. that.hostImg = res.tempFilePaths[0];
  101. let tempFile = res.tempFiles.shift();
  102. let tempFilePath = res.tempFilePaths.shift();
  103. that.checkImgInfo(tempFilePath, (res) => {
  104. // 过滤不是图片不是png、jpeg 格式
  105. if(res){
  106. if(tempFile.size > 10000000){
  107. uni.showModal({
  108. title: '',
  109. content: '您选择的图片过大:'+ (tempFile.size / 1024000).toFixed(2) +"M,请点击确定重新上传",
  110. success: res2 => {
  111. if(res2.confirm){
  112. uni.chooseImage({
  113. count: 1,
  114. sizeType: ['compressed'],
  115. sourceType: ['album', 'camera'],
  116. success: (res3) => {
  117. let tempFilePath = res3.tempFilePaths.shift();
  118. that.is_wx_reduce = true;
  119. that.img_list.push(tempFilePath);
  120. }
  121. })
  122. }
  123. }
  124. })
  125. } else{
  126. that.img_list.push(tempFilePath);
  127. }
  128. } else {
  129. uni.showModal({
  130. title: '',
  131. content: '选择的图片须为jpg、jpeg或png格式',
  132. showCancel: false,
  133. confirmColor: '#1697EE'
  134. })
  135. }
  136. });
  137. }
  138. });
  139. },
  140. // 上传图片到服务器
  141. upload(url){
  142. let that = this;
  143. let uploads = [];
  144. // 商品banner图上传
  145. if (that.img_list.length > 0) {
  146. for (let i = 0; i < that.img_list.length; i++) {
  147. let upload_img = new Promise((resolve, reject) => {
  148. that.uploadFile(that.img_list[i], (res) => {
  149. resolve(res);
  150. }, (err) => {
  151. reject(err);
  152. });
  153. })
  154. uploads.push(upload_img);
  155. }
  156. }
  157. if(uploads.length == 0) {
  158. that.realSubmitInfo([]);
  159. return
  160. }
  161. Promise.all(uploads).then((result) => {
  162. console.log('图片上传...', result)
  163. let img_url_list = [];
  164. if(result.length > 0){
  165. img_url_list = JSON.stringify(result);
  166. }
  167. if(img_url_list) {
  168. that.realSubmitInfo(img_url_list);
  169. }
  170. }).catch(err => {
  171. console.log(err)
  172. that.is_publish = false; // 恢复提交按钮
  173. uni.showModal({
  174. title: '',
  175. content: '图片上传失败,请重新提交',
  176. confirmColor: '#1697EE'
  177. })
  178. })
  179. },
  180. // 预览图片
  181. showImg(index) {
  182. this.$u.throttle(() => {
  183. let goods_banner = this.img_list || [];
  184. let banners = goods_banner.map(item => item);
  185. uni.previewImage({
  186. urls: banners,
  187. current: index
  188. })
  189. }, 200);
  190. },
  191. // 删除图片
  192. DelImg(index) {
  193. uni.showModal({
  194. title: '提示',
  195. content: '即将取消上传这张图片,请确认?',
  196. success: e => {
  197. if (!e.confirm) return;
  198. this.img_list.splice(index, 1);
  199. }
  200. });
  201. },
  202. // 点击复制
  203. copy(text) {
  204. uni.setClipboardData({
  205. data: text
  206. });
  207. },
  208. }
  209. }
  210. </script>
  211. <style>
  212. .btn{
  213. margin: 0;
  214. padding: 0;
  215. width: 212rpx;
  216. height: 82rpx;
  217. background-color: #1998FE;
  218. color: #FFFFFF;
  219. line-height: 80rpx;
  220. font-size: 32rpx;
  221. border-radius: 41rpx;
  222. }
  223. .bref-box {
  224. text-overflow: -o-ellipsis-lastline;
  225. overflow: hidden;
  226. text-overflow: ellipsis;
  227. display: -webkit-box;
  228. -webkit-line-clamp: 2;
  229. -webkit-box-orient: vertical;
  230. }
  231. </style>