金诚优选前端代码
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.

285 lines
7.0 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. </block>
  99. </view>
  100. </template>
  101. <script>
  102. export default {
  103. data(){
  104. return {
  105. token: '',
  106. detail: {}
  107. }
  108. },
  109. onLoad(){
  110. let store_token = this.$cookieStorage.get('store_token');
  111. if(!store_token){
  112. this.$msg('登录状态异常, 即将跳转至登录页').then(() => {
  113. this.$url('/pages/business/login/login', {type: 'redirect'});
  114. })
  115. }else{
  116. this.token = store_token;
  117. this.getStoreCenter();
  118. }
  119. },
  120. methods: {
  121. getStoreCenter(){
  122. this.$http.get({
  123. api: 'api/supplier/index',
  124. header: {
  125. token: this.token
  126. }
  127. }).then(res => {
  128. console.log("getStoreCenter", res);
  129. this.detail = res.data.data;
  130. })
  131. },
  132. // 扫一扫
  133. onScanCode(){
  134. uni.scanCode({
  135. complete: res => {
  136. if(res.errMsg == 'scanCode:ok'){
  137. // 二维码内的内容
  138. let result = this.codeParse(res.result);
  139. if(this.$shared.isValueType(result) == 'object'){
  140. if(result.rand && result.time && result.u_id){
  141. let url = '/pages/business/payment/money';
  142. url += `?u_id=${result.u_id}`;
  143. url += `&rand=${result.rand}`;
  144. url += `&time=${result.time}`;
  145. this.$url(url);
  146. }
  147. }else{
  148. this.$msg('不是有效的支付码');
  149. }
  150. }else{
  151. this.$msg('请扫二维码或条形码');
  152. }
  153. }
  154. })
  155. },
  156. codeParse(str){
  157. str = String(str);
  158. let new_data = null;
  159. try{
  160. new_data = JSON.parse(str);
  161. }catch{
  162. new_data = str;
  163. }
  164. return new_data;
  165. }
  166. }
  167. }
  168. </script>
  169. <style lang="scss" scoped="scoped">
  170. .head{
  171. width: 750rpx;
  172. height: 409rpx;
  173. background: linear-gradient(90deg, #1339B8 0%, #092788 100%);
  174. position: relative;
  175. overflow: hidden;
  176. display: flex;
  177. align-items: flex-end;
  178. box-sizing: border-box;
  179. padding: 60rpx 32rpx 110rpx;
  180. color: #FFFFFF;
  181. .bg-left{
  182. position: absolute;
  183. width: 196rpx;
  184. height: 196rpx;
  185. border-radius: 50%;
  186. background-color: rgba(255,255,255,0.04);
  187. left: -92rpx;
  188. bottom: 60rpx;
  189. }
  190. .bg-right{
  191. position: absolute;
  192. width: 520rpx;
  193. height: 520rpx;
  194. border-radius: 50%;
  195. background-color: rgba(255,255,255,0.04);
  196. right: -168rpx;
  197. top: -142rpx;
  198. }
  199. .head-content{
  200. width: 100%;
  201. display: flex;
  202. justify-content: space-between;
  203. position: relative;
  204. z-index: 9;
  205. .head-img{
  206. width: 100rpx;
  207. height: 100rpx;
  208. border: 2rpx solid #FFFFFF;
  209. box-sizing: border-box;
  210. margin-right: 20rpx;
  211. border-radius: 50%;
  212. }
  213. .head-title{
  214. font-size: 36rpx;
  215. color: #FFFFFF;
  216. font-weight: bold;
  217. width: 390rpx;
  218. }
  219. .head-menu{
  220. display: flex;
  221. flex-direction: column;
  222. align-items: center;
  223. justify-content: center;
  224. color: #FFFFFF;
  225. &:nth-child(n+2){
  226. margin-left: 30rpx;
  227. }
  228. &>text:nth-child(1){
  229. font-size: 50rpx;
  230. }
  231. &>text:nth-child(2){
  232. font-size: 24rpx;
  233. }
  234. }
  235. }
  236. }
  237. .notice{
  238. width: 686rpx;
  239. height: 100rpx;
  240. background: #FFFFFF;
  241. box-shadow: 0rpx 2rpx 8rpx 1rpx rgba(0, 0, 0, 0.1);
  242. border-radius: 20rpx;
  243. margin: -50rpx auto 0;
  244. position: relative;
  245. z-index: 9;
  246. padding: 16rpx 4rpx 0;
  247. box-sizing: border-box;
  248. }
  249. .card{
  250. padding: 30rpx;
  251. width: 686rpx;
  252. height: 287rpx;
  253. background: #FFFFFF;
  254. box-shadow: 0rpx 2rpx 8rpx 1rpx rgba(0, 0, 0, 0.1);
  255. border-radius: 20rpx;
  256. margin: 30rpx auto 0;
  257. &:last-child{
  258. margin-bottom: 50rpx;
  259. }
  260. .title{
  261. font-size: 32rpx;
  262. color: #222222;
  263. font-weight: bold;
  264. }
  265. .item{
  266. box-sizing: border-box;
  267. padding: 0 20rpx;
  268. text-align: center;
  269. font-size: 24rpx;
  270. color: #777777;
  271. .num{
  272. font-size: 36rpx;
  273. color: #222222;
  274. font-weight: bold;
  275. // word-break: break-all;
  276. // line-height: 1;
  277. }
  278. }
  279. }
  280. </style>