order-cashier.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. <template>
  2. <view class="container cashier">
  3. <headerNavbar :systeminfo='systeminfo' :navbar-data='nvabarData' :headerBtnPosi ="headerBtnPosi" :page='2'></headerNavbar>
  4. <view class="container-cash clearfix" :style="{paddingTop:navbarHeight+'px'}">
  5. <view class="container-wrapper">
  6. <view v-if="isSuccess" class="cashier-wrapper-empty" :style="{height:emptyWrapperH+'px'}">
  7. <image class="cashier-wrapper-empty-image" src="https://img.caimei365.com/group1/M00/03/81/Cmis214BwaGANmv9AAE432FGJ5Q324.png"></image>
  8. <view class="txt">订单提交成功</view>
  9. </view>
  10. <view v-else class="cashier-wrapper">
  11. <image src="https://img.caimei365.com/group1/M00/03/95/Cmis216Sk_SAKGNWAAEaFsvZ8c0647.png" mode=""></image>
  12. <view class="wrapper-text">
  13. <view>订单提交成功,请及时转账付款</view>
  14. <view><text class="red">(目前只支持网银转账)</text>否则订单将会被取消。</view>
  15. </view>
  16. <view class="wrapper-message">
  17. <view>支付金额:¥{{payableAmount}}</view>
  18. <view>订单编号:{{orderNumber}}</view>
  19. <view>订单标识:{{orderIdentification}} <text class="clipboard" @click="clipboard(orderIdentification)">复制</text></view>
  20. </view>
  21. <view class="wrapper-title">转账信息</view>
  22. <view class="wrapper-message t">
  23. <view>开户行:{{bankBranch}}</view>
  24. <view>银行卡号:{{this.$reg.bankRegex(bankNumber)}}</view>
  25. <view>户名:{{accountName}}</view>
  26. </view>
  27. <view class="wrapper-title">特别注意</view>
  28. <view class="wrapper-text warning">
  29. <view class="warning">请在网银转账备注中填写上述订单标识,或者直接复制本订单的订单标识,方便财务快速审核,提高发货速度。</view>
  30. </view>
  31. </view>
  32. <view class="cash-btn" :style="{paddingBottom :isIphoneX ? '68rpx' : '20rpx'}">
  33. <view class="btn btn-share" @click="onShareCode">分享订单<view class="tips" v-if="isShareCode">分享码:{{shareCode}}</view></view>
  34. <view class="btn btn-query" @click="this.$api.navigateTo('/pages/user/order/order-details?type=confim&orderID='+shareOrderID)">查看订单</view>
  35. <view class="btn btn-makes" @click="this.$api.switchTabTo('/pages/tabBar/home/home')">继续采购</view>
  36. </view>
  37. </view>
  38. </view>
  39. <share-alert ref="shareAlert" v-if="isShareModal" :orderID="shareOrderID" @btnConfirm ='onShareAppMessage'></share-alert>
  40. </view>
  41. </template>
  42. <script>
  43. import headerNavbar from "@/components/module/headerNavbar/headerNavbar.vue" //顶部自定义胶囊'
  44. import shareAlert from "@/components/module/modelAlert/shareAlert.vue" //分享弹窗'
  45. const thorui = require("@/components/clipboard/clipboard.thorui.js")
  46. export default{
  47. components:{
  48. headerNavbar,
  49. shareAlert
  50. },
  51. data(){
  52. return{
  53. userID:'',
  54. shareOrderID:'',
  55. isSuccess:false,
  56. isShareModal:false,
  57. isShareCode:false,
  58. stateType:'',
  59. payableAmount:0,
  60. shareCode:'',
  61. orderNumber:'',
  62. orderIdentification:'#8888#',
  63. bankBranch:'中信银行(深圳泰然支行)',
  64. bankNumber:'6217 6803 0362 0897',
  65. accountName:'周仁声',
  66. navbarHeight:'',
  67. emptyWrapperH: '',
  68. headerBtnPosi: this.setHeaderBtnPosi(),//获取设备顶部胶囊高度
  69. systeminfo:this.setSysteminfo(), //获取设备信息
  70. isIphoneX:this.$store.state.isIphoneX,
  71. nvabarData: { //顶部自定义导航
  72. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示
  73. title: '收银台', // 导航栏 中间的标题
  74. }
  75. }
  76. },
  77. onLoad(option) {
  78. this.getHeaderTopHeight()
  79. this.getWinHeight()
  80. this.initData(option)
  81. },
  82. methods:{
  83. initData(e){
  84. let data = JSON.parse(e.data);
  85. this.shareOrderID = data.data.orderID
  86. if(e.type =='success'){
  87. this.isSuccess = true
  88. }else{
  89. this.orderNumber = data.data.orderNo
  90. this.orderIdentification = data.data.orderMark
  91. this.payableAmount = data.data.payableAmount
  92. }
  93. this.$api.getStorage().then((resolve) => {
  94. this.userID = resolve.userID;
  95. })
  96. },
  97. getWinHeight() {
  98. const query = wx.createSelectorQuery().in(this);
  99. query.selectAll('.cash-btn').boundingClientRect();
  100. query.exec(res => {
  101. let winHeight = this.$api.getWindowHeight(),
  102. btnHeight = res[0][0].height;
  103. this.emptyWrapperH = winHeight - btnHeight - this.navbarHeight;
  104. })
  105. },
  106. setHeaderBtnPosi(){
  107. // 获得胶囊按钮位置信息
  108. let headerBtnPosi = uni.getMenuButtonBoundingClientRect();
  109. return headerBtnPosi
  110. },
  111. setSysteminfo(){
  112. let systeminfo;
  113. uni.getSystemInfo({ // 获取设备信息
  114. success: (res) => {
  115. systeminfo = res
  116. },
  117. })
  118. return systeminfo
  119. },
  120. getHeaderTopHeight(){
  121. let statusBarHeight = this.systeminfo.statusBarHeight // 状态栏高度
  122. let headerPosi = this.headerBtnPosi
  123. let btnPosi = { // 胶囊实际位置,坐标信息不是左上角原点
  124. height: headerPosi.height,
  125. width: headerPosi.width,
  126. // 胶囊top - 状态栏高度
  127. top: headerPosi.top - statusBarHeight,
  128. // 胶囊bottom - 胶囊height - 状态栏height (现胶囊bottom 为距离导航栏底部的长度)
  129. bottom: headerPosi.bottom - headerPosi.height - statusBarHeight,
  130. // 屏幕宽度 - 胶囊right
  131. right: this.systeminfo.screenWidth - headerPosi.right
  132. }
  133. this.navbarHeight= headerPosi.bottom + btnPosi.bottom// 原胶囊bottom + 现胶囊bottom
  134. },
  135. clipboard(data) {
  136. thorui.getClipboardData(data, (res) => {
  137. // #ifdef H5
  138. if (res) {
  139. this.$util.msg("复制成功",2000);
  140. } else {
  141. this.$util.msg("复制失败",2000);
  142. }
  143. // #endif
  144. })
  145. },
  146. onShareCode(){
  147. this.isShareModal = true
  148. },
  149. onShareAppMessage(res){//分享转发
  150. let self = this
  151. self.isShareModal = false
  152. if (res.from === 'button') {
  153. // 来自页面内转发按钮
  154. setTimeout(function(){
  155. self.isShareCode = true;
  156. },5000)
  157. }
  158. return {
  159. title: '您有新的分享订单,快来查看吧~',
  160. path: `/pages/user/order/orderShareLogin?orderID=${this.shareOrderID}&userID=${this.userID}`,
  161. imageUrl:'https://img.caimei365.com/group1/M00/03/95/Cmis216Sk_SABnOFABZCgCzFV_g063.png'
  162. }
  163. },
  164. goIndex(){
  165. uni.switchTab({
  166. url: '/pages/tabBar/home/home'
  167. });
  168. }
  169. },
  170. onShow() {
  171. }
  172. }
  173. </script>
  174. <style lang="scss">
  175. $width:100%;
  176. $height:100%;
  177. .container-cash{
  178. width: $width;
  179. .container-wrapper{
  180. float: left;
  181. width: $width;
  182. .cashier-wrapper-empty{
  183. width: $width;
  184. float: left;
  185. // min-height: 750rpx;
  186. display: flex;
  187. align-items: center;
  188. justify-content: center;
  189. flex-direction: column;
  190. background: $bg-color;
  191. &-image {
  192. width: 330rpx;
  193. height: 260rpx;
  194. margin-bottom: 10rpx;
  195. margin-top: -120rpx;
  196. }
  197. .txt{
  198. font-size: $font-size-28;
  199. color: #07c160;
  200. line-height: 44rpx;
  201. font-weight: bold;
  202. }
  203. }
  204. .cashier-wrapper{
  205. width: 100%;
  206. height: auto;
  207. display: flex;
  208. flex-direction: column;
  209. align-items: center;
  210. padding-top: 36rpx;
  211. padding-bottom: 100rpx;
  212. image{
  213. display: flex;
  214. width: 330rpx;
  215. height: 260rpx;
  216. margin-bottom: 22rpx;
  217. }
  218. .wrapper-text{
  219. font-size: $font-size-28;
  220. color: $text-color;
  221. text-align: center;
  222. line-height: 44rpx;
  223. font-weight: bold;
  224. margin-bottom: 30rpx;
  225. .red{
  226. color: #FF2A2A;
  227. }
  228. }
  229. .wrapper-text.warning{
  230. width:540rpx;
  231. text-align: justify;
  232. color: #FF2A2A;
  233. font-size: $font-size-24;
  234. line-height: 40rpx;
  235. font-weight: normal;
  236. }
  237. .wrapper-title{
  238. line-height: 36rpx;
  239. text-align: center;
  240. font-size: $font-size-26;
  241. color: $text-color;
  242. margin: 48rpx 0 24rpx 0;
  243. font-weight: bold;
  244. position: relative;
  245. &:before{
  246. content: '';
  247. width: 210rpx;
  248. height: 1px;
  249. background: #F8F8F8;
  250. position: absolute;
  251. left: -235rpx;
  252. top: 18rpx;
  253. }
  254. &:after{
  255. content: '';
  256. width: 210rpx;
  257. height: 1px;
  258. background: #F8F8F8;
  259. position: absolute;
  260. right: -235rpx;
  261. top: 18rpx;
  262. }
  263. }
  264. .wrapper-message.t{
  265. width: 460rpx;
  266. padding: 36rpx 25rpx 36rpx 65rpx;
  267. }
  268. .wrapper-message{
  269. width: 400rpx;
  270. height: 194rpx;
  271. padding: 36rpx 75rpx;
  272. border-radius: 30rpx;
  273. background: rgba(255,255,255,0);
  274. border: 1px solid #F8C499;
  275. font-size: $font-size-26;
  276. color: $text-color;
  277. line-height: 64rpx;
  278. text-align: left;
  279. position: relative;
  280. &:before{
  281. content: "";
  282. width: 100%;
  283. height: 100%;
  284. border-radius: 30rpx;
  285. background: #F8C499;
  286. position: absolute;
  287. right: -20rpx;
  288. bottom: -20rpx;
  289. z-index: -1;
  290. opacity: 0.2;
  291. }
  292. .clipboard{
  293. width: 84rpx;
  294. height: 36rpx;
  295. background: linear-gradient(34deg,rgba(255,41,41,1) 0%,rgba(255,109,27,1) 100%);
  296. text-align: center;
  297. font-size: $font-size-24;
  298. color: #FFFFFF;
  299. border-radius: 6rpx;
  300. line-height: 36rpx;
  301. display: inline-block;
  302. margin-left: 42rpx;
  303. }
  304. }
  305. }
  306. .cash-btn{
  307. width: 612rpx;
  308. height: 64rpx;
  309. padding: 20rpx 69rpx;
  310. display: flex;
  311. align-items: center;
  312. position: fixed;
  313. bottom: 0;
  314. left: 0;
  315. background: #FFFFFF;
  316. .btn{
  317. width: 160rpx;
  318. height: 64rpx;
  319. margin: 0 22rpx;
  320. line-height: 64rpx;
  321. font-size:$font-size-26;
  322. border-radius: 10rpx;
  323. color: #FFFFFF;
  324. text-align: center;
  325. }
  326. .btn-share{
  327. background:linear-gradient(315deg,rgba(0,212,150,1) 0%,rgba(126,243,174,1) 100%);
  328. position: relative;
  329. .tips{
  330. width: 160rpx;
  331. height: 34rpx;
  332. padding: 10rpx 10rpx;
  333. background:linear-gradient(45deg,rgba(0,0,0,1) 0%,rgba(87,87,87,1) 100%);
  334. box-shadow:0px 2px 4px 0px rgba(0,0,0,0.2);
  335. border-radius: 8rpx;
  336. position: absolute;
  337. color: #FFFFFF;
  338. line-height: 34rpx;
  339. font-size: $font-size-24;
  340. text-align: left;
  341. left: 0;
  342. top: -65rpx;
  343. &:before{
  344. content: "";
  345. width: 25rpx;
  346. height: 25rpx;
  347. background:linear-gradient(45deg,rgba(0,0,0,1) 0%,rgba(87,87,87,1) 100%);
  348. position: absolute;
  349. bottom: -8rpx;
  350. left: 30rpx;
  351. z-index: -1;
  352. transform:rotate(45deg);
  353. }
  354. }
  355. }
  356. .btn-query{
  357. background:linear-gradient(225deg,rgba(44,180,255,1) 0%,rgba(0,115,255,1) 100%);
  358. }
  359. .btn-makes{
  360. background:linear-gradient(315deg,rgba(231,0,0,1) 0%,rgba(255,104,1,1) 100%);
  361. }
  362. }
  363. }
  364. }
  365. </style>