code.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <view class="code main-bg">
  3. <view class="header">
  4. <view class="name font-color3 font-thirty-two">{{list.name ? list.name : ''}}</view>
  5. <image class="img" v-if="flag" :src="list.url"></image>
  6. <image class="img" v-else :src="image(list.url)"></image>
  7. </view>
  8. <view class="footer">
  9. <view class="footer-btn">
  10. <view class="btn1 font-color2 font-thirty" @click="gotoShop">优待证结算</view>
  11. <view class="btn1 font-color2 font-thirty" @click="show">唯一识别码结算</view>
  12. </view>
  13. <view class="btn2 font-color2 font-thirty" @click="goto">查看优惠记录</view>
  14. </view>
  15. <ming-pop ref="statement" direction="below" :is_mask="true" :width="100" height="42%" :maskFun="true">
  16. <money @close="close()" @add="submit"></money>
  17. </ming-pop>
  18. <u-toast ref="uToast" />
  19. </view>
  20. </template>
  21. <script>
  22. import money from '@/components/pop/money.vue'
  23. import server from "@/api/index";
  24. import http from '@/common/http.js'
  25. export default {
  26. components:{
  27. money
  28. },
  29. data() {
  30. return {
  31. list: {
  32. name: '店铺',
  33. url: '',
  34. },
  35. id: null,
  36. userInfo: null,
  37. flag: false,
  38. }
  39. },
  40. onLoad(e) {
  41. this.userInfo = uni.getStorageSync('userInfo');
  42. this.id = e.id;
  43. this.list.name = e.name;
  44. if(e.img){
  45. this.list.url = e.img
  46. }
  47. },
  48. methods:{
  49. image(e) {
  50. return http.webUrl + e
  51. },
  52. submit(e){
  53. if(e){
  54. server.getCode({orderPriceOld: e, shopsId: this.userInfo.nickName}).then(res =>{
  55. // this.$refs.uToast.show({
  56. // title: '修改成功!',
  57. // type: 'default',
  58. // })
  59. console.log(res)
  60. this.flag = true;
  61. this.list.url = res;
  62. })
  63. }
  64. },
  65. gotoShop(){
  66. uni.navigateTo({
  67. url: '/pages/merchant/home/shop'
  68. })
  69. },
  70. show(){
  71. uni.navigateTo({
  72. url: '/pages/soldier/user/scanning'
  73. })
  74. },
  75. // show() {
  76. // this.$refs.statement.show();
  77. // },
  78. // close() {
  79. // this.$refs.statement.close();
  80. // },
  81. goto(url){
  82. uni.navigateTo({
  83. url: '/pages/merchant/home/record?id=' + this.id
  84. })
  85. }
  86. }
  87. }
  88. </script>
  89. <style lang="scss" scoped>
  90. .code{
  91. width: 100%;
  92. height: auto;
  93. min-height: 100vh;
  94. padding: 30rpx;
  95. .header{
  96. width: 100%;
  97. height: 575rpx;
  98. background: #FFFFFF;
  99. border-radius: 24rpx;
  100. text-align: center;
  101. .name{
  102. width: 100%;
  103. height: 135rpx;
  104. line-height: 135rpx;
  105. text-align: center;
  106. letter-spacing: 2rpx;
  107. }
  108. .img{
  109. width: 400rpx;
  110. height: 400rpx;
  111. }
  112. }
  113. .footer{
  114. .btn1{
  115. margin-top: 30rpx;
  116. width: 100%;
  117. height: 96rpx;
  118. line-height: 96rpx;
  119. background: rgba(46, 79, 28, 0.13);
  120. border-radius: 16rpx;
  121. text-align: center;
  122. }
  123. .btn2{
  124. margin-top: 30rpx;
  125. width: 100%;
  126. height: 96rpx;
  127. line-height: 96rpx;
  128. background: #FFFFFF;
  129. border-radius: 16rpx;
  130. border: 2rpx solid #2E4F1C;
  131. text-align: center;
  132. }
  133. }
  134. }
  135. </style>