merchant.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  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-bottom" @click="smsh()">
  21. <view class="bottom"><image src="../../static/icon/saoma.png" mode=""></image></view>
  22. 扫码核销
  23. </view>
  24. <view class="userInfoList-bottom" @click="navTo('/pages/merchant/finance')">
  25. <view class="bottom"><image src="../../static/icon/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/icon/order.png" mode=""></image></view>
  30. 订单管理
  31. </view>
  32. <view class="userInfoList-bottom" @click="navTo('/pages/merchant/money?id=' + id)">
  33. <view class="bottom"><image src="../../static/icon/dianpu.png" mode=""></image></view>
  34. 付款记录
  35. </view>
  36. </view>
  37. </view>
  38. <uni-popup ref="popuphx" class="agree-wrapper">
  39. <view class="hx-wrapper">
  40. <view class="hx-img"><image src="../../static/img/hxbg.png" mode=""></image></view>
  41. <view class="hx-body">
  42. <view class="hx-title">输入核销码核销</view>
  43. <input type="text" v-model="code" placeholder="请输入核销码" placeholder-class="hx-placeholder" />
  44. <view class="hx-btn" @click="qhx">立即核销</view>
  45. </view>
  46. <view class="hx-close" @click="close"><image src="../../static/icon/close.png" mode=""></image></view>
  47. </view>
  48. </uni-popup>
  49. </view>
  50. </template>
  51. <script>
  52. import { my, verific } from '@/api/merchant.js';
  53. import { orderVerific } from '@/api/user.js';
  54. import uniPopup from '@/components/uni-popup/uni-popup.vue';
  55. export default {
  56. components: {
  57. uniPopup
  58. },
  59. data() {
  60. return {
  61. image: '',
  62. name: '',
  63. phone: '',
  64. address: '',
  65. code: '',
  66. id: ''
  67. };
  68. },
  69. onLoad() {
  70. my({}).then(({ data }) => {
  71. this.id = data.info.id;
  72. this.image = data.info.image;
  73. this.name = data.info.name;
  74. this.phone = data.info.phone;
  75. this.address = data.info.detailed_address;
  76. });
  77. },
  78. methods: {
  79. //跳转
  80. navTo(url) {
  81. uni.navigateTo({
  82. url
  83. });
  84. },
  85. close() {
  86. this.$refs.popuphx.close();
  87. this.code = '';
  88. },
  89. //调取扫描二维码
  90. smsh() {
  91. let obj = this;
  92. // #ifdef H5
  93. let wx = require('@/plugin/jweixin-module');
  94. wx.scanQRCode({
  95. needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
  96. scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码,默认二者都有
  97. success: function(res) {
  98. this.code = res.result;
  99. this.srhx();
  100. }
  101. });
  102. // #endif
  103. // #ifndef H5
  104. uni.scanCode({
  105. success: res => {
  106. this.code = res.result;
  107. this.srhx();
  108. }
  109. });
  110. // #endif
  111. },
  112. srhx() {
  113. this.$refs.popuphx.open();
  114. },
  115. close() {
  116. this.$refs.popuphx.close();
  117. },
  118. qhx() {
  119. if (this.code == '') {
  120. return this.$api.msg('请输入核销码');
  121. }
  122. uni.showLoading({
  123. title: '核销中...',
  124. mask: true
  125. });
  126. orderVerific({
  127. verify_code: this.code,
  128. is_confirm: 1 //1是核销,0是查看
  129. })
  130. .then(res => {
  131. uni.hideLoading();
  132. // this.$api.msg(res.msg)
  133. console.log(res, '++++++++++++++++++++++++++++++');
  134. this.$refs.popuphx.close();
  135. this.code = '';
  136. this.page = 1;
  137. this.loadingType = 'more';
  138. this.goodList = [];
  139. uni.showToast({
  140. title: '核销成功',
  141. duration: 2000
  142. });
  143. this.loadData();
  144. })
  145. .catch(err => {
  146. console.log('dddd');
  147. });
  148. }
  149. }
  150. };
  151. </script>
  152. <style lang="scss">
  153. page {
  154. height: 100%;
  155. background-color: #eeeded;
  156. padding: 0;
  157. margin: 0;
  158. }
  159. // 弹窗
  160. .hx-wrapper {
  161. width: 536rpx;
  162. height: 630rpx;
  163. position: relative;
  164. // background-color: #fff;
  165. .hx-img {
  166. width: 536rpx;
  167. height: 281rpx;
  168. image {
  169. width: 536rpx;
  170. height: 281rpx;
  171. }
  172. }
  173. .hx-close {
  174. position: absolute;
  175. left: 243rpx;
  176. bottom: -80rpx;
  177. width: 52rpx;
  178. height: 52rpx;
  179. image {
  180. width: 52rpx;
  181. height: 52rpx;
  182. }
  183. }
  184. .hx-body {
  185. width: 536rpx;
  186. height: 349rpx;
  187. background-color: #fff;
  188. border-radius: 0 0 10rpx 10rpx;
  189. .hx-title {
  190. width: 536rpx;
  191. font-size: 36rpx;
  192. font-weight: 500;
  193. color: #333333;
  194. line-height: 1;
  195. padding-top: 42rpx;
  196. text-align: center;
  197. }
  198. input {
  199. width: 439rpx;
  200. height: 68rpx;
  201. background: #dbf3e9;
  202. border-radius: 10rpx;
  203. margin: 39rpx auto 0;
  204. padding-left: 26rpx;
  205. .hx-placeholder {
  206. font-size: 26rpx;
  207. font-weight: 500;
  208. color: #52c696;
  209. }
  210. }
  211. .hx-btn {
  212. margin: 44rpx auto 0;
  213. width: 353rpx;
  214. height: 71rpx;
  215. background: #f75022;
  216. border-radius: 34rpx;
  217. font-size: 36rpx;
  218. font-weight: 500;
  219. color: #f8f9f9;
  220. line-height: 71rpx;
  221. text-align: center;
  222. }
  223. }
  224. }
  225. .content {
  226. background-color: #eeeded;
  227. margin: 0 30rpx;
  228. display: flex;
  229. flex-direction: column;
  230. }
  231. .background {
  232. width: 100%;
  233. height: 220rpx;
  234. background-color: #f75022;
  235. }
  236. .userInfo {
  237. margin-top: -110rpx;
  238. display: flex;
  239. flex-direction: column;
  240. align-items: center;
  241. background-color: #f9f9f9;
  242. border-radius: 19rpx;
  243. width: 100%;
  244. height: 300rpx;
  245. .userInfo-box {
  246. display: flex;
  247. flex-direction: column;
  248. align-items: center;
  249. .userInfo-img {
  250. margin: -65rpx 0 0 0;
  251. width: 130rpx;
  252. height: 130rpx;
  253. border: 5rpx solid #fff;
  254. border-radius: 50%;
  255. image {
  256. border-radius: 50%;
  257. width: 100%;
  258. height: 100%;
  259. }
  260. }
  261. .userInfo-xinxi {
  262. .title {
  263. margin: 20rpx 0;
  264. font-size: 32rpx;
  265. font-family: PingFang SC;
  266. font-weight: bold;
  267. color: #333333;
  268. text-align: center;
  269. }
  270. .phone {
  271. font-size: 28rpx;
  272. font-family: PingFang SC;
  273. font-weight: 500;
  274. color: #666666;
  275. line-height: 21rpx;
  276. }
  277. }
  278. .balance {
  279. margin-top: 10rpx;
  280. text-align: center;
  281. width: 500rpx;
  282. height: 60rpx;
  283. background: #f75022;
  284. border-radius: 30rpx;
  285. font-size: 28rpx;
  286. font-family: PingFang SC;
  287. font-weight: 500;
  288. color: #ffffff;
  289. line-height: 60rpx;
  290. }
  291. }
  292. }
  293. .userInfoList {
  294. margin-top: 20rpx;
  295. display: flex;
  296. flex-wrap: wrap;
  297. justify-content: space-between;
  298. .userInfoList-top {
  299. position: relative;
  300. margin: 15rpx 0;
  301. display: flex;
  302. justify-content: center;
  303. align-items: center;
  304. width: 340rpx;
  305. height: 100rpx;
  306. background: #ffffff;
  307. border-radius: 20rpx;
  308. font-size: 30rpx;
  309. font-family: PingFang SC;
  310. font-weight: 500;
  311. color: #4d4d4d;
  312. line-height: 21rpx;
  313. .top {
  314. position: absolute;
  315. top: 50%;
  316. left: 30rpx;
  317. margin-top: -25rpx;
  318. width: 50rpx;
  319. height: 50rpx;
  320. image {
  321. width: 100%;
  322. height: 100%;
  323. }
  324. }
  325. }
  326. .userInfoList-bottom {
  327. margin-bottom: 15rpx;
  328. width: 340rpx;
  329. height: 250rpx;
  330. background: #f9f9f9;
  331. border-radius: 20rpx;
  332. display: flex;
  333. flex-direction: column;
  334. justify-content: center;
  335. align-items: center;
  336. .bottom {
  337. margin-bottom: 20rpx;
  338. width: 68rpx;
  339. height: 68rpx;
  340. image {
  341. width: 100%;
  342. height: 100%;
  343. }
  344. }
  345. }
  346. }
  347. .hx-wrapper {
  348. width: 536rpx;
  349. height: 630rpx;
  350. position: relative;
  351. // background-color: #fff;
  352. .hx-img {
  353. width: 536rpx;
  354. height: 281rpx;
  355. image {
  356. width: 536rpx;
  357. height: 281rpx;
  358. }
  359. }
  360. .hx-close {
  361. position: absolute;
  362. left: 243rpx;
  363. bottom: -80rpx;
  364. width: 52rpx;
  365. height: 52rpx;
  366. image {
  367. width: 52rpx;
  368. height: 52rpx;
  369. }
  370. }
  371. .hx-body {
  372. width: 536rpx;
  373. height: 349rpx;
  374. background-color: #fff;
  375. border-radius: 0 0 10rpx 10rpx;
  376. .hx-title {
  377. width: 536rpx;
  378. font-size: 36rpx;
  379. font-weight: 500;
  380. color: #333333;
  381. line-height: 1;
  382. padding-top: 42rpx;
  383. text-align: center;
  384. }
  385. input {
  386. width: 439rpx;
  387. height: 68rpx;
  388. background: #eeddde;
  389. border-radius: 10rpx;
  390. margin: 39rpx auto 0;
  391. padding-left: 26rpx;
  392. .hx-placeholder {
  393. font-size: 26rpx;
  394. font-weight: 500;
  395. color: #901b21;
  396. }
  397. }
  398. .hx-btn {
  399. margin: 44rpx auto 0;
  400. width: 353rpx;
  401. height: 71rpx;
  402. background: #901b21;
  403. border-radius: 34rpx;
  404. font-size: 36rpx;
  405. font-weight: 500;
  406. color: #f8f9f9;
  407. line-height: 71rpx;
  408. text-align: center;
  409. }
  410. }
  411. }
  412. </style>