signContract.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854
  1. <template>
  2. <view class="content">
  3. <!-- <view class="content1">
  4. <view style='width:70px'>付款方式</view>
  5. <u-radio-group v-model="dataDetails.advanceFreightService" placement="row">
  6. <u-radio :customStyle="radioCustomStyle" v-for="(item, index) in radiolist1" :key="index"
  7. :label="item.name" :name="item.name" @change="radioChange">
  8. </u-radio>
  9. </u-radio-group>
  10. </view> -->
  11. <view class="content2">
  12. <view class="flex">
  13. <view class="title">合同摘要</view>
  14. <view class="preview" @click="submit(1)">预览合同</view>
  15. </view>
  16. <view class='row-between'>
  17. <view class="gray">发货单位</view>
  18. <view class="">{{dataDetails.compName?dataDetails.compName:'个人货主'}}</view>
  19. </view>
  20. <view class='row-between'>
  21. <view class="gray">发货地</view>
  22. <view class="place">
  23. {{dataDetails.sendPrivate}}{{dataDetails.sendCity}}{{dataDetails.sendArea}}{{dataDetails.sendDetailedAddress}}
  24. </view>
  25. </view>
  26. <view class='row-between'>
  27. <view class="gray">卸货地</view>
  28. <view class=" place">
  29. {{dataDetails.unloadPrivate}}{{dataDetails.unloadCity}}{{dataDetails.unloadArea}}{{dataDetails.unloadDetailedAddress}}
  30. </view>
  31. </view>
  32. <view class='row-between'>
  33. <view class="gray">货名</view>
  34. <view class="">{{dataDetails.goodsName}}</view>
  35. </view>
  36. <view class='row-between'>
  37. <view class="gray">距离</view>
  38. <view class="">约{{dataDetails.distance}}公里</view>
  39. </view>
  40. <view class='row-between'>
  41. <!-- 后加 -->
  42. <view class="gray">服务费(元)</view>
  43. <view class="">{{dataDetails.serviceCharge}}</view>
  44. </view>
  45. <view class="title">
  46. 完善信息
  47. </view>
  48. <view class='row-between'>
  49. <view class="gray">运费(元/车)</view>
  50. <!-- <view class="">{{dataDetails.freight}}{{dataDetails.illingMethod==0?'元/吨':'元/车'}}</view> -->
  51. <!-- <view class="flex"><input type="text" placeholder="请输入运费" v-model="dataDetails.freight"
  52. class="text-align-right yf-input">{{dataDetails.freight}}元/车</view> -->
  53. <view class="flex">
  54. <u--input placeholder="请输入运费" border="none" type="number" v-model="dataDetails.freight"
  55. inputAlign='right' clearable @input="preMoney"></u--input>
  56. <!-- <span> 元/车</span> -->
  57. </view>
  58. </view>
  59. <view class='row-between'>
  60. <view class="gray">车牌号</view>
  61. <view class="" style="color:#BBBBBB;" @click="carClick">
  62. {{dataDetails.carrierInfo.carNo?dataDetails.carrierInfo.carNo:'请选择车牌号'}}
  63. </view>
  64. <!-- <view class="flex">
  65. <input class="" v-model='dataDetails.carrierInfo.carNo' @click.stop="handleShowKeyboard"
  66. :disabled="true" placeholder="输入车牌号" name="input" style="text-align: right;"></input>
  67. </view> -->
  68. </view>
  69. <view class='row-between'>
  70. <view class="gray">挂车号(选填)</view>
  71. <view class="flex">
  72. <u--input placeholder="请输入挂车号" border="none" disabled v-model="dataDetails.trailerNumber"
  73. inputAlign='right' clearable></u--input>
  74. </view>
  75. </view>
  76. <view class='row-between'>
  77. <view class="gray">装车净重(吨)</view>
  78. <view class="flex">
  79. <u--input placeholder="请输入装车净重" border="none" v-model="dataDetails.weight" inputAlign='right'
  80. clearable></u--input>
  81. </view>
  82. </view>
  83. <view class='row-between'>
  84. <view class="gray">运输开始日期</view>
  85. <view class="">
  86. <view @click="dateShow">{{dataDetails.startDates?dataDetails.startDates:'请选择运输开始日期'}}
  87. </view>
  88. <u-calendar :show="startShow" mode="single" @confirm="startDate" @close="startShow= false">
  89. </u-calendar>
  90. </view>
  91. </view>
  92. <view class='row-between'>
  93. <view class="gray">运输截止日期</view>
  94. <view class="">
  95. <!-- <u--input placeholder="请输入内容" border="none" v-model="dataDetails.value" inputAlign='right'
  96. clearable></u--input> -->
  97. <view class="" @click="endShow = true">{{dataDetails.endDates?dataDetails.endDates:'请选择运输截止日期'}}
  98. </view>
  99. <u-calendar :show="endShow" mode="single" @confirm="endDate" @close="endShow= false"></u-calendar>
  100. </view>
  101. </view>
  102. <view class='row-between'>
  103. <view class="gray">联络人姓名</view>
  104. <view class="">
  105. <u--input placeholder="请输入联络人姓名" border="none" v-model="dataDetails.driverName" inputAlign='right'
  106. clearable></u--input>
  107. </view>
  108. </view>
  109. <view class='row-between'>
  110. <view class="gray">联络人电话</view>
  111. <view class="">
  112. <u--input placeholder="请输入联络人电话" border="none" type="number" maxlength="11"
  113. v-model="dataDetails.driverPhone" inputAlign='right' clearable></u--input>
  114. </view>
  115. </view>
  116. <view class='row-between'>
  117. <view class="gray">装车后预付款</view>
  118. <view class="">
  119. <u--input placeholder="自动获取,不可编辑" v-if="dataDetails.freightAdvance == 1" border="none"
  120. v-model="dataDetails.loadingAdvancePayment" inputAlign='right' clearable disabled></u--input>
  121. <u--input placeholder="请输入装车后预付款" v-else border="none" v-model="dataDetails.loadingAdvancePayment"
  122. inputAlign='right' clearable></u--input>
  123. </view>
  124. </view>
  125. <view class='row-between'>
  126. <view class="gray">收款账户</view>
  127. <view class="" @click="collection">
  128. {{dataDetails.bankDeposit?dataDetails.bankDeposit:"请选择收款账户"}}
  129. {{dataDetails.bankCard?dataDetails.bankCard.substring(dataDetails.bankCard.length - 4):""}}
  130. </view>
  131. </view>
  132. </view>
  133. <view class="wrapper content3">
  134. <view class="qm-row">
  135. <view class="handTitle">手写签名</view>
  136. <image src="@/static/xiangpica@2x.png" mode="widthFix" @click="retDraw" class="retDraw-image"></image>
  137. <!-- <button @click="retDraw" class="delBtn">重写</button> -->
  138. </view>
  139. <view class="handCenter">
  140. <canvas class="handWriting" :disable-scroll="true" @touchstart="uploadScaleStart"
  141. @touchmove="uploadScaleMove" canvas-id="handWriting"></canvas>
  142. </view>
  143. <view class="handRight">
  144. </view>
  145. <view class="handBtn">
  146. <!-- <image @click="selectColorEvent('black','#1A1A1A')"
  147. :src="selectColor === 'black' ? '/static/other/color_black_selected.png' : '/static/other/color_black.png'"
  148. :class="[selectColor === 'black' ? 'color_select' : '', 'black-select']"></image>
  149. <image @click="selectColorEvent('red','#ca262a')"
  150. :src="selectColor === 'red' ? '/static/other/color_red_selected.png' : '/static/other/color_red.png'"
  151. :class="[selectColor === 'red' ? 'color_select' : '', 'black-select']"></image> -->
  152. <!-- <button @click="saveCanvasAsImg" class="saveBtn">保存</button> -->
  153. <view @click="submit" class="saveBtn">提交</view>
  154. <!-- <button @click="previewCanvasImg" class="previewBtn">预览</button> -->
  155. <!-- <button @click="subCanvas" class="subBtn">完成</button> -->
  156. </view>
  157. </view>
  158. <u-picker :show="showCarList" :columns="carList" :closeOnClickOverlay='true' @close='selectTypeClose'
  159. @cancel='selectTypeClose' @confirm='confirmBtn'></u-picker>
  160. <master-keyboard ref="keyboard" keyboardtype="car" :show="keyShow" :randomNumber="true" :newCar="false"
  161. :defaultValue="carNumber" @keyboardClick="handleClick"></master-keyboard>
  162. <u-toast ref="uToast"></u-toast>
  163. <u-toast ref="uToast"></u-toast>
  164. </view>
  165. </template>
  166. <script>
  167. import {
  168. mapState
  169. } from 'vuex';
  170. var that;
  171. import uploadImage from '@/components/ossutil/uploadFile.js';
  172. export default {
  173. data() {
  174. return {
  175. showCarList: false,
  176. carList: [],
  177. carlistCopy: [],
  178. keyShow: false,
  179. carNumber: '',
  180. isScaleStart: false,
  181. radioCustomStyle: {
  182. margin: '0 0 0 10rpx'
  183. },
  184. canvasName: 'handWriting',
  185. ctx: "",
  186. startX: null,
  187. startY: null,
  188. canvasWidth: 0,
  189. canvasHeight: 0,
  190. selectColor: 'black',
  191. lineColor: '#1A1A1A', // 颜色
  192. lineSize: 5, // 笔记倍数
  193. value: true,
  194. dataDetails: {
  195. carrierInfo: {},
  196. serviceCharge:'50'
  197. },
  198. radiolist1: [{
  199. name: '平台垫付运费',
  200. disabled: false
  201. },
  202. {
  203. name: '无需平台垫付运费',
  204. disabled: false
  205. },
  206. ],
  207. startShow: false,
  208. endShow: false,
  209. contractCheck:false,//判断合同是否提交
  210. proportion:"",//垫付比例
  211. };
  212. },
  213. computed: {
  214. ...mapState(['hasLogin', 'userInfo', 'firstAuthentication']),
  215. },
  216. onShow() {
  217. let payInfo = uni.getStorageSync("payInfo")
  218. if (payInfo) {
  219. this.dataDetails.bankCard = payInfo.bankCard
  220. this.dataDetails.bankDeposit = payInfo.bankDeposit
  221. this.dataDetails.bankDepositBranch = payInfo.bankDepositBranch
  222. this.dataDetails.payeeName = payInfo.payeeName
  223. } else {
  224. this.$request.baseRequest('get', '/driverPayeeInfo/getDriverPayee', {
  225. commonId: that.firstAuthentication.commonId
  226. }).then(res => {
  227. if(res.data){
  228. this.dataDetails.bankCard = res.data.bankCard
  229. this.dataDetails.bankDeposit = res.data.bankDeposit
  230. this.dataDetails.bankDepositBranch = res.data.bankDepositBranch
  231. this.dataDetails.payeeName = res.data.payeeName
  232. }
  233. })
  234. }
  235. },
  236. onLoad(options) {
  237. this.carList = []
  238. that = this
  239. this.dataDetails = JSON.parse(decodeURIComponent(options.obj))
  240. if(this.dataDetails.freightAdvance == 1){
  241. this.proportion = this.dataDetails.driverAdvancePayment > this.dataDetails.ownerAdvancePayment ? this.dataDetails.ownerAdvancePayment:this.dataDetails.driverAdvancePayment
  242. }
  243. console.log(this.dataDetails)
  244. this.dataDetails.carrierInfo = {}
  245. this.ctx = uni.createCanvasContext("handWriting");
  246. this.$nextTick(() => {
  247. uni.createSelectorQuery().select('.handCenter').boundingClientRect(rect => {
  248. this.canvasWidth = rect.width;
  249. this.canvasHeight = rect.height;
  250. /* 将canvas背景设置为 白底,不设置 导出的canvas的背景为透明 */
  251. this.setCanvasBg('#fff');
  252. })
  253. .exec();
  254. });
  255. uni.showLoading({
  256. title: '加载中'
  257. })
  258. this.$request.baseRequest('get', '/driverCarInfo/selectDriverCar', {
  259. // driverId: that.userInfo.driverId,
  260. commonId:this.userInfo.id
  261. }).then(res => {
  262. if (res.code == '200') {
  263. uni.hideLoading()
  264. if (res.data.length > 0) {
  265. let _list = []
  266. for (let i = 0; i < res.data.length; i++) {
  267. if (res.data[i].status == '已通过') {
  268. _list.push(res.data[i].carNumber)
  269. }
  270. }
  271. that.carlistCopy = res.data
  272. that.carList = [_list]
  273. }
  274. } else {
  275. uni.$u.toast(res.message);
  276. }
  277. })
  278. .catch(res => {
  279. uni.$u.toast(res.message);
  280. });
  281. },
  282. methods: {
  283. preMoney(){
  284. if(this.dataDetails.freightAdvance == 1){
  285. this.dataDetails.loadingAdvancePayment = this.dataDetails.freight * this.proportion
  286. }
  287. },
  288. collection() {
  289. uni.$u.route('/pages/order/bankCard');
  290. },
  291. confirmBtn(e) {
  292. this.dataDetails.carrierInfo.carNo = e.value[0]
  293. for (let i = 0; i < this.carlistCopy.length; i++) {
  294. if (e.value[0] == this.carlistCopy[i].carNumber) {
  295. this.dataDetails.trailerNumber = this.carlistCopy[i].guaCarNumber
  296. }
  297. }
  298. this.showCarList = false
  299. },
  300. selectTypeClose() {
  301. this.showCarList = false
  302. },
  303. carClick() {
  304. this.showCarList = true
  305. },
  306. //车牌号弹出键盘
  307. handleShowKeyboard() {
  308. if (!this.dataDetails.carrierInfo.carNo) {
  309. this.carNumber = ''
  310. } else {
  311. this.carNumber = this.dataDetails.carrierInfo.carNo
  312. }
  313. if (this.$refs.keyboard.open) {
  314. this.$refs.keyboard.open(false) //true 键盘显示 false 键盘隐藏
  315. } else {
  316. this.$refs.keyboard[0].open(false)
  317. }
  318. if (this.$refs.keyboard.open) {
  319. this.$refs.keyboard.open(true) //true 键盘显示 false 键盘隐藏
  320. } else {
  321. this.$refs.keyboard[0].open(true)
  322. }
  323. },
  324. //车牌号弹出键盘
  325. handleClick(e) {
  326. this.carNumber = e.value
  327. this.dataDetails.carrierInfo.carNo = e.value //键盘输入值
  328. },
  329. dateShow() {
  330. this.startShow = true
  331. },
  332. removeStart() {
  333. this.startShow = false
  334. },
  335. removeEnd() {
  336. this.endShow = false
  337. },
  338. startDate(e) {
  339. this.startShow = false
  340. this.dataDetails.startDates = e[0]
  341. },
  342. endDate(e) {
  343. this.dataDetails.endDates = e[0]
  344. this.endShow = false
  345. },
  346. submit(num) {
  347. let _obj = {}
  348. if(num == 1){//预览合同
  349. _obj.submitFlag = 1
  350. this.contractCheck = false
  351. }else{//提交合同
  352. this.contractCheck = true
  353. _obj.submitFlag = 2
  354. }
  355. if (!that.isScaleStart) {
  356. that.$refs.uToast.show({
  357. type: 'error',
  358. message: "手写签名不能为空!",
  359. })
  360. return
  361. }
  362. if (uni.$u.test.isEmpty(that.dataDetails.freight)) {
  363. that.$refs.uToast.show({
  364. type: 'error',
  365. message: "运费不能为空!",
  366. })
  367. return
  368. }
  369. if (uni.$u.test.isEmpty(that.dataDetails.startDates)) {
  370. that.$refs.uToast.show({
  371. type: 'error',
  372. message: "运输起始日期不能为空!",
  373. })
  374. return
  375. }
  376. if (uni.$u.test.isEmpty(that.dataDetails.endDates)) {
  377. that.$refs.uToast.show({
  378. type: 'error',
  379. message: "运输截止日期不能为空!",
  380. })
  381. return
  382. }
  383. if (uni.$u.test.isEmpty(that.dataDetails.driverName)) {
  384. that.$refs.uToast.show({
  385. type: 'error',
  386. message: "联络人姓名不能为空!",
  387. })
  388. return
  389. }
  390. if (uni.$u.test.isEmpty(that.dataDetails.driverPhone)) {
  391. that.$refs.uToast.show({
  392. type: 'error',
  393. message: "联络人电话不能为空!",
  394. })
  395. return
  396. }
  397. if (uni.$u.test.isEmpty(that.dataDetails.loadingAdvancePayment)) {
  398. that.$refs.uToast.show({
  399. type: 'error',
  400. message: "装车后预付款不能为空!",
  401. })
  402. return
  403. }
  404. _obj.trailerNumber = that.dataDetails.trailerNumber
  405. _obj.startDates = that.dataDetails.startDates
  406. _obj.endDates = that.dataDetails.endDates
  407. _obj.contactPersonName = that.dataDetails.driverName
  408. _obj.contactPersonPhone = that.dataDetails.driverPhone
  409. _obj.freightCars = that.dataDetails.freight
  410. // _obj.advanceCharge = that.dataDetails.advanceCharge
  411. _obj.id = that.dataDetails.id
  412. _obj.carNumber = that.dataDetails.carrierInfo.carNo
  413. _obj.weight = that.dataDetails.weight
  414. _obj.loadingAdvancePayment = that.dataDetails.loadingAdvancePayment
  415. _obj.typeFlag = 2
  416. uni.canvasToTempFilePath({
  417. canvasId: 'handWriting',
  418. fileType: 'png',
  419. quality: 1, //图片质量
  420. success(res) {
  421. uploadImage('image', res.tempFilePath, 'appData/',
  422. result => {
  423. // 上传成功
  424. that.dataDetails.cargoOwnerAutograph = result
  425. _obj.driverAutograph = result
  426. uni.showLoading({
  427. title: '加载中',
  428. mask: true
  429. })
  430. that.$request.baseRequest('get', '/orderInfo/setPdf', _obj).then(
  431. res => {
  432. if (res.code == 200) {
  433. uni.hideLoading()
  434. that.contractSrc = res.data
  435. uni.downloadFile({
  436. url: res.data,
  437. success: function(res) {
  438. var filePath = res.tempFilePath;
  439. uni.openDocument({
  440. filePath: filePath,
  441. showMenu: true,
  442. success: function(res) {
  443. console.log('打开文档成功');
  444. }
  445. });
  446. }
  447. });
  448. if(that.contractCheck){//提交
  449. that.$refs.uToast.show({
  450. type: 'success',
  451. message: "提交成功",
  452. complete() {
  453. uni.removeStorageSync("payInfo") //如果要有银行卡缓存就删除
  454. uni.$u.route('/pages/order/confirmLoading', {
  455. obj: JSON.stringify(that
  456. .dataDetails),
  457. });
  458. // that.upCallback({
  459. // size: 10,
  460. // num: 1
  461. // })
  462. }
  463. })
  464. }
  465. }else{
  466. uni.$u.toast(res.message);
  467. uni.hideLoading()
  468. }
  469. })
  470. .catch(res => {
  471. uni.$u.toast(res.message);
  472. });
  473. }
  474. )
  475. }
  476. });
  477. },
  478. // change(e){
  479. // if(this.value){
  480. // this.$set(this.dataDetails,'advanceFreightService',1)
  481. // }else{
  482. // this.$set(this.dataDetails,'advanceFreightService',0)
  483. // }
  484. // },
  485. // 笔迹开始
  486. uploadScaleStart(e) {
  487. this.isScaleStart = true
  488. this.startX = e.changedTouches[0].x
  489. this.startY = e.changedTouches[0].y
  490. //设置画笔参数
  491. //画笔颜色
  492. this.ctx.setStrokeStyle(this.lineColor)
  493. //设置线条粗细
  494. this.ctx.setLineWidth(this.lineSize)
  495. //设置线条的结束端点样式
  496. this.ctx.setLineCap("round") //'butt'、'round'、'square'
  497. //开始画笔
  498. this.ctx.beginPath()
  499. },
  500. // 笔迹移动
  501. uploadScaleMove(e) {
  502. //取点
  503. let temX = e.changedTouches[0].x
  504. let temY = e.changedTouches[0].y
  505. //画线条
  506. this.ctx.moveTo(this.startX, this.startY)
  507. this.ctx.lineTo(temX, temY)
  508. this.ctx.stroke()
  509. this.startX = temX
  510. this.startY = temY
  511. this.ctx.draw(true)
  512. },
  513. /**
  514. * 重写
  515. */
  516. retDraw() {
  517. this.ctx.clearRect(0, 0, 700, 730);
  518. this.ctx.draw();
  519. //设置canvas背景
  520. this.setCanvasBg('#fff');
  521. },
  522. /**
  523. * @param {Object} str
  524. * @param {Object} color
  525. * 选择颜色
  526. */
  527. selectColorEvent(str, color) {
  528. this.selectColor = str;
  529. this.lineColor = color;
  530. },
  531. //完成
  532. subCanvas() {
  533. uni.canvasToTempFilePath({
  534. canvasId: 'handWriting',
  535. fileType: 'png',
  536. quality: 1, //图片质量
  537. success(res) {
  538. // console.log(res.tempFilePath, 'canvas生成图片地址');
  539. uni.showToast({
  540. title: '以保存'
  541. });
  542. //保存到系统相册
  543. uni.saveImageToPhotosAlbum({
  544. filePath: res.tempFilePath,
  545. success(res) {
  546. uni.showToast({
  547. title: '已成功保存到相册',
  548. duration: 2000
  549. });
  550. }
  551. });
  552. }
  553. });
  554. },
  555. //保存到相册
  556. saveCanvasAsImg() {
  557. uni.canvasToTempFilePath({
  558. canvasId: 'handWriting',
  559. fileType: 'png',
  560. quality: 1, //图片质量
  561. success(res) {
  562. console.log(res.tempFilePath, 'canvas生成图片地址');
  563. uni.saveImageToPhotosAlbum({
  564. filePath: res.tempFilePath,
  565. success(res) {
  566. uni.showToast({
  567. title: '已保存到相册',
  568. duration: 2000
  569. });
  570. }
  571. });
  572. }
  573. });
  574. },
  575. //预览
  576. previewCanvasImg() {
  577. uni.canvasToTempFilePath({
  578. canvasId: 'handWriting',
  579. fileType: 'jpg',
  580. quality: 1, //图片质量
  581. success(res) {
  582. uni.previewImage({
  583. urls: [res.tempFilePath] //预览图片 数组
  584. });
  585. }
  586. });
  587. },
  588. //设置canvas背景色 不设置 导出的canvas的背景为透明
  589. //@params:字符串 color
  590. setCanvasBg(color) {
  591. /* 将canvas背景设置为 白底,不设置 导出的canvas的背景为透明 */
  592. //rect() 参数说明 矩形路径左上角的横坐标,左上角的纵坐标, 矩形路径的宽度, 矩形路径的高度
  593. //这里是 canvasHeight - 4 是因为下边盖住边框了,所以手动减了写
  594. this.ctx.rect(0, 0, this.canvasWidth, this.canvasHeight - 4);
  595. // ctx.setFillStyle('red')
  596. this.ctx.setFillStyle(color);
  597. this.ctx.fill(); //设置填充
  598. this.ctx.draw(); //开画
  599. }
  600. }
  601. };
  602. </script>
  603. <style lang="scss" scoped>
  604. page {
  605. background: #fbfbfb;
  606. height: auto;
  607. }
  608. .content1 {
  609. background: white;
  610. border-radius: 20rpx;
  611. margin: 20rpx;
  612. padding: 30rpx 20rpx;
  613. display: flex;
  614. justify-content: space-between;
  615. .right {
  616. display: flex;
  617. }
  618. }
  619. .content2 {
  620. background: white;
  621. border-radius: 20rpx;
  622. margin: 20rpx;
  623. padding: 30rpx 20rpx;
  624. .title {
  625. font-size: 36rpx;
  626. font-weight: 700;
  627. margin-bottom: 20rpx;
  628. width: 50%;
  629. }
  630. .preview{
  631. width: 50%;
  632. text-align: right;
  633. color: #2772FB;
  634. font-size: 26rpx;
  635. }
  636. .row-between {
  637. margin-bottom: 20rpx;
  638. }
  639. .left-text {
  640. margin-right: 20rpx;
  641. }
  642. .yf-input {
  643. padding-right: 10rpx;
  644. }
  645. }
  646. .content3 {
  647. background: white;
  648. border-radius: 20rpx;
  649. margin: 20rpx;
  650. padding: 30rpx 20rpx;
  651. }
  652. .place {
  653. width: 80%;
  654. text-align: right;
  655. }
  656. .handCenter {
  657. border: 4rpx dashed #e9e9e9;
  658. overflow: hidden;
  659. box-sizing: border-box;
  660. height: 500rpx;
  661. }
  662. .handWriting {
  663. background: #F9F9FB;
  664. width: 100%;
  665. height: 100%;
  666. }
  667. .handRight {
  668. display: inline-flex;
  669. align-items: center;
  670. }
  671. .handCenter {
  672. border: 4rpx dashed #e9e9e9;
  673. flex: 5;
  674. overflow: hidden;
  675. box-sizing: border-box;
  676. }
  677. .handTitle {
  678. font-size: 36rpx;
  679. color: #666;
  680. font-weight: 700;
  681. color: #333333;
  682. margin-bottom: 20rpx;
  683. }
  684. .retDraw-image {
  685. width: 50rpx;
  686. }
  687. .qm-row {
  688. display: flex;
  689. justify-content: space-between;
  690. }
  691. .saveBtn {
  692. width: 80%;
  693. background: #2772FB;
  694. color: white;
  695. text-align: center;
  696. border-radius: 50rpx;
  697. padding: 20rpx;
  698. }
  699. .handBtn {
  700. display: flex;
  701. justify-content: center;
  702. }
  703. /*
  704. .wrapper {
  705. width: 100%;
  706. height: 95vh;
  707. margin: 30rpx 0;
  708. overflow: hidden;
  709. display: flex;
  710. align-content: center;
  711. flex-direction: row;
  712. justify-content: center;
  713. font-size: 28rpx;
  714. }
  715. .handBtn button {
  716. font-size: 28rpx;
  717. }
  718. .handBtn {
  719. height: 95vh;
  720. display: inline-flex;
  721. flex-direction: column;
  722. justify-content: space-between;
  723. align-content: space-between;
  724. flex: 1;
  725. }
  726. .delBtn {
  727. position: absolute;
  728. top: 250rpx;
  729. left: 0rpx;
  730. transform: rotate(90deg);
  731. color: #666;
  732. }
  733. .delBtn image {
  734. position: absolute;
  735. top: 13rpx;
  736. left: 25rpx;
  737. }
  738. .subBtn {
  739. position: absolute;
  740. bottom: 52rpx;
  741. left: -3rpx;
  742. display: inline-flex;
  743. transform: rotate(90deg);
  744. background: #008ef6;
  745. color: #fff;
  746. margin-bottom: 30rpx;
  747. text-align: center;
  748. justify-content: center;
  749. }
  750. .saveBtn {
  751. position: absolute;
  752. top: 375rpx;
  753. left: 0rpx;
  754. transform: rotate(90deg);
  755. color: #666;
  756. }
  757. .previewBtn {
  758. position: absolute;
  759. top: 500rpx;
  760. left: 0rpx;
  761. transform: rotate(90deg);
  762. color: #666;
  763. }
  764. .uploadBtn {
  765. position: absolute;
  766. top: 625rpx;
  767. left: 0rpx;
  768. transform: rotate(90deg);
  769. color: #666;
  770. }
  771. .black-select {
  772. width: 60rpx;
  773. height: 60rpx;
  774. position: absolute;
  775. top: 30rpx;
  776. left: 25rpx;
  777. }
  778. .black-select.color_select {
  779. width: 90rpx;
  780. height: 90rpx;
  781. top: 100rpx;
  782. left: 10rpx;
  783. }
  784. .red-select {
  785. width: 60rpx;
  786. height: 60rpx;
  787. position: absolute;
  788. top: 140rpx;
  789. left: 25rpx;
  790. }
  791. .red-select.color_select {
  792. width: 90rpx;
  793. height: 90rpx;
  794. top: 120rpx;
  795. left: 10rpx;
  796. } */
  797. </style>