subordinate.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  1. <template>
  2. <view class="body">
  3. <view class="vheigh"></view>
  4. <view class="background"></view>
  5. <view class="content">
  6. <view class="userInfo">
  7. <view class="userInfo-box">
  8. <view class="userInfo-img" v-if="store_info"><image class="portrait" :src="store_info.image"></image></view>
  9. <view class="userInfo-img" v-else><image class="portrait" src="../../static/error/missing-face.png"></image></view>
  10. <view class="userInfo-xinxi">
  11. <view class="title clamp">
  12. <text>{{ store_info ? store_info.name : '总店' }}</text>
  13. </view>
  14. <view class="phone">
  15. <text>{{ store_info ? store_info.phone : '' }}</text>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. <!-- <view class="saoma" @click="sao()">
  21. <view class="saoma-left">
  22. <image class="saoma-icon" src="../../static/img/shop1.png" mode=""></image>
  23. <view class="saoma-font">扫码核销</view>
  24. </view>
  25. <view class="saoma-jt"><image src="../../static/img/shop2.png" mode=""></image></view>
  26. </view> -->
  27. <view class="userInfoList">
  28. <view class="userInfoList-bottom" @click="navTo('/pages/shop/turnover')">
  29. <view class="bottom"><image class="bottom-icon1" src="../../static/img/shop3.png" mode=""></image></view>
  30. <view class="num">¥{{ achievement }}</view>
  31. <view class="font">成交金额</view>
  32. </view>
  33. <view class="userInfoList-bottom" @click="navTo('/pages/shop/order?id=' + store_id)">
  34. <view class="bottom"><image class="bottom-icon2" src="../../static/img/shop4.png" mode=""></image></view>
  35. <view class="num">{{ order_count }}</view>
  36. <view class="font">订单总数</view>
  37. </view>
  38. <view class="userInfoList-bottom" @click="navTo('/pages/shop/employee?id=' + store_id)">
  39. <view class="bottom"><image class="bottom-icon3" src="../../static/img/shop5.png" mode=""></image></view>
  40. <view class="num">¥{{ achievement_waiter || 0 }}</view>
  41. <view class="font">员工业绩</view>
  42. </view>
  43. <!-- <view class="userInfoList-bottom" @click="navTo('/pages/shop/vipDetail')"> -->
  44. <view class="userInfoList-bottom">
  45. <view class="bottom"><image class="bottom-icon4" src="../../static/img/shop6.png" mode=""></image></view>
  46. <view class="num">{{ store_info ? store_info.valid_time : 0 }}</view>
  47. <view class="font">曝光量</view>
  48. </view>
  49. <view class="userInfoList-bottom" @click="navTo('/pages/shop/myriad?id=' + store_id)">
  50. <view class="bottom"><image class="bottom-icon5" src="../../static/img/shop7.png" mode=""></image></view>
  51. <view class="num">{{ over }}</view>
  52. <view class="font">破万大神</view>
  53. </view>
  54. <view class="userInfoList-bottom" @click="navTo('/pages/shop/product')">
  55. <view class="bottom"><image class="bottom-icon6" src="../../static/img/shop8.png" mode=""></image></view>
  56. <view class="num">{{ productNum }}</view>
  57. <view class="font">热卖项目排行</view>
  58. </view>
  59. <view class="userInfoList-bottom" @click="navTo('/pages/shop/fissioned')">
  60. <view class="bottom"><image class="bottom-icon7" src="../../static/img/shop9.png" mode=""></image></view>
  61. <view class="num">{{ user_explode }}</view>
  62. <view class="font">已裂变客数</view>
  63. </view>
  64. <!-- <view class="userInfoList-bottom" @click="navTo('/pages/shop/fission')">
  65. <view class="bottom"><image class="bottom-icon8" src="../../static/img/shop10.png" mode=""></image></view>
  66. <view class="num">30</view>
  67. <view class="font">待裂变客数</view>
  68. </view> -->
  69. <!-- <view class="userInfoList-bottom" @click="navTo('/pages/shop/subbranch')">
  70. <view class="bottom"><image class="bottom-icon9" src="../../static/img/shop11.png" mode=""></image></view>
  71. <view class="num">{{ shopNum }}</view>
  72. <view class="font">分店数据</view>
  73. </view> -->
  74. </view>
  75. </view>
  76. <uni-popup ref="popuphx" class="agree-wrapper">
  77. <view class="hx-wrapper">
  78. <view class="hx-img"><image src="../../static/img/hxbg.png" mode=""></image></view>
  79. <view class="hx-body">
  80. <view class="hx-title">输入核销码核销</view>
  81. <input type="text" v-model="code" placeholder="请输入核销码" placeholder-class="hx-placeholder" />
  82. <view class="hx-btn" @click="qhx">立即核销</view>
  83. </view>
  84. <view class="hx-close" @click="close"><image src="../../static/icon/close.png" mode=""></image></view>
  85. </view>
  86. </uni-popup>
  87. <!-- <u-tabbar
  88. v-if="userInfo.user_rule == 'leader' || userInfo.user_rule == 'admin'"
  89. v-model="current"
  90. :list="tabbar"
  91. active-color="#FF4C4C"
  92. inactive-color="#666666"
  93. ></u-tabbar>
  94. <u-tabbar v-else v-model="current" :list="tabbar1" active-color="#FF4C4C" inactive-color="#666666"></u-tabbar> -->
  95. </view>
  96. </template>
  97. <script>
  98. import { mapState, mapMutations } from 'vuex';
  99. import { tabbar, tabbar1 } from '@/utils/tabbar.js';
  100. import { getStoreGoods } from '@/api/product.js';
  101. import { userinfo, check } from '@/api/user.js';
  102. import { store, over10000, store_list, product } from '@/api/info.js';
  103. // #ifdef H5
  104. import { weixindata } from '@/utils/wxAuthorized';
  105. // #endif
  106. export default {
  107. // #ifdef MP
  108. onShareAppMessage: function(res) {
  109. if (res.from === 'button') {
  110. // 来自页面内分享按钮
  111. let pages = getCurrentPages();
  112. // 获取当前页面
  113. let page = pages[pages.length - 1];
  114. let path = '/' + page.route + '?';
  115. // 保存传值
  116. for (let i in page.options) {
  117. path += i + '=' + page.options[i] + '&';
  118. }
  119. // 保存邀请人
  120. path += 'shopId=' + this.userInfo.store_info.id + '&spread=' + this.userInfo.uid;
  121. let data = {
  122. path: path,
  123. imageUrl: this.userInfo.store_info.image,
  124. title: this.userInfo.store_info.name
  125. };
  126. console.log('data', data);
  127. return data;
  128. }
  129. },
  130. // #endif
  131. data() {
  132. return {
  133. current: 1,
  134. tabbar: tabbar,
  135. tabbar1: tabbar1,
  136. code: '',
  137. achievement: '',
  138. order_count: '',
  139. user_explode: '',
  140. store_info: {},
  141. over: '',
  142. shopNum: '',
  143. productNum: '',
  144. achievement_waiter: '',
  145. store_id: ''
  146. };
  147. },
  148. computed: {
  149. ...mapState(['userInfo'])
  150. },
  151. onLoad(option) {
  152. if (option.id) {
  153. this.store_id = option.id;
  154. } else {
  155. this.store_id = userInfo.store_id;
  156. }
  157. // this.loadData();
  158. },
  159. // 进入页面刷新数据
  160. onShow() {
  161. this.loadData();
  162. },
  163. methods: {
  164. loadData() {
  165. store({}, this.store_id).then(({ data }) => {
  166. this.achievement = data.achievement;
  167. this.order_count = data.order_count;
  168. this.user_explode = data.user_explode;
  169. this.store_info = data.store_info;
  170. this.achievement_waiter = data.achievement_waiter;
  171. console.log(data, '123456');
  172. });
  173. over10000({}).then(e => {
  174. this.over = e.data.count;
  175. console.log(this.over, 111);
  176. });
  177. store_list({}).then(e => {
  178. this.shopNum = e.data.count;
  179. console.log(this.shopNum, 111);
  180. });
  181. product({}).then(e => {
  182. this.productNum = e.data.count;
  183. console.log(this.productNum, 111);
  184. });
  185. // getStoreGoods({ page: 1, limit: 10, store_id: this.store_id }).then(({ data }) => {
  186. // this.list = data;
  187. // });
  188. },
  189. //调取扫描二维码
  190. sao() {
  191. let obj = this;
  192. // #ifndef H5
  193. uni.scanCode({
  194. success(e) {
  195. obj.code = e.result;
  196. obj.$refs.popuphx.open();
  197. }
  198. });
  199. // #endif
  200. // #ifdef H5
  201. let wx = require('jweixin-module');
  202. wx.scanQRCode({
  203. needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
  204. scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码,默认二者都有
  205. success: function(res) {
  206. obj.code = res.resultStr; // 当needResult 为 1 时,扫码返回的结果
  207. obj.$refs.popuphx.open();
  208. }
  209. });
  210. // #endif
  211. },
  212. qhx() {
  213. check({
  214. verify_code: this.code,
  215. is_confirm: 1 //1是核销,0是查看
  216. })
  217. .then(e => {
  218. this.$api.msg('核销成功');
  219. this.close();
  220. })
  221. .catch(e => {
  222. console.log(e);
  223. });
  224. },
  225. //跳转
  226. navTo(url) {
  227. console.log(url, '123456');
  228. uni.navigateTo({
  229. url
  230. });
  231. },
  232. close() {
  233. this.$refs.popuphx.close();
  234. this.code = '';
  235. }
  236. }
  237. };
  238. </script>
  239. <style lang="scss">
  240. page {
  241. height: auto;
  242. min-height: 100%;
  243. background-color: #eeeded;
  244. padding: 0;
  245. margin: 0;
  246. }
  247. // 弹窗
  248. .hx-wrapper {
  249. width: 536rpx;
  250. height: 630rpx;
  251. position: relative;
  252. // background-color: #fff;
  253. .hx-img {
  254. width: 536rpx;
  255. height: 281rpx;
  256. image {
  257. width: 536rpx;
  258. height: 281rpx;
  259. }
  260. }
  261. .hx-close {
  262. position: absolute;
  263. left: 243rpx;
  264. bottom: -80rpx;
  265. width: 52rpx;
  266. height: 52rpx;
  267. image {
  268. width: 52rpx;
  269. height: 52rpx;
  270. }
  271. }
  272. .hx-body {
  273. width: 536rpx;
  274. height: 349rpx;
  275. background-color: #fff;
  276. border-radius: 0 0 10rpx 10rpx;
  277. .hx-title {
  278. width: 536rpx;
  279. font-size: 36rpx;
  280. font-weight: 500;
  281. color: #333333;
  282. line-height: 1;
  283. padding-top: 42rpx;
  284. text-align: center;
  285. }
  286. input {
  287. width: 439rpx;
  288. height: 68rpx;
  289. background: #dbf3e9;
  290. border-radius: 10rpx;
  291. margin: 39rpx auto 0;
  292. padding-left: 26rpx;
  293. .hx-placeholder {
  294. font-size: 26rpx;
  295. font-weight: 500;
  296. color: #52c696;
  297. }
  298. }
  299. .hx-btn {
  300. margin: 44rpx auto 0;
  301. width: 353rpx;
  302. height: 71rpx;
  303. background: #52c696;
  304. border-radius: 34rpx;
  305. font-size: 36rpx;
  306. font-weight: 500;
  307. color: #f8f9f9;
  308. line-height: 71rpx;
  309. text-align: center;
  310. }
  311. }
  312. }
  313. .saoma {
  314. width: 690rpx;
  315. background: #ffffff;
  316. border-radius: 20rpx;
  317. margin: 20rpx auto;
  318. display: flex;
  319. justify-content: space-between;
  320. padding: 24rpx 46rpx;
  321. align-items: center;
  322. .saoma-left {
  323. display: flex;
  324. justify-content: center;
  325. align-items: center;
  326. .saoma-icon {
  327. width: 50rpx;
  328. height: 50rpx;
  329. }
  330. .saoma-font {
  331. margin-left: 20rpx;
  332. font-size: 30rpx;
  333. font-family: PingFang SC;
  334. font-weight: 500;
  335. color: #4d4d4d;
  336. }
  337. }
  338. .saoma-jt {
  339. width: 18rpx;
  340. height: 30rpx;
  341. image {
  342. width: 100%;
  343. height: 100%;
  344. }
  345. }
  346. }
  347. .content {
  348. background-color: #eeeded;
  349. margin: 0 auto;
  350. width: 690rpx;
  351. display: flex;
  352. flex-direction: column;
  353. }
  354. .background {
  355. width: 750rpx;
  356. height: 220rpx;
  357. background-color: #ff4c4c;
  358. }
  359. .vheigh {
  360. height: var(--status-bar-height);
  361. background-color: #ff4c4c;
  362. }
  363. .userInfo {
  364. margin-top: -110rpx;
  365. display: flex;
  366. flex-direction: column;
  367. align-items: center;
  368. background-color: #f9f9f9;
  369. border-radius: 19rpx;
  370. width: 100%;
  371. height: 220rpx;
  372. .userInfo-box {
  373. display: flex;
  374. flex-direction: column;
  375. align-items: center;
  376. .userInfo-img {
  377. margin: -65rpx 0 0 0;
  378. width: 130rpx;
  379. height: 130rpx;
  380. border: 5rpx solid #fff;
  381. border-radius: 50%;
  382. image {
  383. border-radius: 50%;
  384. width: 100%;
  385. height: 100%;
  386. }
  387. }
  388. .userInfo-xinxi {
  389. .title {
  390. margin: 20rpx 0;
  391. font-size: 32rpx;
  392. font-family: PingFang SC;
  393. font-weight: bold;
  394. color: #333333;
  395. text-align: center;
  396. }
  397. .phone {
  398. text-align: center;
  399. font-size: 28rpx;
  400. font-family: PingFang SC;
  401. font-weight: 500;
  402. color: #666666;
  403. line-height: 21rpx;
  404. }
  405. }
  406. .balance {
  407. margin-top: 10rpx;
  408. text-align: center;
  409. width: 500rpx;
  410. height: 60rpx;
  411. background: #52c696;
  412. border-radius: 30rpx;
  413. font-size: 28rpx;
  414. font-family: PingFang SC;
  415. font-weight: 500;
  416. color: #ffffff;
  417. line-height: 60rpx;
  418. }
  419. }
  420. }
  421. .userInfoList {
  422. margin-top: 20rpx;
  423. display: flex;
  424. flex-wrap: wrap;
  425. justify-content: space-between;
  426. .userInfoList-bottom {
  427. margin-bottom: 15rpx;
  428. width: 340rpx;
  429. height: 250rpx;
  430. background: #f9f9f9;
  431. border-radius: 20rpx;
  432. display: flex;
  433. flex-direction: column;
  434. justify-content: center;
  435. align-items: center;
  436. line-height: 1;
  437. .bottom {
  438. .bottom-icon1 {
  439. width: 68rpx;
  440. height: 68rpx;
  441. }
  442. .bottom-icon2 {
  443. width: 60rpx;
  444. height: 68rpx;
  445. }
  446. .bottom-icon3 {
  447. width: 66rpx;
  448. height: 74rpx;
  449. }
  450. .bottom-icon4 {
  451. width: 76rpx;
  452. height: 62rpx;
  453. }
  454. .bottom-icon5 {
  455. width: 56rpx;
  456. height: 52rpx;
  457. }
  458. .bottom-icon6 {
  459. width: 66rpx;
  460. height: 70rpx;
  461. }
  462. .bottom-icon7 {
  463. width: 70rpx;
  464. height: 60rpx;
  465. }
  466. .bottom-icon8 {
  467. width: 74rpx;
  468. height: 52rpx;
  469. }
  470. .bottom-icon9 {
  471. width: 74rpx;
  472. height: 68rpx;
  473. }
  474. }
  475. .num {
  476. margin-top: 16rpx;
  477. font-size: 30rpx;
  478. font-family: PingFang SC;
  479. font-weight: 500;
  480. color: #333333;
  481. }
  482. .font {
  483. margin-top: 10rpx;
  484. font-size: 26rpx;
  485. font-family: PingFang SC;
  486. font-weight: 500;
  487. color: #4d4d4d;
  488. }
  489. }
  490. }
  491. </style>