fc-list.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. <template>
  2. <view>
  3. <uni-nav-bar id="nav-bar" status-bar="true" backgroundColor="rgba(255, 255,255, 255)" @clickLeft="onBack()"
  4. @clickRight="onDownLoad()" fixed="true">
  5. <view slot="left">
  6. <view class=" flex align-center margin-left">
  7. <image class="p-left-arrow" src="../../../static/p-left-arrow.png"></image>
  8. </view>
  9. </view>
  10. <view slot="middle" class="uni-navbar__header-container">
  11. <view class="uni-navbar__header-container-inner">
  12. <view>
  13. <text>我的游戏</text>
  14. </view>
  15. <view class="flex align-center text-13px margin-left-sm" @click="togglePopup('top', 'popup')">
  16. <image class="b-down-arrow" src="../../../static/down-arrow@2x.png"></image>
  17. </view>
  18. </view>
  19. </view>
  20. <view slot="right">
  21. <view class="flex align-center text-13px" style="margin-right: 20rpx;">
  22. <image class="png-more" style="width: 50rpx;height: 40rpx;" src="../../../static/download@2x.png"></image>
  23. </view>
  24. </view>
  25. </uni-nav-bar>
  26. <view style="position: relative;" v-for="(item, index) in FCList" :key="index" :data-id="index">
  27. <view class="fc-list-container">
  28. <view class="fc-list-body">
  29. <view class="flex">
  30. <image class="data-png-64" :src="item.gamePicture"></image>
  31. <view style="display: flex;flex-direction: column;">
  32. <text class="cont">{{item.gameName}}</text>
  33. <view style="padding-left: 5px;">
  34. <text class="cont-blue">{{item.suffix}}</text>
  35. <text class="cont-blue">{{item.type}}</text>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="fc-list-start-button">
  40. 启动
  41. </view>
  42. </view>
  43. </view>
  44. <uni-swipe-action :options="options1" style="border: 1rpx solid #000000; z-index: 10000;">
  45. <view style="height: 200rpx;"></view>
  46. </uni-swipe-action>
  47. </view>
  48. <uni-popup :show="showpopup" type="top" @change="changePopup">
  49. <view style="display: flex;justify-content: center;" @click="changePopup({
  50. show: false
  51. })">
  52. <view class="popup-content" @click.stop="clear">
  53. <view class="popup-item " v-for="(item, index) in popupList" :key="index" :data-id="index" :class="index == popupList.length-1?'':'solid-bottom'">
  54. <view style="padding: 10px; " :class="index == 0?'make-text-bPurple':''">{{item.name}}</view>
  55. </view>
  56. <view class="triangle"></view>
  57. </view>
  58. </view>
  59. </uni-popup>
  60. </view>
  61. </template>
  62. <script>
  63. import uniSwipeAction from '@/components/uni-swipe-action/uni-swipe-action.vue';
  64. import uniNavBar from '@/components/uni-nav-bar/uni-nav-bar.vue';
  65. import uniPopup from '@/components/uni-popup/uni-popup.vue'
  66. export default {
  67. components: {
  68. uniSwipeAction,
  69. uniNavBar,
  70. uniPopup
  71. },
  72. data() {
  73. return {
  74. isOpened: false,
  75. options1: [{
  76. text: '删除',
  77. bShowDeleteIcon: true,
  78. style: {
  79. backgroundColor: 'rgb(255,58,49)'
  80. }
  81. }],
  82. showpopup: false,
  83. showtip: false,
  84. showimage: false,
  85. showshare: false,
  86. type: '',
  87. list: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'],
  88. popupList: [{
  89. id: 0,
  90. name: "全部游戏",
  91. type: 0,
  92. }, {
  93. id: 0,
  94. name: "FC",
  95. type: 0,
  96. }, {
  97. id: 0,
  98. name: "MD",
  99. type: 0,
  100. }, {
  101. id: 0,
  102. name: "GBA",
  103. type: 0,
  104. }, {
  105. id: 0,
  106. name: "PS",
  107. type: 0,
  108. }, {
  109. id: 0,
  110. name: "GBC",
  111. type: 0,
  112. }, {
  113. id: 0,
  114. name: "MAME",
  115. type: 0,
  116. }, {
  117. id: 0,
  118. name: "NDS",
  119. type: 0,
  120. }],
  121. content: '顶部弹 popup',
  122. //我的fc游戏列表
  123. FCList: []
  124. }
  125. },
  126. onReady() {
  127. this.$nextTick(() => {
  128. this.isOpened = true
  129. })
  130. this.onGetStoreFCList();
  131. },
  132. methods: {
  133. clear() {},
  134. onBack() {
  135. uni.navigateBack({
  136. delta: 1
  137. })
  138. },
  139. onDownLoad() {
  140. },
  141. bindClick(e) {
  142. console.log(e)
  143. uni.showToast({
  144. title: `点击了${e.content.text}按钮`,
  145. icon: 'none'
  146. })
  147. },
  148. setOpened() {
  149. this.isOpened = !this.isOpened
  150. },
  151. change(e) {
  152. this.isOpened = e
  153. },
  154. togglePopup(type, open) {
  155. this['show' + open] = true
  156. },
  157. cancelPopup(type) {
  158. this['show' + type] = false
  159. },
  160. changePopup(e) {
  161. console.log('是否打开:' + e.show)
  162. if (!e.show) {
  163. this.showpopup = false
  164. this.showtip = false
  165. this.showimage = false
  166. this.showshare = false
  167. }
  168. },
  169. onGetStoreFCList() {
  170. //todo 下载完成,设置记录数据到本地,
  171. //#ifdef H5
  172. this.FCList = uni.getStorageSync("FCList");
  173. //#endif
  174. //#ifdef APP-PLUS
  175. this.FCList = plus.storage.getItem("FCList");
  176. //#endif
  177. }
  178. }
  179. }
  180. </script>
  181. <style>
  182. .uni-navbar__header-container {
  183. flex: 1;
  184. }
  185. .uni-navbar__header-container-inner {
  186. /* #ifndef APP-NVUE */
  187. display: flex;
  188. /* #endif */
  189. flex: 1;
  190. align-items: center;
  191. justify-content: center;
  192. font-size: 15px;
  193. }
  194. .fc-list-container {
  195. position: absolute;
  196. width: 100%;
  197. background-color: #FFFFFF;
  198. }
  199. .fc-list-body {
  200. display: flex;
  201. justify-content: space-between;
  202. align-items: center;
  203. height: 200rpx;
  204. margin: 0 20px;
  205. border-bottom: 1rpx solid #eee;
  206. }
  207. .fc-list-start-button {
  208. width: 60px;
  209. height: 36px;
  210. font-size: 16px;
  211. line-height: 36px;
  212. background-color: #F5E003;
  213. text-align: center;
  214. border-radius: 12rpx;
  215. }
  216. /* #ifndef APP-NVUE */
  217. page {
  218. display: flex;
  219. flex-direction: column;
  220. box-sizing: border-box;
  221. background-color: #efeff4;
  222. min-height: 100%;
  223. height: auto;
  224. }
  225. view {
  226. font-size: 28rpx;
  227. line-height: inherit;
  228. }
  229. /* #endif */
  230. .cont {
  231. height: 45px;
  232. line-height: 45px;
  233. padding: 0 15px;
  234. position: relative;
  235. background-color: #fff;
  236. font-size: 15px;
  237. /* border-bottom-color: #F5F5F5; */
  238. /* border-bottom-width: 1px; */
  239. /* border-bottom-style: solid; */
  240. }
  241. .cont-blue {
  242. height: 20px;
  243. line-height: 20px;
  244. padding: 0 10px;
  245. position: relative;
  246. color: #2B95FF;
  247. font-size: 15px;
  248. /* border-bottom-color: #F5F5F5; */
  249. /* border-bottom-width: 1px; */
  250. /* border-bottom-style: solid; */
  251. }
  252. .popup-content {
  253. background-color: #fff;
  254. padding: 5px;
  255. font-size: 14px;
  256. width: 250rpx;
  257. /* border: 1rpx solid #007AFF; */
  258. margin-top: 70px;
  259. position: relative;
  260. border-radius: 12rpx;
  261. }
  262. /* clip-path属性可以创建一个只有元素的部分区域可以显示的剪切区域 */
  263. .triangle {
  264. display: block;
  265. height: 20px;
  266. width: 20px;
  267. background-color: inherit;
  268. border: inherit;
  269. position: absolute;
  270. top: -5px;
  271. left: calc(50% - 10px);
  272. // ---关键代码 start---
  273. clip-path: polygon(0% 0%, 100% 100%, 0% 100%);
  274. transform: rotate(135deg);
  275. // ---end---
  276. border-radius: 0 0 0 2px;
  277. }
  278. .popup-item {
  279. align-items: center;
  280. text-align: center;
  281. }
  282. </style>