Index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541
  1. <template><page-meta :root-font-size="fontSize+'px'"></page-meta>
  2. <seller-base :show="true">
  3. <title-header />
  4. <view class="div container">
  5. <view class="div top-wrapper">
  6. <view class="div nav-item left-nav-item" @click="goSettingIndex">
  7. <image mode="aspectFit" src="../../../static/image/seller/icon_setting_nor.png" class="img nav-icon">
  8. </view>
  9. <view class="div nav-item right-nav-item" @click="goNews()">
  10. <image mode="aspectFit" src="../../../static/image/seller/icon_news_nor.png" class="img nav-icon">
  11. <text class="span" v-if="0"></text>
  12. </view>
  13. <view class="div top-info-wrapper">
  14. <view class="div avatar-wrapper" @click="goSettingIndex">
  15. <image mode="aspectFit" class="img avatar" v-bind:src="store_info.store_avatar" v-if="isOnline && store_info"/>
  16. </view>
  17. <label class="sellername" @click="goSettingIndex">{{sellername}}</label>
  18. </view>
  19. </view>
  20. <flex-line class="div order-header" :is-link="true" @click.native="goSellerorder('')">
  21. <text class="span">订单管理</text>
  22. <text class="span" slot="right">查看全部订单</text>
  23. </flex-line>
  24. <view class="div order-wrapper">
  25. <index-order-item
  26. class="order-item"
  27. v-on:onclick="goSellerorder('state_new')"
  28. :src="require('../../../static/image/seller/icon_pay_seller_nor.png')"
  29. title="待付款"
  30. :orderNumber = 'seller_info.order_nopay_count'>
  31. </index-order-item>
  32. <index-order-item
  33. class="order-item"
  34. v-on:onclick="goSellerorder('state_pay')"
  35. :src="require('../../../static/image/seller/icon_good_seller_nor.png')"
  36. title="待发货"
  37. :orderNumber = 'seller_info.order_noship_count'>
  38. </index-order-item>
  39. <index-order-item
  40. class="order-item"
  41. v-on:onclick="goSellerorder('state_send')"
  42. :src="require('../../../static/image/seller/icon_consignee_seller_nor.png')"
  43. title="待收货"
  44. :orderNumber = 'seller_info.order_noreceipt_count'>
  45. </index-order-item>
  46. </view>
  47. <view class="div manage-wrapper mt-5">
  48. <index-manage-item
  49. v-on:onclick="goGoodsonline"
  50. :src="require('../../../static/image/seller/icon_goods_seller_nor.png')"
  51. title="商品管理">
  52. </index-manage-item>
  53. <index-manage-item
  54. v-on:onclick="goGoodsclass"
  55. :src="require('../../../static/image/seller/icon_classify_seller_pre.png')"
  56. title="店铺分类">
  57. </index-manage-item>
  58. <index-manage-item
  59. v-on:onclick="goGoodsspec"
  60. :src="require('../../../static/image/seller/icon_specifications_seller_pre.png')"
  61. title="商品规格">
  62. </index-manage-item>
  63. <index-manage-item
  64. v-if="seller && !seller.is_platform_store"
  65. v-on:onclick="goMoney"
  66. :src="require('../../../static/image/seller/icon_capital_seller_pre.png')"
  67. title="店铺资金">
  68. </index-manage-item>
  69. <index-manage-item
  70. v-if="seller && !seller.is_platform_store"
  71. v-on:onclick="goDeposit"
  72. :src="require('../../../static/image/seller/icon_deposit_seller_pre.png')"
  73. title="店铺保证金">
  74. </index-manage-item>
  75. <index-manage-item
  76. v-on:onclick="goVrorder"
  77. :src="require('../../../static/image/seller/icon_order_seller_pre.png')"
  78. title="虚拟订单">
  79. </index-manage-item>
  80. <index-manage-item
  81. v-on:onclick="goSellerbill"
  82. :src="require('../../../static/image/seller/icon_settle_seller_pre.png')"
  83. title="结算管理">
  84. </index-manage-item>
  85. <index-manage-item
  86. v-on:onclick="goSellerRefundList(1)"
  87. :src="require('../../../static/image/seller/icon_refunds_seller_pre.png')"
  88. title="退款管理">
  89. </index-manage-item>
  90. <index-manage-item
  91. v-on:onclick="goSellerRefundList(2)"
  92. :src="require('../../../static/image/seller/icon_refund_seller_pre.png')"
  93. title="退货管理">
  94. </index-manage-item>
  95. <index-manage-item
  96. v-on:onclick="goSellerChatList"
  97. :src="require('../../../static/image/seller/icon_chat_seller_pre.png')"
  98. title="聊天列表">
  99. </index-manage-item>
  100. <index-manage-item
  101. v-on:onclick="goSellerChainList"
  102. :src="require('../../../static/image/seller/icon_shop_seller_nor.png')"
  103. title="门店管理">
  104. </index-manage-item>
  105. <index-manage-item
  106. v-on:onclick="goSellerEvaluateList"
  107. :src="require('../../../static/image/seller/icon_judge_seller_nor.png')"
  108. title="评价管理">
  109. </index-manage-item>
  110. <index-manage-item
  111. v-on:onclick="goSellerLiveApplyList"
  112. :src="require('../../../static/image/seller/icon_live_seller_nor.png')"
  113. title="直播管理">
  114. </index-manage-item>
  115. <index-manage-item
  116. v-on:onclick="goSellerComplainList"
  117. :src="require('../../../static/image/seller/icon_letterseller__nor.png')"
  118. title="投诉管理">
  119. </index-manage-item>
  120. <index-manage-item
  121. v-on:onclick="goConsult"
  122. :src="require('../../../static/image/seller/icon_consult_seller_nor.png')"
  123. title="咨询管理">
  124. </index-manage-item>
  125. <index-manage-item
  126. v-on:onclick="goAccount"
  127. :src="require('../../../static/image/seller/icon_person_seller_nor.png')"
  128. title="子账户管理">
  129. </index-manage-item>
  130. <index-manage-item
  131. v-on:onclick="goSellerInviter"
  132. :src="require('../../../static/image/seller/icon_retail_nor.png')"
  133. title="店铺分销">
  134. </index-manage-item>
  135. <index-manage-item
  136. v-on:onclick="goSellerStatisticsGeneral"
  137. :src="require('../../../static/image/seller/icon_count_seller_nor.png')"
  138. title="店铺概况统计">
  139. </index-manage-item>
  140. <index-manage-item
  141. v-on:onclick="goSellerVoucherList"
  142. :src="require('../../../static/image/seller/icon_vouchers_nor.png')"
  143. title="代金券管理">
  144. </index-manage-item>
  145. <index-manage-item
  146. v-on:onclick="goSellerCostList"
  147. :src="require('../../../static/image/seller/icon_dianpuxiaofei_pre.png')"
  148. title="店铺消费">
  149. </index-manage-item>
  150. </view>
  151. </view>
  152. </seller-base>
  153. </template>
  154. <script>
  155. import {getFontSize} from '@/util/common'
  156. import TitleHeader from '../../TitleHeader'
  157. import { urlencode } from '@/util/common'
  158. import SellerBase from '../SellerBase'
  159. import IndexOrderItem from './IndexOrderItem'
  160. import IndexManageItem from './IndexManageItem'
  161. import flexLine from '../../flexLine'
  162. import { getSellerInfo } from '../../../api/seller'
  163. import { mapState, mapMutations, mapActions } from 'vuex'
  164. export default {
  165. name: 'Index',
  166. data () {
  167. return {
  168. store_info: {},
  169. seller_info: {},
  170. statics: {}
  171. }
  172. },
  173. components:{
  174. TitleHeader,
  175. flexLine,
  176. SellerBase,
  177. IndexManageItem,
  178. IndexOrderItem
  179. },
  180. created: function () {
  181. this.fetchConfig({})
  182. if (this.isOnline) {
  183. getSellerInfo().then(response => {
  184. if (response && response.result) {
  185. this.seller_info = response.result.seller_info
  186. this.store_info = response.result.store_info
  187. this.statics = response.result.statics
  188. }
  189. }
  190. ).catch(function (error) {
  191. uni.showToast({icon:'none',title: error.message})
  192. })
  193. }
  194. },
  195. computed:{
  196. fontSize(){
  197. return getFontSize()
  198. },
  199. ...mapState({
  200. isOnline: state => state.seller.isOnline,
  201. seller: state => state.seller.info,
  202. config: state => state.config.config
  203. }),
  204. sellername () {
  205. let title = '登录/注册'
  206. if (this.isOnline) {
  207. if (this.seller && typeof this.seller !== 'undefined' && JSON.stringify(this.seller) !== '{}') {
  208. title = this.seller.seller_name
  209. }
  210. }
  211. return title
  212. }
  213. },
  214. methods:{
  215. goNavigate(path,query=false){
  216. uni.navigateTo({url:path+(query?('?'+urlencode(query)):'')})
  217. },
  218. ...mapMutations({
  219. memberUpdate: 'memberUpdate'
  220. }),
  221. ...mapActions({
  222. fetchConfig: 'fetchConfig'
  223. }),
  224. showLogin () {
  225. uni.navigateTo({url:'/pages/home/sellerlogin/Login'})
  226. },
  227. // 店铺资金 普通店铺显示
  228. goMoney () {
  229. if (this.isOnline) {
  230. uni.navigateTo({url:'/pages/seller/money/Index'})
  231. } else {
  232. this.showLogin()
  233. }
  234. },
  235. // 店铺保证金 普通店铺显示
  236. goDeposit () {
  237. if (this.isOnline) {
  238. uni.navigateTo({url:'/pages/seller/deposit/Index'})
  239. } else {
  240. this.showLogin()
  241. }
  242. },
  243. // 店铺设置
  244. goSettingIndex () {
  245. if (this.isOnline) {
  246. uni.navigateTo({url:'/pages/seller/setting/Index'})
  247. } else {
  248. this.showLogin()
  249. }
  250. },
  251. // 投诉
  252. goSellerComplainList(){
  253. if (this.isOnline) {
  254. uni.navigateTo({url:'/pages/seller/complaint/ComplaintList'})
  255. } else {
  256. this.showLogin()
  257. }
  258. },
  259. // 直播
  260. goSellerLiveApplyList () {
  261. if (this.isOnline) {
  262. if (this.config.live_type == 1) {
  263. uni.navigateTo({url:'/pages/seller/minipro_live/MiniproLiveList'})
  264. } else {
  265. uni.navigateTo({url:'/pages/seller/live_apply/LiveApplyList'})
  266. }
  267. } else {
  268. this.showLogin()
  269. }
  270. },
  271. goNews () {
  272. if (this.isOnline) {
  273. uni.navigateTo({url:'/pages/seller/notice/NoticeList'})
  274. } else {
  275. this.showLogin()
  276. }
  277. },
  278. goSellerChainList () {
  279. if (this.isOnline) {
  280. uni.navigateTo({url:'/pages/seller/chain/ChainList'})
  281. } else {
  282. this.showLogin()
  283. }
  284. },
  285. // 子账户管理
  286. goAccount () {
  287. if (this.isOnline) {
  288. uni.navigateTo({url:'/pages/seller/account/Index'})
  289. } else {
  290. this.showLogin()
  291. }
  292. },
  293. // 商品管理
  294. goGoodsonline () {
  295. if (this.isOnline) {
  296. uni.navigateTo({url:'/pages/seller/goods/Goodsonline'})
  297. } else {
  298. this.showLogin()
  299. }
  300. },
  301. // 商家聊天列表
  302. goSellerChatList () {
  303. if (this.isOnline) {
  304. uni.navigateTo({url:'/pages/seller/chat/ChatList'})
  305. } else {
  306. this.showLogin()
  307. }
  308. },
  309. // 订单列表
  310. goSellerorder (state) {
  311. if (this.isOnline) {
  312. uni.navigateTo({url:'/pages/seller/order/OrderList'+'?'+urlencode({ state: state })})
  313. } else {
  314. this.showLogin()
  315. }
  316. },
  317. // 退款管理
  318. goSellerRefundList (refundType) {
  319. if (this.isOnline) {
  320. uni.navigateTo({url:'/pages/seller/refund/RefundList'+'?'+urlencode({ refund_type: refundType })})
  321. } else {
  322. this.showLogin()
  323. }
  324. },
  325. // 评价管理
  326. goSellerEvaluateList () {
  327. if (this.isOnline) {
  328. uni.navigateTo({url:'/pages/seller/evaluate/EvaluateList'})
  329. } else {
  330. this.showLogin()
  331. }
  332. },
  333. // 订单结算
  334. goSellerbill () {
  335. if (this.isOnline) {
  336. uni.navigateTo({url:'/pages/seller/bill/BillList'})
  337. } else {
  338. this.showLogin()
  339. }
  340. },
  341. // 店铺统计
  342. goSellerStatisticsGeneral () {
  343. if (this.isOnline) {
  344. uni.navigateTo({url:'/pages/seller/statisticsgeneral/Index'})
  345. } else {
  346. this.showLogin()
  347. }
  348. },
  349. // 咨询管理
  350. goConsult () {
  351. if (this.isOnline) {
  352. uni.navigateTo({url:'/pages/seller/consult/ConsultList'})
  353. } else {
  354. this.showLogin()
  355. }
  356. },
  357. // 商品规格
  358. goGoodsspec () {
  359. if (this.isOnline) {
  360. uni.navigateTo({url:'/pages/seller/spec/Index'})
  361. } else {
  362. this.showLogin()
  363. }
  364. },
  365. // 店铺分类
  366. goGoodsclass () {
  367. if (this.isOnline) {
  368. uni.navigateTo({url:'/pages/seller/goodsclass/GoodsClassList'})
  369. } else {
  370. this.showLogin()
  371. }
  372. },
  373. // 虚拟订单
  374. goVrorder () {
  375. if (this.isOnline) {
  376. uni.navigateTo({url:'/pages/seller/vrorder/OrderList'})
  377. } else {
  378. this.showLogin()
  379. }
  380. },
  381. // 店铺分销
  382. goSellerInviter () {
  383. if (this.isOnline) {
  384. uni.navigateTo({url:'/pages/seller/inviter/Index'})
  385. } else {
  386. this.showLogin()
  387. }
  388. },
  389. // 代金券管理
  390. goSellerVoucherList () {
  391. if (this.isOnline) {
  392. uni.navigateTo({url:'/pages/seller/voucher/VoucherList'})
  393. } else {
  394. this.showLogin()
  395. }
  396. },
  397. // 店铺消费
  398. goSellerCostList () {
  399. if (this.isOnline) {
  400. uni.navigateTo({url:'/pages/seller/cost/CostList'})
  401. } else {
  402. this.showLogin()
  403. }
  404. }
  405. }
  406. }
  407. </script>
  408. <style scoped lang='scss'>
  409. .container {
  410. display: flex;
  411. flex-direction: column;
  412. justify-content: flex-start;
  413. align-items: stretch;
  414. background-color: #f0f2f5;
  415. .top-wrapper {
  416. position:relative;
  417. display: flex;
  418. flex-direction: column;
  419. justify-content: flex-start;
  420. align-items: stretch;
  421. height:8rem;
  422. background: linear-gradient(90deg,#f01414,#f01414);
  423. .top-info-wrapper {
  424. flex: 1;
  425. width: 100%;
  426. display: flex;
  427. flex-direction: column;
  428. justify-content: flex-start;
  429. align-items: center;
  430. }
  431. }
  432. .nav-item {
  433. position: absolute;
  434. display: flex;
  435. justify-content: center;
  436. align-items: center;
  437. top:0.5rem;
  438. .span {
  439. width:0.4rem;
  440. height:0.4rem;
  441. background-color: #f0f2f5;
  442. border-radius: 50%;
  443. position: absolute;
  444. top:0.5rem;
  445. right: 0.5rem;
  446. }
  447. }
  448. .left-nav-item {
  449. left: 0.5rem;
  450. }
  451. .right-nav-item {
  452. right: 0.5rem;
  453. }
  454. .nav-icon {
  455. width: 1.3rem;
  456. height: 1.3rem;
  457. text-align: center;
  458. color: #fff;
  459. }
  460. .avatar-wrapper {
  461. display: flex;
  462. flex-direction: row;
  463. justify-content: center;
  464. align-items: center;
  465. width:4rem;
  466. height:4rem;
  467. border-radius:50%;
  468. background-color: #fff;
  469. margin-top:1rem;
  470. .avatar {
  471. width:3.6rem;
  472. height:3.6rem;
  473. border-radius:50%;
  474. }
  475. }
  476. .sellername {
  477. width: 100%;
  478. margin-top:.5rem;
  479. font-size:$h2;
  480. color:rgba(255,255,255,1);
  481. text-align: center;
  482. margin-left: 0;
  483. margin-right: 0;
  484. }
  485. .info-wrapper {
  486. width: 100%;
  487. height: 2rem;
  488. display: inline-flex;
  489. flex-direction: row;
  490. justify-content: flex-start;
  491. align-content: stretch;
  492. background-color: rgba(0, 0, 0, 0.1);
  493. }
  494. .info-item {
  495. flex: 1;
  496. display: flex;
  497. flex-direction: row;
  498. justify-content: center;
  499. align-items: center;
  500. color: #fff;
  501. font-size:$h2;
  502. }
  503. .order-header {
  504. background-color: #fff;
  505. padding:0 $pageSpace;
  506. }
  507. .order-wrapper {
  508. height:4rem;
  509. display: flex;
  510. flex-direction: row;
  511. justify-content: space-between;
  512. align-items: stretch;
  513. background-color: #fff;
  514. }
  515. .order-item {
  516. flex: 1;
  517. }
  518. .bottom-wrapper {
  519. display: flex;
  520. flex-direction: column;
  521. justify-content: flex-start;
  522. align-items: stretch;
  523. margin-bottom:2rem;
  524. padding: 0 $pageSpace;
  525. background-color: #fff;
  526. }
  527. .item-icon{
  528. width:1.2rem;
  529. height:1.2rem;
  530. margin-right: .4rem;
  531. }
  532. .manage-wrapper{background:#fff;}
  533. }
  534. </style>