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

264 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">{{ dynamicLength() }}/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. dynamicLength(){
  82. return parseInt(this.applyInfo.length);
  83. },
  84. checkImgInfo(tempFilePath, suc){
  85. uni.getImageInfo({
  86. src: tempFilePath,
  87. success (res) {
  88. let type = res.type;
  89. console.log('checkImgInfo...', type);
  90. if(type == 'png' || type == 'jpeg' || type == 'jpg'){
  91. suc && suc(true);
  92. } else {
  93. suc && suc(false);
  94. }
  95. },
  96. fail(err) {
  97. suc && suc(false);
  98. }
  99. })
  100. },
  101. // 选择图片
  102. ChooseImage(e) {
  103. let that = this;
  104. uni.chooseImage({
  105. count: 1,
  106. sizeType: ['original'], // 可以指定是原图original还是压缩图compressed ,默认二者都有
  107. sourceType: ['album', 'camera'], // album 从相册选图,camera 使用相机,默认二者都有
  108. success: res => {
  109. that.hostImg = res.tempFilePaths[0];
  110. let tempFile = res.tempFiles.shift();
  111. let tempFilePath = res.tempFilePaths.shift();
  112. that.checkImgInfo(tempFilePath, (res) => {
  113. // 过滤不是图片不是png、jpeg 格式
  114. if(res){
  115. if(tempFile.size > 10000000){
  116. uni.showModal({
  117. title: '',
  118. content: '您选择的图片过大:'+ (tempFile.size / 1024000).toFixed(2) +"M,请点击确定重新上传",
  119. success: res2 => {
  120. if(res2.confirm){
  121. uni.chooseImage({
  122. count: 1,
  123. sizeType: ['compressed'],
  124. sourceType: ['album', 'camera'],
  125. success: (res3) => {
  126. let tempFilePath = res3.tempFilePaths.shift();
  127. that.is_wx_reduce = true;
  128. that.img_list.push(tempFilePath);
  129. }
  130. })
  131. }
  132. }
  133. })
  134. } else{
  135. that.img_list.push(tempFilePath);
  136. }
  137. } else {
  138. uni.showModal({
  139. title: '',
  140. content: '选择的图片须为jpg、jpeg或png格式',
  141. showCancel: false,
  142. confirmColor: '#1697EE'
  143. })
  144. }
  145. });
  146. }
  147. });
  148. },
  149. // 上传图片到服务器
  150. upload(url){
  151. let that = this;
  152. let uploads = [];
  153. // 商品banner图上传
  154. if (that.img_list.length > 0) {
  155. for (let i = 0; i < that.img_list.length; i++) {
  156. let upload_img = new Promise((resolve, reject) => {
  157. that.uploadFile(that.img_list[i], (res) => {
  158. resolve(res);
  159. }, (err) => {
  160. reject(err);
  161. });
  162. })
  163. uploads.push(upload_img);
  164. }
  165. }
  166. if(uploads.length == 0) {
  167. that.realSubmitInfo([]);
  168. return
  169. }
  170. Promise.all(uploads).then((result) => {
  171. console.log('图片上传...', result)
  172. let img_url_list = [];
  173. if(result.length > 0){
  174. img_url_list = JSON.stringify(result);
  175. }
  176. if(img_url_list) {
  177. that.realSubmitInfo(img_url_list);
  178. }
  179. }).catch(err => {
  180. console.log(err)
  181. that.is_publish = false; // 恢复提交按钮
  182. uni.showModal({
  183. title: '',
  184. content: '图片上传失败,请重新提交',
  185. confirmColor: '#1697EE'
  186. })
  187. })
  188. },
  189. // 预览图片
  190. showImg(index) {
  191. this.$u.throttle(() => {
  192. let goods_banner = this.img_list || [];
  193. let banners = goods_banner.map(item => item);
  194. uni.previewImage({
  195. urls: banners,
  196. current: index
  197. })
  198. }, 200);
  199. },
  200. // 删除图片
  201. DelImg(index) {
  202. uni.showModal({
  203. title: '提示',
  204. content: '即将取消上传这张图片,请确认?',
  205. success: e => {
  206. if (!e.confirm) return;
  207. this.img_list.splice(index, 1);
  208. }
  209. });
  210. },
  211. // 点击复制
  212. copy(text) {
  213. uni.setClipboardData({
  214. data: text
  215. });
  216. },
  217. }
  218. }
  219. </script>
  220. <style>
  221. .btn{
  222. margin: 0;
  223. padding: 0;
  224. width: 212rpx;
  225. height: 82rpx;
  226. background-color: #1998FE;
  227. color: #FFFFFF;
  228. line-height: 80rpx;
  229. font-size: 32rpx;
  230. border-radius: 41rpx;
  231. }
  232. .bref-box {
  233. text-overflow: -o-ellipsis-lastline;
  234. overflow: hidden;
  235. text-overflow: ellipsis;
  236. display: -webkit-box;
  237. -webkit-line-clamp: 2;
  238. -webkit-box-orient: vertical;
  239. }
  240. .area-self {
  241. width: 100%;
  242. padding: 30rpx;
  243. padding-bottom: 36rpx;
  244. color: #333;
  245. border: 1px solid #D0D0D0;
  246. border-radius: 10rpx;
  247. }
  248. .font-change{
  249. position: absolute;
  250. right: 10rpx;
  251. bottom: 10rpx;
  252. width: max-content;
  253. color: #777777;
  254. }
  255. </style>