orderDetail.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. <template>
  2. <view style="background-color: #fff;height: 100vh;">
  3. <view class="address flexB ">
  4. <view class="flexV">
  5. <view class="address_tip red">
  6. 收货人
  7. </view>
  8. <view>
  9. <view>
  10. <text>{{ form.user_name }}</text>
  11. <text style="margin-left: 24rpx;">{{ form.mobile }}</text>
  12. </view>
  13. <view class="gray">
  14. {{ form.province + form.city + form.area + form.address }}
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. <view class="soapBox">
  20. <view class="soapBox_middle">
  21. <view class="flexB">
  22. <image :src="type ? image[0] : image[1]" style="width: 200rpx;height:160rpx;margin-right: 20rpx;"></image>
  23. <view class="middleFlex">
  24. <view class="middleFlex_title">
  25. {{ type ? '【大卫博士健康内裤】专用洗涤皂' : '【大卫博士健康内裤】专用打包胶带' }}
  26. </view>
  27. <view class="middleFlex_dan">
  28. <view style="font-weight: bold;">
  29. ¥{{ type ? 8 : 20 }}
  30. </view>
  31. <view class="num">
  32. x{{ form.num }}
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="soapBox_bottom">
  39. <text class="text1">共{{ `${form.num + (type ? '块' : '卷')}` }},</text>
  40. <text>合计;</text>
  41. <text class="text2">¥</text>
  42. <text class="text3">{{ form.cost }}</text>
  43. </view>
  44. </view>
  45. <view class="botFlex">
  46. <view class="flexB botFlex_flex">
  47. <view class="title">
  48. 订单编号:
  49. <text style="font-weight: 400;">{{ form.order_num }}</text>
  50. </view>
  51. <view class="anniu" @click="copy(form.order_num)">
  52. 复制
  53. </view>
  54. </view>
  55. <view class="flexB botFlex_flex">
  56. <view class="title">
  57. 下单时间:
  58. <text style="font-weight: 400;">{{ newDate(form.created_at) }}</text>
  59. </view>
  60. </view>
  61. <view class="flexB botFlex_flex">
  62. <view class="title">
  63. 商品总额:
  64. </view>
  65. <view class="right">
  66. ¥{{ form.cost }}
  67. </view>
  68. </view>
  69. <view class="flexB botFlex_flex">
  70. <view class="title">
  71. 商品数量:
  72. </view>
  73. <view class="right">
  74. {{ `${form.num + (type ? '块' : '卷')}` }}
  75. </view>
  76. </view>
  77. <view v-if="form.remark" class="flexT botFlex_flex">
  78. <view class="title">
  79. 订单备注:
  80. </view>
  81. <view class="remark">
  82. {{ form.remark }}
  83. </view>
  84. </view>
  85. </view>
  86. <view class="submitPay">
  87. <view class="anniu red" @click="again">
  88. 再次下单
  89. </view>
  90. </view>
  91. </view>
  92. </template>
  93. <script>
  94. export default {
  95. data() {
  96. return {
  97. type: '',
  98. image: [
  99. require('../../static/Buy_soap_tape/soap-s.png'),
  100. require('../../static/Buy_soap_tape/tape-s.png')
  101. ],
  102. form: {}
  103. }
  104. },
  105. onLoad(opt){
  106. this.form = JSON.parse(decodeURIComponent(opt.data))
  107. this.type = this.form.goods_type == 1 ? 1 : 0
  108. },
  109. methods: {
  110. newDate(time) {
  111. var date = new Date(time)
  112. var y = date.getFullYear()
  113. var m = date.getMonth() + 1
  114. m = m < 10 ? '0' + m : m
  115. var d = date.getDate()
  116. d = d < 10 ? '0' + d : d
  117. var h = date.getHours()
  118. h = h < 10 ? '0' + h : h
  119. var minute = date.getMinutes()
  120. minute = minute < 10 ? '0' + minute : minute
  121. var s = date.getSeconds()
  122. s = s < 10 ? '0' + s : s
  123. return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + s
  124. },
  125. // 再次下单
  126. again() {
  127. const type = this.type == 1 ? 'soap' : 'tape'
  128. uni.navigateTo({
  129. url: './goods?type=' + type
  130. })
  131. },
  132. /*复制单号*/
  133. copy(order_num) {
  134. try {
  135. uni.setClipboardData({
  136. data: order_num,
  137. success: () => {
  138. uni.showToast({
  139. title: '复制成功'
  140. })
  141. }
  142. })
  143. } catch (e) {
  144. uni.showModal({
  145. content: '您的手机暂不支持复制',
  146. showCancel: false
  147. })
  148. }
  149. },
  150. }
  151. }
  152. </script>
  153. <style lang="scss" scoped>
  154. .address {
  155. padding: 40rpx 0;
  156. margin: 0 24rpx;
  157. background-color: #fff;
  158. &_tip {
  159. width: 92rpx;
  160. color: #fff;
  161. font-size: 24rpx;
  162. font-weight: bold;
  163. line-height: 50rpx;
  164. text-align: center;
  165. border-radius: 8rpx 8rpx 8rpx 8rpx;
  166. margin-right: 20rpx;
  167. }
  168. .green {
  169. background: linear-gradient(180deg, #46DBA1 0%, #19D16E 100%);
  170. }
  171. .red {
  172. background: linear-gradient(180deg, #FF232C 0%, #FF571B 100%);
  173. }
  174. &_title {
  175. font-size: 28rpx;
  176. font-weight: 400;
  177. color: $uni-text-color;
  178. }
  179. text {
  180. font-size: 34rpx;
  181. font-weight: bold;
  182. }
  183. .gray {
  184. width: 570rpx;
  185. font-size: 28rpx;
  186. color: #999999;
  187. margin-top: 8rpx;
  188. text-overflow: -o-ellipsis-lastline;
  189. overflow: hidden; //溢出内容隐藏
  190. text-overflow: ellipsis; //文本溢出部分用省略号表示
  191. display: -webkit-box; //特别显示模式
  192. line-clamp: 2;
  193. -webkit-line-clamp: 2; //行数
  194. -webkit-box-orient: vertical;
  195. }
  196. }
  197. .soapBox {
  198. border-top: 24rpx solid #F5F5F5;
  199. border-bottom: 24rpx solid #F5F5F5;
  200. padding: 24rpx 24rpx 48rpx 24rpx;
  201. background: #FFFFFF;
  202. position: relative;
  203. &_statusImg {
  204. width: 148rpx;
  205. position: absolute;
  206. right: 0;
  207. top: 0;
  208. }
  209. &_middle {
  210. display: flex;
  211. justify-content: space-between;
  212. align-items: flex-end;
  213. margin-top: 24rpx;
  214. .num {
  215. font-size: 28rpx;
  216. color: #999999;
  217. }
  218. .middleFlex {
  219. height: 130rpx;
  220. display: flex;
  221. justify-content: flex-start;
  222. flex-direction: column;
  223. &_title {
  224. font-size: 30rpx;
  225. font-weight: bold;
  226. }
  227. &_dan {
  228. margin-top: 24rpx;
  229. font-size: 28rpx;
  230. width: 472rpx;
  231. display: flex;
  232. align-items: center;
  233. justify-content: space-between;
  234. }
  235. }
  236. }
  237. &_bottom {
  238. text-align: right;
  239. // margin-top: 34rpx;
  240. font-weight: bold;
  241. font-size: 28rpx;
  242. .text1 {
  243. color: #999;
  244. }
  245. .text2 {
  246. color: #FB231F;
  247. }
  248. .text3 {
  249. font-size: 44rpx;
  250. color: #FB231F;
  251. }
  252. }
  253. }
  254. .botFlex {
  255. background-color: #fff;
  256. margin-top: 30rpx;
  257. padding: 20rpx 30rpx;
  258. .botzuofei {
  259. align-items: flex-start;
  260. .red {
  261. padding-top: 10rpx;
  262. width: 500rpx;
  263. font-size: 28rpx;
  264. line-height: 35rpx;
  265. color: #FB231F;
  266. // text-align: ri;
  267. display: flex;
  268. justify-content: flex-end;
  269. }
  270. }
  271. &_flex {
  272. .title {
  273. line-height: 56rpx;
  274. font-size: 28rpx;
  275. font-weight: bold;
  276. }
  277. .anniu {
  278. width: 72rpx;
  279. height: 42rpx;
  280. background: #FFF4F3;
  281. border-radius: 8rpx;
  282. text-align: center;
  283. line-height: 42rpx;
  284. font-size: 24rpx;
  285. color: #FB231F;
  286. }
  287. .right {
  288. font-size: 28rpx;
  289. font-weight: bold;
  290. color: #FB231F;
  291. }
  292. .remark {
  293. text-align: right;
  294. width: 60%;
  295. font-size: 28rpx;
  296. }
  297. }
  298. }
  299. .submitPay {
  300. position: fixed;
  301. left: 0;
  302. bottom: 0;
  303. width: 100%;
  304. height: 102rpx;
  305. background-color: #fff;
  306. box-shadow: 0px -4px 24px 2px rgba(0, 0, 0, 0.1);
  307. display: flex;
  308. justify-content: flex-end;
  309. align-items: center;
  310. border-top: 2rpx solid #EEEEEE;
  311. .anniu {
  312. width: 160rpx;
  313. height: 64rpx;
  314. text-align: center;
  315. line-height: 64rpx;
  316. border-radius: 34rpx;
  317. margin-left: 20rpx;
  318. font-size: 28rpx;
  319. margin-right: 30rpx;
  320. }
  321. .grays {
  322. border: 2rpx solid #CCCCCC;
  323. color: 333;
  324. }
  325. .red {
  326. background: linear-gradient(84deg, #F30000 0%, #FE4815 100%);
  327. color: #fff;
  328. }
  329. }
  330. </style>