merchant.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  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">
  8. <image class="portrait" :src="showimg || '../../../static/error/missing-face.png'"></image>
  9. </view>
  10. <view class="userInfo-xinxi">
  11. <view class="title clamp">
  12. <text>{{ name }}</text>
  13. </view>
  14. <view class="phone">
  15. <text>{{ phone }}</text>
  16. </view>
  17. </view>
  18. <view class="balance clamp">{{ address }}</view>
  19. </view>
  20. </view>
  21. <view class="userInfoList">
  22. <view class="userInfoList-bottom" @click="navTo('/user/page/hexiao')">
  23. <view class="bottom">
  24. <image src="../../../static/merchant/saoma.png" mode=""></image>
  25. </view>
  26. 扫码核销
  27. </view>
  28. <view class="userInfoList-bottom" @click="navTo('/user/page/merchant/finance')">
  29. <view class="bottom">
  30. <image src="../../../static/merchant/money.png" mode=""></image>
  31. </view>
  32. 店铺财务
  33. </view>
  34. <view class="userInfoList-bottom" @click="navTo('/user/page/merchant/order')">
  35. <view class="bottom">
  36. <image src="../../../static/merchant/order.png" mode=""></image>
  37. </view>
  38. 订单管理
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. import {
  46. my,
  47. verific
  48. } from '@/api/merchant.js';
  49. import uniPopup from '@/components/uni-popup/uni-popup.vue';
  50. export default {
  51. components: {
  52. uniPopup
  53. },
  54. data() {
  55. return {
  56. showimg: '',
  57. name: '',
  58. phone: '',
  59. address: '',
  60. code: ''
  61. };
  62. },
  63. onLoad() {
  64. my({}).then(({
  65. data
  66. }) => {
  67. this.showimg = data.info.showimg;
  68. this.name = data.info.name;
  69. this.phone = data.info.phone;
  70. this.address = data.info.detailed_address;
  71. });
  72. },
  73. methods: {
  74. //跳转
  75. navTo(url) {
  76. uni.navigateTo({
  77. url
  78. });
  79. },
  80. close() {
  81. this.$refs.popuphx.close();
  82. this.code = '';
  83. },
  84. qhx() {
  85. verific({
  86. verify_code: this.code,
  87. is_confirm: 1 //1是核销,0是查看
  88. })
  89. .then(e => {
  90. this.$api.msg('核销成功');
  91. this.close();
  92. })
  93. .catch(e => {
  94. console.log(e);
  95. });
  96. },
  97. //调取扫描二维码
  98. sao() {
  99. let obj = this;
  100. // #ifndef H5
  101. uni.scanCode({
  102. success(e) {
  103. obj.code = e.result;
  104. obj.$refs.popuphx.open();
  105. }
  106. });
  107. // #endif
  108. }
  109. }
  110. };
  111. </script>
  112. <style lang="scss">
  113. page {
  114. height: 100%;
  115. background-color: #eeeded;
  116. padding: 0;
  117. margin: 0;
  118. }
  119. // 弹窗
  120. .hx-wrapper {
  121. width: 536rpx;
  122. height: 630rpx;
  123. position: relative;
  124. // background-color: #fff;
  125. .hx-img {
  126. width: 536rpx;
  127. height: 281rpx;
  128. image {
  129. width: 536rpx;
  130. height: 281rpx;
  131. }
  132. }
  133. .hx-close {
  134. position: absolute;
  135. left: 243rpx;
  136. bottom: -80rpx;
  137. width: 52rpx;
  138. height: 52rpx;
  139. image {
  140. width: 52rpx;
  141. height: 52rpx;
  142. }
  143. }
  144. .hx-body {
  145. width: 536rpx;
  146. height: 349rpx;
  147. background-color: #fff;
  148. border-radius: 0 0 10rpx 10rpx;
  149. .hx-title {
  150. width: 536rpx;
  151. font-size: 36rpx;
  152. font-weight: 500;
  153. color: #333333;
  154. line-height: 1;
  155. padding-top: 42rpx;
  156. text-align: center;
  157. }
  158. input {
  159. width: 439rpx;
  160. height: 68rpx;
  161. background: #dbf3e9;
  162. border-radius: 10rpx;
  163. margin: 39rpx auto 0;
  164. padding-left: 26rpx;
  165. .hx-placeholder {
  166. font-size: 26rpx;
  167. font-weight: 500;
  168. color: #52c696;
  169. }
  170. }
  171. .hx-btn {
  172. margin: 44rpx auto 0;
  173. width: 353rpx;
  174. height: 71rpx;
  175. background: #F75022;
  176. border-radius: 34rpx;
  177. font-size: 36rpx;
  178. font-weight: 500;
  179. color: #f8f9f9;
  180. line-height: 71rpx;
  181. text-align: center;
  182. }
  183. }
  184. }
  185. .content {
  186. background-color: #eeeded;
  187. margin: 0 30rpx;
  188. display: flex;
  189. flex-direction: column;
  190. }
  191. .background {
  192. width: 100%;
  193. height: 220rpx;
  194. background-color: #F75022;
  195. }
  196. .userInfo {
  197. margin-top: -110rpx;
  198. display: flex;
  199. flex-direction: column;
  200. align-items: center;
  201. background-color: #f9f9f9;
  202. border-radius: 19rpx;
  203. width: 100%;
  204. height: 300rpx;
  205. .userInfo-box {
  206. display: flex;
  207. flex-direction: column;
  208. align-items: center;
  209. .userInfo-img {
  210. margin: -65rpx 0 0 0;
  211. width: 130rpx;
  212. height: 130rpx;
  213. border: 5rpx solid #fff;
  214. border-radius: 50%;
  215. image {
  216. border-radius: 50%;
  217. width: 100%;
  218. height: 100%;
  219. }
  220. }
  221. .userInfo-xinxi {
  222. .title {
  223. margin: 20rpx 0;
  224. font-size: 32rpx;
  225. font-family: PingFang SC;
  226. font-weight: bold;
  227. color: #333333;
  228. text-align: center;
  229. }
  230. .phone {
  231. font-size: 28rpx;
  232. font-family: PingFang SC;
  233. font-weight: 500;
  234. color: #666666;
  235. line-height: 21rpx;
  236. }
  237. }
  238. .balance {
  239. margin-top: 10rpx;
  240. text-align: center;
  241. width: 500rpx;
  242. height: 60rpx;
  243. background: #F75022;
  244. border-radius: 30rpx;
  245. font-size: 28rpx;
  246. font-family: PingFang SC;
  247. font-weight: 500;
  248. color: #ffffff;
  249. line-height: 60rpx;
  250. }
  251. }
  252. }
  253. .userInfoList {
  254. margin-top: 20rpx;
  255. display: flex;
  256. flex-wrap: wrap;
  257. justify-content: space-between;
  258. .userInfoList-top {
  259. position: relative;
  260. margin: 15rpx 0;
  261. display: flex;
  262. justify-content: center;
  263. align-items: center;
  264. width: 340rpx;
  265. height: 100rpx;
  266. background: #ffffff;
  267. border-radius: 20rpx;
  268. font-size: 30rpx;
  269. font-family: PingFang SC;
  270. font-weight: 500;
  271. color: #4d4d4d;
  272. line-height: 21rpx;
  273. .top {
  274. position: absolute;
  275. top: 50%;
  276. left: 30rpx;
  277. margin-top: -25rpx;
  278. width: 50rpx;
  279. height: 50rpx;
  280. image {
  281. width: 100%;
  282. height: 100%;
  283. }
  284. }
  285. }
  286. .userInfoList-bottom {
  287. margin-bottom: 15rpx;
  288. width: 340rpx;
  289. height: 250rpx;
  290. background: #f9f9f9;
  291. border-radius: 20rpx;
  292. display: flex;
  293. flex-direction: column;
  294. justify-content: center;
  295. align-items: center;
  296. .bottom {
  297. margin-bottom: 20rpx;
  298. width: 68rpx;
  299. height: 68rpx;
  300. image {
  301. width: 100%;
  302. height: 100%;
  303. }
  304. }
  305. }
  306. }
  307. </style>