index.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  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:'',
  110. info: {
  111. url: '',
  112. name: '首农食品旗舰店',
  113. money: 100,
  114. },
  115. list: [ //
  116. {
  117. url: '',
  118. name: '商品名称',
  119. money: 100,
  120. },
  121. ],
  122. // 收藏
  123. collection: false,
  124. };
  125. },
  126. onShow: function() {},
  127. methods: {
  128. // 选择底部菜单
  129. barChange(index, item) {
  130. const that = this;
  131. that.$set(that, `barActive`, index);
  132. },
  133. // 公共跳转
  134. toCommon(e) {
  135. uni.navigateTo({
  136. url: `/${e}`
  137. })
  138. },
  139. // 收藏
  140. toCollect() {
  141. const that = this;
  142. that.collection = !that.collection;
  143. if (that.collection == true) {
  144. uni.showToast({
  145. title: `收藏成功`,
  146. icon: 'none'
  147. })
  148. } else {
  149. uni.showToast({
  150. title: `取消成功`,
  151. icon: 'none'
  152. })
  153. }
  154. },
  155. // 分页
  156. toPage() {}
  157. }
  158. }
  159. </script>
  160. <style lang="scss">
  161. .main {
  162. display: flex;
  163. flex-direction: column;
  164. width: 100vw;
  165. height: 100vh;
  166. .one {
  167. position: relative;
  168. flex-grow: 1;
  169. .one_1 {
  170. display: flex;
  171. flex-direction: column;
  172. width: 96vw;
  173. height: 90vh;
  174. padding: 2vw;
  175. background-color: var(--fFB1Color);
  176. .first {
  177. margin: 0 0 2vw 0;
  178. .image {
  179. width: 100%;
  180. height: 50vw;
  181. }
  182. }
  183. .second {
  184. position: relative;
  185. flex-grow: 1;
  186. .list {
  187. margin: 0 2vw 2vw 0;
  188. background-color: var(--fffColor);
  189. padding: 2vw;
  190. width: 43vw;
  191. border-radius: 5px;
  192. .image {
  193. width: 100%;
  194. height: 49vw;
  195. margin: 0 0 1vw 0;
  196. }
  197. .name {
  198. font-size: var(--font15Size);
  199. margin: 0 0 2vw 0;
  200. }
  201. .other {
  202. display: flex;
  203. flex-direction: row;
  204. justify-content: space-between;
  205. .money {
  206. color: var(--ff0Color);
  207. text:nth-child(1) {
  208. font-size: var(--font12Size);
  209. }
  210. }
  211. .btn {
  212. button {
  213. border-radius: 25px;
  214. color: var(--fffColor);
  215. background-color: var(--ff0Color);
  216. font-size: var(--font12Size);
  217. }
  218. }
  219. }
  220. }
  221. .list:nth-child(2n) {
  222. margin: 0 0 2vw 0;
  223. }
  224. }
  225. }
  226. .one_4 {
  227. .first {
  228. display: flex;
  229. flex-direction: column;
  230. align-items: center;
  231. background-color: var(--fFB1Color);
  232. border-bottom-right-radius: 10vw;
  233. border-bottom-left-radius: 10vw;
  234. .image {
  235. width: 20vw;
  236. height: 20vw;
  237. border-radius: 20vw;
  238. }
  239. .name {
  240. margin: 2vw 0;
  241. font-size: var(--font16Szie);
  242. font-weight: bold;
  243. color: var(--mainColor);
  244. }
  245. }
  246. .second {
  247. margin: 2vw 0;
  248. .second_1 {
  249. display: flex;
  250. justify-content: space-evenly;
  251. .grade {
  252. display: flex;
  253. flex-direction: column;
  254. align-items: center;
  255. color: var(--f85Color);
  256. font-size: var(--font13Size);
  257. view {
  258. margin: 1vw 0 0 0;
  259. color: var(--ff0Color);
  260. }
  261. }
  262. }
  263. .second_2 {
  264. display: flex;
  265. justify-content: center;
  266. flex-direction: column;
  267. margin: 15vw 25vw 0 25vw;
  268. text-align: center;
  269. background: #b2b2b2;
  270. padding: 2vw;
  271. border-radius: 5px;
  272. .second_2_bor {
  273. .image {
  274. width: 100%;
  275. height: 40vw;
  276. }
  277. }
  278. .txt {
  279. color: #fff;
  280. font-size: 14px;
  281. margin: 2vw 0;
  282. }
  283. }
  284. }
  285. }
  286. .collect {
  287. position: fixed;
  288. top: 0;
  289. right: 2vw;
  290. .iconfont {
  291. font-size: 25px;
  292. }
  293. }
  294. }
  295. .two {
  296. display: flex;
  297. flex-direction: row;
  298. justify-content: space-around;
  299. border-top: 1px solid #f1f1f1;
  300. .list {
  301. padding: 1vw 0;
  302. text-align: center;
  303. .icon {}
  304. .name {
  305. font-size: 12px;
  306. }
  307. .activename {
  308. color: var(--fFB1Color);
  309. }
  310. }
  311. }
  312. }
  313. .scroll-view {
  314. position: absolute;
  315. top: 0;
  316. left: 0;
  317. right: 0;
  318. bottom: 0;
  319. .list-scroll-view {
  320. display: flex;
  321. flex-direction: row;
  322. flex-wrap: wrap;
  323. }
  324. }
  325. </style>