小程序个人笔记,样式,js,等

 position: relative;
 position: absolute;

position: relative;
width: 10rpx;
height: 10rpx;
top:6rpx;

left:1rpx;


width: 50%;
height: 100rpx;

top:50%;
top:30rpx;


position: absolute;
 width: 100%;
  height: 100%;

 border-radius: 50%;
  height:500rpx;

width:auto;

height:auto;


overflow: hidden;

居中

display:flex;
justify-content:center;
align-items:center;


text-align:center;

left    把文本排列到左边。默认值:由浏览器决定。
right    把文本排列到右边。
center    把文本排列到中间。
justify    实现两端对齐文本效果。
inherit    规定应该从父元素继承 text-align 属性的值。


文本
左对齐
text-align:justify;
居中
text-align:center;
文本缩进
text-indent:50rpx;
字体间距
letter-spacing:7rpx;

行高
line-height:40rpx;

颜色
color:#969696;


底线
border-bottom:1.4px #e6e6e6 solid;
字体大小
1.4px #f9f9f9 solid


font-size: 25rpx;
换行
flex-wrap: wrap;
 word-wrap:break-word; word-break:normal; 

不换行
white-space:nowrap;  //字体不换行
flex-wrap: nowrap;

font-size:25rpx;


font-weight:bold;

flex-direction 属性规定灵活项目的方向。
flex-wrap: wrap;
  flex-direction:row; 横
 flex-direction:column; 竖排

提高优先级
!important


去除按钮边框
.share{
  border: 0 !important;
  background-color: white !important;
  color: white!important;
}
.share::after{
  border: 0 !important;
}

JS:

e.currentTarget.dataset.parent

//小程序分享
//开启右上角分享按钮
  wx.showShareMenu({
      withShareTicket: true
    })

//处理分享事件

  // 分享
  onShareAppMessage: function (res) {
    if (res.from === 'button') {
      // 来自页面内转发按钮
      console.log(res.target.dataset)
      var name = res.target.dataset.name
      var goods_id = res.target.dataset.goods
      return {
        title: name,
        path: '/pages/index/goods/goods?id=' + goods_id,
        success:function(e){    //分享回调
          
        }
      }
      
    }else{
      return {
        title: this.data.name,
        path: '/pages/index/goods/goods?id=' + this.data.goods_id,
        success: function (e) {    //分享回调

        }
      }
    }
  },
 
wx.redirectTo({
  url: 'test?id=1'
})

e.currentTarget.dataset.index   // 获取data- 传进来的index
  <navigator url="/pages/my/stylistGoodlist/stylistGoodlist?choose=2" open-type="navigate" hover-class="other-navigator-hover">


  <navigator url="/page/index/index" open-type="switchTab" hover-class="other-navigator-hover">切换 Tab</navigator>
        'Content-Type': 'application/x-www-form-urlencoded' // 默认值


  var value = wx.getStorageSync('key')

    that.setData({
      key: value
    })

  //刷新页面
    function myrefresh(){
        window.location.reload();
    }


样式模板:


{
  "navigationBarTitleText": "提交订单"
}


//完善手机号码

<form bindsubmit='sendphone'>
<view class='phone'>

<view class='text'>手机号</view>
<view class='input'><input placeholder="请输入手机号码" type='number' name='phone'></input></view>

</view>
<view class='code'>
<view class='text'>验证码</view>
<view class='input-code'><input placeholder="请输入验证码" type='number' name='code'></input></view>
<view><button bindtap='sendcode'>获取验证码</button></view>
</view>

<view  class='bnt'>
<button  form-type='submit'>确定</button>
</view>
</form>


    wx.getStorage({
      key: 'key',
      success: function (res) {

}})

统计数量
   $option = [
                'field' => 'count(*) as count',
                'table' => 'store',
            ];
            $count = M()->selectOne($option);
            $list[0]['counts']=$count['count'];

//封装的AJAX

var com = require('../../utils/util.js')

  ///js刷新
//手动下拉刷新
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    this.setData({
      goods_list: [],
    })
    this.getindex(this.data.pages)
    wx.stopPullDownRefresh()
  },

//自动下拉刷新

 wx.startPullDownRefresh();

  onPullDownRefresh: function() {
    console.log('刷新')
    var that = this;
    that.setData({
      imgUrl: [],
    })
    // 获取头像以及昵称
    that.getindex(that.data.pages);
    wx.stopPullDownRefresh()

  },


