order-cashier.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  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/index')">继续采购</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/cm-module/headerNavbar/headerNavbar.vue" //顶部自定义胶囊'
  44. import shareAlert from "@/components/cm-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 = Number(data.data.payableAmount).toFixed(2)
  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. if (res) {
  138. this.$util.msg("复制成功",2000,true,'success');
  139. } else {
  140. this.$util.msg("复制失败",2000,true,'none');
  141. }
  142. })
  143. },
  144. onShareCode(){
  145. this.isShareModal = true
  146. },
  147. onShareAppMessage(res){//分享转发
  148. let self = this
  149. self.isShareModal = false
  150. if (res.from === 'button') {
  151. // 来自页面内转发按钮
  152. setTimeout(function(){
  153. self.isShareCode = true;
  154. },5000)
  155. }
  156. return {
  157. title: '您有新的分享订单,快来查看吧~',
  158. path: `/pages/user/order/order-sharelogin?orderID=${this.shareOrderID}&userID=${this.userID}`,
  159. imageUrl:'https://img.caimei365.com/group1/M00/03/95/Cmis216Sk_SABnOFABZCgCzFV_g063.png'
  160. }
  161. },
  162. goIndex(){
  163. uni.switchTab({
  164. url: '/pages/tabBar/home/index'
  165. });
  166. }
  167. },
  168. onShow() {
  169. }
  170. }
  171. </script>
  172. <style lang="scss">
  173. $width:100%;
  174. $height:100%;
  175. .container-cash{
  176. width: $width;
  177. .container-wrapper{
  178. float: left;
  179. width: $width;
  180. .cashier-wrapper-empty{
  181. width: $width;
  182. float: left;
  183. // min-height: 750rpx;
  184. display: flex;
  185. align-items: center;
  186. justify-content: center;
  187. flex-direction: column;
  188. background: $bg-color;
  189. &-image {
  190. width: 330rpx;
  191. height: 260rpx;
  192. margin-bottom: 10rpx;
  193. margin-top: -120rpx;
  194. }
  195. .txt{
  196. font-size: $font-size-28;
  197. color: #07c160;
  198. line-height: 44rpx;
  199. font-weight: bold;
  200. }
  201. }
  202. .cashier-wrapper{
  203. width: 100%;
  204. height: auto;
  205. display: flex;
  206. flex-direction: column;
  207. align-items: center;
  208. padding-top: 36rpx;
  209. padding-bottom: 100rpx;
  210. image{
  211. display: flex;
  212. width: 330rpx;
  213. height: 260rpx;
  214. margin-bottom: 22rpx;
  215. }
  216. .wrapper-text{
  217. font-size: $font-size-28;
  218. color: $text-color;
  219. text-align: center;
  220. line-height: 44rpx;
  221. font-weight: bold;
  222. margin-bottom: 30rpx;
  223. .red{
  224. color: #FF2A2A;
  225. }
  226. }
  227. .wrapper-text.warning{
  228. width:540rpx;
  229. text-align: justify;
  230. color: #FF2A2A;
  231. font-size: $font-size-24;
  232. line-height: 40rpx;
  233. font-weight: normal;
  234. }
  235. .wrapper-title{
  236. line-height: 36rpx;
  237. text-align: center;
  238. font-size: $font-size-26;
  239. color: $text-color;
  240. margin: 48rpx 0 24rpx 0;
  241. font-weight: bold;
  242. position: relative;
  243. &:before{
  244. content: '';
  245. width: 210rpx;
  246. height: 1px;
  247. background: #F8F8F8;
  248. position: absolute;
  249. left: -235rpx;
  250. top: 18rpx;
  251. }
  252. &:after{
  253. content: '';
  254. width: 210rpx;
  255. height: 1px;
  256. background: #F8F8F8;
  257. position: absolute;
  258. right: -235rpx;
  259. top: 18rpx;
  260. }
  261. }
  262. .wrapper-message.t{
  263. width: 460rpx;
  264. padding: 36rpx 25rpx 36rpx 65rpx;
  265. }
  266. .wrapper-message{
  267. width: 400rpx;
  268. height: 194rpx;
  269. padding: 36rpx 75rpx;
  270. border-radius: 30rpx;
  271. background: rgba(255,255,255,0);
  272. border: 1px solid #F8C499;
  273. font-size: $font-size-26;
  274. color: $text-color;
  275. line-height: 64rpx;
  276. text-align: left;
  277. position: relative;
  278. &:before{
  279. content: "";
  280. width: 100%;
  281. height: 100%;
  282. border-radius: 30rpx;
  283. background: #F8C499;
  284. position: absolute;
  285. right: -20rpx;
  286. bottom: -20rpx;
  287. z-index: -1;
  288. opacity: 0.2;
  289. }
  290. .clipboard{
  291. width: 84rpx;
  292. height: 36rpx;
  293. background: linear-gradient(34deg,rgba(255,41,41,1) 0%,rgba(255,109,27,1) 100%);
  294. text-align: center;
  295. font-size: $font-size-24;
  296. color: #FFFFFF;
  297. border-radius: 6rpx;
  298. line-height: 36rpx;
  299. display: inline-block;
  300. margin-left: 42rpx;
  301. }
  302. }
  303. }
  304. .cash-btn{
  305. width: 612rpx;
  306. height: 64rpx;
  307. padding: 20rpx 69rpx;
  308. display: flex;
  309. align-items: center;
  310. position: fixed;
  311. bottom: 0;
  312. left: 0;
  313. background: #FFFFFF;
  314. .btn{
  315. width: 160rpx;
  316. height: 64rpx;
  317. margin: 0 22rpx;
  318. line-height: 64rpx;
  319. font-size:$font-size-26;
  320. border-radius: 10rpx;
  321. color: #FFFFFF;
  322. text-align: center;
  323. }
  324. .btn-share{
  325. background:linear-gradient(315deg,rgba(0,212,150,1) 0%,rgba(126,243,174,1) 100%);
  326. position: relative;
  327. .tips{
  328. width: 160rpx;
  329. height: 34rpx;
  330. padding: 10rpx 10rpx;
  331. background:linear-gradient(45deg,rgba(0,0,0,1) 0%,rgba(87,87,87,1) 100%);
  332. box-shadow:0px 2px 4px 0px rgba(0,0,0,0.2);
  333. border-radius: 8rpx;
  334. position: absolute;
  335. color: #FFFFFF;
  336. line-height: 34rpx;
  337. font-size: $font-size-24;
  338. text-align: left;
  339. left: 0;
  340. top: -65rpx;
  341. &:before{
  342. content: "";
  343. width: 25rpx;
  344. height: 25rpx;
  345. background:linear-gradient(45deg,rgba(0,0,0,1) 0%,rgba(87,87,87,1) 100%);
  346. position: absolute;
  347. bottom: -8rpx;
  348. left: 30rpx;
  349. z-index: -1;
  350. transform:rotate(45deg);
  351. }
  352. }
  353. }
  354. .btn-query{
  355. background:linear-gradient(225deg,rgba(44,180,255,1) 0%,rgba(0,115,255,1) 100%);
  356. }
  357. .btn-makes{
  358. background:linear-gradient(315deg,rgba(231,0,0,1) 0%,rgba(255,104,1,1) 100%);
  359. }
  360. }
  361. }
  362. }
  363. </style>