merchant.vue 7.2 KB

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