| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <template>
- <view class="content">
- <view v-html="content"></view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- content:"",
- }
- },
- onLoad(val) {
- const originalHtml = uni.getStorageSync('content') || '';
- this.content = originalHtml.replace(
- /<img([^>]*)>/gi,
- (match, attrs) => {
- // 如果已有 style,追加;没有则新增
- const hasStyle = /style\s*=/.test(attrs);
- if (hasStyle) {
- return match.replace(/style\s*=\s*["']([^"']*)["']/i, (s, old) =>
- s.replace(old, old + ';max-width:100%;display:block;')
- );
- } else {
- return `<img${attrs} style="max-width:100%;display:block;">`;
- }
- }
- );
- }
-
- }
-
-
- </script>
- <style scoped lang="scss">
- page{
- height: 100%;
- }
- .content{
- height: 100%;
- }
- .logo{
- padding-top: 15%;
- text-align: center;
- image{
- width: 80px;
- height: 80px;
- }
- p{
- margin: 10px 0px;
- font-size: 14px;
- }
- }
- .set-box{
- margin-top: 30upx;
- background: #fff;
- padding: 0 40upx;
- .item{
-
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 25upx 0;
- .left{
- display: flex;
- align-items: center;
- .text{
- font-size: 30upx;
- color: #666;
- }
- }
- .right{
- width: 10upx;
- height: 20upx;
- }
- .right-text{
-
- }
- }
- }
- .contact-btn {
- display: inline-block;
- position: absolute;
- width: 100%;
- background: salmon;
- opacity: 0;
- }
- </style>
|