急救驿站小程序项目部分设计

(2020.9.1 已终止)

前端测试效果:

部分代码:

<!-- index wxml -->
<view class="contain">
    <view class="mod">
        <view>
            <block>
                <navigator wx:for="{{nav}}" open-type="{{item.opty}}" url="{{item.purl}}">
                    <image src="{{picurl}}{{item.img}}" />
                </navigator>
            </block>
        </view>
        <view>
            <block>
                <text wx:for="{{nav}}">{{item.name}}</text>
            </block>
        </view>
    </view>
    <view class=""></view>
</view>



/* index js */
Page({
  data: {
    picurl: "http://58.87.127.76/imgs/",        //已失效
    nav: [
      {
        opty: "switchTab",
        purl: "/pages/surrounding/index",
        img: "驿站位置.png",
        name:"驿站位置"
      },
      {
        opty: "navigate",
        purl: "/pages/video/index",
        img: "视频专栏.png",
        name:"视频专栏"
      },
      {
        opty: "navigate",
        purl: "/pages/ask/index",
        img: "智能问答.png",
        name:"智能问答"
      },
      {
        opty: "navigate",
        purl: "/pages/vip/index",
        img: "会员精选.png",
        name:"会员精选"
      }
    ]
  }
});
<!-- surrounding wxml -->
<view class="contain">
    <view>
        <swiper autoplay="{{true}}" circular="{{true}}" indicator-dots="{{true}}" indicator-active-color="#666ccc">
            <swiper-item>
                <navigator>
                    <image mode="widthFix" src="" /> 
                </navigator>
            </swiper-item>
            <swiper-item>
                <navigator>
                    <image mode="widthFix" src="" />
                </navigator>
            </swiper-item>
        </swiper>
    </view>

    <view class="map">
        <map id="myMap" show-location class="myMap"/>
        <view class="op">
            <button bindtap="moveToLocation" class="bt" style="width:250rpx">当前位置</button>
            <button bindtap="includePoints" class="bt" style="width:250rpx">移动标注</button>
        </view>
    </view>
</view>



/* surrounding js */
Page({
  onReady: function (e) {
    this.mapCtx = wx.createMapContext('myMap')
  },
  moveToLocation: function () {
    this.mapCtx.moveToLocation()
  },
  includePoints: function() {
    this.mapCtx.includePoints({
      padding: [10],
      points: [{
        latitude:0,
        longitude:0,
      }, {
        latitude:0,
        longitude:0,
      }]
    })
  }
})
<!-- user wxml -->
<view class="user">
    <view wx:if="{{islogout}}">
        <button plain="{{true}}" type="primary" bindgetuserinfo="handleGetUserInfo" open-type="getUserInfo">登录</button>
    </view>
    <view wx:elif="{{islogout?false:true}}">
        <navigator url="/pages/vip/index" class="info">
            <image class="userpic" src="{{userinfo.avatarUrl}}" />
            <text class="username">{{userinfo.nickName}}</text>
        </navigator>
        <view class="operations">
            <view class="line"></view>
            <navigator wx:for="{{op}}" url="{{item.path}}">
                <image src="{{picurl}}{{item.img}}" />{{item.name}}
            </navigator>
        </view>
        <button bindtap="logOut">退出</button>
    </view>
</view>



/* user js */
Page({

  /**
   * 页面的初始数据
   */
  data: {
    picurl: "http://58.87.127.760/imgs/",       //已失效
    op:[
      {
        path: "/pages/collection/index",
        img: "收藏.png",
        name: "收藏"
      },
      {
        path: "/pages/notice/index",
        img: "通知.png",
        name: "通知"
      },
      {
        path: "/pages/support/index",
        img: "客服.png",
        name: "客服"
      }
    ],
    islogout:true,
    userinfo:{}
  },
  handleGetUserInfo(e){
    const {userInfo} = e.detail;
    wx.setStorageSync("userinfo", userInfo);
    this.setData({
      islogout:false
    })
  },
  onShow() {
    const userinfo=wx.getStorageSync("userinfo");
    this.setData({userinfo})
  },
  logOut() {
    this.setData({
      islogout:true
//
    })
  }
})
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值