index.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  1. <template>
  2. <mobile-frame>
  3. <view class="main">
  4. <view class="one">
  5. <view class="one_1" v-if="barActive=='0'">
  6. <view class="first">
  7. <image class="image" :src="oneUrl" mode=""></image>
  8. </view>
  9. <view class="second">
  10. <scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage">
  11. <view class="list-scroll-view">
  12. <view class="list" v-for="(item,index) in list" :key="index" @tap="toCommon('pagesHome/order/detail')">
  13. <image class="image" :src="item.url" mode=""></image>
  14. <view class="name">
  15. {{item.name}}
  16. </view>
  17. <view class="other">
  18. <view class="money">
  19. <text>¥</text>
  20. <text>{{item.money}}</text>
  21. </view>
  22. <view class="btn">
  23. <button type="default" size="mini">购买</button>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </scroll-view>
  29. </view>
  30. </view>
  31. <view class="one_2" v-else-if="barActive=='1'">
  32. 商品分类
  33. </view>
  34. <view class="one_3" v-else-if="barActive=='2'">
  35. 全部商品
  36. </view>
  37. <view class="one_4" v-else-if="barActive=='3'">
  38. <view class="first">
  39. <image class="image" :src="info.url" mode=""></image>
  40. <view class="name">{{info.name}}</view>
  41. </view>
  42. <view class="second">
  43. <view class="second_1">
  44. <view class="grade">
  45. <view>{{info.grade||'5'}}</view>
  46. 商品
  47. </view>
  48. <view class="grade">
  49. <view>{{info.grade||'5'}}</view>
  50. 发货
  51. </view>
  52. <view class="grade">
  53. <view>{{info.grade||'5'}}</view>
  54. 服务
  55. </view>
  56. </view>
  57. <view class="second_2">
  58. <view class="second_2_bor">
  59. <image class="image" :src="info.url" mode=""></image>
  60. </view>
  61. <view class="txt">
  62. 店铺二维码
  63. </view>
  64. </view>
  65. </view>
  66. <view class="collect">
  67. <text v-if="!collection" @click="toCollect" class="iconfont icon-yduishoucangkongxin"></text>
  68. <text v-else @click="toCollect" class="iconfont icon-yduishoucangshixin"></text>
  69. </view>
  70. </view>
  71. </view>
  72. <view class="two">
  73. <view class="list" v-for="(item,index) in barList" :key="index" @tap="barChange(index,item)">
  74. <view class="icon">
  75. <text :class="['iconfont',barActive==index?item.acticon:item.icon]"></text>
  76. </view>
  77. <view :class="['name',barActive==index?'activename':'']">
  78. {{item.name}}
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. </mobile-frame>
  84. </template>
  85. <script>
  86. export default {
  87. data() {
  88. return {
  89. barActive: '0',
  90. barList: [ //底部菜单
  91. {
  92. icon: 'icon-shangdian',
  93. acticon: "icon-shangdian-copy",
  94. name: '微店首页'
  95. }, {
  96. icon: 'icon-fenlei',
  97. acticon: "icon-fenlei-copy",
  98. name: '商品分类'
  99. }, {
  100. icon: 'icon-shangpinfenlei',
  101. acticon: "icon-shangpinfenlei-copy",
  102. name: '全部商品'
  103. }, {
  104. icon: 'icon-qiyejianjie',
  105. acticon: "icon-qiyejianjie-copy",
  106. name: '店铺简介'
  107. }
  108. ],
  109. oneUrl: require('@/static/test.png'),
  110. info: {
  111. url: require('@/static/test.png'),
  112. name: '首农食品旗舰店',
  113. money: 100,
  114. },
  115. list: [ //
  116. {
  117. url: require('@/static/test.png'),
  118. name: '商品名称',
  119. money: 100,
  120. },
  121. {
  122. url: require('@/static/test.png'),
  123. name: '商品名称',
  124. money: 100,
  125. },
  126. {
  127. url: require('@/static/test.png'),
  128. name: '商品名称',
  129. money: 100,
  130. },
  131. {
  132. url: require('@/static/test.png'),
  133. name: '商品名称',
  134. money: 100,
  135. },
  136. {
  137. url: require('@/static/test.png'),
  138. name: '商品名称',
  139. money: 100,
  140. },
  141. ],
  142. // 收藏
  143. collection: false,
  144. };
  145. },
  146. onShow: function() {},
  147. methods: {
  148. // 选择底部菜单
  149. barChange(index, item) {
  150. const that = this;
  151. that.$set(that, `barActive`, index);
  152. },
  153. // 公共跳转
  154. toCommon(e) {
  155. uni.navigateTo({
  156. url: `/${e}`
  157. })
  158. },
  159. // 收藏
  160. toCollect() {
  161. const that = this;
  162. that.collection = !that.collection;
  163. if (that.collection == true) {
  164. uni.showToast({
  165. title: `收藏成功`,
  166. icon: 'none'
  167. })
  168. } else {
  169. uni.showToast({
  170. title: `取消成功`,
  171. icon: 'none'
  172. })
  173. }
  174. },
  175. // 分页
  176. toPage() {}
  177. }
  178. }
  179. </script>
  180. <style lang="scss">
  181. .main {
  182. display: flex;
  183. flex-direction: column;
  184. width: 100vw;
  185. height: 100vh;
  186. .one {
  187. position: relative;
  188. flex-grow: 1;
  189. .one_1 {
  190. display: flex;
  191. flex-direction: column;
  192. width: 96vw;
  193. height: 90vh;
  194. padding: 2vw;
  195. background-color: var(--fFB1Color);
  196. .first {
  197. margin: 0 0 2vw 0;
  198. .image {
  199. width: 100%;
  200. height: 50vw;
  201. }
  202. }
  203. .second {
  204. position: relative;
  205. flex-grow: 1;
  206. .list {
  207. margin: 0 2vw 2vw 0;
  208. background-color: var(--fffColor);
  209. padding: 2vw;
  210. width: 43vw;
  211. border-radius: 5px;
  212. .image {
  213. width: 100%;
  214. height: 49vw;
  215. margin: 0 0 1vw 0;
  216. }
  217. .name {
  218. font-size: var(--font15Size);
  219. margin: 0 0 2vw 0;
  220. }
  221. .other {
  222. display: flex;
  223. flex-direction: row;
  224. justify-content: space-between;
  225. .money {
  226. color: var(--ff0Color);
  227. text:nth-child(1) {
  228. font-size: var(--font12Size);
  229. }
  230. }
  231. .btn {
  232. button {
  233. border-radius: 25px;
  234. color: var(--fffColor);
  235. background-color: var(--ff0Color);
  236. font-size: var(--font12Size);
  237. }
  238. }
  239. }
  240. }
  241. .list:nth-child(2n) {
  242. margin: 0 0 2vw 0;
  243. }
  244. }
  245. }
  246. .one_4 {
  247. .first {
  248. display: flex;
  249. flex-direction: column;
  250. align-items: center;
  251. background-color: var(--fFB1Color);
  252. border-bottom-right-radius: 10vw;
  253. border-bottom-left-radius: 10vw;
  254. .image {
  255. width: 20vw;
  256. height: 20vw;
  257. border-radius: 20vw;
  258. }
  259. .name {
  260. margin: 2vw 0;
  261. font-size: var(--font16Szie);
  262. font-weight: bold;
  263. color: var(--mainColor);
  264. }
  265. }
  266. .second {
  267. margin: 2vw 0;
  268. .second_1 {
  269. display: flex;
  270. justify-content: space-evenly;
  271. .grade {
  272. display: flex;
  273. flex-direction: column;
  274. align-items: center;
  275. color: var(--f85Color);
  276. font-size: var(--font13Size);
  277. view {
  278. margin: 1vw 0 0 0;
  279. color: var(--ff0Color);
  280. }
  281. }
  282. }
  283. .second_2 {
  284. display: flex;
  285. justify-content: center;
  286. flex-direction: column;
  287. margin: 15vw 25vw 0 25vw;
  288. text-align: center;
  289. background: #b2b2b2;
  290. padding: 2vw;
  291. border-radius: 5px;
  292. .second_2_bor {
  293. .image {
  294. width: 100%;
  295. height: 40vw;
  296. }
  297. }
  298. .txt {
  299. color: #fff;
  300. font-size: 14px;
  301. margin: 2vw 0;
  302. }
  303. }
  304. }
  305. }
  306. .collect {
  307. position: fixed;
  308. top: 0;
  309. right: 2vw;
  310. .iconfont {
  311. font-size: 25px;
  312. }
  313. }
  314. }
  315. .two {
  316. display: flex;
  317. flex-direction: row;
  318. justify-content: space-around;
  319. border-top: 1px solid #f1f1f1;
  320. .list {
  321. padding: 1vw 0;
  322. text-align: center;
  323. .icon {}
  324. .name {
  325. font-size: 12px;
  326. }
  327. .activename {
  328. color: var(--fFB1Color);
  329. }
  330. }
  331. }
  332. }
  333. .scroll-view {
  334. position: absolute;
  335. top: 0;
  336. left: 0;
  337. right: 0;
  338. bottom: 0;
  339. .list-scroll-view {
  340. display: flex;
  341. flex-direction: row;
  342. flex-wrap: wrap;
  343. }
  344. }
  345. </style>