that.setData({
      key: key
    })

 var that = this;
 
http://sungroow.com/images/Slideshow/top/lunbo-65.png

//普通版
    wx.getStorage({
      key: 'key',
      success: function (res) {
        com.POST({
          url: 'Goods/top_stylist_delete',
          data: {
            key: res.data,
            car_id:car_id
          },
          success: function (msg) {
         if(msg.data.code==200){
        
         }
          }
        })
      }
    })

//最新
    var that = this
    wx.getStorage({
      key: 'key',
      success: function (res) {
        com.POST({
          url: 'Store/stylist_grade',
          data: {
            key: res.data,
            grade:1
          },
          success: function (msg) {
            console.log(msg)
            if (msg.data.code==200){
              wx.showModal({
                title: '温馨提示',
                content: msg.data.datas,
                success: function (res) {
                  if (res.confirm) {
                    wx.switchTab({
                      url: '/pages/index/index'
                    })
                  }
                }

              })
            }else{
              wx.showModal({
                title: '温馨提示',
                content: msg.data.error,
                success: function (res) {
                  if (res.confirm) {
                    wx.switchTab({
                      url: '/pages/index/index'
                    })
                  }
                }
              })
            }
          }
        })
      }
    })
  },
 
//返回更新数据

            //获取页面栈
                    var pages = getCurrentPages();
                    console.log(pages)
                    if (pages.length > 1) {
                      //上一个页面实例对象
                      var prePage = pages[pages.length - 2];
                      //关键在这里
                      prePage.setData({
                        name: that.data.name,
                        phone: that.data.phone,
                        address: that.data.address,
                        is_address:true
                      })
                    }
                    wx.navigateBack({ changed: true });//返回上一页


  


    wx.getStorage({
      key: 'key',
      success: function (res) { 
          console.log(res)
        wx.request({
          url: url + 'Goods/get_car_goods',
          method: "POST",
          data: {
            key: res.data
          },
          header: {
            "Content-Type": "application/x-www-form-urlencoded" //不同于get
          },

          success: function (res) {
            var dataArray = [];
            var datalength = res.data.datas.length;
            for (var i = 0; i < datalength; i++) {
              var index = res.data.datas[i];
              // console.log(index);
              var obj = {
                isSelect: false,
                id: index.goods_id, //商品id
                title: index.goods_name, //商品标题
                typeid: index.class_id, //商品分类<=5是成衣>5是图纸
                gnum: index.goods_sn, //商品编号
                prices: index.price, //商品价格
                imgurl: index.image_thumb, //商品图片
                number: 1 //商品数量
              }
              dataArray.push(obj);
            }
            that.setData({
              dataLists: dataArray
            })
            console.log(that.data.dataLists)

          }
        })
      }
    })


标题
{
  "navigationBarTitleText": "我的订单"
}


//提示


wx.redirectTo({
  url: 'test?id=1'
})


wx.showToast({
  title: '成功',
  icon: 'success',
  duration: 2000
})

  wx.showToast({
                    title: msg.data.error,
                    icon: 'none',
                    duration: 2000
                  })

  wx.showModal({
        
title: '温馨提示',
        
content: '该宝贝不能减少了哟~',
        
success: function(res) {
          
if (res.confirm) {
            
 wx.switchTab({
 url: '/pages/index/index'
 })   
}
        
}
      
})

//延时跳转
 setTimeout(function(){
                  wx.navigateTo({
                    url: '/pages/dd/index'
                  })
                },2000)


//跳转
  wx.switchTab({
            url: '/pages/index/index'
          })

wx.navigateTo({
  url: 'test?id=1'
})


<button size="mini" type="primary" bindtap='onsale' >绑定手机号码</button>

吴振强
13242605046

广东省广州市海珠区中大轻纺交易园E30006尚古服装设计有限公司


  <!--弹窗  -->
<view class="modal {{showAmountModal.showModal}}">
  <view class="modal-content">
    <view class="modal-line-box amount-title">
      <text>温馨提示</text>
    </view>
    <view>点击授权获取微信头像和微信名字</view>
  </view>
  <button  open-type="getUserInfo" type='primary' bindgetuserinfo='onGotUserInfo' class="button-color">授权</button>
</view>
<view class="mask {{showAmountModal.showMask}}"></view>

/* 弹窗 */
.modal{
  position: absolute;
  left: 0rpx;
  top: 20%;
  z-index: 200;
  width:100%;
}

