home.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. <template>
  2. <view class="user-area" v-if="fetch && fetch.info">
  3. <use-tabbar :tarbar="false"></use-tabbar>
  4. <view class="header-area padding-lr-sm" style="padding-top: 12px;">
  5. <view class="dflex-b">
  6. <view class="member-area padding-top-sm margin-bottom dflex pos-r flex1"
  7. @click="Dever.location('sales/setting')">
  8. <view>
  9. <image class="headimg border-radius-c" :src="fetch.user.avatar" mode="aspectFill"></image>
  10. </view>
  11. <view class="margin-left-sm">
  12. <view class="info-box">
  13. <text class="fs-lg line-height-1">{{fetch.info.name}}</text>
  14. </view>
  15. <view>
  16. <text class="fs-xxs">{{info}}</text>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="border-radius">
  22. <u-grid :border="false" class="stats-area dflex-c bg-main">
  23. <u-grid-item>
  24. <view class="item dflex dflex-flow-c" @click="go('sales/user')">
  25. <text class="num">{{fetch.member}}</text>
  26. <text>用户</text>
  27. </view>
  28. <view class="vertical-line"></view>
  29. </u-grid-item>
  30. <u-grid-item v-for="(item, index) in fetch.role" :key="index">
  31. <view class="item dflex dflex-flow-c" @click="go('sales/role?role_id=' + item.id)">
  32. <text class="num">{{item.num}}</text>
  33. <text>{{item.name}}</text>
  34. </view>
  35. <view class="vertical-line"></view>
  36. </u-grid-item>
  37. <u-grid-item>
  38. <view class="item dflex dflex-flow-c" @click="go('sales/order/list')">
  39. <text class="num">{{fetch.order}}</text>
  40. <text>订单</text>
  41. </view>
  42. <view class="vertical-line"></view>
  43. </u-grid-item>
  44. <u-grid-item>
  45. <view class="item dflex dflex-flow-c" @click="go('sales/order/list')">
  46. <text class="num">{{fetch.cash}}</text>
  47. <text>流水</text>
  48. </view>
  49. <view class="vertical-line"></view>
  50. </u-grid-item>
  51. <u-grid-item>
  52. <view class="item dflex dflex-flow-c" @click="go('sales/profit')">
  53. <text class="num">{{fetch.profit}}</text>
  54. <text>收益</text>
  55. </view>
  56. <view class="vertical-line"></view>
  57. </u-grid-item>
  58. </u-grid>
  59. </view>
  60. </view>
  61. <view class="container-area padding-lr-sm padding-bottom-sm">
  62. <view class="border-radius margin-top-sm bg-main">
  63. <view class="use-list-title dflex-b padding-lr w-full bg-main" @click="go('sales/order/list')">
  64. <view class="dflex">
  65. <view class="iconfont __left margin-right-sm icondingdan" style="color: rgb(255, 106, 108);">
  66. </view>
  67. <text class="flex1 ws-np" style="font-size: 13px; font-weight: 600;">订单管理</text>
  68. </view>
  69. <view class="dflex margin-left-xl">
  70. <u-tag @click="go('sales/order/list')" class="tip line-height-1 margin-right-xs" text="有2单退款申请"
  71. plain plainFill shape="circle" size="mini" type="error" v-if="fetch.order_5 > 0"
  72. style="margin-left:10rpx;"></u-tag>
  73. <text v-else class="tip line-height-1 margin-right-xs">查看全部订单</text>
  74. <view class="iconfont fs-sm iconjiantou-01" style="color: rgb(192, 192, 192);"></view>
  75. </view>
  76. </view>
  77. <view class="order-area padding-bottom-sm padding-lr dflex-c">
  78. <view class="item dflex dflex-flow-c" @click="go('sales/order/list?status=1')">
  79. <view class="iconfont"><view class="badge badge-small" v-if="fetch.order_1 > 0">
  80. {{fetch.order_1}}
  81. </view>
  82. </view>
  83. <text>待付款</text>
  84. </view>
  85. <view class="item dflex dflex-flow-c" @click="go('sales/order/list?status=2')">
  86. <view class="iconfont"><view class="badge badge-small" v-if="fetch.order_2 > 0">
  87. {{fetch.order_2}}
  88. </view>
  89. </view>
  90. <text>待发货</text>
  91. </view>
  92. <view class="item dflex dflex-flow-c" @click="go('sales/order/list?status=3')">
  93. <view class="iconfont"><view class="badge badge-small" v-if="fetch.order_3 > 0">
  94. {{fetch.order_3}}
  95. </view>
  96. </view>
  97. <text>待收货</text>
  98. </view>
  99. <view class="item dflex dflex-flow-c" @click="go('sales/order/list?status=5')">
  100. <view class="iconfont"><view class="badge badge-small" v-if="fetch.order_4 > 0">
  101. {{fetch.order_4}}
  102. </view>
  103. </view>
  104. <text>已完成</text>
  105. </view>
  106. </view>
  107. </view>
  108. <view class="border-radius margin-top-sm bg-main">
  109. <view class="use-list-title dflex-b padding-lr w-full bg-main">
  110. <view class="dflex">
  111. <view class="iconfont __left margin-right-sm iconhaibao1" style="color: rgb(85, 170, 255);">
  112. </view>
  113. <text class="flex1 ws-np" style="font-size: 13px; font-weight: 600;">功能列表</text>
  114. </view>
  115. <view class="dflex margin-left-xl">
  116. <text class="tip line-height-1 margin-right-xs">
  117. 店铺管理,便携操作
  118. </text>
  119. </view>
  120. </view>
  121. <view class="header-area padding-lr-sm">
  122. <view class="border-radius">
  123. <u-grid :border="false" class="stats-area dflex-c bg-main" v-if="fetch.user">
  124. <u-grid-item @click="openPoster">
  125. <view class="item dflex dflex-flow-c">
  126. <text class="num">邀请</text>
  127. <text>店铺拉新</text>
  128. </view>
  129. <view class="vertical-line"></view>
  130. </u-grid-item>
  131. <u-grid-item @click="showBenefit" v-if="fetch.benefit">
  132. <view class="item dflex dflex-flow-c">
  133. <text class="num">权益</text>
  134. <text>店铺权益</text>
  135. </view>
  136. <view class="vertical-line"></view>
  137. </u-grid-item>
  138. <u-grid-item @click="go('sales/setting')">
  139. <view class="item dflex dflex-flow-c">
  140. <text class="num">设置</text>
  141. <text>店铺设置</text>
  142. </view>
  143. <view class="vertical-line"></view>
  144. </u-grid-item>
  145. </u-grid>
  146. </view>
  147. </view>
  148. </view>
  149. <view class="border-radius margin-top-sm padding-sm dflex-c bg-main log-out-btn" @click="Dever.goUser()">
  150. <view class="cell-tit">返回个人中心</view>
  151. </view>
  152. </view>
  153. <use-copyright :title="title" :desc="info"></use-copyright>
  154. <u-modal :show="benefit.show" :title="benefit.title" :closeOnClickOverlay="true" @close="closeBenefit"
  155. @confirm="closeBenefit">
  156. <view class="slot-content">
  157. <rich-text :nodes="fetch.benefit"></rich-text>
  158. </view>
  159. </u-modal>
  160. <use-poster ref="poster" @setShare="setShare"></use-poster>
  161. </view>
  162. </template>
  163. <script>
  164. export default {
  165. data() {
  166. return {
  167. type: 0,
  168. id: 0,
  169. fetch: {},
  170. logo: '',
  171. title: '',
  172. info: '',
  173. poster: {
  174. show: false,
  175. title: '长按保存分享好友',
  176. width: 255,
  177. value: {}
  178. },
  179. benefit: {
  180. show: false,
  181. title: '店铺权益说明',
  182. }
  183. }
  184. },
  185. onLoad(options) {
  186. this.type = options.type;
  187. this.id = options.id;
  188. if (!this.type || !this.id) {
  189. return Dever.goUser()
  190. }
  191. //#ifdef MP-WEIXIN
  192. wx.hideShareMenu({
  193. menus: ['shareAppMessage', 'shareTimeline']
  194. })
  195. //#endif
  196. },
  197. onShow() {
  198. this.load();
  199. this.loadData();
  200. },
  201. // 小程序分享
  202. onShareAppMessage(res) {
  203. if (res.from === 'button' && this.share && this.share.name && this.share.path) {
  204. return {
  205. title: this.share.name,
  206. path: this.share.path,
  207. imageUrl: this.share.pic || '',
  208. }
  209. }
  210. return null
  211. },
  212. methods: {
  213. setShare(value) {
  214. this.share = value;
  215. },
  216. load() {
  217. this.Dever.config().then(config => {
  218. this.logo = config.l;
  219. this.title = config.n;
  220. this.info = config.i;
  221. });
  222. },
  223. loadData() {
  224. this.DeverApi.get(this, 'sales.info', {
  225. sales_type: this.type,
  226. sales_id: this.id
  227. });
  228. },
  229. go(url) {
  230. var param = 'type=' + this.type + '&id=' + this.id;
  231. if (url.indexOf('?') == -1) {
  232. url = url + '?' + param
  233. } else {
  234. url = url + '&' + param
  235. }
  236. this.Dever.location(url)
  237. },
  238. showBenefit() {
  239. if (this.fetch.benefit) {
  240. this.benefit.show = true;
  241. }
  242. },
  243. closeBenefit() {
  244. this.benefit.show = false;
  245. },
  246. openPoster() {
  247. this.$refs.poster.open(this.fetch.info.name, this.title, this.fetch.desc, this.logo, this.fetch.user.avatar, '', {
  248. sales_type: this.type,
  249. sales_id: this.id
  250. })
  251. }
  252. }
  253. }
  254. </script>
  255. <style lang="scss">
  256. .member-area {
  257. image {
  258. width: 124rpx;
  259. height: 124rpx;
  260. border: 4rpx solid #fff;
  261. }
  262. }
  263. .vip-card-area {
  264. padding-top: 10rpx;
  265. padding-bottom: 10rpx;
  266. font-size: 22rpx;
  267. color: #c6b181;
  268. background-color: #000;
  269. background-image: linear-gradient(90deg, #3a3a3a, #000);
  270. .iconfont {
  271. font-size: 62rpx;
  272. }
  273. }
  274. .border-radius {
  275. border-radius: 18rpx;
  276. }
  277. .item {
  278. padding: 28rpx 0;
  279. position: relative;
  280. font-size: 22rpx;
  281. color: #75787d;
  282. flex: 1;
  283. }
  284. .num {
  285. font-size: 30rpx;
  286. color: #303133;
  287. margin-bottom: 4rpx;
  288. }
  289. .order-area {
  290. .item {
  291. position: relative;
  292. font-size: 22rpx;
  293. color: #75787d;
  294. flex: 1;
  295. }
  296. .num {
  297. font-size: 30rpx;
  298. color: #303133;
  299. margin-bottom: 4rpx;
  300. }
  301. }
  302. .browsing-area {
  303. image {
  304. width: 152rpx;
  305. height: 152rpx;
  306. }
  307. }
  308. .log-out-btn {
  309. color: #75787d;
  310. }
  311. .badge {
  312. margin-right: 20rpx;
  313. }
  314. </style>