金诚优选前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

306 lines
7.7 KiB

  1. <template>
  2. <view>
  3. <lf-nav title="我的" :showIcon="true" :spreadOut="false" bgColor="transparent" titleColor="#fff"></lf-nav>
  4. <block v-if="$isRight(detail)">
  5. <view class="head">
  6. <view class="bg-left"></view>
  7. <view class="bg-right"></view>
  8. <view class="head-content">
  9. <view class="lf-flex">
  10. <image class="head-img" mode="aspectFill" :src="detail.brand.logo"></image>
  11. <view class="head-title lf-line-3">{{ detail.brand.name }}</view>
  12. </view>
  13. <view class="lf-flex">
  14. <view class="head-menu" @click="$url('/pages/business/balance/balance')">
  15. <text class="lf-iconfont icon-yue"></text>
  16. <text>余额</text>
  17. </view>
  18. <view class="head-menu" @click="onScanCode">
  19. <text class="lf-iconfont icon-saoyisao"></text>
  20. <text>扫一扫</text>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="notice" v-if="detail.notice.length">
  26. <u-notice-bar mode="vertical" type="none" :list="detail.notice"></u-notice-bar>
  27. </view>
  28. <view class="card">
  29. <view class="lf-row-between">
  30. <view class="title">待处理</view>
  31. <view class="lf-color-777" @click="$url('/pages/business/order/list')">
  32. <text class="lf-font-24 lf-m-r-10">订单管理</text>
  33. <text class="lf-iconfont icon-xiangyou lf-font-20"></text>
  34. </view>
  35. </view>
  36. <view class="lf-flex lf-m-t-50">
  37. <view class="item" :style="{width: 100 / 3 +'%'}">
  38. <view class="num">{{ detail.todo.new }}</view>
  39. <view>待付款</view>
  40. </view>
  41. <view class="item" :style="{width: 100 / 3 +'%'}">
  42. <view class="num">{{ detail.todo.send }}</view>
  43. <view>待发货</view>
  44. </view>
  45. <view class="item" :style="{width: 100 / 3 +'%'}">
  46. <view class="num">{{ detail.todo.pick }}</view>
  47. <view>待提货</view>
  48. </view>
  49. </view>
  50. </view>
  51. <view class="card">
  52. <view class="lf-row-between">
  53. <view class="title">今日数据</view>
  54. </view>
  55. <view class="lf-flex lf-m-t-50">
  56. <view class="item" :style="{width: 100 / 3 +'%'}">
  57. <view class="num">
  58. <text>{{ detail.today.pay }}</text>
  59. <text class="lf-font-24">()</text>
  60. </view>
  61. <view>支付金额</view>
  62. </view>
  63. <view class="item" :style="{width: 100 / 3 +'%'}">
  64. <view class="num">
  65. <text>{{ detail.today.online }}</text>
  66. <text class="lf-font-24">()</text>
  67. </view>
  68. <view>线上订单</view>
  69. </view>
  70. <view class="item" :style="{width: 100 / 3 +'%'}">
  71. <view class="num">
  72. <text>{{ detail.today.offline }}</text>
  73. <text class="lf-font-24">()</text>
  74. </view>
  75. <view>线下订单</view>
  76. </view>
  77. </view>
  78. </view>
  79. <view class="card">
  80. <view class="lf-row-between">
  81. <view class="title">我的商品</view>
  82. </view>
  83. <view class="lf-flex lf-m-t-50">
  84. <view class="item" :style="{width: 100 / 3 +'%'}">
  85. <view class="num">{{ detail.goods.del }}</view>
  86. <view>销售中</view>
  87. </view>
  88. <view class="item" :style="{width: 100 / 3 +'%'}">
  89. <view class="num">{{ detail.goods.on_sell }}</view>
  90. <view>待上架</view>
  91. </view>
  92. <view class="item" :style="{width: 100 / 3 +'%'}">
  93. <view class="num">{{ detail.goods.off_sell }}</view>
  94. <view>已下架</view>
  95. </view>
  96. </view>
  97. </view>
  98. <view class="card">
  99. <view class="lf-row-between">
  100. <view class="title">我的活动</view>
  101. </view>
  102. <view class="lf-flex lf-m-t-50">
  103. <view class="item" :style="{width: 100 / 3 +'%'}" @click="$url('/pages/business/activity/add')">
  104. <view class="lf-iconfont icon-bianji lf-font-60"></view>
  105. <view>新增活动</view>
  106. </view>
  107. <view class="item" :style="{width: 100 / 3 +'%'}" @click="$url('/pages/business/activity/list')">
  108. <view class="lf-iconfont icon-fabujilu lf-font-60"></view>
  109. <view>活动列表</view>
  110. </view>
  111. </view>
  112. </view>
  113. </block>
  114. </view>
  115. </template>
  116. <script>
  117. export default {
  118. data(){
  119. return {
  120. token: '',
  121. detail: {}
  122. }
  123. },
  124. onLoad(){
  125. let store_token = this.$cookieStorage.get('store_token');
  126. if(!store_token){
  127. this.$msg('登录状态异常, 即将跳转至登录页').then(() => {
  128. this.$url('/pages/business/login/login', {type: 'redirect'});
  129. })
  130. }else{
  131. this.token = store_token;
  132. this.getStoreCenter();
  133. }
  134. },
  135. methods: {
  136. getStoreCenter(){
  137. this.$http.get({
  138. api: 'api/supplier/index',
  139. header: {
  140. token: this.token
  141. }
  142. }).then(res => {
  143. console.log("getStoreCenter", res);
  144. if(res.data.code == 200){
  145. this.detail = res.data.data;
  146. }else{
  147. this.$msg('您的状态异常,请重新登录').then(() => {
  148. this.$url('/pages/business/login/login', {type: 'redirect'});
  149. })
  150. }
  151. })
  152. },
  153. // 扫一扫
  154. onScanCode(){
  155. uni.scanCode({
  156. complete: res => {
  157. if(res.errMsg == 'scanCode:ok'){
  158. // 二维码内的内容
  159. let result = this.codeParse(res.result);
  160. if(this.$shared.isValueType(result) == 'object'){
  161. if(result.rand && result.time && result.u_id){
  162. let url = '/pages/business/payment/money';
  163. url += `?u_id=${result.u_id}`;
  164. url += `&rand=${result.rand}`;
  165. url += `&time=${result.time}`;
  166. this.$url(url);
  167. }
  168. }else{
  169. this.$msg('不是有效的支付码');
  170. }
  171. }else{
  172. this.$msg('请扫二维码或条形码');
  173. }
  174. }
  175. })
  176. },
  177. codeParse(str){
  178. str = String(str);
  179. let new_data = null;
  180. try{
  181. new_data = JSON.parse(str);
  182. }catch{
  183. new_data = str;
  184. }
  185. return new_data;
  186. }
  187. }
  188. }
  189. </script>
  190. <style lang="scss" scoped="scoped">
  191. .head{
  192. width: 750rpx;
  193. height: 409rpx;
  194. background: linear-gradient(90deg, #1339B8 0%, #092788 100%);
  195. position: relative;
  196. overflow: hidden;
  197. display: flex;
  198. align-items: flex-end;
  199. box-sizing: border-box;
  200. padding: 60rpx 32rpx 110rpx;
  201. color: #FFFFFF;
  202. .bg-left{
  203. position: absolute;
  204. width: 196rpx;
  205. height: 196rpx;
  206. border-radius: 50%;
  207. background-color: rgba(255,255,255,0.04);
  208. left: -92rpx;
  209. bottom: 60rpx;
  210. }
  211. .bg-right{
  212. position: absolute;
  213. width: 520rpx;
  214. height: 520rpx;
  215. border-radius: 50%;
  216. background-color: rgba(255,255,255,0.04);
  217. right: -168rpx;
  218. top: -142rpx;
  219. }
  220. .head-content{
  221. width: 100%;
  222. display: flex;
  223. justify-content: space-between;
  224. position: relative;
  225. z-index: 9;
  226. .head-img{
  227. width: 100rpx;
  228. height: 100rpx;
  229. border: 2rpx solid #FFFFFF;
  230. box-sizing: border-box;
  231. margin-right: 20rpx;
  232. border-radius: 50%;
  233. }
  234. .head-title{
  235. font-size: 36rpx;
  236. color: #FFFFFF;
  237. font-weight: bold;
  238. width: 390rpx;
  239. }
  240. .head-menu{
  241. display: flex;
  242. flex-direction: column;
  243. align-items: center;
  244. justify-content: center;
  245. color: #FFFFFF;
  246. &:nth-child(n+2){
  247. margin-left: 30rpx;
  248. }
  249. &>text:nth-child(1){
  250. font-size: 50rpx;
  251. }
  252. &>text:nth-child(2){
  253. font-size: 24rpx;
  254. }
  255. }
  256. }
  257. }
  258. .notice{
  259. width: 686rpx;
  260. height: 100rpx;
  261. background: #FFFFFF;
  262. box-shadow: 0rpx 2rpx 8rpx 1rpx rgba(0, 0, 0, 0.1);
  263. border-radius: 20rpx;
  264. margin: -50rpx auto 0;
  265. position: relative;
  266. z-index: 9;
  267. padding: 16rpx 4rpx 0;
  268. box-sizing: border-box;
  269. }
  270. .card{
  271. padding: 30rpx;
  272. width: 686rpx;
  273. height: 287rpx;
  274. background: #FFFFFF;
  275. box-shadow: 0rpx 2rpx 8rpx 1rpx rgba(0, 0, 0, 0.1);
  276. border-radius: 20rpx;
  277. margin: 30rpx auto 0;
  278. &:last-child{
  279. margin-bottom: 50rpx;
  280. }
  281. .title{
  282. font-size: 32rpx;
  283. color: #222222;
  284. font-weight: bold;
  285. }
  286. .item{
  287. box-sizing: border-box;
  288. padding: 0 20rpx;
  289. text-align: center;
  290. font-size: 24rpx;
  291. color: #777777;
  292. .num{
  293. font-size: 36rpx;
  294. color: #222222;
  295. font-weight: bold;
  296. // word-break: break-all;
  297. // line-height: 1;
  298. }
  299. }
  300. }
  301. </style>