upload.vue 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237
  1. <template>
  2. <view class="upload">
  3. <custom-nav :title="pageTitle"></custom-nav>
  4. <custom-toast ref="toast"></custom-toast>
  5. <view v-if="loading" class="loading">
  6. <image src="https://api.jiuweiyun.cn/public/uploads/weapp/icon/loading.png" mode=""></image>
  7. <image class="rotate" src="../../static/icon/loadingcenter.png" mode=""></image>
  8. <text>{{ progress }}%</text>
  9. <view>{{ loadingText }}</view>
  10. </view>
  11. <view class="success" v-if="gotScore" :class="gotScore ? 'showbg' : ''">
  12. <view class="success_con">
  13. <view class="userinfo">
  14. <image :src="avatarUrl" class="photo"></image>
  15. <view class="nickname">“{{ nickname }}”</view>
  16. </view>
  17. <!-- <image src="https://api.jiuweiyun.cn/public/uploads/icon/bingo.gif" mode="widthFix" class="level_score_bg"></image> -->
  18. <image src="https://api.jiuweiyun.cn/public/uploads/icon/gold_new.gif" mode="widthFix" class="level_score_bg"></image>
  19. <view class="upload_success_box">
  20. <!-- <view class="level_score">恭喜获得{{ gotScore }}学分{{ riseNumber > 0 ? `,上升${riseNumber}名` : '' }}</view> -->
  21. <view class="level_score">恭喜获得{{ gotScore }}学分{{ riseNumber > 0 ? `,上升${riseNumber}名` : '' }}</view>
  22. <view class="goon_box">
  23. <view class="goon" @tap="goon">继续获得</view>
  24. <view class="goon save" @tap="toRank">查看排行榜</view>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. <view v-if="repair" class="repair">
  30. <image src="https://api.jiuweiyun.cn/public/uploads/weapp/icon/repair.png" mode=""></image>
  31. <view class="text">
  32. 预计维护时间至 {{ userServerInfo.repair_end | getYear }} 年 {{ userServerInfo.repair_end | getMonth }} 月 {{ userServerInfo.repair_end | getDate }} 日
  33. {{ userServerInfo.repair_end | getHousr }} 时 {{ userServerInfo.repair_end | getMinute }} 分结束
  34. </view>
  35. </view>
  36. <view v-else class="content">
  37. <view class="header" style="margin-top: 10rpx;">
  38. <view class="header_con">
  39. <view>
  40. <text>请填写零售数量</text>
  41. <text class="small">(单位:套)</text>
  42. </view>
  43. <!-- <view class="how" @click="skipHow">如何操作</view> -->
  44. </view>
  45. </view>
  46. <view class="top">
  47. <view v-for="(item, i) in formList" :key="i" class="upload_item_parent">
  48. <view class="upload_item col_inp">
  49. <view>{{ item.name }}:</view>
  50. <view class="input" style="color: #333;">
  51. <input type="number" placeholder="请输入零售数量" v-model="item.input"
  52. placeholder-style="color:#999;font-weight:normal;font-size:28rpx;">
  53. </view>
  54. </view>
  55. </view>
  56. <view class="upload_item_parent">
  57. <view class="upload_item col_inp">
  58. <view>零售总额:</view>
  59. <view class="input">
  60. <text style="color: #FB231F;">¥</text>
  61. <input type="number" placeholder="请输入零售总额" v-model="money" @input="handleInput"
  62. @focus="money===0?money='':''"
  63. placeholder-style="color:#999;font-weight:normal;font-size:28rpx;">
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. <view class="header">请上传收款截图</view>
  69. <view class="bot">
  70. <view class="grid col-4 grid-square flex-sub">
  71. <view class="bg-img choose" v-for="(item, index) in imgList" :key="index" @tap="ViewImage" :data-url="imgList[index]">
  72. <image :src="imgList[index]" mode="aspectFill"></image>
  73. <view class="cu-tag bg-red" @tap.stop="DelImg" :data-index="index"><text class="cuIcon-close"></text></view>
  74. </view>
  75. <view class="choose" @tap="ChooseImage" v-if="imgList.length === 0">
  76. <view class="upload_img" />
  77. <text>点击添加图片,只能上传一张</text>
  78. </view>
  79. </view>
  80. </view>
  81. <view class="submit" v-if="!gotScore" @tap="$noMultipleClicks(upload)">提交</view>
  82. <!-- <view class="howupload" @tap="tohowupload">如何上传 <text class="cuIcon-question"></text></view>
  83. <view class="example" @tap="previewExample">
  84. <image src="../../static/icon/example.png" mode="aspectFit"></image>
  85. </view> -->
  86. <view class="poster" v-if="posterShow">
  87. <view class="poster_con flexCC">
  88. <image src="../../static/icon/close.png" @click="posterShow = false" class="close"></image>
  89. <view class="canvas">
  90. <canvas canvas-id="canvas" id="canvas"></canvas>
  91. <image :src="poster" @longpress="saveImg"></image>
  92. </view>
  93. <view class="save_img">长按图片保存</view>
  94. </view>
  95. </view>
  96. </view>
  97. <canvas canvas-id= "canvas"></canvas>
  98. </view>
  99. </template>
  100. <script>
  101. import { api_upload, UploadNew } from '../../api.js';
  102. import UploadNum from '../../components/upload-num.vue';
  103. import { mapState } from 'vuex';
  104. export default {
  105. components: {
  106. UploadNum
  107. },
  108. data() {
  109. return {
  110. pageTitle: '图片上传',
  111. noClick:true,
  112. // input1: 0,
  113. // input2: 0,
  114. // input3: 0,
  115. // input4: 0,
  116. formList: [
  117. {
  118. name: '精装版',
  119. input: '',
  120. },
  121. {
  122. name: '简约版',
  123. input: '',
  124. },
  125. {
  126. name: '高腰版',
  127. input: '',
  128. },
  129. {
  130. name: '纯棉版',
  131. input: '',
  132. },
  133. {
  134. name: '青春版',
  135. input: '',
  136. },
  137. ],
  138. imgList: [],
  139. gotScore: 0, //获得分数
  140. moveIndex: 0,
  141. loading: false,
  142. progress: 0,
  143. loadingText: '',
  144. riseNumber: 0, //上升名次
  145. money: '',
  146. sizeToggle: {
  147. input1: false,
  148. input2: false,
  149. input3: false,
  150. input4: false,
  151. input5: false
  152. },
  153. sizeType: {
  154. input1: [['', '', 0]],
  155. input2: [['', '', 0]],
  156. input3: [['', '', 0]],
  157. input4: [['', '', 0]],
  158. input5: [['', '', 0]]
  159. },
  160. posterShow: false, //是否显示海报
  161. poster: '', //海报图片
  162. canvasWidth: '',
  163. canvasHeight: '',
  164. photo: '', //海报头像
  165. nickname: '', //用户昵称
  166. avatarUrl: '', //用户头像
  167. timer: null //出现分享弹窗定时器
  168. };
  169. },
  170. filters: {
  171. sizeName(key) {
  172. let out;
  173. switch (key) {
  174. case 'input1':
  175. out = '精装版';
  176. break;
  177. case 'input2':
  178. out = '简约版';
  179. break;
  180. case 'input3':
  181. out = '高腰版';
  182. break;
  183. case 'input4':
  184. out = '纯棉版';
  185. break;
  186. case 'input5':
  187. out = '青春版';
  188. break;
  189. }
  190. return out;
  191. },
  192. sizeNum(arr) {
  193. let a1 = arr.map(item => item[2]);
  194. let a = Array.prototype.concat.apply([], a1);
  195. return a.reduce((a, b) => Number(a) + Number(b), 0);
  196. }
  197. },
  198. computed: {
  199. ...mapState(['userWeixinInfo']),
  200. userServerInfo() {
  201. return this.$store.state.userServerInfo;
  202. },
  203. repair() {
  204. return +new Date() / 1000 > this.userServerInfo.repair_start && +new Date() / 1000 < this.userServerInfo.repair_end;
  205. }
  206. },
  207. onLoad() {
  208. const that = this;
  209. wx.getSystemInfo({
  210. success: res => {
  211. that.model = res.model;
  212. that.canvasWidth = res.windowWidth / 375;
  213. that.canvasHeight = res.windowHeight;
  214. }
  215. });
  216. //测试海报
  217. // let _this = this;
  218. // let nickname = _this.userWeixinInfo.nickName;
  219. // _this.nickname = nickname.length > 8 ? nickname.slice(0, 8) : nickname;
  220. // _this.avatarUrl = _this.userWeixinInfo.avatarUrl;
  221. // _this.gotScore = 100;
  222. // _this.riseNumber = 15;
  223. // _this.getPoster();
  224. // _this.posterShow = true;
  225. },
  226. beforeDestroy() {
  227. clearInterval(this.timer);
  228. },
  229. methods: {
  230. //获取海报头像和背景
  231. getPoster() {
  232. let _this = this;
  233. uni.downloadFile({
  234. url: _this.avatarUrl,
  235. success: ({ statusCode, tempFilePath }) => {
  236. if (statusCode === 200) {
  237. this.photo = tempFilePath;
  238. }
  239. },
  240. fail: e => {
  241. uni.showModal({
  242. content: JSON.stringify(e),
  243. showCancel: false
  244. });
  245. },
  246. complete: () => {
  247. uni.getImageInfo({
  248. src: 'https://api.jiuweiyun.cn/public/uploads/icon/poster_new.png',
  249. // src: 'https://api.jiuweiyun.cn/public/uploads/icon/poster_new_one.png',
  250. success: res => {
  251. this.drawPoster(res.path);
  252. },
  253. fail: err => {
  254. uni.showModal({
  255. content: '获取背景图失败',
  256. showCancel: false,
  257. success: res => {
  258. if (res.confirm) {
  259. this.getPoster();
  260. }
  261. }
  262. });
  263. }
  264. });
  265. }
  266. });
  267. },
  268. ///绘制海报
  269. drawPoster(posterBg) {
  270. let _this = this;
  271. uni.showLoading({
  272. title: '图片加载中...'
  273. });
  274. let ctx = uni.createCanvasContext('canvas');
  275. let rpx = _this.canvasWidth;
  276. ctx.drawImage(posterBg, 0, 0, 270 * rpx, 450 * rpx);
  277. ctx.font = 'italic bold 28px Microsoft YaHei';
  278. ctx.setFillStyle('#fff');
  279. ctx.textAlign = 'center';
  280. ctx.fillText(_this.gotScore, uni.upx2px(250), uni.upx2px(432));
  281. // ctx.fillText(_this.gotScore, uni.upx2px(195), uni.upx2px(450));
  282. ctx.font = 'italic bold 18px 微软雅黑';
  283. ctx.setFillStyle('#fff');
  284. ctx.textAlign = 'center';
  285. ctx.fillText(_this.riseNumber, uni.upx2px(270), uni.upx2px(467));
  286. ctx.beginPath(); //开始一个新的路径
  287. ctx.setLineWidth(2); //设置线条的宽度
  288. ctx.setStrokeStyle('#EF0A16'); //设置线条的样式
  289. ctx.setFillStyle('#EF0A16'); //设置填充的样式s
  290. ctx.font = 'noraml bold 18px 微软雅黑';
  291. ctx.textAlign = 'center';
  292. ctx.fillText(_this.nickname, uni.upx2px(270), uni.upx2px(360));
  293. // ctx.fillText('面朝大海,春暖花开', uni.upx2px(270), uni.upx2px(360));
  294. ctx.moveTo(uni.upx2px(175), uni.upx2px(375)); //设置线条的起始路径坐标
  295. ctx.lineTo(uni.upx2px(365), uni.upx2px(375)); //设置线条的终点路径坐标
  296. ctx.stroke(); //对当前路径进行描边
  297. ctx.closePath(); //关闭当前路径
  298. // //绘制红色圆形
  299. // ctx.save();
  300. // ctx.arc(uni.upx2px(117) / 2 + uni.upx2px(214), uni.upx2px(117) / 2 + uni.upx2px(202), uni.upx2px(117) / 2, 0, Math.PI * 2, false);
  301. // ctx.setFillStyle('#EF0A16');
  302. // ctx.fill();
  303. // ctx.clip();
  304. // ctx.beginPath();
  305. // ctx.arc(uni.upx2px(110) / 2 + uni.upx2px(218), uni.upx2px(110) / 2 + uni.upx2px(205), uni.upx2px(110) / 2, 0, Math.PI * 2, false); // 画一个圆形裁剪区域
  306. // ctx.clip(); // 裁剪
  307. // ctx.drawImage(_this.photo, uni.upx2px(218), uni.upx2px(205), uni.upx2px(110), uni.upx2px(110));
  308. // ctx.restore(); //恢复之前保存的绘图上下文
  309. // ctx.closePath();
  310. ctx.beginPath();
  311. ctx.arc((55 * rpx) / 2 + 110 * rpx, (55 * rpx) / 2 + 104 * rpx, (55 * rpx) / 2, 0, Math.PI * 2, false); // 画一个圆形裁剪区域
  312. ctx.clip(); // 裁剪
  313. ctx.drawImage(_this.photo, 110 * rpx, 104 * rpx, 55 * rpx, 55 * rpx);
  314. ctx.restore(); //恢复之前保存的绘图上下文
  315. setTimeout(res => {
  316. ctx.draw(false, () => {
  317. uni.canvasToTempFilePath({
  318. width: 270 * rpx,
  319. height: 450 * rpx,
  320. canvasId: 'canvas',
  321. success: res => {
  322. this.poster = res.tempFilePath;
  323. }
  324. });
  325. });
  326. uni.hideLoading();
  327. }, 1000);
  328. },
  329. /*保存图片到相册*/
  330. saveImg() {
  331. uni.showLoading({
  332. title: '保存中...'
  333. });
  334. uni.saveImageToPhotosAlbum({
  335. filePath: this.poster,
  336. success: res => {
  337. uni.showModal({
  338. content: '图片保存成功!',
  339. showCancel: false
  340. });
  341. },
  342. fail: err => {
  343. if (err.errMsg === 'saveImageToPhotosAlbum:fail auth deny') {
  344. uni.showModal({
  345. title: '提示',
  346. content: '您好,请先授权,再保存此图片。',
  347. showCancel: false,
  348. success: res => {
  349. if (res.confirm) {
  350. uni.openSetting({
  351. success(settingdata) {
  352. console.log(settingdata);
  353. if (settingdata.authSetting['scope.writePhotosAlbum']) {
  354. uni.showModal({
  355. content: '请重新长按保存图片',
  356. showCancel: false
  357. });
  358. } else {
  359. uni.showModal({
  360. content: '您拒绝了保存到相册权限',
  361. showCancel: false
  362. });
  363. }
  364. },
  365. fail: err => {
  366. uni.showModal({
  367. content: '手动打开相册权限失败',
  368. showCancel: false
  369. });
  370. }
  371. });
  372. }
  373. }
  374. });
  375. }
  376. },
  377. complete() {
  378. uni.hideLoading();
  379. }
  380. });
  381. },
  382. skipHow() {
  383. uni.navigateTo({
  384. url: '../howOpera/howOpera'
  385. });
  386. },
  387. audioPlay() {
  388. const innerAudioContext = uni.createInnerAudioContext();
  389. innerAudioContext.src = 'https://api.jiuweiyun.cn/public/uploads/icon/empty.mp3';
  390. innerAudioContext.play();
  391. },
  392. deleteSizeItem(sk, bi) {
  393. this.sizeType[sk].splice(bi, 1);
  394. },
  395. addSizeItem(sk) {
  396. this.sizeType[sk].push(['', '', 0]);
  397. },
  398. inputCounter(k, i, vi, v) {
  399. let arr = Object.assign([], this.sizeType[k]);
  400. arr[i][vi] = v;
  401. this.$set(this.sizeType, k, arr);
  402. },
  403. previewExample() {
  404. uni.compressImage({
  405. src: '../../static/icon/example.png',
  406. quality: 100,
  407. success: ({ tempFilePath }) => {
  408. uni.previewImage({
  409. urls: [tempFilePath]
  410. });
  411. }
  412. });
  413. },
  414. goon() {
  415. this.gotScore = 0;
  416. this.clear();
  417. },
  418. toRank() {
  419. uni.toRank = true;
  420. uni.navigateBack();
  421. },
  422. showModal(content) {
  423. uni.showModal({
  424. title: '上传失败',
  425. content,
  426. cancelText: '取消',
  427. confirmText: '重新上传',
  428. success: res => {
  429. if (res.cancel) {
  430. this.clear();
  431. }
  432. if (res.confirm) {
  433. this.clear();
  434. this.ChooseImage();
  435. }
  436. }
  437. });
  438. },
  439. showModalSuc(content) {
  440. uni.showModal({
  441. title: '上传成功',
  442. showCancel: false,
  443. content,
  444. success: res => {
  445. if (res.confirm) {
  446. this.clear();
  447. }
  448. }
  449. });
  450. },
  451. handleInput(e) {
  452. this.money = e.target.value.replace(/\D/g, '').replace(/^0{1,}/g, '');
  453. },
  454. upload() {
  455. const hard = this.formList[0].input?this.formList[0].input: 0,
  456. simple = this.formList[1].input?this.formList[1].input: 0,
  457. old = this.formList[2].input?this.formList[2].input: 0,
  458. new_old = this.formList[3].input?this.formList[3].input: 0,
  459. youth = this.formList[4].input?this.formList[4].input: 0
  460. console.log(hard,
  461. simple,
  462. old,
  463. new_old,
  464. youth)
  465. if (!hard && !simple && !old && !new_old && !youth ) {
  466. uni.showToast({ title: '请填写零售数量', icon: 'none' })
  467. return
  468. }
  469. // const rule = /^[0-9]+.?[0-9]*$/
  470. // console.log(2222, rule.test(simple))
  471. // if (rule.test(hard) || rule.test(simple) || rule.test(old) || rule.test(new_old) || rule.test(youth) ) {
  472. // uni.showToast({ title: '零售数量只能是数字类型', icon: 'none' })
  473. // return
  474. // }
  475. if (!this.money) {
  476. uni.showToast({ title: '请填写零售总额', icon: 'none' })
  477. return
  478. }
  479. // if (rule.test(this.money) == false) {
  480. // uni.showToast({ title: '零售总额只能是数字类型', icon: 'none' })
  481. // return
  482. // }
  483. if (this.imgList.length == 0) {
  484. uni.showToast({ title: '请上传图片', icon: 'none' })
  485. return
  486. }
  487. uni.showLoading({
  488. title: '上传中...',
  489. mask: true
  490. })
  491. this.$ajax.upload(UploadNew, 'img', this.imgList[0], {
  492. hard,
  493. simple,
  494. old,
  495. new_old,
  496. youth,
  497. season: this.userServerInfo.season,
  498. money: this.money
  499. }).then(([ , { data: res }]) => {
  500. uni.hideLoading()
  501. if (typeof res === 'string') {
  502. res = JSON.parse(res)
  503. }
  504. if (res.code == 200) {
  505. uni.showModal({
  506. title: '上传成功',
  507. showCancel: false,
  508. success: res => {
  509. if (res.confirm) {
  510. this.clear()
  511. }
  512. }
  513. })
  514. } else {
  515. uni.showModal({
  516. title: '上传失败',
  517. showCancel: false,
  518. content: res.message
  519. })
  520. }
  521. })
  522. },
  523. clear() {
  524. // this.input1 = 0
  525. // this.input2 = 0
  526. // this.input3 = 0
  527. // this.input4 = 0
  528. // this.$refs.counter1.inputValue = 0
  529. // this.$refs.counter2.inputValue = 0
  530. // this.$refs.counter3.inputValue = 0
  531. // this.$refs.counter4.inputValue = 0
  532. this.formList = [
  533. {
  534. name: '精装版',
  535. input: '',
  536. },
  537. {
  538. name: '简约版',
  539. input: '',
  540. },
  541. {
  542. name: '高腰版',
  543. input: '',
  544. },
  545. {
  546. name: '纯棉版',
  547. input: '',
  548. },
  549. {
  550. name: '青春版',
  551. input: '',
  552. },
  553. ],
  554. this.money = ''
  555. this.imgList = [];
  556. },
  557. ChooseImage() {
  558. const self = this
  559. uni.chooseImage({
  560. count: 1,
  561. sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
  562. sourceType: ['album'], //从相册选择
  563. success: function (res) {
  564. console.log('选择图片结果');
  565. console.log(res);
  566. self.frontPath = res.tempFilePaths[0];
  567. uni.compressImage({
  568. src: self.frontPath,
  569. quality: 50,
  570. width: 'auto',
  571. height: 'auto',
  572. success: compressRes => {
  573. self.frontPath = compressRes.tempFilePath;
  574. console.log('压缩图片结果');
  575. console.log(compressRes);
  576. self.imgList = [compressRes.tempFilePath]
  577. }
  578. })
  579. }
  580. })
  581. },
  582. ViewImage(e) {
  583. uni.previewImage({
  584. urls: this.imgList,
  585. current: e.currentTarget.dataset.url
  586. });
  587. },
  588. DelImg(e) {
  589. uni.showModal({
  590. title: '删除',
  591. content: '确定删除这张截图嘛?',
  592. cancelText: '取消',
  593. confirmText: '确定',
  594. success: res => {
  595. if (res.confirm) {
  596. this.imgList.splice(e.currentTarget.dataset.index, 1);
  597. }
  598. }
  599. });
  600. },
  601. tohowupload() {
  602. uni.navigateTo({
  603. url: '../howupload/howupload'
  604. });
  605. uni.navigateTo({
  606. url: '../../packone/pages/howupload/howupload'
  607. });
  608. }
  609. }
  610. };
  611. </script>
  612. <style lang="scss" scoped>
  613. .poster {
  614. width: 100%;
  615. height: 100vh;
  616. position: fixed;
  617. top: 0;
  618. left: 0;
  619. background-color: rgba(0, 0, 0, 0.7);
  620. z-index: 9999;
  621. .poster_con {
  622. width: 90%;
  623. margin: 0 auto;
  624. height: 100%;
  625. display: flex;
  626. flex-direction: column;
  627. justify-content: center;
  628. align-items: center;
  629. .canvas {
  630. width: 540rpx;
  631. height: 900rpx;
  632. border-radius: 24rpx;
  633. position: relative;
  634. #canvas {
  635. width: 540rpx;
  636. height: 900rpx;
  637. position: absolute;
  638. top: 0;
  639. left: 0;
  640. opacity: 0;
  641. }
  642. image {
  643. width: 540rpx;
  644. height: 900rpx;
  645. }
  646. }
  647. .close {
  648. position: absolute;
  649. top: 12vh;
  650. right: 42rpx;
  651. color: #dedede;
  652. width: 50rpx;
  653. height: 50rpx;
  654. z-index: 999;
  655. }
  656. .save_img {
  657. color: #fff;
  658. width: 100%;
  659. text-align: center;
  660. font-size: 30rpx;
  661. margin-top: 20rpx;
  662. }
  663. }
  664. }
  665. // .poster {
  666. // width: 100vw;
  667. // height: 100vh;
  668. // position: fixed;
  669. // top: 0;
  670. // left: 0;
  671. // background-color: rgba(0, 0, 0, 0.7);
  672. // z-index: 9999;
  673. // .poster_con {
  674. // width: 220;
  675. // height: 100vh;
  676. // .canvas {
  677. // width: 100vw;
  678. // height: 100vh;
  679. // position: relative;
  680. // #canvas {
  681. // position: absolute;
  682. // top: 0;
  683. // left: 0;
  684. // z-index: 9999;
  685. // // opacity: 0;
  686. // }
  687. // // image {
  688. // // width: 100%;
  689. // // height: 100%;
  690. // // border-radius: 24rpx;
  691. // // z-index: 99999;
  692. // // }
  693. // }
  694. // }
  695. // .iconfont {
  696. // position: absolute;
  697. // top: 3vh;
  698. // right: 25rpx;
  699. // color: #dedede;
  700. // font-size: 60rpx;
  701. // z-index: 999;
  702. // }
  703. // .sub_btn {
  704. // margin-top: 76rpx;
  705. // }
  706. // }
  707. .upload {
  708. @include page();
  709. overflow: hidden;
  710. background: $custom-nav-borderbot-color;
  711. .header {
  712. line-height: 70rpx;
  713. // line-height: 90rpx;
  714. padding: 0 48rpx;
  715. color: #2a2a2a;
  716. font-size: 36rpx;
  717. background-color: #eeeeee;
  718. border-bottom: 1px solid #eeeeee;
  719. font-weight: bolder;
  720. .header_con {
  721. display: flex;
  722. justify-content: space-between;
  723. align-items: center;
  724. .how {
  725. width: 134rpx;
  726. height: 58rpx;
  727. background: #fb6342;
  728. display: flex;
  729. align-items: center;
  730. justify-content: center;
  731. color: #fff;
  732. font-size: 28rpx;
  733. font-weight: normal;
  734. border-radius: 8rpx;
  735. }
  736. }
  737. .small {
  738. font-size: 28rpx;
  739. }
  740. }
  741. .repair {
  742. image {
  743. width: 100%;
  744. height: 600rpx;
  745. margin-top: 140rpx;
  746. }
  747. view {
  748. font-size: 30rpx;
  749. font-weight: bold;
  750. text-align: center;
  751. line-height: 50rpx;
  752. text-shadow: 2rpx #1cbbb4;
  753. }
  754. }
  755. .loading {
  756. top: 0;
  757. left: 0;
  758. right: 0;
  759. bottom: 0;
  760. z-index: 2;
  761. position: fixed;
  762. display: flex;
  763. align-items: center;
  764. justify-content: center;
  765. background: rgba(0, 0, 0, 0.6);
  766. text {
  767. width: 150rpx;
  768. height: 150rpx;
  769. display: flex;
  770. align-items: center;
  771. justify-content: center;
  772. color: #fa6342;
  773. font-size: 60rpx;
  774. border-radius: 50%;
  775. background: #ffffff;
  776. }
  777. image {
  778. top: 50%;
  779. left: 50%;
  780. width: 400rpx;
  781. height: 400rpx;
  782. position: absolute;
  783. margin-top: -200rpx;
  784. margin-left: -200rpx;
  785. &.rotate {
  786. animation: loading 4s infinite;
  787. }
  788. }
  789. view {
  790. top: 30%;
  791. left: 50%;
  792. width: 100%;
  793. color: #fa6342;
  794. font-size: 42rpx;
  795. text-align: center;
  796. position: absolute;
  797. transform: translateX(-50%);
  798. }
  799. }
  800. .content {
  801. margin-top: $custom-nav-borderbot-height;
  802. position: relative;
  803. display: flex;
  804. flex-direction: column;
  805. .example {
  806. flex: 1;
  807. background: #ffffff;
  808. overflow-y: hidden;
  809. image {
  810. width: 100%;
  811. height: 100%;
  812. }
  813. }
  814. .connect {
  815. width: 16rpx;
  816. height: 112rpx;
  817. position: absolute;
  818. top: 278rpx;
  819. &.left {
  820. left: 91rpx;
  821. }
  822. &.right {
  823. right: 91rpx;
  824. }
  825. }
  826. .top {
  827. box-sizing: border-box;
  828. .upload_item_parent {
  829. margin-bottom: 20rpx;
  830. }
  831. .col_inp {
  832. view,
  833. input {
  834. font-size: 28rpx;
  835. font-weight: bold;
  836. }
  837. .input {
  838. display: flex;
  839. align-items: center;
  840. color: #FB231F;
  841. width: 78%;
  842. input {
  843. margin-left: 10rpx;
  844. }
  845. }
  846. }
  847. .upload_item {
  848. width: 100%;
  849. height: 100rpx;
  850. padding: 0 30rpx;
  851. box-sizing: border-box;
  852. background-color: #ffffff;
  853. border-bottom: 1px solid #f5f5f5;
  854. display: flex;
  855. align-items: center;
  856. justify-content: space-between;
  857. .upload_type_name {
  858. color: #333333;
  859. font-size: 28rpx;
  860. font-weight: bolder;
  861. width: 95rpx;
  862. text-align: left;
  863. }
  864. .upload_controls {
  865. flex: 1;
  866. overflow: hidden;
  867. margin-left: 22rpx;
  868. margin-right: 30rpx;
  869. }
  870. &:nth-last-of-type(1) {
  871. border-bottom: none;
  872. }
  873. .upload_delete_btn_box {
  874. width: 40rpx;
  875. height: 40rpx;
  876. display: flex;
  877. justify-content: center;
  878. align-items: center;
  879. .upload_delete_btn {
  880. width: 30rpx;
  881. height: 30rpx;
  882. background-image: url(../../static/icon/delete.png);
  883. background-size: 100% 100%;
  884. }
  885. }
  886. .upload_add_btn {
  887. width: 40rpx;
  888. height: 40rpx;
  889. border-radius: 50%;
  890. background-color: #fb6342;
  891. position: relative;
  892. &::after {
  893. content: '';
  894. display: block;
  895. width: 20rpx;
  896. height: 4rpx;
  897. background-color: #ffffff;
  898. border-radius: 4rpx;
  899. position: absolute;
  900. top: 50%;
  901. left: 50%;
  902. margin-top: -2rpx;
  903. margin-left: -10rpx;
  904. }
  905. &::before {
  906. content: '';
  907. display: block;
  908. width: 4rpx;
  909. height: 20rpx;
  910. background-color: #ffffff;
  911. border-radius: 20rpx;
  912. position: absolute;
  913. top: 50%;
  914. left: 50%;
  915. margin-top: -10rpx;
  916. margin-left: -2rpx;
  917. }
  918. }
  919. }
  920. // .upload_item {
  921. // width: 100%;
  922. // margin-bottom: 20rpx;
  923. // &:nth-last-of-type(1) {
  924. // margin-bottom: 0;
  925. // }
  926. // .upload_header {
  927. // width: 100%;
  928. // background-color: #FFFFFF;
  929. // height: 94rpx;
  930. // display: flex;
  931. // align-items: center;
  932. // justify-content: space-between;
  933. // padding: 0 30rpx;
  934. // box-sizing: border-box;
  935. // }
  936. // .upload_title {
  937. // color: #333333;
  938. // font-size: 28rpx;
  939. // }
  940. // .upload_num {
  941. // color: #333333;
  942. // font-size: 28rpx;
  943. // .num_spec {
  944. // color: #FB6342;
  945. // margin-right: 10rpx;
  946. // }
  947. // }
  948. // .upload_right {
  949. // display: flex;
  950. // align-items: center;
  951. // }
  952. // .upload_btn {
  953. // height: 42rpx;
  954. // line-height: 42rpx;
  955. // border-radius: 42rpx;
  956. // width: 136rpx;
  957. // background-color: #FB6342;
  958. // color: #FFFFFF;
  959. // font-size: 24rpx;
  960. // text-align: center;
  961. // margin-right: 30rpx;
  962. // }
  963. // .upload_up_arrow {
  964. // &::after{
  965. // transform: rotate(270deg) !important;
  966. // }
  967. // }
  968. // .upload_arrow {
  969. // &::after {
  970. // content: "";
  971. // display: block;
  972. // width: 28rpx;
  973. // height: 28rpx;
  974. // background-image: url(../../static/icon/arrow.png);
  975. // background-size: 100% 100%;
  976. // background-repeat: no-repeat;
  977. // transform: rotate(90deg);
  978. // }
  979. // }
  980. // }
  981. .top-item {
  982. font-size: 30rpx;
  983. color: #333333;
  984. display: flex;
  985. justify-content: space-between;
  986. align-items: center;
  987. background: #ffffff;
  988. margin-bottom: 12rpx;
  989. height: 90rpx;
  990. padding: 0 35rpx;
  991. box-sizing: border-box;
  992. }
  993. }
  994. .bot {
  995. height: 240rpx;
  996. box-sizing: border-box;
  997. padding: 0 30rpx;
  998. color: rgba(178, 178, 178, 1);
  999. .grid {
  1000. width: 100%;
  1001. height: 100%;
  1002. }
  1003. .choose {
  1004. width: 100%;
  1005. height: 100%;
  1006. display: flex;
  1007. justify-content: center;
  1008. flex-direction: column;
  1009. align-items: center;
  1010. color: #ff7e00;
  1011. font-size: 30rpx;
  1012. padding-bottom: 0 !important;
  1013. background: #ffffff;
  1014. margin: 0 !important;
  1015. }
  1016. .upload_img {
  1017. width: 128rpx;
  1018. height: 128rpx;
  1019. margin-bottom: 12rpx;
  1020. background-image: url(../../static/new/upload.png);
  1021. background-size: 100% 100%;
  1022. background-repeat: no-repeat;
  1023. }
  1024. }
  1025. .submit {
  1026. width: calc(100% - 60rpx);
  1027. height: 70rpx;
  1028. margin: 30rpx auto 10rpx;
  1029. background: rgba(250, 99, 66, 1);
  1030. border-radius: 35rpx;
  1031. color: #ffffff;
  1032. font-size: 32rpx;
  1033. line-height: 70rpx;
  1034. text-align: center;
  1035. padding: 0 30rpx;
  1036. }
  1037. .howupload {
  1038. font-size: 24rpx;
  1039. line-height: 84rpx;
  1040. text-align: center;
  1041. font-weight: bold;
  1042. color: rgba(243, 67, 54, 1);
  1043. text {
  1044. margin-left: 9rpx;
  1045. }
  1046. }
  1047. }
  1048. .success {
  1049. position: fixed;
  1050. top: 0;
  1051. left: 0;
  1052. right: 0;
  1053. bottom: 0;
  1054. background: rgba(0, 0, 0, 0.85);
  1055. z-index: 3;
  1056. .success_con {
  1057. position: relative;
  1058. display: flex;
  1059. flex-direction: column;
  1060. justify-content: center;
  1061. align-items: center;
  1062. .userinfo {
  1063. position: absolute;
  1064. display: flex;
  1065. flex-direction: column;
  1066. justify-content: center;
  1067. align-items: center;
  1068. top: 178rpx;
  1069. z-index: 888;
  1070. .photo {
  1071. width: 148rpx;
  1072. height: 148rpx;
  1073. border-radius: 50%;
  1074. border: 2rpx solid #faf0a9;
  1075. margin-bottom: 30rpx;
  1076. }
  1077. .nickname {
  1078. background: #fa3033;
  1079. border-radius: 44rpx;
  1080. border: 4rpx solid #faf0a9;
  1081. padding: 10rpx 30rpx;
  1082. color: #faf0a9;
  1083. font-size: 40rpx;
  1084. font-weight: bold;
  1085. }
  1086. }
  1087. .level_score_bg {
  1088. width: 100%;
  1089. height: 100%;
  1090. margin-top: 50rpx;
  1091. }
  1092. .upload_success_box {
  1093. position: absolute;
  1094. bottom: 308rpx;
  1095. .level_score {
  1096. font-size: 36rpx;
  1097. color: #ffffff;
  1098. font-weight: bolder;
  1099. min-width: 450rpx;
  1100. text-align: center;
  1101. // margin-boottom:50rpx;
  1102. // margin: -88rpx auto 100rpx auto;
  1103. }
  1104. .user-name {
  1105. width: 100%;
  1106. text-align: center;
  1107. color: #ffec34;
  1108. font-size: 36rpx;
  1109. margin: 40rpx auto;
  1110. }
  1111. // .goon_box {
  1112. // display: flex;
  1113. // justify-content: center;
  1114. // align-items: center;
  1115. // margin-top:85rpx;
  1116. // .goon {
  1117. // width: 300rpx;
  1118. // height: 70rpx;
  1119. // line-height: 70rpx;
  1120. // text-align: center;
  1121. // background: #fa6342;
  1122. // font-size: 32rpx;
  1123. // color: #ffffff;
  1124. // border-radius: 35rpx;
  1125. // &.rank {
  1126. // color: #fa6342;
  1127. // background: #ffffff;
  1128. // border: 1rpx solid #fa6342;
  1129. // margin-left: 60rpx;
  1130. // }
  1131. // }
  1132. // }
  1133. .goon_box {
  1134. display: flex;
  1135. justify-content: center;
  1136. align-items: center;
  1137. margin-top: 70rpx;
  1138. .goon,
  1139. .save {
  1140. width: 300rpx;
  1141. height: 88rpx;
  1142. line-height: 88rpx;
  1143. text-align: center;
  1144. font-size: 32rpx;
  1145. border-radius: 44rpx;
  1146. &.rank {
  1147. color: #fa6342;
  1148. background: #ffffff;
  1149. border: 1rpx solid #fa6342;
  1150. margin-left: 60rpx;
  1151. }
  1152. }
  1153. .goon {
  1154. background: #fff;
  1155. color: #fe0000;
  1156. margin-right: 22rpx;
  1157. }
  1158. .save {
  1159. background: linear-gradient(90deg, #f97c55 0%, #f44545 100%);
  1160. color: #ffffff;
  1161. }
  1162. }
  1163. }
  1164. }
  1165. .animation {
  1166. width: 66rpx;
  1167. height: 66rpx;
  1168. position: absolute;
  1169. margin-left: -33rpx;
  1170. top: -66rpx;
  1171. left: 50%;
  1172. &.drop {
  1173. animation: monkey-drop 0.2s linear;
  1174. animation-fill-mode: forwards;
  1175. }
  1176. }
  1177. &::before {
  1178. content: '';
  1179. display: block;
  1180. width: 100%;
  1181. height: 653rpx;
  1182. position: absolute;
  1183. left: 0;
  1184. right: 0;
  1185. top: 105rpx;
  1186. background-image: url(https://api.jiuweiyun.cn/public/uploads/icon/light.png);
  1187. background-size: 100% 100%;
  1188. background-repeat: no-repeat;
  1189. }
  1190. }
  1191. }
  1192. @keyframes unload-ok-bg {
  1193. 0% {
  1194. background: rgba(0, 0, 0, 0);
  1195. }
  1196. 100% {
  1197. background: rgba(0, 0, 0, 0.3);
  1198. }
  1199. }
  1200. @keyframes monkey-drop {
  1201. 0% {
  1202. top: -66rpx;
  1203. display: block;
  1204. }
  1205. 100% {
  1206. top: 470rpx;
  1207. display: none;
  1208. }
  1209. }
  1210. @keyframes loading {
  1211. 0% {
  1212. transform: rotateZ(0deg);
  1213. }
  1214. 100% {
  1215. transform: rotateZ(360deg);
  1216. }
  1217. }
  1218. </style>