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

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