jsxq.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498
  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}}吨{{iswarm == 1?'保温水箱': '冷水箱'}}, {{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. iswarm: 0,
  138. }
  139. },
  140. onLoad(opt) {
  141. console.log(opt)
  142. if (opt.id) {
  143. this.id = opt.id
  144. this.getjsDetail()
  145. }
  146. if (opt.price) {
  147. this.price = opt.price
  148. }
  149. if(opt.weight) {
  150. this.weight = opt.weight
  151. }
  152. //weight=' + item.weight + '&long=' + item.long + '&wide=' + item.wide + '&high=' + item.high
  153. if(opt.high) {
  154. this.high = opt.high*1
  155. console.log(this.high)
  156. }
  157. if(opt.wide) {
  158. this.wide = opt.wide*1
  159. console.log(this.wide)
  160. }
  161. if(opt.long) {
  162. this.long = opt.long*1
  163. console.log(this.long)
  164. }
  165. if(opt.iswarm) {
  166. this.iswarm = opt.iswarm
  167. }
  168. },
  169. onShow() {
  170. },
  171. onReachBottom() {
  172. },
  173. onReady() {
  174. },
  175. methods: {
  176. getjsDetail() {
  177. let obj = this
  178. getjsDetail({
  179. id: obj.id
  180. }).then(res => {
  181. console.log(res)
  182. obj.jsjg = res.data
  183. })
  184. },
  185. // 打开客服
  186. openKf() {
  187. this.$refs.popupkf.open();
  188. },
  189. // 关闭客服
  190. cancel() {
  191. this.$refs.popupkf.close();
  192. },
  193. // 复制客服微信
  194. comfirm(text) {
  195. console.log(text);
  196. const result = this.uniCopy(text);
  197. if (result === false) {
  198. uni.showToast({
  199. title: '不支持'
  200. });
  201. } else {
  202. uni.showToast({
  203. title: '复制成功',
  204. icon: 'none'
  205. });
  206. }
  207. this.$refs.popupkf.close();
  208. },
  209. uniCopy(content) {
  210. /**
  211. * 小程序端 和 app端的复制逻辑
  212. */
  213. //#ifndef H5
  214. uni.setClipboardData({
  215. data: content,
  216. success: function() {
  217. console.log('success');
  218. return true;
  219. }
  220. });
  221. //#endif
  222. /**
  223. * H5端的复制逻辑
  224. */
  225. // #ifdef H5
  226. if (!document.queryCommandSupported('copy')) {
  227. //为了兼容有些浏览器 queryCommandSupported 的判断
  228. // 不支持
  229. return false;
  230. }
  231. let textarea = document.createElement('textarea');
  232. textarea.value = content;
  233. textarea.readOnly = 'readOnly';
  234. document.body.appendChild(textarea);
  235. textarea.select(); // 选择对象
  236. textarea.setSelectionRange(0, content.length); //核心
  237. let result = document.execCommand('copy'); // 执行浏览器复制命令
  238. textarea.remove();
  239. return result;
  240. // #endif
  241. },
  242. }
  243. }
  244. </script>
  245. <style lang="scss">
  246. .jg-wrap {
  247. width: 710rpx;
  248. margin: -120rpx auto 0;
  249. background: #FFFFFF;
  250. box-shadow: 0px 3rpx 18rpx 0px rgba(114, 136, 231, 0.27);
  251. border-radius: 0px 0px 14rpx 14rpx;
  252. border-radius: 20rpx;
  253. }
  254. .jsjg-wrap {
  255. height: 110rpx;
  256. border-top: 1px solid #EDEDED;
  257. border-bottom: 1px solid #EDEDED;
  258. width: 646rpx;
  259. margin: auto;
  260. font-size: 22rpx;
  261. padding: 0 15rpx;
  262. .jg-left {
  263. .left-top {
  264. .item-tit {
  265. font-size: 30rpx;
  266. font-weight: bold;
  267. color: #0C0C0C;
  268. padding-right: 10rpx;
  269. }
  270. }
  271. }
  272. .jg-right {
  273. flex-shrink: 0;
  274. font-size: 32rpx;
  275. font-weight: 500;
  276. color: #282828;
  277. }
  278. }
  279. .jg-zj {
  280. padding: 35rpx 43rpx 20rpx 40rpx;
  281. font-size: 28rpx;
  282. font-weight: 500;
  283. color: #444444;
  284. .price {
  285. font-size: 60rpx;
  286. font-weight: bold;
  287. color: #444444;
  288. &::before {
  289. content: '¥';
  290. font-size: 32rpx;
  291. padding-right: 10rpx;
  292. }
  293. }
  294. }
  295. .jg-tip {
  296. font-size: 25rpx;
  297. font-weight: 500;
  298. color: #A0A0A0;
  299. text-align: right;
  300. padding-right: 44rpx;
  301. padding-bottom: 50rpx;
  302. }
  303. .top-bg {
  304. width: 750rpx;
  305. height: 187rpx;
  306. background: linear-gradient(-43deg, #4464ED, #0328C7);
  307. }
  308. .xyb {
  309. width: 520rpx;
  310. height: 88rpx;
  311. line-height: 88rpx;
  312. text-align: center;
  313. background: linear-gradient(270deg, #4464ED, #0328C7);
  314. border-radius: 44rpx;
  315. margin: 45rpx auto 0;
  316. font-size: 32rpx;
  317. font-weight: 500;
  318. color: #FFFFFF;
  319. }
  320. .syb {
  321. width: 318rpx;
  322. height: 88rpx;
  323. background: #ECEFFC;
  324. border: 1px solid #4261E3;
  325. border-radius: 44px;
  326. color: #4261E3;
  327. }
  328. .ksjs {
  329. width: 318rpx;
  330. height: 88rpx;
  331. background: linear-gradient(270deg, #4464ED, #0328C7);
  332. border-radius: 44rpx;
  333. }
  334. .popup-box {
  335. width: 522rpx;
  336. height: 605rpx;
  337. background-color: #ffffff;
  338. border-radius: 20rpx;
  339. position: relative;
  340. .img {
  341. position: relative;
  342. top: -56rpx;
  343. left: 0;
  344. width: 522rpx;
  345. height: 132rpx;
  346. display: flex;
  347. justify-content: center;
  348. image {
  349. border-radius: 20rpx 20rpx 0 0;
  350. width: 450rpx;
  351. height: 132rpx;
  352. }
  353. }
  354. .mian {
  355. margin-top: -44rpx;
  356. display: flex;
  357. flex-direction: column;
  358. align-items: center;
  359. // padding: 32rpx 32rpx;
  360. background-color: #ffffff;
  361. border-radius: 0 0 20rpx 20rpx;
  362. text-align: center;
  363. .delivery {
  364. font-size: 40rpx;
  365. color: #333333;
  366. display: flex;
  367. align-items: center;
  368. flex-direction: column;
  369. image {
  370. margin-top: 48rpx;
  371. width: 172rpx;
  372. height: 160rpx;
  373. }
  374. }
  375. .nocancel {
  376. font-size: 32rpx;
  377. color: #333333;
  378. margin-top: 14rpx;
  379. }
  380. .comfirm-box {
  381. margin-top: 52rpx;
  382. display: flex;
  383. // margin-bottom: 32rpx;
  384. // justify-content: space-around;
  385. .cancel {
  386. display: flex;
  387. align-items: center;
  388. justify-content: center;
  389. width: 197rpx;
  390. height: 74rpx;
  391. border: 1px solid #dcc786;
  392. border-radius: 38rpx;
  393. font-size: 32rpx;
  394. color: #605128;
  395. }
  396. .comfirm {
  397. margin-left: 32rpx;
  398. display: flex;
  399. align-items: center;
  400. justify-content: center;
  401. width: 197rpx;
  402. height: 74rpx;
  403. background: linear-gradient(-90deg, #d1ba77 0%, #f7e8ad 100%);
  404. border-radius: 38px;
  405. font-size: 32rpx;
  406. color: #605128;
  407. }
  408. }
  409. }
  410. }
  411. .new-bg {
  412. width: 750rpx;
  413. background-color: #fff;
  414. padding: 0 10rpx;
  415. .bg-line {
  416. height: 100rpx;
  417. font-size: 26rpx;
  418. justify-content: flex-start;
  419. border-bottom: 1px solid #eeeeee;
  420. &:nth-child(odd) {
  421. background-color: #f6f7fb;
  422. }
  423. view {
  424. border-top: 1px solid #eee;
  425. text-align: center;
  426. height: 100rpx;
  427. display: flex;
  428. align-items: center;
  429. justify-content: center;
  430. border-right: 1px solid #eee;
  431. }
  432. .title {
  433. width: 128rpx;
  434. text-align: left;
  435. }
  436. .name {
  437. width: 160rpx;
  438. }
  439. .specifications {
  440. width: 140rpx;
  441. }
  442. .number {
  443. width: 95rpx;
  444. }
  445. .unit_price {
  446. width: 120rpx;
  447. }
  448. .ot-price {
  449. width: 110rpx;
  450. border-right: none;
  451. }
  452. }
  453. }
  454. .jg-jz {
  455. padding: 0 20rpx;
  456. font-size: 30rpx;
  457. height: 90rpx;
  458. line-height: 90rpx;
  459. }
  460. </style>