index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755
  1. <template>
  2. <view v-if="is_login==1">
  3. <view class="tuanzhangbox">
  4. <view class="tui-mybg-box">
  5. <view class="tui-header-center">
  6. <image :src="tuanzhang.touxiang || '/static/images/my/mine_def_touxiang_3x.png'" class="tui-avatar">
  7. </image>
  8. <view class="tui-info">
  9. <view class="tui-nickname">
  10. {{tuanzhang.community_title}}
  11. </view>
  12. <view class="tui-explain">{{lang.tuanzhang}}:{{tuanzhang.title}}</view>
  13. </view>
  14. </view>
  15. <view class="tui-share-position" @tap="goadminstore">
  16. <tui-tag type="white" shape="circleLeft" padding="24rpx 36rpx">
  17. <view class="tui-share-box">
  18. <tui-icon name="shop" color="#333" :size="16"></tui-icon>
  19. <text class="tui-share-text tui-size">店铺管理</text>
  20. </view>
  21. </tui-tag>
  22. </view>
  23. </view>
  24. <view class="tui-content-box">
  25. <view class="tui-box tui-assets-box">
  26. <view class="tui-order-list tui-assets-list">
  27. <view class="tui-order-item">
  28. <view class="tui-assets-num"><text>{{tuanzhang.total_income}}</text></view>
  29. <view class="tui-assets-text">总收入</view>
  30. </view>
  31. <view class="tui-order-item">
  32. <view class="tui-assets-num">
  33. <text>{{tuanzhang.income}}</text>
  34. </view>
  35. <view class="tui-assets-text">本月收入</view>
  36. </view>
  37. <view class="tui-order-item">
  38. <view class="tui-assets-num">
  39. <text>{{tuanzhang.income}}</text>
  40. </view>
  41. <view class="tui-assets-text">可提现</view>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="tui-box tui-order-box" style="margin-top: 20rpx;">
  46. <tui-list-cell :arrow="true" padding="0" unlined :lineLeft="false"
  47. @click="navigateTo('/pagesA/my/admintuanzhang/order')">
  48. <view class="tui-cell-header">
  49. <view class="tui-cell-title">{{lang.tuanzhang}}订单管理</view>
  50. <view class="tui-cell-sub">全部订单</view>
  51. </view>
  52. </tui-list-cell>
  53. <view class="tui-order-list">
  54. <view class="tui-order-item" @tap="navigateTo('/pagesA/my/admintuanzhang/order?currentTab=1')">
  55. <view class="tui-icon-box">
  56. <tui-icon name="clock" :size="30" color="#ff1e02"></tui-icon>
  57. </view>
  58. <view class="tui-order-text">{{lang.tuanzhang}}收货</view>
  59. </view>
  60. <view class="tui-order-item" @tap="navigateTo('/pagesA/my/admintuanzhang/order?currentTab=2')">
  61. <view class="tui-icon-box">
  62. <tui-icon name="signin" :size="30" color="#666666"></tui-icon>
  63. </view>
  64. <view class="tui-order-text">用户取货</view>
  65. </view>
  66. <view class="tui-order-item" @tap="navigateTo('/pagesA/my/admintuanzhang/order?currentTab=3')">
  67. <view class="tui-icon-box">
  68. <tui-icon name="feedback" :size="30" color="#666666"></tui-icon>
  69. </view>
  70. <view class="tui-order-text">已完成</view>
  71. </view>
  72. <view class="tui-order-item" @tap="navigateTo('/pagesA/my/admintuanzhang/order?currentTab=5')">
  73. <view class="tui-icon-box">
  74. <tui-icon name="square-fill" :size="30" color="#666666"></tui-icon>
  75. </view>
  76. <view class="tui-order-text">售后</view>
  77. </view>
  78. </view>
  79. </view>
  80. <view class="tui-box tui-tool-box">
  81. <tui-list-view>
  82. <tui-list-cell @tap="qrcode" :arrow="true">
  83. <view class="tui-item-box">
  84. <tui-icon name="qrcode" :size="24" color="#5677fc"></tui-icon>
  85. <view class="tui-list-cell_name">我的二维码</view>
  86. </view>
  87. </tui-list-cell>
  88. <tui-list-cell v-if="tuanzhang.is_submitaudit!=1"
  89. @tap="navigateTo('/pagesA/my/withdraw/withdraw?mo=tuanzhang')" :arrow="true">
  90. <view class="tui-item-box">
  91. <tui-icon name="wealth-fill" :size="24" color="#5677fc"></tui-icon>
  92. <text class="tui-list-cell_name">申请提现</text>
  93. </view>
  94. </tui-list-cell>
  95. <tui-list-cell @tap="navigateTo('/pagesA/my/withdraw/withdrawlog?mo=tuanzhang')" :arrow="true">
  96. <view class="tui-item-box">
  97. <tui-icon name="listview" :size="24" color="#5677fc"></tui-icon>
  98. <view class="tui-list-cell_name">提现记录</view>
  99. </view>
  100. </tui-list-cell>
  101. <tui-list-cell v-if="tuanzhang.is_submitaudit!=1"
  102. @tap="navigateTo('/pagesA/my/memberbankcard/memberbankcard')" :arrow="true">
  103. <view class="tui-item-box">
  104. <tui-icon name="bankcard-fill" :size="24" color="#5677fc"></tui-icon>
  105. <view class="tui-list-cell_name">提现帐号</view>
  106. </view>
  107. </tui-list-cell>
  108. <!-- #ifdef MP-WEIXIN -->
  109. <tui-list-cell @tap="scancode" :arrow="true">
  110. <view class="tui-item-box">
  111. <tui-icon name="sweep" :size="24" color="#5677fc"></tui-icon>
  112. <view class="tui-list-cell_name">扫码核销</view>
  113. </view>
  114. </tui-list-cell>
  115. <tui-list-cell @tap="navigateTo('/pagesA/my/userInfo/setmpopenid')" :arrow="true">
  116. <view class="tui-item-box">
  117. <tui-icon name="setup" :size="24" color="#5677fc"></tui-icon>
  118. <view class="tui-list-cell_name">绑定公众号通知</view>
  119. </view>
  120. </tui-list-cell>
  121. <!-- #endif -->
  122. <tui-list-cell @tap="navigateTo('/pagesA/my/admintuanzhang/update')" :arrow="true">
  123. <view class="tui-item-box">
  124. <tui-icon name="setup" :size="24" color="#5677fc"></tui-icon>
  125. <view class="tui-list-cell_name">修改资料</view>
  126. </view>
  127. </tui-list-cell>
  128. <tui-list-cell @tap="navigateTo('/pages/login/logout?ptype=tuanzhang')" :arrow="true">
  129. <view class="tui-item-box">
  130. <tui-icon name="setup" :size="24" color="#5677fc"></tui-icon>
  131. <view class="tui-list-cell_name">安全退出</view>
  132. </view>
  133. </tui-list-cell>
  134. </tui-list-view>
  135. </view>
  136. </view>
  137. </view>
  138. <!--=======二维码 start=======-->
  139. <tui-modal custom :show="modalShow" backgroundColor="transparent" padding="0" @cancel="hideModal">
  140. <view class="tui-poster__box" :style="{marginTop:height+'px'}">
  141. <image src="/static/images/mall/icon_popup_closed.png" class="tui-close__img" @tap.stop="hideModal">
  142. </image>
  143. <image :src="qrcodeImg" v-if="qrcodeImg" class="tui-poster__img"></image>
  144. <tui-button type="danger" width="460rpx" height="80rpx" shape="circle" @click="savePic">保存图片
  145. </tui-button>
  146. <view class="tui-share__tips">保存二维图片到手机相册后,分享到您的圈子</view>
  147. </view>
  148. </tui-modal>
  149. <!--=======二维码 end=======-->
  150. <tui-tabbar mo='tuanzhang' :current="current">
  151. </tui-tabbar>
  152. </view>
  153. </template>
  154. <script>
  155. export default {
  156. components: {},
  157. data() {
  158. return {
  159. isLogin: false,
  160. lang: {},
  161. is_login: 0,
  162. top: 0, //标题图标距离顶部距离
  163. opacity: 0,
  164. scrollTop: 0.5,
  165. current: '',
  166. agentconfig: [],
  167. recommendgoods: [],
  168. module: this.$module,
  169. tuanzhang: [],
  170. is_submitaudit: 1,
  171. modalShow: false,
  172. qrcodeImg: ''
  173. };
  174. },
  175. onLoad: function(options) {
  176. let _this = this;
  177. let obj = {};
  178. // #ifdef MP-WEIXIN
  179. obj = wx.getMenuButtonBoundingClientRect();
  180. // #endif
  181. // #ifdef MP-BAIDU
  182. obj = swan.getMenuButtonBoundingClientRect();
  183. // #endif
  184. // #ifdef MP-ALIPAY
  185. my.hideAddToDesktopMenu();
  186. // #endif
  187. uni.getSystemInfo({
  188. success: res => {
  189. this.width = obj.left || res.windowWidth;
  190. this.height = obj.top ? obj.top + obj.height + 8 : res.statusBarHeight + 44;
  191. this.top = obj.top ? obj.top + (obj.height - 32) / 2 : res.statusBarHeight + 6;
  192. this.scrollH = res.windowWidth * 0.6;
  193. }
  194. });
  195. _this.$request.get('Lang.getlang').then(res => {
  196. if (res.errno == 0) {
  197. _this.lang = res.data;
  198. uni.setNavigationBarTitle({
  199. title: _this.lang.communitytuanzhang + '工作台'
  200. });
  201. }
  202. });
  203. },
  204. onShow() {
  205. let _this = this;
  206. _this.$request.get('admintuanzhang.check', {
  207. samkey: (new Date()).valueOf()
  208. }).then(res => {
  209. if (res.errno == 0 && res.is_login == 1) {
  210. _this.is_login = res.is_login;
  211. _this.tuanzhang = res.data;
  212. } else {
  213. uni.showModal({
  214. title: '提示',
  215. content: res.message || '请先登录!',
  216. showCancel: false,
  217. //是否显示取消按钮
  218. success: function(res) {
  219. if (res.cancel) { //点击取消,默认隐藏弹框
  220. } else {
  221. uni.reLaunch({
  222. url: "/pages/login/userlogin?ptype=tuanzhang",
  223. })
  224. }
  225. }
  226. });
  227. }
  228. });
  229. },
  230. methods: {
  231. navigateTo(url) {
  232. uni.navigateTo({
  233. url: url
  234. });
  235. },
  236. goadminstore() {
  237. this.sam.navigateTo('/pagesA/my/adminstore/index')
  238. },
  239. initNavigation(e) {
  240. this.opacity = e.opacity;
  241. this.top = e.top;
  242. },
  243. opacityChange(e) {
  244. this.opacity = e.opacity;
  245. },
  246. scancode: function() {
  247. var _this = this;
  248. // 允许从相机和相册扫码
  249. uni.scanCode({
  250. success: function(res) {
  251. if (res.path) {
  252. uni.navigateTo({
  253. url: '/' + res.path
  254. });
  255. }
  256. //console.log('条码类型:' + res.scanType);
  257. //console.log('条码内容:' + res.path);
  258. }
  259. });
  260. },
  261. async qrcode() {
  262. const _this = this;
  263. if (this.qrcodeImg) {
  264. this.modalShow = true;
  265. return;
  266. }
  267. uni.showLoading({
  268. mask: true,
  269. title: '二维生成中...'
  270. });
  271. let qrdata = await _this.$request.post('qrcode.tuanzhang', {
  272. id: _this.tuanzhang.id,
  273. page: '',
  274. is_hyaline: true,
  275. expireHours: 1
  276. })
  277. //console.log(qrdata);
  278. if (qrdata.errno == 0) {
  279. uni.hideLoading();
  280. this.qrcodeImg = qrdata.data;
  281. setTimeout(() => {
  282. this.modalShow = true;
  283. }, 60);
  284. } else {
  285. uni.hideLoading();
  286. this.tui.toast('生成二维图片失败,请稍后再试');
  287. }
  288. },
  289. hideModal() {
  290. this.modalShow = false;
  291. },
  292. savePic() {
  293. if (this.qrcodeImg) {
  294. // #ifdef H5
  295. uni.previewImage({
  296. urls: [this.qrcodeImg]
  297. });
  298. // #endif
  299. // #ifndef H5
  300. this.sam.saveImage(this.qrcodeImg);
  301. //console.log(this.qrcodeImg);
  302. // #endif
  303. this.hideModal();
  304. }
  305. },
  306. },
  307. onPageScroll(e) {
  308. this.scrollTop = e.scrollTop;
  309. },
  310. onPullDownRefresh() {
  311. setTimeout(() => {
  312. uni.stopPullDownRefresh();
  313. }, 200);
  314. },
  315. onReachBottom: function() {
  316. }
  317. };
  318. </script>
  319. <style>
  320. .tuanzhangbox {
  321. padding-bottom: 80rpx;
  322. }
  323. .tui-set-box {
  324. display: flex;
  325. align-items: center;
  326. justify-content: space-between;
  327. }
  328. .tui-icon-box {
  329. position: relative;
  330. }
  331. .tui-icon-setup {
  332. margin-left: 8rpx;
  333. }
  334. .tui-badge {
  335. position: absolute;
  336. font-size: 24rpx;
  337. height: 32rpx;
  338. min-width: 20rpx;
  339. padding: 0 6rpx;
  340. border-radius: 40rpx;
  341. right: 10rpx;
  342. top: -5rpx;
  343. transform: scale(0.8) translateX(60%);
  344. transform-origin: center center;
  345. display: flex;
  346. align-items: center;
  347. justify-content: center;
  348. z-index: 10;
  349. }
  350. .tui-badge-red {
  351. background: #f74d54;
  352. color: #fff;
  353. }
  354. .tui-badge-white {
  355. background: #fff;
  356. color: #f74d54;
  357. }
  358. .tui-badge-dot {
  359. position: absolute;
  360. height: 12rpx;
  361. width: 12rpx;
  362. border-radius: 50%;
  363. right: -12rpx;
  364. top: 0;
  365. background: #f74d54;
  366. }
  367. .tui-mybg-box {
  368. width: 100%;
  369. height: 264rpx;
  370. position: relative;
  371. background-color: #ffb524;
  372. }
  373. .tui-my-bg {
  374. width: 100%;
  375. height: 464rpx;
  376. display: block;
  377. }
  378. .tui-header-center {
  379. position: absolute;
  380. width: 100%;
  381. height: 128rpx;
  382. left: 0;
  383. top: 18rpx;
  384. padding: 0 30rpx;
  385. box-sizing: border-box;
  386. display: flex;
  387. align-items: center;
  388. }
  389. .tui-avatar {
  390. flex-shrink: 0;
  391. width: 128rpx;
  392. height: 128rpx;
  393. border-radius: 50%;
  394. display: block;
  395. }
  396. .tui-info {
  397. width: 60%;
  398. padding-left: 30rpx;
  399. }
  400. .tui-nickname {
  401. font-size: 30rpx;
  402. font-weight: 500;
  403. color: #fff;
  404. display: flex;
  405. align-items: center;
  406. }
  407. .tui-img-vip {
  408. width: 56rpx;
  409. height: 24rpx;
  410. margin-left: 18rpx;
  411. }
  412. .tui-explain {
  413. width: 80%;
  414. font-size: 24rpx;
  415. font-weight: 400;
  416. color: #fff;
  417. opacity: 0.75;
  418. padding-top: 8rpx;
  419. white-space: nowrap;
  420. overflow: hidden;
  421. text-overflow: ellipsis;
  422. }
  423. .tui-btn-edit {
  424. flex-shrink: 0;
  425. padding-right: 22rpx;
  426. }
  427. .tui-header-btm {
  428. width: 100%;
  429. padding: 0 30rpx;
  430. box-sizing: border-box;
  431. position: absolute;
  432. left: 0;
  433. top: 280rpx;
  434. display: flex;
  435. align-items: center;
  436. justify-content: space-between;
  437. color: #fff;
  438. }
  439. .tui-btm-item {
  440. flex: 1;
  441. display: flex;
  442. flex-direction: column;
  443. align-items: center;
  444. justify-content: center;
  445. }
  446. .tui-btm-num {
  447. font-size: 32rpx;
  448. font-weight: 600;
  449. position: relative;
  450. }
  451. .tui-btm-text {
  452. font-size: 24rpx;
  453. opacity: 0.85;
  454. padding-top: 4rpx;
  455. }
  456. .tui-content-box {
  457. width: 100%;
  458. padding: 0 30rpx;
  459. box-sizing: border-box;
  460. position: relative;
  461. top: -100rpx;
  462. z-index: 10;
  463. }
  464. .tui-box {
  465. width: 100%;
  466. background: #fff;
  467. box-shadow: 0 3rpx 20rpx rgba(183, 183, 183, 0.1);
  468. border-radius: 30rpx;
  469. overflow: hidden;
  470. }
  471. .tui-order-box {
  472. height: 208rpx;
  473. }
  474. .tui-cell-header {
  475. width: 100%;
  476. height: 74rpx;
  477. padding: 0 26rpx;
  478. box-sizing: border-box;
  479. display: flex;
  480. align-items: center;
  481. justify-content: space-between;
  482. }
  483. .tui-cell-title {
  484. font-size: 30rpx;
  485. line-height: 30rpx;
  486. font-weight: 600;
  487. color: #333;
  488. }
  489. .tui-cell-sub {
  490. font-size: 26rpx;
  491. font-weight: 400;
  492. color: #999;
  493. padding-right: 28rpx;
  494. }
  495. .tui-order-list {
  496. width: 100%;
  497. height: 134rpx;
  498. padding: 0 30rpx;
  499. box-sizing: border-box;
  500. display: flex;
  501. align-items: center;
  502. justify-content: space-between;
  503. }
  504. .tui-order-item {
  505. flex: 1;
  506. display: flex;
  507. flex-direction: column;
  508. align-items: center;
  509. }
  510. .tui-order-text,
  511. .tui-tool-text {
  512. font-size: 26rpx;
  513. font-weight: 400;
  514. color: #666;
  515. padding-top: 4rpx;
  516. }
  517. .tui-tool-text {
  518. font-size: 24rpx;
  519. }
  520. .tui-order-icon {
  521. width: 56rpx;
  522. height: 56rpx;
  523. display: block;
  524. }
  525. .tui-assets-box {
  526. height: 118rpx;
  527. margin-top: 20rpx;
  528. padding-top: 30rpx;
  529. }
  530. .tui-assets-list {
  531. height: 84rpx;
  532. }
  533. .tui-assets-num {
  534. font-size: 38rpx;
  535. font-weight: 500;
  536. color: #333;
  537. font-weight: bold;
  538. position: relative;
  539. }
  540. .tui-assets-text {
  541. font-size: 24rpx;
  542. font-weight: 400;
  543. color: #666;
  544. padding-top: 6rpx;
  545. }
  546. .tui-tool-box {
  547. margin-top: 20rpx;
  548. }
  549. .tui-flex-wrap {
  550. flex-wrap: wrap;
  551. height: auto;
  552. padding-bottom: 30rpx;
  553. }
  554. .tui-tool-item {
  555. width: 25%;
  556. display: flex;
  557. align-items: center;
  558. justify-content: center;
  559. flex-direction: column;
  560. padding-top: 30rpx;
  561. }
  562. .tui-tool-icon {
  563. width: 64rpx;
  564. height: 64rpx;
  565. display: block;
  566. }
  567. .tui-badge-icon {
  568. width: 66rpx;
  569. height: 30rpx;
  570. position: absolute;
  571. right: 0;
  572. transform: translateX(88%);
  573. top: -15rpx;
  574. }
  575. /*为你推荐*/
  576. .tui-product-list {
  577. display: flex;
  578. justify-content: space-between;
  579. flex-direction: row;
  580. flex-wrap: wrap;
  581. box-sizing: border-box;
  582. }
  583. .tui-product-container {
  584. width: 100%;
  585. display: flex;
  586. flex-direction: row;
  587. flex-wrap: wrap;
  588. }
  589. .tui-pro-item {
  590. background: #fff;
  591. box-sizing: border-box;
  592. overflow: hidden;
  593. border-radius: 12rpx;
  594. width: 48%;
  595. margin-left: 1%;
  596. margin-right: 1%;
  597. margin-bottom: 2%;
  598. }
  599. .tui-pro-img {
  600. width: 100%;
  601. display: block;
  602. }
  603. .tui-pro-content {
  604. display: flex;
  605. flex-direction: column;
  606. justify-content: space-between;
  607. box-sizing: border-box;
  608. padding: 20rpx;
  609. }
  610. .tui-pro-tit {
  611. color: #2e2e2e;
  612. font-size: 26rpx;
  613. word-break: break-all;
  614. overflow: hidden;
  615. text-overflow: ellipsis;
  616. display: -webkit-box;
  617. -webkit-box-orient: vertical;
  618. -webkit-line-clamp: 2;
  619. }
  620. .tui-pro-price {
  621. padding-top: 18rpx;
  622. }
  623. .tui-sale-price {
  624. font-size: 34rpx;
  625. font-weight: 500;
  626. color: #e41f19;
  627. }
  628. .tui-factory-price {
  629. font-size: 24rpx;
  630. color: #a0a0a0;
  631. text-decoration: line-through;
  632. padding-left: 12rpx;
  633. }
  634. .tui-pro-pay {
  635. padding-top: 10rpx;
  636. font-size: 24rpx;
  637. color: #656565;
  638. }
  639. .tui-item-box {
  640. width: 100%;
  641. display: flex;
  642. align-items: center;
  643. }
  644. .tui-list-cell_name {
  645. padding-left: 20rpx;
  646. display: flex;
  647. align-items: center;
  648. justify-content: center;
  649. }
  650. /*二维码modal弹层*/
  651. .tui-poster__box {
  652. width: 100%;
  653. position: relative;
  654. display: flex;
  655. justify-content: center;
  656. align-items: center;
  657. flex-direction: column;
  658. }
  659. .tui-close__img {
  660. width: 48rpx;
  661. height: 48rpx;
  662. position: absolute;
  663. right: 0;
  664. top: -60rpx;
  665. }
  666. .tui-poster__img {
  667. width: 560rpx;
  668. height: 560rpx;
  669. border-radius: 20rpx;
  670. margin-bottom: 40rpx;
  671. }
  672. .tui-share__tips {
  673. font-size: 24rpx;
  674. transform: scale(0.8);
  675. transform-origin: center center;
  676. color: #ffffff;
  677. padding-top: 12rpx;
  678. }
  679. .tui-share-position {
  680. position: absolute;
  681. right: 0;
  682. top: 60rpx;
  683. }
  684. .tui-share-text {
  685. color: #333;
  686. padding-left: 8rpx;
  687. }
  688. </style>