order-cashier.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  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://admin-b.caimei365.com/userfiles/1/images/photo/2020/03/%E8%AE%A2%E5%8D%95%E6%8F%90%E4%BA%A4%E6%88%90%E5%8A%9F%EF%BC%8C%E8%AF%B7%E5%8F%8A%E6%97%B6%E8%BD%AC%E8%B4%A6%E4%BB%98%E6%AC%BE%20%EF%BC%88%E7%9B%AE%E5%89%8D%E5%8F%AA%E6%94%AF%E6%8C%81%E7%BD%91%E9%93%B6%E8%BD%AC%E8%B4%A6%EF%BC%89%E5%90%A6%E5%88%99%E8%AE%A2%E5%8D%95%E5%B0%86%E4%BC%9A%E8%A2%AB%E5%8F%96%E6%B6%88%E3%80%82%403x.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. // console.log(JSON.parse(e.data));
  85. let data = JSON.parse(e.data);
  86. this.shareOrderID = data.data.orderID
  87. if(e.type =='success'){
  88. this.isSuccess = true
  89. }else{
  90. this.orderNumber = data.data.orderNo
  91. this.orderIdentification = data.data.orderMark
  92. this.payableAmount = data.data.payableAmount
  93. }
  94. this.$api.getStorage().then((resolve) => {
  95. this.userID = resolve.userID;
  96. })
  97. },
  98. getWinHeight() {
  99. const query = wx.createSelectorQuery().in(this);
  100. query.selectAll('.cash-btn').boundingClientRect();
  101. query.exec(res => {
  102. let winHeight = this.$api.getWindowHeight(),
  103. btnHeight = res[0][0].height;
  104. this.emptyWrapperH = winHeight - btnHeight - this.navbarHeight;
  105. })
  106. },
  107. setHeaderBtnPosi(){
  108. // 获得胶囊按钮位置信息
  109. let headerBtnPosi = uni.getMenuButtonBoundingClientRect();
  110. return headerBtnPosi
  111. },
  112. setSysteminfo(){
  113. let systeminfo;
  114. uni.getSystemInfo({ // 获取设备信息
  115. success: (res) => {
  116. systeminfo = res
  117. },
  118. })
  119. return systeminfo
  120. },
  121. getHeaderTopHeight(){
  122. let statusBarHeight = this.systeminfo.statusBarHeight // 状态栏高度
  123. let headerPosi = this.headerBtnPosi
  124. let btnPosi = { // 胶囊实际位置,坐标信息不是左上角原点
  125. height: headerPosi.height,
  126. width: headerPosi.width,
  127. // 胶囊top - 状态栏高度
  128. top: headerPosi.top - statusBarHeight,
  129. // 胶囊bottom - 胶囊height - 状态栏height (现胶囊bottom 为距离导航栏底部的长度)
  130. bottom: headerPosi.bottom - headerPosi.height - statusBarHeight,
  131. // 屏幕宽度 - 胶囊right
  132. right: this.systeminfo.screenWidth - headerPosi.right
  133. }
  134. this.navbarHeight= headerPosi.bottom + btnPosi.bottom// 原胶囊bottom + 现胶囊bottom
  135. },
  136. clipboard(data) {
  137. thorui.getClipboardData(data, (res) => {
  138. // #ifdef H5
  139. if (res) {
  140. this.$util.msg("复制成功",3000);
  141. } else {
  142. this.$util.msg("复制失败",3000);
  143. }
  144. // #endif
  145. })
  146. },
  147. onShareCode(){
  148. this.isShareModal = true
  149. },
  150. onShareAppMessage(res){//分享转发
  151. console.log(res)
  152. let self = this
  153. self.isShareModal = false
  154. if (res.from === 'button') {
  155. // 来自页面内转发按钮
  156. console.log(res.target)
  157. // self.$util.msg("分享成功",3000);
  158. setTimeout(function(){
  159. self.isShareCode = true;
  160. },5000)
  161. }
  162. return {
  163. title: '您有新的分享订单,快来查看吧~',
  164. path: `/pages/user/order/orderShareLogin?orderID=${this.shareOrderID}&userID=${this.userID}`,
  165. imageUrl:'https://admin-b.caimei365.com/userfiles/1/images/photo/2020/03/%E8%AE%A2%E5%8D%95%E5%88%86%E4%BA%AB%E5%9B%BE%403x.png'
  166. }
  167. },
  168. goIndex(){
  169. uni.switchTab({
  170. url: '/pages/tabBar/home/home'
  171. });
  172. }
  173. },
  174. onShow() {
  175. }
  176. }
  177. </script>
  178. <style lang="scss">
  179. $width:100%;
  180. $height:100%;
  181. .container-cash{
  182. width: $width;
  183. .container-wrapper{
  184. float: left;
  185. width: $width;
  186. .cashier-wrapper-empty{
  187. width: $width;
  188. float: left;
  189. // min-height: 750rpx;
  190. display: flex;
  191. align-items: center;
  192. justify-content: center;
  193. flex-direction: column;
  194. background: $bg-color;
  195. &-image {
  196. width: 382rpx;
  197. height: 310rpx;
  198. margin-bottom: 10rpx;
  199. margin-top: -120rpx;
  200. }
  201. .txt{
  202. font-size: $font-size-28;
  203. color: $text-color;
  204. line-height: 44rpx;
  205. }
  206. }
  207. .cashier-wrapper{
  208. width: 100%;
  209. height: auto;
  210. display: flex;
  211. flex-direction: column;
  212. align-items: center;
  213. padding-top: 36rpx;
  214. padding-bottom: 100rpx;
  215. image{
  216. display: flex;
  217. width: 382rpx;
  218. height: 310rpx;
  219. margin-bottom: 22rpx;
  220. }
  221. .wrapper-text{
  222. font-size: $font-size-28;
  223. color: $text-color;
  224. text-align: center;
  225. line-height: 44rpx;
  226. font-weight: bold;
  227. margin-bottom: 30rpx;
  228. .red{
  229. color: #FF2A2A;
  230. }
  231. }
  232. .wrapper-text.warning{
  233. width:540rpx;
  234. text-align: justify;
  235. color: #FF2A2A;
  236. font-size: $font-size-24;
  237. line-height: 40rpx;
  238. font-weight: normal;
  239. }
  240. .wrapper-title{
  241. line-height: 36rpx;
  242. text-align: center;
  243. font-size: $font-size-26;
  244. color: $text-color;
  245. margin: 48rpx 0 24rpx 0;
  246. font-weight: bold;
  247. position: relative;
  248. &:before{
  249. content: '';
  250. width: 210rpx;
  251. height: 1px;
  252. background: #F8F8F8;
  253. position: absolute;
  254. left: -235rpx;
  255. top: 18rpx;
  256. }
  257. &:after{
  258. content: '';
  259. width: 210rpx;
  260. height: 1px;
  261. background: #F8F8F8;
  262. position: absolute;
  263. right: -235rpx;
  264. top: 18rpx;
  265. }
  266. }
  267. .wrapper-message.t{
  268. width: 460rpx;
  269. padding: 36rpx 25rpx 36rpx 65rpx;
  270. }
  271. .wrapper-message{
  272. width: 400rpx;
  273. height: 194rpx;
  274. padding: 36rpx 75rpx;
  275. border-radius: 30rpx;
  276. background: rgba(255,255,255,0);
  277. border: 1px solid #F8C499;
  278. font-size: $font-size-26;
  279. color: $text-color;
  280. line-height: 64rpx;
  281. text-align: left;
  282. position: relative;
  283. &:before{
  284. content: "";
  285. width: 100%;
  286. height: 100%;
  287. border-radius: 30rpx;
  288. background: #F8C499;
  289. position: absolute;
  290. right: -20rpx;
  291. bottom: -20rpx;
  292. z-index: -1;
  293. opacity: 0.2;
  294. }
  295. .clipboard{
  296. width: 84rpx;
  297. height: 36rpx;
  298. background: linear-gradient(34deg,rgba(255,41,41,1) 0%,rgba(255,109,27,1) 100%);
  299. text-align: center;
  300. font-size: $font-size-24;
  301. color: #FFFFFF;
  302. border-radius: 6rpx;
  303. line-height: 36rpx;
  304. display: inline-block;
  305. margin-left: 42rpx;
  306. }
  307. }
  308. }
  309. .cash-btn{
  310. width: 612rpx;
  311. height: 64rpx;
  312. padding: 20rpx 69rpx;
  313. display: flex;
  314. align-items: center;
  315. position: fixed;
  316. bottom: 0;
  317. left: 0;
  318. background: #FFFFFF;
  319. .btn{
  320. width: 160rpx;
  321. height: 64rpx;
  322. margin: 0 22rpx;
  323. line-height: 64rpx;
  324. font-size:$font-size-26;
  325. border-radius: 10rpx;
  326. color: #FFFFFF;
  327. text-align: center;
  328. }
  329. .btn-share{
  330. background:linear-gradient(315deg,rgba(0,212,150,1) 0%,rgba(126,243,174,1) 100%);
  331. position: relative;
  332. .tips{
  333. width: 160rpx;
  334. height: 34rpx;
  335. padding: 10rpx 10rpx;
  336. background:linear-gradient(45deg,rgba(0,0,0,1) 0%,rgba(87,87,87,1) 100%);
  337. box-shadow:0px 2px 4px 0px rgba(0,0,0,0.2);
  338. border-radius: 8rpx;
  339. position: absolute;
  340. color: #FFFFFF;
  341. line-height: 34rpx;
  342. font-size: $font-size-24;
  343. text-align: left;
  344. left: 0;
  345. top: -65rpx;
  346. &:before{
  347. content: "";
  348. width: 25rpx;
  349. height: 25rpx;
  350. background:linear-gradient(45deg,rgba(0,0,0,1) 0%,rgba(87,87,87,1) 100%);
  351. position: absolute;
  352. bottom: -8rpx;
  353. left: 30rpx;
  354. z-index: -1;
  355. transform:rotate(45deg);
  356. }
  357. }
  358. }
  359. .btn-query{
  360. background:linear-gradient(225deg,rgba(44,180,255,1) 0%,rgba(0,115,255,1) 100%);
  361. }
  362. .btn-makes{
  363. background:linear-gradient(315deg,rgba(231,0,0,1) 0%,rgba(255,104,1,1) 100%);
  364. }
  365. }
  366. }
  367. }
  368. </style>