.modal-content{
width:60%;
height:300rpx;
margin:0 auto;
background:#fff;
font-size:30rpx;
font-family:"微软雅黑";
padding:20rpx;
border-radius:5px;

}

.modal-line-box{
  margin: 30rpx 0rpx;
}
.modal-line-box.amount-title{
  text-align: center;
  font-size: 40rpx;
}

.mask{
  position: fixed;
  top: 0px;
  left: 0px;
  width: 100%;
  height:100%;
  z-index: 100;
  background:rgba(0,0,0,0.5);
}
.showMask,.showModal{
  display: block;
}
.hideMask,.hideModal{
  display: none;
}
.button-color{
  width:30%;
margin-top:-94rpx;
height:65rpx;
display:flex;
align-items:center;
justify-content:center;

}
//底部提示
.is-show {
  position: relative;
  width: 100%;
  height: 70rpx;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 28rpx;
  /* border-top:1.4px #e6e6e6 solid; */
  margin-top:14rpx;
}

.is-hide {
  display: none;
  position: relative;
  width: 100%;
  height: 70rpx;
  padding-left: 33%;
  padding-top: 3%;
  font-size: 28rpx;
  
}

刷新
    wx.startPullDownRefresh();

  onPullDownRefresh: function(){
    wx.stopPullDownRefresh()
  }


//统计数量

       $options=[
                    'field'=>'count(*) as count',
                    'table'=>'goods',
                    'where'=>[
                        'store_id'=>$_POST['store_id']
                    ]
                ];
               $count =M()->selectOne($options);
                $list[$k]['count']=$count['count'];


    pay_status: pay_status,
        shipping_status: shipping_status,
        order_status: order_status,


border:2.4px #E4C34D solid;

getindex
 waitpay
waitsend
waitget
allok
allcolse
style='height:42rpx;'
style='width:44.7rpx;'

   private $datas = array(
        'mch_appid'=>'wx3670f6b94f08b57e',     //商户账号appid
        'mchid'=>'1263967901',                 //商户号
        'nonce_str'=>'',                       //随机字符串
        'sign'=>'',                            //签名
        'out_trade_no'=>'',                    //商户订单号
        'openid'=>'',                          //用户openid
        'check_name'=>'',                      //校验用户姓名选项
        'amount'=>'',                          //金额
        'desc'=>'尚古服装设计有限公司用户提现',//企业付款描述信息
        'spbill_create_ip'=>'',                //Ip地址

  //开启事务管理
     M()->startTrans();

   if($list && $lists){
           M()->commit();   //提交事务管理
            output_data('发货成功!');
        }else{
           M()->rollback();  //回滚
            output_errors("发货失败,请重试!");
        }
    );

//转换时间
date('Y-m-d H:i:s',$v['add_time']);


<!-- //悬浮窗 -->
<view class="floating" bindtap='backIndex'>
<image src='/images/backindex.png'></image>
</view>
/* 悬浮窗 */
.floating{
position:fixed;
width:67rpx;
height:120rpx;
bottom:500rpx;
left:683rpx;
justify-content:center;
align-items:center;
flex-direction:column;
display:flex;
z-index:300;
}
.floating image{
position:relative;
width:67rpx;
height:120rpx;
/* border:1.4px #e6e6e6 solid; */
border-radius:15rpx;

}
.floating view{
  position: relative;
  display:flex;
   flex-direction:row; 
   font-size: 20rpx;
}

 
that.waitpay(that.data.page)
that.waitsend(that.data.page)
that.allok(that.data.page)
 that.allcolse(that.data.page)

/var/www/xiaoshuo/images/txt/八零年代大美人.txt
670b14728ad9902aecba32e22fa4f6bd

\b\$

<td><input type="checkbox" class="radioSelect"  value={{v.goods_id}} lay-skin="primary"></td>

    //获取所有选中项
    var GetSelectedItems = function()
    {
        var list = new Array;
        document.querySelectorAll('.radioSelect').forEach(function(item)
        {
            //如果选中,放入list
            if(item.checked)
                list.push(item.value);
        });
        return list;
    }

 var goods_ids=GetSelectedItems();
        console.log(goods_ids);
        var goods_id='';
        if(goods_ids){
            goods_id=goods_ids;
        }else{
            goods_id=id;
        }

//刷新
 myrefresh();

   //刷新页面
    function myrefresh(){
        window.location.reload();
    }

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值