openpictrue.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <template>
  2. <view>
  3. <view class="example" @click="togglePopup('')">
  4. <uniPopup :show="types" position="middle" mode="insert" >
  5. <view class="uni-center center-box">
  6. <img mode="widthFix" :src="images" style="width: 100%;"/>
  7. <!-- <img @bindload="imageLoad" :src="images" style="width: images[index].widthrpx; height:images[index].heightrpx;"/> -->
  8. </view>
  9. </uniPopup>
  10. </view>
  11. </view>
  12. <!--
  13. <view v-if="types" style="width: 100vw;
  14. height:100vh;
  15. position: fixed;
  16. z-index: 99;
  17. top: 0;
  18. right: 0;
  19. bottom: 0;
  20. left: 0;
  21. background-color: black;">
  22. <view style="position: absolute;
  23. width: 0px;
  24. top: 50%;
  25. width: 100%;height: 100%;
  26. left: 50%;
  27. transform: translate(-50%, -50%);">
  28. <img mode='widthFix' :src="images" />
  29. </view> -->
  30. </view>
  31. </template>
  32. <script>
  33. import uniPopup from './uni-popup.vue'
  34. export default {
  35. props: {
  36. show: {
  37. default: false,
  38. type: Boolean
  39. },
  40. images: {
  41. default: [],
  42. type:Array
  43. }
  44. },
  45. components: {
  46. uniPopup
  47. },
  48. watch: {
  49. 'show':function(val) {
  50. if(val) {
  51. this.types = true;
  52. }else {
  53. this.types = false;
  54. }
  55. },
  56. },
  57. data() {
  58. return {
  59. types: false,
  60. pictureUrl: this.pictureUrl,
  61. // images:[],
  62. list: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'],
  63. };
  64. },
  65. // onBackPress() {
  66. // if (this.type !== '') {
  67. // this.type = '';
  68. // return true;
  69. // }
  70. // },
  71. mounted() {
  72. },
  73. methods: {
  74. // imageLoad() {
  75. // console.log("999");
  76. // let $width=e.detail.width; //获取图片真实宽度
  77. // let $height=e.detail.height;
  78. // let ratio=$width/$height; //图片的真实宽高比例
  79. // let viewWidth=718; //设置图片显示宽度,左右留有16rpx边距
  80. // let viewHeight=718/ratio; //计算的高度值
  81. // let image= this.data.images;
  82. // //将图片的datadata-index作为image对象的key,然后存储图片的宽高值
  83. // image[e.target.dataset.index]={
  84. // width:viewWidth,
  85. // height:viewHeight
  86. // }
  87. // this.data.images = images;
  88. // },
  89. togglePopup() {
  90. this.type = false;
  91. uni.$emit('changshow')
  92. },
  93. gomoney() {
  94. // uni.navigateTo({
  95. // url:'/pages/myCenter/definite'
  96. // })
  97. }
  98. }
  99. };
  100. </script>
  101. <style>
  102. page {
  103. display: flex;
  104. flex-direction: column;
  105. box-sizing: border-box;
  106. background-color: #fff
  107. }
  108. view {
  109. font-size: 28upx;
  110. line-height: inherit
  111. }
  112. .example {
  113. padding: 0 30upx 30upx
  114. }
  115. .example-title {
  116. font-size: 32upx;
  117. line-height: 32upx;
  118. color: #777;
  119. margin: 40upx 25upx;
  120. position: relative
  121. }
  122. .example .example-title {
  123. margin: 40upx 0
  124. }
  125. .example-body {
  126. padding: 0 40upx
  127. }
  128. .uni-padding-wrap {
  129. padding: 0 30upx;
  130. }
  131. button {
  132. margin: 20upx 0;
  133. }
  134. .uni-helllo-text {
  135. height: 100upx;
  136. line-height: 100upx;
  137. text-align: center;
  138. }
  139. .center-box {
  140. width: 100vw;
  141. }
  142. .uni-list-item {
  143. text-align: left;
  144. line-height: 80upx;
  145. border-bottom: 1px #f5f5f5 solid;
  146. }
  147. .uni-list-item:last-child {
  148. border: none;
  149. }
  150. .center-box .image {
  151. width: 100%;
  152. height: 100%;
  153. }
  154. .bottom-title {
  155. line-height: 60upx;
  156. font-size: 24upx;
  157. padding: 15upx 0;
  158. }
  159. .bottom-content {
  160. display: flex;
  161. flex-wrap: wrap;
  162. padding: 0 35upx;
  163. }
  164. .bottom-content-box {
  165. display: flex;
  166. flex-direction: column;
  167. align-items: center;
  168. margin-bottom: 15upx;
  169. width: 25%;
  170. box-sizing: border-box;
  171. }
  172. .bottom-content-image {
  173. display: flex;
  174. justify-content: center;
  175. align-items: center;
  176. width: 90upx;
  177. height: 90upx;
  178. overflow: hidden;
  179. background: #007aff;
  180. border-radius: 10upx;
  181. }
  182. .bottom-content-text {
  183. font-size: 26upx;
  184. color: #333;
  185. margin-top: 10upx;
  186. }
  187. .bottom-btn {
  188. height: 90upx;
  189. line-height: 90upx;
  190. border-top: 1px #f5f5f5 solid;
  191. }
  192. .bottom-content-image.wx {
  193. background: #00ce47;
  194. }
  195. .bottom-content-image.qq {
  196. background: #00b6f6;
  197. }
  198. .bottom-content-image.sina {
  199. background: #ff766a;
  200. }
  201. .bottom-content-image.copy {
  202. background: #07ccd0;
  203. }
  204. @font-face {
  205. font-family: 'iconfont';
  206. /* project id 1028200 */
  207. src: url('https://at.alicdn.com/t/font_1028200_47ewtwy4t04.ttf') format('truetype');
  208. }
  209. .icon {
  210. font-family: 'iconfont';
  211. font-size: 40upx;
  212. color: #fff;
  213. }
  214. </style>