popup.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. <template>
  2. <view>
  3. <view class="example">
  4. <uniPopup :show="type" position="middle" mode="insert" @hidePopup="togglePopup('')">
  5. <view class="uni-center center-box">
  6. <image @click="gomoney" class="image" :src="pictureUrl+'/uploads/home/adv/'+images" />
  7. </view>
  8. </uniPopup>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. import uniPopup from './newpoup.vue'
  14. import {
  15. mapMutations,mapState
  16. } from 'vuex'
  17. export default {
  18. props: {
  19. ishow: {
  20. default: false,
  21. type: Boolean
  22. },
  23. images: {
  24. default: '',
  25. type: String
  26. }
  27. },
  28. components: {
  29. uniPopup
  30. },
  31. // watch: {
  32. // 'ishow':function(val) {
  33. // if(val) {
  34. // this.type = true;
  35. // }else {
  36. // this.type = false;
  37. // }
  38. // },
  39. // },
  40. data() {
  41. return {
  42. type: true,
  43. pictureUrl: this.pictureUrl,
  44. list: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'],
  45. bottomData: [{
  46. text: '微信',
  47. icon: '\ue6a4',
  48. name: 'wx'
  49. },
  50. {
  51. text: '朋友圈',
  52. icon: '\ue646',
  53. name: 'wx'
  54. },
  55. {
  56. text: 'QQ',
  57. icon: '\ue66b',
  58. name: 'qq'
  59. },
  60. {
  61. text: '新浪',
  62. icon: '\ue600',
  63. name: 'sina'
  64. },
  65. {
  66. text: '复制',
  67. icon: '\ue632',
  68. name: 'copy'
  69. },
  70. {
  71. text: '更多',
  72. icon: '\ue618',
  73. name: 'more'
  74. }
  75. ]
  76. };
  77. },
  78. onBackPress() {
  79. if (this.type !== '') {
  80. this.type = '';
  81. return true;
  82. }
  83. },
  84. watch: {
  85. // 'successlogion':function(val) {
  86. // if(val) {
  87. // uni.navigateTo({
  88. // url:'/pages/myCenter/definite'
  89. // })
  90. // }else {
  91. // uni.navigateTo({
  92. // url: './logion'
  93. // })
  94. // }
  95. // },
  96. },
  97. computed:{
  98. ...mapState([
  99. 'hasLogin',
  100. 'userInfo',
  101. 'successlogion'
  102. ]),
  103. },
  104. methods: {
  105. togglePopup() {
  106. this.type = false;
  107. },
  108. gomoney() {
  109. console.log(this.successlogion && this.hasLogin)
  110. if(this.successlogion && this.hasLogin) {
  111. uni.navigateTo({
  112. url:'/pages/myCenter/definite'
  113. })
  114. }else {
  115. uni.navigateTo({
  116. url: '/pages/myCenter/logion'
  117. })
  118. }
  119. }
  120. }
  121. };
  122. </script>
  123. <style>
  124. page {
  125. display: flex;
  126. flex-direction: column;
  127. box-sizing: border-box;
  128. background-color: #fff
  129. }
  130. view {
  131. font-size: 28upx;
  132. line-height: inherit
  133. }
  134. .example {
  135. padding: 0 30upx 30upx
  136. }
  137. .example-title {
  138. font-size: 32upx;
  139. line-height: 32upx;
  140. color: #777;
  141. margin: 40upx 25upx;
  142. position: relative
  143. }
  144. .example .example-title {
  145. margin: 40upx 0
  146. }
  147. .example-body {
  148. padding: 0 40upx
  149. }
  150. .uni-padding-wrap {
  151. padding: 0 30upx;
  152. }
  153. button {
  154. margin: 20upx 0;
  155. }
  156. .uni-helllo-text {
  157. height: 100upx;
  158. line-height: 100upx;
  159. text-align: center;
  160. }
  161. .center-box {
  162. width: 700upx;
  163. height: 700upx;
  164. }
  165. .uni-list-item {
  166. text-align: left;
  167. line-height: 80upx;
  168. border-bottom: 1px #f5f5f5 solid;
  169. }
  170. .uni-list-item:last-child {
  171. border: none;
  172. }
  173. .center-box .image {
  174. width: 100%;
  175. height: 100%;
  176. }
  177. .bottom-title {
  178. line-height: 60upx;
  179. font-size: 24upx;
  180. padding: 15upx 0;
  181. }
  182. .bottom-content {
  183. display: flex;
  184. flex-wrap: wrap;
  185. padding: 0 35upx;
  186. }
  187. .bottom-content-box {
  188. display: flex;
  189. flex-direction: column;
  190. align-items: center;
  191. margin-bottom: 15upx;
  192. width: 25%;
  193. box-sizing: border-box;
  194. }
  195. .bottom-content-image {
  196. display: flex;
  197. justify-content: center;
  198. align-items: center;
  199. width: 90upx;
  200. height: 90upx;
  201. overflow: hidden;
  202. background: #007aff;
  203. border-radius: 10upx;
  204. }
  205. .bottom-content-text {
  206. font-size: 26upx;
  207. color: #333;
  208. margin-top: 10upx;
  209. }
  210. .bottom-btn {
  211. height: 90upx;
  212. line-height: 90upx;
  213. border-top: 1px #f5f5f5 solid;
  214. }
  215. .bottom-content-image.wx {
  216. background: #00ce47;
  217. }
  218. .bottom-content-image.qq {
  219. background: #00b6f6;
  220. }
  221. .bottom-content-image.sina {
  222. background: #ff766a;
  223. }
  224. .bottom-content-image.copy {
  225. background: #07ccd0;
  226. }
  227. @font-face {
  228. font-family: 'iconfont';
  229. /* project id 1028200 */
  230. src: url('https://at.alicdn.com/t/font_1028200_47ewtwy4t04.ttf') format('truetype');
  231. }
  232. .icon {
  233. font-family: 'iconfont';
  234. font-size: 40upx;
  235. color: #fff;
  236. }
  237. </style>