noUser.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. <template>
  2. <view class="container">
  3. <view class="content">
  4. <view class="title">
  5. <text>HI,车主</text>
  6. </view>
  7. <view class="tip">
  8. <text>
  9. 您还没未拥有车辆。
  10. </text>
  11. </view>
  12. <view class="itemTitleBox flex">
  13. <view class="itemTitle">
  14. 附近商家
  15. </view>
  16. <view class="tager flex" @click="navTo('/pages/index/shopTab')">
  17. <text>切换</text>
  18. <image class="itemIcon" src="../../../static/icon/next1.png" mode="widthFix"></image>
  19. </view>
  20. </view>
  21. <view class="shopContent flex">
  22. <view class="shoplogo">
  23. <image class="logo" :src="shopDetail.image" mode="scaleToFill"></image>
  24. </view>
  25. <view class="shopDetail">
  26. <view class="shopName clamp">
  27. {{shopDetail.name}}
  28. </view>
  29. <view class="shopDetailText">
  30. {{shopDetail.detailed_address}}
  31. </view>
  32. </view>
  33. </view>
  34. <view class="itemTitleBox flex">
  35. <view class="itemTitle">
  36. 国标系列
  37. </view>
  38. <view class="tager flex" @click="navTo('/pages/shop/shopIndex?id='+shopDetail.id+'&type=1')">
  39. <text>全部</text>
  40. <image class="itemIcon" src="/static/icon/next1.png" mode="widthFix"></image>
  41. </view>
  42. </view>
  43. <view class="flex cartList">
  44. <view class="itemBox" v-for="(item,index) in cartList" @click="navTo('/pages/product/product?id='+item.id)" :key='index'>
  45. <view class="imgBox">
  46. <image class="imageItem" :src="item.image" mode="scaleToFill"></image>
  47. </view>
  48. <view class="itemDetaile">
  49. <view class="cartName">
  50. <view class="clamp2 ">
  51. {{item.store_name}}
  52. </view>
  53. </view>
  54. <view class="maney clamp">
  55. <text class="greenText font-size-base">¥{{item.price}}</text>
  56. <text class="lign font-size-sm">{{item.sales|getNum}}+付款</text>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. <view class="itemTitleBox flex">
  62. <view class="itemTitle">
  63. 电摩系列
  64. </view>
  65. <view class="tager flex" @click="navTo('/pages/shop/shopIndex?id='+shopDetail.id+'&type=2')">
  66. <text>全部</text>
  67. <image class="itemIcon" src="../../../static/icon/next1.png" mode="widthFix"></image>
  68. </view>
  69. </view>
  70. <view class="flex cartList">
  71. <view class="itemBox" v-for="(item,index) in carTwoList" :key='index' @click="navTo('/pages/product/product?id='+item.id)">
  72. <view class="imgBox">
  73. <image class="imageItem" :src="item.image" mode="scaleToFill"></image>
  74. </view>
  75. <view class="itemDetaile">
  76. <view class="cartName">
  77. <view class="clamp2 ">
  78. {{item.store_name}}
  79. </view>
  80. </view>
  81. <view class="maney clamp">
  82. <text class="greenText font-size-base">¥{{item.price}}</text>
  83. <text class="lign font-size-sm">{{item.sales|getNum}}+付款</text>
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. <view class="itemTitleBox flex">
  89. <view class="itemTitle">
  90. 电轻摩系列
  91. </view>
  92. <view class="tager flex" @click="navTo('/pages/shop/shopIndex?id='+shopDetail.id)+'&type=3'">
  93. <text>全部</text>
  94. <image class="itemIcon" src="../../../static/icon/next1.png" mode="widthFix"></image>
  95. </view>
  96. </view>
  97. <view class="flex cartList">
  98. <view class="itemBox" v-for="(item,index) in carTreeList" :key='index' @click="navTo('/pages/product/product?id='+item.id)">
  99. <view class="imgBox">
  100. <image class="imageItem" :src="item.image" mode="scaleToFill"></image>
  101. </view>
  102. <view class="itemDetaile">
  103. <view class="cartName">
  104. <view class="clamp2 ">
  105. {{item.store_name}}
  106. </view>
  107. </view>
  108. <view class="maney clamp">
  109. <text class="greenText font-size-base">¥{{item.price}}</text>
  110. <text class="lign font-size-sm">{{item.sales|getNum}}+付款</text>
  111. </view>
  112. </view>
  113. </view>
  114. </view>
  115. </view>
  116. </view>
  117. </template>
  118. <script>
  119. import {
  120. mapState,
  121. } from 'vuex';
  122. import {
  123. getProducts,
  124. } from '@/api/product.js';
  125. export default {
  126. data() {
  127. return {
  128. cartList: [], //国标系列电动车
  129. carTwoList: [], //电摩系列电动车
  130. carTreeList: [], //电摩系列电动车
  131. };
  132. },
  133. computed: {
  134. ...mapState('shop', ['shopDetail'])
  135. },
  136. filters: {
  137. getNum(num) {
  138. if (num) {
  139. // 转为字符串
  140. num += '';
  141. let nu = num.slice(0, 1);
  142. for (let i = 0; i < num.length - 1; i++) {
  143. nu += 0
  144. }
  145. return nu
  146. } else {
  147. return 0
  148. }
  149. }
  150. },
  151. methods: {
  152. init() {
  153. // 查询国标
  154. this.getProducts(2, 'salesOrder').then((data) => {
  155. this.cartList = data;
  156. })
  157. // 查询电车
  158. this.getProducts(5, 'salesOrder').then((data) => {
  159. this.carTwoList = data;
  160. })
  161. // 查询电轻摩
  162. this.getProducts(6, 'salesOrder').then((data) => {
  163. this.carTreeList = data;
  164. })
  165. },
  166. // 获取门店车辆信息
  167. getProducts(sid, type) {
  168. let data = {
  169. sid: sid,
  170. page: 1,
  171. limit: 10,
  172. store_id: this.shopDetail.id,
  173. is_car: 1
  174. }
  175. // 保存查询分类
  176. data[type] = 1
  177. return new Promise((ok, erro) => {
  178. getProducts(data).then(({
  179. data
  180. }) => {
  181. ok(data)
  182. }).catch((e) => {
  183. erro(e)
  184. })
  185. })
  186. },
  187. navTo(url) {
  188. uni.navigateTo({
  189. url: url
  190. })
  191. }
  192. },
  193. };
  194. </script>
  195. <style lang="scss">
  196. $paddingJg:40rpx;
  197. .container{
  198. /* #ifdef APP */
  199. padding-top: calc(105rpx + var(--status-bar-height));
  200. /* #endif */
  201. /* #ifdef H5 || MP */
  202. padding-top: 105rpx;
  203. /* #endif */
  204. }
  205. .content {
  206. .greenText {
  207. color: $color-green;
  208. }
  209. .title {
  210. font-size: 48rpx;
  211. padding: 0 $paddingJg;
  212. padding-top: 60rpx;
  213. }
  214. .tip {
  215. font-size: 22rpx;
  216. color: $font-color-light;
  217. margin: 20rpx 0;
  218. padding: 0 $paddingJg;
  219. }
  220. .shopContent {
  221. color: $font-color-white;
  222. background-color: $base-color;
  223. border-radius: 20rpx;
  224. height: 160rpx;
  225. padding: 20rpx;
  226. margin: 0 $paddingJg;
  227. margin-bottom: 20rpx;
  228. .shoplogo {
  229. flex-shrink: 0;
  230. background-color: $font-color-white;
  231. width: 120rpx;
  232. height: 120rpx;
  233. border-radius: 20rpx;
  234. .logo {
  235. height: 100%;
  236. width: 100%;
  237. }
  238. }
  239. .shopDetail {
  240. padding-left: 30rpx;
  241. flex-grow: 1;
  242. .shopName {
  243. margin-bottom: 25rpx;
  244. font-size: 36rpx;
  245. }
  246. .shopDetailText {
  247. font-size: 22rpx;
  248. }
  249. }
  250. }
  251. .cartList {
  252. flex-wrap: wrap;
  253. margin: 0 $paddingJg;
  254. overflow: hidden;
  255. .itemBox {
  256. width: 310rpx;
  257. min-height: 460rpx;
  258. background-color: $font-color-white;
  259. border-radius: 20rpx;
  260. box-shadow: 0px 0px 10px 0px rgba(226, 226, 226, 0.35);
  261. margin-bottom: 30rpx;
  262. overflow: hidden;
  263. .imgBox {
  264. line-height: 0;
  265. .imageItem {
  266. width: 310rpx;
  267. height: 310rpx;
  268. }
  269. }
  270. .itemDetaile {
  271. padding: 10rpx 20rpx;
  272. .cartName {
  273. line-height: 1.5;
  274. font-size: 28rpx;
  275. color: $font-color-base;
  276. font-weight: 400;
  277. min-height: 90rpx;
  278. }
  279. .maney {
  280. line-height: 1;
  281. .lign {
  282. margin-left: 20rpx;
  283. color: $font-color-light;
  284. }
  285. }
  286. }
  287. }
  288. }
  289. }
  290. </style>