index.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <template>
  2. <view class="business">
  3. <view class="business-header">
  4. <view class="headerbox" @click="changeTips" v-if="service">
  5. <image :src="service.merchant.mer_avatar" mode=""></image>
  6. <span class='font line1'>{{service.merchant.mer_name || '暂无店铺'}}</span>
  7. <text v-if="!downStatus" class="iconfont icon-xiala1 spin"></text>
  8. <text v-else class="iconfont icon-xiala1"></text>
  9. </view>
  10. </view>
  11. <view class="business-content">
  12. <view @click="goNext(item)" class="listBox" v-for="(item,index) in list">
  13. <text :class="item.icon" class="businessIcon"></text>
  14. <view>{{item.title}}</view>
  15. </view>
  16. </view>
  17. <shopList ref="shopList" @changeStoreClose="changeClose" @getService="getService" :is_sys='is_sys'></shopList>
  18. </view>
  19. </template>
  20. <script>
  21. // +----------------------------------------------------------------------
  22. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  23. // +----------------------------------------------------------------------
  24. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  25. // +----------------------------------------------------------------------
  26. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  27. // +----------------------------------------------------------------------
  28. // | Author: CRMEB Team <admin@crmeb.com>
  29. // +----------------------------------------------------------------------
  30. import shopList from '@/components/shopList';
  31. export default {
  32. name: 'business',
  33. components: {
  34. shopList
  35. },
  36. data() {
  37. return {
  38. is_sys: '',
  39. downStatus: false,
  40. service: null
  41. }
  42. },
  43. computed: {
  44. list(){
  45. if(!this.service) return [];
  46. const merId = this.service.mer_id;
  47. const list = [{
  48. type: 'customer',
  49. title: '客服记录',
  50. url: '/pages/chat/customer_list/index?type=1&mer_id=' + merId,
  51. icon: 'iconfont icon-kefujilu'
  52. }];
  53. if(this.service.is_verify){
  54. list.push({
  55. title: '订单核销',
  56. url: '/pages/admin/order_cancellation/index?mer_id=' + merId,
  57. icon: 'iconfont icon-dingdanhexiao'
  58. });
  59. }
  60. if(this.service.customer){
  61. list.push({
  62. title: '订单管理',
  63. url: '/pages/admin/order/index?mer_id=' + merId,
  64. icon: 'iconfont icon-dingdanguanli'
  65. });
  66. }
  67. if(this.service.is_goods){
  68. list.push({
  69. title: '商品管理',
  70. url: '/pages/product/list/index?mer_id=' + merId,
  71. icon: 'iconfont icon-shangjiaguanli'
  72. });
  73. }
  74. return list;
  75. }
  76. },
  77. onLoad: function(options) {
  78. this.is_sys = options.is_sys;
  79. this.getStoreList({is_sys:this.is_sys});
  80. uni.setNavigationBarTitle({
  81. title: this.is_sys ? '平台管理' : '商家管理'
  82. })
  83. },
  84. methods: {
  85. getStoreList: function(data) {
  86. this.$nextTick(() => {
  87. this.$refs.shopList.getStoreList(data)
  88. });
  89. },
  90. changeTips(data) {
  91. this.downStatus = !this.downStatus;
  92. this.$refs.shopList.isShowStore();
  93. },
  94. changeClose() {
  95. this.downStatus = false;
  96. },
  97. goNext(item){
  98. if(item.type == 'customer' && this.service.status == 0){
  99. return this.$util.Tips({
  100. title: '客服已离线,请开启客服状态!'
  101. });
  102. }else{
  103. uni.navigateTo({
  104. url: item.url,
  105. });
  106. }
  107. },
  108. getService: function(data) {
  109. this.service = data;
  110. if(data && data.merchant){
  111. uni.setNavigationBarTitle({
  112. title: data.merchant.mer_name
  113. })
  114. }else{
  115. uni.setNavigationBarTitle({
  116. title: (!data.mer_id) ? '平台管理' : '商家管理'
  117. })
  118. }
  119. }
  120. }
  121. }
  122. </script>
  123. <style scoped lang="scss">
  124. .businessIcon {
  125. color: #2291F8;
  126. font-size: 80rpx;
  127. display: inline-block;
  128. margin-bottom: 29rpx;
  129. }
  130. .business-header {
  131. height: 305rpx;
  132. background: linear-gradient(180deg, #2291F8 0%, rgba(34,145,248,0) 100%);
  133. position: fixed;
  134. width: 100%;
  135. text-align: center;
  136. top: 0;
  137. left: 0;
  138. .headerbox {
  139. max-width: 360rpx;
  140. margin: 0 auto;
  141. position: relative;
  142. padding: 10rpx 0rpx 10rpx 0rpx;
  143. background-color: rgba(0, 0, 0, .25);
  144. border-radius: 30rpx;
  145. color: #FFFFFF;
  146. margin-top: 33rpx;
  147. .font {
  148. max-width: 260rpx;
  149. display: inline-block;
  150. margin-left: 10rpx;
  151. line-height: 28rpx;
  152. }
  153. image {
  154. width: 34rpx;
  155. height: 34rpx;
  156. position: relative;
  157. top: 4rpx;
  158. }
  159. .spin {
  160. display: inline-block;
  161. transform: rotate(180deg);
  162. font-size: 36rpx;
  163. }
  164. }
  165. }
  166. .business-content {
  167. width: 100%;
  168. padding: 0 18rpx;
  169. margin-top: 151rpx;
  170. display: flex;
  171. justify-content: space-around;
  172. flex-wrap: wrap;
  173. .listBox {
  174. width: 345rpx;
  175. height: 270rpx;
  176. background: #FFFFFF;
  177. box-shadow: 0rpx 5rpx 15rpx rgba(142, 82, 77, 0.1);
  178. border-radius: 20rpx;
  179. z-index: 1;
  180. margin-bottom: 20rpx;
  181. display: flex;
  182. flex-direction: column;
  183. justify-content: center;
  184. align-items: center;
  185. image {
  186. width: 66rpx;
  187. height: 66rpx;
  188. background: #F34C20;
  189. }
  190. }
  191. }
  192. /deep/ radio .wx-radio-input.wx-radio-input-checked,
  193. /deep/radio .uni-radio-input.uni-radio-input-checked {
  194. border: 1px solid #2291F8 !important;
  195. background-color: #2291F8 !important
  196. }
  197. </style>