shop.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  1. <template>
  2. <view class="content">
  3. <view class="top">
  4. <u-navbar title=" " @leftClick="leftClick" height="44px" bgColor="rgb(255,255,255,0)" :placeholder="true">
  5. <view class="u-nav-slot" slot="center">
  6. <u-search placeholder="店铺热搜" v-model="keyword" :showAction="false"></u-search>
  7. </view>
  8. </u-navbar>
  9. </view>
  10. <view class="box">
  11. <view class="box_top hflex acenter" @click="toDetail">
  12. <image :src="shop.img" class="avatar"></image>
  13. <view class="top_name">{{shop.name}}</view>
  14. </view>
  15. <view class="addr hflex acenter jbetween">
  16. <view class="addr_text">{{shop.address}}</view>
  17. <image src="/static/images/shop/map_icon.png" class="addr_icon"></image>
  18. </view>
  19. <view class="tabs hflex acenter">
  20. <block v-for="(item,index) in tabs" :key="index">
  21. <view class="hflex acenter" style="padding-right: 68rpx;">
  22. <view class="tab_item" :class="tab_active == index ? 'tab_active': ''" @click="changeTab(index)">{{item.name}}</view>
  23. <view class="vflex acenter jcenter" v-if="index == 2">
  24. <u-icon name="arrow-up-fill" :color="color" size="4"></u-icon>
  25. <u-icon name="arrow-down-fill" :color="color2" size="4"></u-icon>
  26. </view>
  27. </view>
  28. </block>
  29. </view>
  30. <menuList :menuLists="shop.lists" bottomSize="200rpx" @listenEvent="myEvent" @listenMenu="myMenu">
  31. </menuList>
  32. <view class="bottom hflex acenter jbetween">
  33. <view class="vflex acenter" @click="tellPhone">
  34. <u-icon name="phone-fill" color="#506dff" size="20"></u-icon>
  35. <view class="text_style1">打电话</view>
  36. </view>
  37. <view class="hflex acenter jcenter btn">
  38. <image class="btn_icon" src="/static/images/shop/consulting.png"></image>
  39. <view class="btn_text">咨询客服</view>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. import $api from '@/static/js/api.js'
  47. var that = ''
  48. export default {
  49. data() {
  50. return {
  51. keyword: '',
  52. shop: {
  53. img: '/static/images/mine/avatar1.jpg',
  54. name: '江南造船厂',
  55. address: '北城新区与汾河路交汇处',
  56. phone: '13412341234',
  57. lists: [
  58. {
  59. title: '柴油机',
  60. goods: [
  61. {
  62. label: '扬子柴油发电机3kw/5kw/8kw/10kw小型家用工业…',
  63. img: '/static/images/index/class_img3.png',
  64. price: '3400.00',
  65. },
  66. {
  67. label: '扬子柴油发电机3kw/5kw/8kw/10kw小型家用工业…',
  68. img: '/static/images/index/class_img3.png',
  69. price: '3400.00',
  70. },
  71. {
  72. label: '扬子柴油发电机3kw/5kw/8kw/10kw小型家用工业…',
  73. img: '/static/images/index/class_img3.png',
  74. price: '3400.00',
  75. },
  76. {
  77. label: '扬子柴油发电机3kw/5kw/8kw/10kw小型家用工业…',
  78. img: '/static/images/index/class_img3.png',
  79. price: '3400.00',
  80. },
  81. {
  82. label: '扬子柴油发电机3kw/5kw/8kw/10kw小型家用工业…',
  83. img: '/static/images/index/class_img3.png',
  84. price: '3400.00',
  85. },
  86. {
  87. label: '扬子柴油发电机3kw/5kw/8kw/10kw小型家用工业…',
  88. img: '/static/images/index/class_img3.png',
  89. price: '3400.00',
  90. },
  91. {
  92. label: '扬子柴油发电机3kw/5kw/8kw/10kw小型家用工业…',
  93. img: '/static/images/index/class_img3.png',
  94. price: '3400.00',
  95. }
  96. ]
  97. },
  98. {
  99. title: '齿轮箱',
  100. goods: [
  101. {
  102. label: '扬子柴油发电机3kw/5kw/8kw/10kw小型家用工业…',
  103. img: '/static/images/index/class_img4.png',
  104. price: '3400.00',
  105. },
  106. {
  107. label: '扬子柴油发电机3kw/5kw/8kw/10kw小型家用工业…',
  108. img: '/static/images/index/class_img3.png',
  109. price: '3400.00',
  110. },
  111. {
  112. label: '扬子柴油发电机3kw/5kw/8kw/10kw小型家用工业…',
  113. img: '/static/images/index/class_img3.png',
  114. price: '3400.00',
  115. },
  116. {
  117. label: '扬子柴油发电机3kw/5kw/8kw/10kw小型家用工业…',
  118. img: '/static/images/index/class_img3.png',
  119. price: '3400.00',
  120. },
  121. {
  122. label: '扬子柴油发电机3kw/5kw/8kw/10kw小型家用工业…',
  123. img: '/static/images/index/class_img3.png',
  124. price: '3400.00',
  125. },
  126. {
  127. label: '扬子柴油发电机3kw/5kw/8kw/10kw小型家用工业…',
  128. img: '/static/images/index/class_img3.png',
  129. price: '3400.00',
  130. },
  131. {
  132. label: '扬子柴油发电机3kw/5kw/8kw/10kw小型家用工业…',
  133. img: '/static/images/index/class_img3.png',
  134. price: '3400.00',
  135. }
  136. ]
  137. },
  138. {
  139. title: '舵机',
  140. goods: [
  141. {
  142. label: '扬子柴油发电机3kw/5kw/8kw/10kw小型家用工业…',
  143. img: '/static/images/index/class_img5.png',
  144. price: '3400.00',
  145. },
  146. {
  147. label: '扬子柴油发电机3kw/5kw/8kw/10kw小型家用工业…',
  148. img: '/static/images/index/class_img3.png',
  149. price: '3400.00',
  150. },
  151. {
  152. label: '扬子柴油发电机3kw/5kw/8kw/10kw小型家用工业…',
  153. img: '/static/images/index/class_img3.png',
  154. price: '3400.00',
  155. },
  156. {
  157. label: '扬子柴油发电机3kw/5kw/8kw/10kw小型家用工业…',
  158. img: '/static/images/index/class_img3.png',
  159. price: '3400.00',
  160. },
  161. {
  162. label: '扬子柴油发电机3kw/5kw/8kw/10kw小型家用工业…',
  163. img: '/static/images/index/class_img3.png',
  164. price: '3400.00',
  165. },
  166. {
  167. label: '扬子柴油发电机3kw/5kw/8kw/10kw小型家用工业…',
  168. img: '/static/images/index/class_img3.png',
  169. price: '3400.00',
  170. },
  171. {
  172. label: '扬子柴油发电机3kw/5kw/8kw/10kw小型家用工业…',
  173. img: '/static/images/index/class_img3.png',
  174. price: '3400.00',
  175. }
  176. ]
  177. }
  178. ],
  179. },
  180. tabs: [
  181. {
  182. index: 0,
  183. name: '全部',
  184. },
  185. {
  186. index: 1,
  187. name: '销量',
  188. },
  189. {
  190. index: 2,
  191. name: '价格',
  192. }
  193. ],
  194. tab_active: 0,
  195. color: '#7D7D7D',
  196. color2: '#7D7D7D',
  197. }
  198. },
  199. onLoad() {
  200. that = this
  201. },
  202. methods: {
  203. // 返回
  204. leftClick() {
  205. console.log('返回');
  206. $api.jump(-1)
  207. },
  208. // 店铺详情
  209. toDetail() {
  210. $api.jump('/page_shop/pages/good/shopDetail')
  211. },
  212. // 点击产品列表
  213. myEvent(e) {
  214. console.log(e);
  215. },
  216. // 点击菜单列表
  217. myMenu(e) {
  218. console.log(e);
  219. },
  220. // 切换tabs
  221. changeTab(e) {
  222. console.log(e);
  223. if(that.tab_active != 2) {
  224. that.color = '#506dff'
  225. } else {
  226. that.color = '#7D7D7D'
  227. that.color2 = '#506dff'
  228. }
  229. that.tab_active = e
  230. },
  231. // 打电话
  232. tellPhone() {
  233. var value = that.shop.phone
  234. uni.makePhoneCall({
  235. phoneNumber: value //仅为示例
  236. });
  237. }
  238. },
  239. }
  240. </script>
  241. <style lang="scss" scoped>
  242. .content {
  243. position: relative;
  244. .top {
  245. background: url('../../../static/images/comment/nav_bg.png') no-repeat;
  246. background-size: 100%;
  247. box-sizing: border-box;
  248. padding: 30rpx;
  249. height: 540rpx;
  250. .u-nav-slot {
  251. position: absolute;
  252. top: 8rpx;
  253. left: 134rpx;
  254. }
  255. }
  256. .box {
  257. position: absolute;
  258. left: 0;
  259. top: 240rpx;
  260. width: 100%;
  261. min-height: calc(100vh - 240rpx);
  262. background: #FFFFFF;
  263. border-radius: 40rpx 40rpx 0 0;
  264. .box_top {
  265. position: relative;
  266. .avatar {
  267. position: absolute;
  268. left: 30rpx;
  269. top: -52rpx;
  270. width: 148rpx;
  271. height: 148rpx;
  272. border-radius: 50%;
  273. border: 4rpx solid #FFFFFF;
  274. }
  275. .top_name {
  276. font-size: 40rpx;
  277. font-weight: 500;
  278. color: #222222;
  279. line-height: 56rpx;
  280. padding: 20rpx 0 0 218rpx;
  281. }
  282. }
  283. .addr {
  284. padding: 44rpx 30rpx 28rpx;
  285. box-sizing: border-box;
  286. border-bottom: 1rpx solid #F4F4F4;
  287. width: 100%;
  288. .addr_text {
  289. font-size: 26rpx;
  290. font-weight: 400;
  291. color: #222222;
  292. line-height: 36rpx ;
  293. }
  294. .addr_icon {
  295. width: 36rpx;
  296. height: 36rpx;
  297. }
  298. }
  299. .tabs {
  300. width: 100%;
  301. box-sizing: border-box;
  302. padding: 34rpx 30rpx 40rpx;
  303. .tab_item {
  304. font-size: 32rpx;
  305. font-weight: 500;
  306. color: #7D7D7D;
  307. line-height: 44rpx;
  308. padding-right: 10rpx;
  309. }
  310. .tab_active {
  311. font-size: 36rpx;
  312. font-weight: 500;
  313. color: #222222;
  314. line-height: 50rpx;
  315. position: relative;
  316. }
  317. .tab_active::after {
  318. content: "";
  319. position: absolute;
  320. left: 18rpx;
  321. bottom: -5rpx;
  322. width: 40rpx;
  323. height: 8rpx;
  324. background: #506DFF;
  325. border-radius: 4rpx;
  326. }
  327. }
  328. .bottom {
  329. width: 100%;
  330. z-index: 9;
  331. position: fixed;
  332. bottom: 0;
  333. height: 166rpx;
  334. background: #FFFFFF;
  335. box-sizing: border-box;
  336. padding: 8rpx 50rpx 74rpx;
  337. .text_style1 {
  338. font-size: 20rpx;
  339. font-weight: 400;
  340. color: #506DFF;
  341. line-height: 28rpx;
  342. padding-top: 6rpx;
  343. }
  344. .btn {
  345. width: 550rpx;
  346. height: 84rpx;
  347. background: #506DFF;
  348. border-radius: 42rpx;
  349. }
  350. .btn_icon {
  351. width: 40rpx;
  352. height: 40rpx;
  353. }
  354. .btn_text {
  355. padding-left: 4rpx;
  356. font-size: 32rpx;
  357. font-weight: 500;
  358. color: #FFFFFF;
  359. line-height: 44rpx;
  360. }
  361. }
  362. }
  363. }
  364. </style>