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