merchant.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. <template>
  2. <view class="body">
  3. <view class="background"></view>
  4. <view class="content">
  5. <view class="userInfo">
  6. <view class="userInfo-box">
  7. <view class="userInfo-img"><image class="portrait" :src="image || '../../static/error/missing-face.png'"></image></view>
  8. <view class="userInfo-xinxi">
  9. <view class="title"><text>{{name}}</text></view>
  10. <view class="phone"><text>{{phone}}</text></view>
  11. </view>
  12. <view class="balance clamp">{{address}}</view>
  13. </view>
  14. </view>
  15. <view class="userInfoList">
  16. <view class="userInfoList-top" @click="sao()">
  17. <view class="top"><image src="../../static/merchant/saoma.png" mode=""></image></view>
  18. 扫码核销
  19. </view>
  20. <view class="userInfoList-top" @click="navTo('/pages/merchant/storeQr')">
  21. <view class="top"><image src="../../static/merchant/erweima.png" mode=""></image></view>
  22. 店铺二维码
  23. </view>
  24. <view class="userInfoList-bottom" @click="navTo('/pages/merchant/finance')">
  25. <view class="bottom"><image src="../../static/merchant/money.png" mode=""></image></view>
  26. 店铺财务
  27. </view>
  28. <view class="userInfoList-bottom" @click="navTo('/pages/merchant/order')">
  29. <view class="bottom"><image src="../../static/merchant/order.png" mode=""></image></view>
  30. 订单管理
  31. </view>
  32. <view class="userInfoList-bottom" @click="navTo('/pages/merchant/commodity')">
  33. <view class="bottom"><image src="../../static/merchant/shop.png" mode=""></image></view>
  34. 商品管理
  35. </view>
  36. <view class="userInfoList-bottom" @click="navTo('/pages/merchant/vipDetail')">
  37. <view class="bottom"><image src="../../static/merchant/vip.png" mode=""></image></view>
  38. 店铺会员
  39. </view>
  40. <view class="userInfoList-bottom" @click="navTo('/pages/merchant/storeData')">
  41. <view class="bottom"><image src="../../static/merchant/dianpu.png" mode=""></image></view>
  42. 店铺数据
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. import { my } from '@/api/merchant.js'
  50. export default {
  51. data() {
  52. return {
  53. image:'',
  54. name:'',
  55. phone:'',
  56. address:'',
  57. };
  58. },
  59. onLoad() {
  60. my({}).then(({data}) =>{
  61. this.image = data.image;
  62. this.name = data.name;
  63. this.phone = data.phone;
  64. this.address = data.detailed_address
  65. })
  66. },
  67. methods: {
  68. //跳转
  69. navTo(url) {
  70. uni.navigateTo({
  71. url
  72. });
  73. },
  74. //调取扫描二维码
  75. sao() {
  76. let obj = this;
  77. // #ifndef H5
  78. uni.scanCode({
  79. success(e) {
  80. obj.orderVerific(e.result);
  81. }
  82. });
  83. // #endif
  84. // #ifdef H5
  85. this.weichatObj.scanQRCode({
  86. needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
  87. scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码,默认二者都有
  88. success: function(res) {
  89. obj.orderVerific(res.resultStr); // 当needResult 为 1 时,扫码返回的结果
  90. }
  91. });
  92. // #endif
  93. }
  94. }
  95. };
  96. </script>
  97. <style lang="scss">
  98. page {
  99. height: 100%;
  100. background-color: #eeeded;
  101. padding: 0;
  102. margin: 0;
  103. }
  104. .content {
  105. background-color: #eeeded;
  106. margin: 0 30rpx;
  107. display: flex;
  108. flex-direction: column;
  109. }
  110. .background {
  111. width: 100%;
  112. height: 220rpx;
  113. background-color: #75e5b6;
  114. }
  115. .userInfo {
  116. margin-top: -110rpx;
  117. display: flex;
  118. flex-direction: column;
  119. justify-content: center;
  120. background-color: #f9f9f9;
  121. border-radius: 19rpx;
  122. width: 100%;
  123. height: 300rpx;
  124. .userInfo-box {
  125. display: flex;
  126. flex-direction: column;
  127. align-items: center;
  128. .userInfo-img {
  129. margin: -65rpx 0 0 0;
  130. width: 130rpx;
  131. height: 130rpx;
  132. border: 5rpx solid #fff;
  133. border-radius: 50%;
  134. image {
  135. border-radius: 50%;
  136. width: 100%;
  137. height: 100%;
  138. }
  139. }
  140. .userInfo-xinxi {
  141. .title {
  142. margin: 20rpx 0;
  143. font-size: 32rpx;
  144. font-family: PingFang SC;
  145. font-weight: bold;
  146. color: #333333;
  147. line-height: 21rpx;
  148. }
  149. .phone {
  150. font-size: 28rpx;
  151. font-family: PingFang SC;
  152. font-weight: 500;
  153. color: #666666;
  154. line-height: 21rpx;
  155. margin-bottom: 40rpx;
  156. }
  157. }
  158. .balance {
  159. text-align: center;
  160. width: 500rpx;
  161. height: 60rpx;
  162. background: #52c696;
  163. border-radius: 30rpx;
  164. font-size: 28rpx;
  165. font-family: PingFang SC;
  166. font-weight: 500;
  167. color: #ffffff;
  168. line-height: 60rpx;
  169. }
  170. }
  171. }
  172. .userInfoList {
  173. display: flex;
  174. flex-wrap: wrap;
  175. justify-content: space-between;
  176. .userInfoList-top {
  177. position: relative;
  178. margin: 15rpx 0;
  179. display: flex;
  180. justify-content: center;
  181. align-items: center;
  182. width: 340rpx;
  183. height: 100rpx;
  184. background: #ffffff;
  185. border-radius: 20rpx;
  186. font-size: 30rpx;
  187. font-family: PingFang SC;
  188. font-weight: 500;
  189. color: #4d4d4d;
  190. line-height: 21rpx;
  191. .top {
  192. position: absolute;
  193. margin-left: -230rpx;
  194. width: 50rpx;
  195. height: 50rpx;
  196. image {
  197. width: 100%;
  198. height: 100%;
  199. }
  200. }
  201. }
  202. .userInfoList-bottom {
  203. margin-bottom: 15rpx;
  204. width: 340rpx;
  205. height: 250rpx;
  206. background: #f9f9f9;
  207. border-radius: 20rpx;
  208. display: flex;
  209. flex-direction: column;
  210. justify-content: center;
  211. align-items: center;
  212. .bottom {
  213. margin-bottom: 20rpx;
  214. width: 68rpx;
  215. height: 68rpx;
  216. image {
  217. width: 100%;
  218. height: 100%;
  219. }
  220. }
  221. }
  222. }
  223. </style>