jsxq.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
  1. <template>
  2. <view class="content">
  3. <!-- <view class="top-bg">
  4. </view> -->
  5. <view class="flex jg-jz">
  6. <view class="">
  7. 规格
  8. </view>
  9. <view class="zj">
  10. {{long}}m*{{wide}}m*{{high}}m={{high*wide*long}}吨冷水箱 {{2*(long*wide + long*high + wide*high)}}平方
  11. </view>
  12. </view>
  13. <view class="new-bg">
  14. <view class="bg-line flex">
  15. <view class="title">
  16. 名称
  17. </view>
  18. <view class="name">
  19. 材质/厚度
  20. </view>
  21. <view class="specifications">
  22. 规格
  23. </view>
  24. <view class="number">
  25. 数量
  26. </view>
  27. <view class="unit_price">
  28. 单价
  29. </view>
  30. <view class="ot-price">
  31. 总价格
  32. </view>
  33. </view>
  34. <view class="bg-line flex" v-for="item in jsjg">
  35. <view class="title clamp2">
  36. {{item.title}}
  37. </view>
  38. <view class="name">
  39. {{item.name}}
  40. </view>
  41. <view class="specifications">
  42. {{item.specifications}}
  43. </view>
  44. <view class="number">
  45. {{item.number}}
  46. </view>
  47. <view class="unit_price">
  48. {{item.unit_price*1}}
  49. </view>
  50. <view class="ot-price">
  51. {{item.ot_price*1}}
  52. </view>
  53. </view>
  54. </view>
  55. <view class="flex jg-jz">
  56. <view class="">
  57. 总重量:{{(weight*1).toFixed(2)}}kg
  58. </view>
  59. <view class="zj">
  60. 含税总价:{{price*1}}元
  61. </view>
  62. </view>
  63. <!-- <view class="jg-wrap">
  64. <view class="jsjg-wrap flex" v-for="jitem in jsjg">
  65. <view class="jg-left">
  66. <view class="left-top">
  67. <text
  68. class="item-tit">{{jitem.title}}</text><text>单价:{{jitem.unit_price}}数量:{{jitem.number}}</text>
  69. </view>
  70. <view class="left-btm">
  71. 规格:{{jitem.specifications}} {{jitem.name}}
  72. </view>
  73. </view>
  74. <view class="jg-right">
  75. ¥{{jitem.ot_price}}元
  76. </view>
  77. </view>
  78. <view class="flex jg-zj">
  79. <view class="">
  80. 总计(元):
  81. </view>
  82. <view class="price">
  83. {{price}}
  84. </view>
  85. </view>
  86. <view class="jg-tip">
  87. *此结果为预估价格 详细请联系我们
  88. </view>
  89. </view> -->
  90. <view class="btn-wrap flex">
  91. <!-- <view class="xyb syb" @click="endjs">
  92. 结束计算
  93. </view> -->
  94. <button open-type="contact" plain="true" class="xyb ksjs" style="color: #fff;border: none;">
  95. 联系我们
  96. </button>
  97. </view>
  98. <view class="" style="height: 50rpx;">
  99. </view>
  100. <!-- 客服 start -->
  101. <uni-popup ref="popupkf" type="center">
  102. <view class="popup-box">
  103. <view class="img">
  104. <image src="../../static/img/img009.png" mode=""></image>
  105. </view>
  106. <view class="mian">
  107. <view class="delivery">
  108. <view class="title">已经为您定制专属客服</view>
  109. <image src="../../static/img/img010.png" mode=""></image>
  110. </view>
  111. <view class="nocancel">客服VX:{{ text }}</view>
  112. <view class="comfirm-box">
  113. <view class="cancel" @click="cancel">取消</view>
  114. <view class="comfirm" @click="comfirm(text)">复制微信</view>
  115. </view>
  116. </view>
  117. </view>
  118. </uni-popup>
  119. <!-- 客服 end -->
  120. </view>
  121. </template>
  122. <script>
  123. import {
  124. getjsDetail
  125. } from '@/api/user.js'
  126. export default {
  127. data() {
  128. return {
  129. text: '',
  130. jsjg: [],
  131. id: '',
  132. price: '',
  133. weight: '',
  134. high: '',
  135. wide: '',
  136. long: ''
  137. }
  138. },
  139. onLoad(opt) {
  140. console.log(opt)
  141. if (opt.id) {
  142. this.id = opt.id
  143. this.getjsDetail()
  144. }
  145. if (opt.price) {
  146. this.price = opt.price
  147. }
  148. if(opt.weight) {
  149. this.weight = opt.weight
  150. }
  151. //weight=' + item.weight + '&long=' + item.long + '&wide=' + item.wide + '&high=' + item.high
  152. if(opt.high) {
  153. this.high = opt.high*1
  154. console.log(this.high)
  155. }
  156. if(opt.wide) {
  157. this.wide = opt.wide*1
  158. console.log(this.wide)
  159. }
  160. if(opt.long) {
  161. this.long = opt.long*1
  162. console.log(this.long)
  163. }
  164. },
  165. onShow() {
  166. },
  167. onReachBottom() {
  168. },
  169. onReady() {
  170. },
  171. methods: {
  172. getjsDetail() {
  173. let obj = this
  174. getjsDetail({
  175. id: obj.id
  176. }).then(res => {
  177. console.log(res)
  178. obj.jsjg = res.data
  179. })
  180. },
  181. // 打开客服
  182. openKf() {
  183. this.$refs.popupkf.open();
  184. },
  185. // 关闭客服
  186. cancel() {
  187. this.$refs.popupkf.close();
  188. },
  189. // 复制客服微信
  190. comfirm(text) {
  191. console.log(text);
  192. const result = this.uniCopy(text);
  193. if (result === false) {
  194. uni.showToast({
  195. title: '不支持'
  196. });
  197. } else {
  198. uni.showToast({
  199. title: '复制成功',
  200. icon: 'none'
  201. });
  202. }
  203. this.$refs.popupkf.close();
  204. },
  205. uniCopy(content) {
  206. /**
  207. * 小程序端 和 app端的复制逻辑
  208. */
  209. //#ifndef H5
  210. uni.setClipboardData({
  211. data: content,
  212. success: function() {
  213. console.log('success');
  214. return true;
  215. }
  216. });
  217. //#endif
  218. /**
  219. * H5端的复制逻辑
  220. */
  221. // #ifdef H5
  222. if (!document.queryCommandSupported('copy')) {
  223. //为了兼容有些浏览器 queryCommandSupported 的判断
  224. // 不支持
  225. return false;
  226. }
  227. let textarea = document.createElement('textarea');
  228. textarea.value = content;
  229. textarea.readOnly = 'readOnly';
  230. document.body.appendChild(textarea);
  231. textarea.select(); // 选择对象
  232. textarea.setSelectionRange(0, content.length); //核心
  233. let result = document.execCommand('copy'); // 执行浏览器复制命令
  234. textarea.remove();
  235. return result;
  236. // #endif
  237. },
  238. }
  239. }
  240. </script>
  241. <style lang="scss">
  242. .jg-wrap {
  243. width: 710rpx;
  244. margin: -120rpx auto 0;
  245. background: #FFFFFF;
  246. box-shadow: 0px 3rpx 18rpx 0px rgba(114, 136, 231, 0.27);
  247. border-radius: 0px 0px 14rpx 14rpx;
  248. border-radius: 20rpx;
  249. }
  250. .jsjg-wrap {
  251. height: 110rpx;
  252. border-top: 1px solid #EDEDED;
  253. border-bottom: 1px solid #EDEDED;
  254. width: 646rpx;
  255. margin: auto;
  256. font-size: 22rpx;
  257. padding: 0 15rpx;
  258. .jg-left {
  259. .left-top {
  260. .item-tit {
  261. font-size: 30rpx;
  262. font-weight: bold;
  263. color: #0C0C0C;
  264. padding-right: 10rpx;
  265. }
  266. }
  267. }
  268. .jg-right {
  269. flex-shrink: 0;
  270. font-size: 32rpx;
  271. font-weight: 500;
  272. color: #282828;
  273. }
  274. }
  275. .jg-zj {
  276. padding: 35rpx 43rpx 20rpx 40rpx;
  277. font-size: 28rpx;
  278. font-weight: 500;
  279. color: #444444;
  280. .price {
  281. font-size: 60rpx;
  282. font-weight: bold;
  283. color: #444444;
  284. &::before {
  285. content: '¥';
  286. font-size: 32rpx;
  287. padding-right: 10rpx;
  288. }
  289. }
  290. }
  291. .jg-tip {
  292. font-size: 25rpx;
  293. font-weight: 500;
  294. color: #A0A0A0;
  295. text-align: right;
  296. padding-right: 44rpx;
  297. padding-bottom: 50rpx;
  298. }
  299. .top-bg {
  300. width: 750rpx;
  301. height: 187rpx;
  302. background: linear-gradient(-43deg, #4464ED, #0328C7);
  303. }
  304. .xyb {
  305. width: 520rpx;
  306. height: 88rpx;
  307. line-height: 88rpx;
  308. text-align: center;
  309. background: linear-gradient(270deg, #4464ED, #0328C7);
  310. border-radius: 44rpx;
  311. margin: 45rpx auto 0;
  312. font-size: 32rpx;
  313. font-weight: 500;
  314. color: #FFFFFF;
  315. }
  316. .syb {
  317. width: 318rpx;
  318. height: 88rpx;
  319. background: #ECEFFC;
  320. border: 1px solid #4261E3;
  321. border-radius: 44px;
  322. color: #4261E3;
  323. }
  324. .ksjs {
  325. width: 318rpx;
  326. height: 88rpx;
  327. background: linear-gradient(270deg, #4464ED, #0328C7);
  328. border-radius: 44rpx;
  329. }
  330. .popup-box {
  331. width: 522rpx;
  332. height: 605rpx;
  333. background-color: #ffffff;
  334. border-radius: 20rpx;
  335. position: relative;
  336. .img {
  337. position: relative;
  338. top: -56rpx;
  339. left: 0;
  340. width: 522rpx;
  341. height: 132rpx;
  342. display: flex;
  343. justify-content: center;
  344. image {
  345. border-radius: 20rpx 20rpx 0 0;
  346. width: 450rpx;
  347. height: 132rpx;
  348. }
  349. }
  350. .mian {
  351. margin-top: -44rpx;
  352. display: flex;
  353. flex-direction: column;
  354. align-items: center;
  355. // padding: 32rpx 32rpx;
  356. background-color: #ffffff;
  357. border-radius: 0 0 20rpx 20rpx;
  358. text-align: center;
  359. .delivery {
  360. font-size: 40rpx;
  361. color: #333333;
  362. display: flex;
  363. align-items: center;
  364. flex-direction: column;
  365. image {
  366. margin-top: 48rpx;
  367. width: 172rpx;
  368. height: 160rpx;
  369. }
  370. }
  371. .nocancel {
  372. font-size: 32rpx;
  373. color: #333333;
  374. margin-top: 14rpx;
  375. }
  376. .comfirm-box {
  377. margin-top: 52rpx;
  378. display: flex;
  379. // margin-bottom: 32rpx;
  380. // justify-content: space-around;
  381. .cancel {
  382. display: flex;
  383. align-items: center;
  384. justify-content: center;
  385. width: 197rpx;
  386. height: 74rpx;
  387. border: 1px solid #dcc786;
  388. border-radius: 38rpx;
  389. font-size: 32rpx;
  390. color: #605128;
  391. }
  392. .comfirm {
  393. margin-left: 32rpx;
  394. display: flex;
  395. align-items: center;
  396. justify-content: center;
  397. width: 197rpx;
  398. height: 74rpx;
  399. background: linear-gradient(-90deg, #d1ba77 0%, #f7e8ad 100%);
  400. border-radius: 38px;
  401. font-size: 32rpx;
  402. color: #605128;
  403. }
  404. }
  405. }
  406. }
  407. .new-bg {
  408. width: 750rpx;
  409. background-color: #fff;
  410. padding: 0 10rpx;
  411. .bg-line {
  412. height: 90rpx;
  413. font-size: 26rpx;
  414. justify-content: flex-start;
  415. border-bottom: 1px solid #eeeeee;
  416. &:nth-child(odd) {
  417. background-color: #f6f7fb;
  418. }
  419. view {
  420. border-top: 1px solid #eee;
  421. text-align: center;
  422. height: 90rpx;
  423. display: flex;
  424. align-items: center;
  425. justify-content: center;
  426. border-right: 1px solid #eee;
  427. }
  428. .title {
  429. width: 128rpx;
  430. text-align: left;
  431. }
  432. .name {
  433. width: 160rpx;
  434. }
  435. .specifications {
  436. width: 140rpx;
  437. }
  438. .number {
  439. width: 95rpx;
  440. }
  441. .unit_price {
  442. width: 120rpx;
  443. }
  444. .ot-price {
  445. width: 110rpx;
  446. border-right: none;
  447. }
  448. }
  449. }
  450. .jg-jz {
  451. padding: 0 20rpx;
  452. font-size: 30rpx;
  453. height: 90rpx;
  454. line-height: 90rpx;
  455. }
  456. </style>